:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #20242c;
  --muted: #667085;
  --line: #dde2e8;
  --brand: #265b8f;
  --brand-soft: #e8f1fa;
  --red: #d94a4a;
  --blue: #2f73d8;
  --green: #258f63;
  --orange: #db7b21;
  --gray: #8a94a6;
  --shadow: 0 12px 28px rgba(30, 41, 59, 0.08);
  --keyboard-inset: 0px;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.app-hosted-production [data-demo-login-area],
.app-hosted-production [data-demo-login-note] {
  display: none !important;
}

.app-booting #login-screen,
.app-booting #parent-registration-screen {
  display: none !important;
}

.app-booting.app-has-session .app-shell.hidden {
  display: block !important;
}

.app-booting.app-has-session .app-shell main {
  opacity: 0;
  pointer-events: none;
}

.app-booting.app-has-admin #admin-view {
  display: block !important;
}

.app-booting.app-has-admin #parent-view {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px;
  background: rgba(246, 247, 249, 0.96);
}

.login-card {
  width: min(620px, 100%);
  margin-block: auto;
  flex-shrink: 0;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-bottom: 8px;
}

.auth-login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.auth-login-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.auth-login-form input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.auth-login-form button {
  padding: 12px 16px;
  color: #fff;
  background: var(--brand);
  border-radius: 6px;
  font-weight: 700;
}

.parent-initial-registration-form {
  gap: 12px;
}

.parent-initial-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.parent-initial-section > strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.parent-initial-two-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.parent-initial-registration-form .parent-initial-section > label,
.parent-student-registration-panel label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

.parent-initial-registration-form select,
.parent-initial-registration-form input[type="number"] {
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.parent-initial-registration-form [data-parent-initial-grade] {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 64px;
  min-height: 64px;
  padding: 0 42px 0 14px;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}

.parent-registration-grade-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.parent-registration-grade-select-wrap::after {
  content: none;
}

.parent-classroom-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.parent-registration-classroom-picker {
  position: relative;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.parent-registration-classroom-trigger {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 54px;
  align-content: center;
  gap: 0;
  padding: 7px 42px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.08;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  cursor: pointer;
  touch-action: manipulation;
}

.parent-registration-classroom-trigger::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.parent-registration-classroom-trigger span,
.parent-registration-classroom-option span {
  display: block;
  line-height: 1.08;
}

.parent-registration-classroom-trigger:focus,
.parent-registration-classroom-trigger:focus-visible,
.parent-registration-classroom-trigger:active,
.parent-registration-classroom-picker.is-open .parent-registration-classroom-trigger {
  outline: none !important;
  border-color: var(--line) !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.parent-registration-classroom-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 80;
  display: grid;
  max-height: min(560px, 70vh);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.parent-registration-classroom-menu[hidden] {
  display: none;
}

/* 学年メニューは項目が短く数が多いので2列にして全学年を一画面に収める */
.parent-registration-grade-select-wrap .parent-registration-classroom-menu {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 6px;
  padding: 6px;
}

.parent-registration-grade-select-wrap .parent-registration-classroom-menu .parent-registration-classroom-divider {
  display: none;
}

.parent-registration-classroom-option {
  display: grid;
  width: 100%;
  min-height: 58px;
  align-content: center;
  gap: 0;
  padding: 9px 14px;
  border: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.08;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  cursor: pointer;
  touch-action: manipulation;
}

.parent-registration-classroom-option.is-selected,
.parent-registration-classroom-option:focus,
.parent-registration-classroom-option:focus-visible,
.parent-registration-classroom-option:active {
  outline: none !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.parent-registration-classroom-option.is-disabled {
  cursor: default;
  color: var(--muted);
}

.parent-registration-classroom-divider {
  height: 1px;
  margin: 0 14px;
  background: #d6dee8;
}

.parent-initial-registration-form .subject-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
}

.parent-initial-registration-form .subject-check-list label {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.parent-initial-registration-form .subject-check-list input {
  width: auto;
  min-height: 0;
}

.parent-initial-registration-form .parent-student-registration-hour-grid {
  display: grid;
}

.parent-registration-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.parent-registration-method-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-registration-method-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  min-width: 0;
}

.parent-registration-method-head > strong {
  min-width: 0;
  padding-top: 2px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.parent-registration-hour-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
}

.parent-registration-hour-control label {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
  color: currentColor;
}

.parent-registration-hour-control span {
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.parent-registration-hour-control select {
  width: 100%;
  min-height: 70px;
  min-width: 0;
  padding: 0 14px;
  font-size: 17px;
  font-weight: 400;
}

.parent-registration-monthly-display {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 70px;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.55);
}

.parent-registration-monthly-display strong {
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.parent-registration-contract-formula {
  letter-spacing: 0;
}

.contract-time-formula-line {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.25;
}

.contract-time-formula-line b {
  font-size: 11px;
  line-height: 1.2;
}

.contract-time-formula-line span {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 400;
}

.parent-registration-monthly-display small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.parent-registration-hour-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.parent-registration-classroom-preview {
  display: none !important;
}

.parent-registration-method-subjects {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.parent-registration-method-subjects > span,
.parent-registration-fixed-subject {
  margin: 0;
  font-size: 11px;
  font-weight: 900;
}

.parent-registration-method-card .subject-check-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.parent-registration-method-card .subject-check-list label {
  min-height: 30px;
  padding: 5px 6px;
  font-size: 12px;
}

.parent-registration-method-card.method-self-learning {
  border-color: #f2b7b7;
  background: #fff7f7;
  color: #b33333;
}

.parent-registration-method-card.method-practice {
  border-color: #b9cdf5;
  background: #f5f8ff;
  color: #245cb0;
}

.parent-registration-method-card.method-one-to-one {
  border-color: #adddc6;
  background: #f3fbf7;
  color: #23744f;
}

.parent-registration-method-card.method-programming {
  border-color: #f4d98a;
  background: #fff9e8;
  color: #7a5b00;
}

.parent-registration-method-card strong,
.parent-registration-method-card b {
  color: currentColor;
}

.parent-registration-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.42);
  overscroll-behavior: none;
}

.parent-registration-confirm-card {
  display: grid;
  gap: 12px;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.parent-registration-confirm-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.parent-registration-confirm-warning {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: #fff7f7;
  color: #b91c1c;
  font-weight: 900;
  text-align: center;
}

.parent-registration-confirm-warning p {
  margin: 0;
}

.parent-registration-confirm-summary {
  display: grid;
  gap: 7px;
  margin: 0;
}

.parent-registration-confirm-summary div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: start;
}

.parent-registration-confirm-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.parent-registration-confirm-summary dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
}

.parent-registration-confirm-methods {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.parent-registration-confirm-methods li {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.parent-registration-confirm-methods span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* 入力フォームの授業形態カードと同じ色分け */
.parent-registration-confirm-methods li.method-self-learning {
  border-color: #f2b7b7;
  background: #fff7f7;
}

.parent-registration-confirm-methods li.method-self-learning strong {
  color: #b33333;
}

.parent-registration-confirm-methods li.method-practice {
  border-color: #b9cdf5;
  background: #f5f8ff;
}

.parent-registration-confirm-methods li.method-practice strong {
  color: #245cb0;
}

.parent-registration-confirm-methods li.method-one-to-one {
  border-color: #adddc6;
  background: #f3fbf7;
}

.parent-registration-confirm-methods li.method-one-to-one strong {
  color: #23744f;
}

.parent-registration-confirm-methods li.method-programming {
  border-color: #f4d98a;
  background: #fff9e8;
}

.parent-registration-confirm-methods li.method-programming strong {
  color: #7a5b00;
}

.parent-registration-confirm-note {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  line-height: 1.5;
}

.parent-registration-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.login-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.login-role-grid button {
  min-height: 118px;
  padding: 16px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-role-grid button:hover,
.login-role-grid button:focus {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.login-role-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.login-role-grid span,
.login-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-note {
  margin-top: 16px;
}

.login-forgot-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #315170;
  background: #f4f8fc;
  border: 1px solid #d6e3f0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.link-button {
  margin-top: 14px;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
  position: relative;
}

.app-shell main {
  transition: opacity 0.18s ease;
}

.app-shell.app-data-loading main {
  opacity: 0;
  pointer-events: none;
}

.app-shell.app-data-loading .topbar {
  opacity: 0;
  pointer-events: none;
}

.app-shell.app-data-loading::after {
  content: "";
  display: block;
  min-height: 220px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

.login-context {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  display: none;
}

.view-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #e9edf2;
  border-radius: 8px;
}

.view-switch button {
  min-width: 112px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
}

.view-switch button.active {
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

/* 1人で2つのアカウント(先生用・保護者用)を持つ人が上のタブで行き来するための切替。
   保護者画面でも出す必要があるので .view-switch とは別に持つ(あちらは保護者だと隠れる)。 */
.account-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #e9edf2;
  border-radius: 8px;
}

.account-switch button {
  min-width: 112px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
}

.account-switch button.active {
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.account-add-button {
  white-space: nowrap;
}

/* 先生カードのログインID表示と、初回パスワード設定リンクの発行box */
.teacher-login-id {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

.teacher-setup-link-box {
  margin: 8px 0 4px;
  padding: 10px 12px;
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.teacher-setup-link-note {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.teacher-setup-link-text {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  word-break: break-all;
}

.teacher-setup-link-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

/* 月謝の手動配信（自動配信が届かなかったときの予備）と、その実行結果 */
.tuition-billing-manual {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tuition-billing-manual-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tuition-billing-run-status {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.tuition-billing-run-status.status-danger {
  color: #d02a2a;
}

/* 新年度の進級（管理者が明示的に実行。押すと対象一覧を見せて確認してから進級） */
.student-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.grade-promotion-panel {
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.grade-promotion-head strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.grade-promotion-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.grade-promotion-subhead {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.grade-promotion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grade-promotion-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  background: var(--panel);
  border-radius: 8px;
}

.grade-promotion-name {
  font-weight: 700;
}

.grade-promotion-arrow strong {
  color: #1d5bd6;
}

.grade-promotion-stay {
  color: var(--muted);
}

.grade-promotion-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.grade-promotion-run-status {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.grade-promotion-run-status.status-danger {
  color: #d02a2a;
}

/* 分析タブ：授業報告書の本数 */
.analytics-total {
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0 10px;
}
.analytics-total b {
  font-size: 24px;
  color: #2563eb;
}
.analytics-chart {
  overflow-x: auto;
  margin-bottom: 8px;
}
.report-count-chart-svg {
  width: 100%;
  min-width: 320px;
  height: auto;
}
.analytics-legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 12px;
}
.analytics-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: -1px;
  margin-right: 4px;
}
.analytics-swatch-auto { background: #2563eb; }
.analytics-swatch-manual { background: #98a2ad; }

/* 年度ごとの折れ線の凡例と、月×年度の数字表(エクセルの再現) */
.analytics-fy-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  font-size: 13px;
  font-weight: 700;
}
.analytics-fy-legend-item i {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  vertical-align: 3px;
  margin-right: 5px;
}
.analytics-fy-table-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
}
.analytics-fy-table {
  border-collapse: collapse;
  font-size: 13px;
  /* 全体ルール(table{width:100%;min-width:820px})に引っ張られて横いっぱいに広がるのを打ち消し、
     中身にちょうどの幅にする(はみ出す場合だけ横スクロール)。 */
  width: auto;
  min-width: 0;
}
.analytics-fy-table th,
.analytics-fy-table td {
  border: 1px solid var(--line);
  padding: 4px 10px;
  text-align: right;
  white-space: nowrap;
}
.analytics-fy-table th {
  background: #f4f7fb;
  font-weight: 700;
}
.analytics-fy-table tr > th:first-child {
  text-align: left;
}
.analytics-fy-table .analytics-fy-total th,
.analytics-fy-table .analytics-fy-total td {
  background: #eef4ff;
  font-weight: 800;
}

/* 表のセルは押すとその場で入力できる */
.analytics-fy-cell {
  cursor: pointer;
  min-width: 64px;
}

/* まだ終わっていない月(予想値・途中経過)はエクセルと同じく赤字 */
.analytics-fy-cell.analytics-fy-forecast {
  color: #d02a2a;
  font-weight: 700;
}

.analytics-forecast-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: -6px 0 14px;
}
.analytics-fy-cell:hover {
  background: #f0f6ff;
}
.analytics-fy-cell-input {
  width: 62px;
  font-family: inherit;
  font-size: 13px;
  text-align: right;
  border: 1px solid #2563eb;
  border-radius: 4px;
  padding: 2px 4px;
}
.analytics-input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}
.analytics-input > summary {
  cursor: pointer;
  font-weight: 700;
}
.analytics-input-note {
  font-size: 13px;
  margin: 8px 0;
}
.analytics-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.analytics-input-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}
.analytics-input-row input {
  font-family: inherit;
  font-size: 15px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.analytics-input-status {
  font-size: 14px;
  font-weight: 700;
  color: #1d5bd6;
  margin: 8px 0 4px;
}

.analytics-input-status.status-danger {
  color: #d02a2a;
  font-size: 15px;
  font-weight: 800;
}

/* 生徒面談メモ(生徒詳細ページ・自由記入) */
.student-interview-memo-panel .student-detail-head {
  margin-bottom: 6px;
}
.student-interview-memo {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  min-height: 120px;
}
.student-interview-memo:focus {
  outline: 2px solid #2563eb;
  outline-offset: -1px;
}
[data-interview-memo-status] {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
}
[data-interview-memo-status].status-danger {
  color: #d02a2a;
  font-weight: 800;
  font-size: 15px;
}
.analytics-manual-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.analytics-manual-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--panel);
  border-radius: 8px;
}
.analytics-manual-month {
  font-weight: 700;
  min-width: 60px;
}
.analytics-manual-count {
  flex: 1;
  color: var(--muted);
  font-weight: 600;
}

/* 月謝の合計金額(7分類) */
.analytics-tuition-panel {
  margin-top: 16px;
}
.tuition-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.tuition-chart-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfdfc;
  overflow-x: auto;
}
.tuition-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.tuition-chart-head strong {
  font-size: 14px;
  font-weight: 800;
}
.tuition-chart-latest {
  font-size: 12px;
  font-weight: 700;
  color: #0f9d76;
  white-space: nowrap;
}
.tuition-chart-svg {
  width: 100%;
  min-width: 300px;
  height: auto;
}
.analytics-empty {
  font-size: 13px;
  margin: 8px 0;
}
.analytics-swatch-yen-auto { background: #0f9d76; }

.analytics-input-row select {
  font-family: inherit;
  font-size: 15px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.logout-button {
  padding: 10px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.refresh-button {
  padding: 10px 14px;
  color: #fff;
  background: var(--brand, #2563eb);
  border: 1px solid var(--brand, #2563eb);
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.refresh-button:disabled {
  opacity: 0.6;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.parent-page-tabs {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.parent-page-tabs button,
.parent-page-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.parent-page-tabs button.active,
.parent-page-tabs a.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.parent-page-tabs button.has-alert-badge:not(.active) {
  border-color: #bfdbfe;
  background: #f8fbff;
  color: var(--brand);
}

.parent-page-tabs button.active .admin-tab-badge {
  background: #fff;
  color: var(--brand);
}

/* 5タブを横スクロールなしで1行に収める（均等幅） */
.parent-page-tabs-compact {
  flex-wrap: nowrap;
  gap: 6px;
}

.parent-page-tabs-compact button {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 4px;
  font-size: 13px;
  white-space: nowrap;
}

/* 授業カードを方式ごとに色分け（カレンダーの色と統一）：左に太い色帯＋方式名を色付き */
.day-detail-card.method-self-learning { border-left: 6px solid #d94b4b; }
.day-detail-card.method-self-learning .lesson-method-name { color: #9b1f1f; font-weight: 800; }
.day-detail-card.method-practice { border-left: 6px solid #2f73d8; }
.day-detail-card.method-practice .lesson-method-name { color: #1f559d; font-weight: 800; }
.day-detail-card.method-one-to-one { border-left: 6px solid #2d9465; }
.day-detail-card.method-one-to-one .lesson-method-name { color: #1f6b48; font-weight: 800; }
.day-detail-card.method-one-to-one-study { border-left: 6px solid #0891b2; }
.day-detail-card.method-one-to-one-study .lesson-method-name { color: #0e7490; font-weight: 800; }
.day-detail-card.method-programming { border-left: 6px solid #d6a500; }
.day-detail-card.method-programming .lesson-method-name { color: #856400; font-weight: 800; }

/* 「手続き」まとめページ: 大きめのボタンを2列で並べる */
.parent-handling-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.parent-handling-grid button {
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.parent-handling-grid button:active {
  background: #f1f5f9;
}

#parent-view.parent-page-makeup .side-column,
#parent-view.parent-page-messages .side-column,
#parent-view.parent-page-tuition .side-column,
#parent-view.parent-page-reports .side-column,
#parent-view.parent-page-notifications .side-column,
#parent-view.parent-page-feedback .side-column,
#parent-view.parent-page-applications .side-column {
  grid-column: 1 / -1;
}

#parent-view.parent-page-schedule [data-parent-section="messages"],
#parent-view.parent-page-schedule [data-parent-section="makeup"],
#parent-view.parent-page-schedule [data-parent-section="tuition"],
#parent-view.parent-page-schedule [data-parent-section="reports"],
#parent-view.parent-page-schedule [data-parent-section="notifications"],
#parent-view.parent-page-schedule [data-parent-section="feedback"],
#parent-view.parent-page-schedule [data-parent-section="applications"],
#parent-view.parent-page-makeup [data-parent-section="schedule"],
#parent-view.parent-page-makeup [data-parent-section="tuition"],
#parent-view.parent-page-makeup [data-parent-section="reports"],
#parent-view.parent-page-makeup [data-parent-section="messages"],
#parent-view.parent-page-makeup [data-parent-section="notifications"],
#parent-view.parent-page-makeup [data-parent-section="feedback"],
#parent-view.parent-page-makeup [data-parent-section="applications"],
#parent-view.parent-page-messages [data-parent-section="schedule"],
#parent-view.parent-page-messages [data-parent-section="makeup"],
#parent-view.parent-page-messages [data-parent-section="tuition"],
#parent-view.parent-page-messages [data-parent-section="reports"],
#parent-view.parent-page-messages [data-parent-section="notifications"],
#parent-view.parent-page-messages [data-parent-section="feedback"],
#parent-view.parent-page-messages [data-parent-section="applications"],
#parent-view.parent-page-tuition [data-parent-section="schedule"],
#parent-view.parent-page-tuition [data-parent-section="makeup"],
#parent-view.parent-page-tuition [data-parent-section="messages"],
#parent-view.parent-page-tuition [data-parent-section="reports"],
#parent-view.parent-page-tuition [data-parent-section="notifications"],
#parent-view.parent-page-tuition [data-parent-section="feedback"],
#parent-view.parent-page-tuition [data-parent-section="applications"],
#parent-view.parent-page-reports [data-parent-section="schedule"],
#parent-view.parent-page-reports [data-parent-section="makeup"],
#parent-view.parent-page-reports [data-parent-section="messages"],
#parent-view.parent-page-reports [data-parent-section="tuition"],
#parent-view.parent-page-reports [data-parent-section="notifications"],
#parent-view.parent-page-reports [data-parent-section="feedback"],
#parent-view.parent-page-reports [data-parent-section="applications"],
#parent-view.parent-page-notifications [data-parent-section="schedule"],
#parent-view.parent-page-notifications [data-parent-section="makeup"],
#parent-view.parent-page-notifications [data-parent-section="tuition"],
#parent-view.parent-page-notifications [data-parent-section="reports"],
#parent-view.parent-page-notifications [data-parent-section="messages"],
#parent-view.parent-page-notifications [data-parent-section="feedback"],
#parent-view.parent-page-notifications [data-parent-section="applications"],
#parent-view.parent-page-feedback [data-parent-section="schedule"],
#parent-view.parent-page-feedback [data-parent-section="makeup"],
#parent-view.parent-page-feedback [data-parent-section="tuition"],
#parent-view.parent-page-feedback [data-parent-section="reports"],
#parent-view.parent-page-feedback [data-parent-section="messages"],
#parent-view.parent-page-feedback [data-parent-section="notifications"],
#parent-view.parent-page-feedback [data-parent-section="applications"],
#parent-view.parent-page-applications [data-parent-section="schedule"],
#parent-view.parent-page-applications [data-parent-section="makeup"],
#parent-view.parent-page-applications [data-parent-section="tuition"],
#parent-view.parent-page-applications [data-parent-section="reports"],
#parent-view.parent-page-applications [data-parent-section="messages"],
#parent-view.parent-page-applications [data-parent-section="notifications"],
#parent-view.parent-page-applications [data-parent-section="feedback"] {
  display: none !important;
}

.dashboard-grid,
.parent-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}

.lower-grid {
  align-items: start;
}

.admin-section[data-admin-section="students"].lower-grid {
  align-items: stretch;
}

.admin-section[data-admin-section="students"].lower-grid > .panel {
  max-height: calc(100vh - 230px);
  overflow: auto;
}

.admin-section[data-admin-section="students"].lower-grid > .panel:nth-child(2) {
  position: sticky;
  top: 14px;
}

.form-grid {
  align-items: stretch;
}

.office-panel {
  margin-bottom: 16px;
}

.office-panel.hidden {
  display: none;
}

.admin-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.admin-menu button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.admin-menu button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.admin-menu button.has-alert-badge:not(.active) {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.admin-menu button.worklog-force-visible {
  display: inline-flex !important;
  visibility: visible !important;
}

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.admin-menu button.active .admin-tab-badge {
  background: #fff;
  color: #b91c1c;
}

.admin-subtabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-subtabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.admin-subtabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.admin-subtabs button.active .admin-tab-badge {
  background: #fff;
  color: #b91c1c;
}

.teacher-scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #b8d2ee;
  border-radius: 8px;
  background: #f3f8fd;
}

.teacher-scope-bar strong {
  display: block;
  font-size: 17px;
}

.teacher-scope-bar .muted {
  margin: 4px 0 0;
}

.teacher-scope-bar label {
  display: grid;
  gap: 6px;
  min-width: 240px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.teacher-scope-bar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.teacher-empty-state {
  margin-bottom: 16px;
}

.admin-section.hidden {
  display: none;
}

[data-admin-section="tuition"]:not(.hidden) {
  display: block;
}

.payroll-calculator,
.teacher-worklog-panel,
.tuition-calculator {
  display: grid;
  gap: 14px;
}

.tuition-pricing-settings {
  display: grid;
  gap: 14px;
}

.classroom-settings-root {
  display: grid;
  gap: 14px;
}

.classroom-settings-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.classroom-settings-card .panel-heading {
  margin-bottom: 0;
}

/* ── 押すと開閉できる場所は青色で統一(枠外クリックでは閉じない・2026-07-29) ── */
.classroom-settings-heading {
  cursor: pointer;
  background: #eff6ff;
  border: 1px solid #b9cdf5;
  border-radius: 8px;
  padding: 8px 12px;
}

.classroom-settings-heading .mini-button {
  justify-self: end;
  background: #245cb0;
  border-color: #245cb0;
  color: #fff;
  font-weight: 700;
}

.classroom-settings-actions .secondary-button {
  background: #eff6ff;
  border-color: #b9cdf5;
  color: #245cb0;
  font-weight: 700;
}

.classroom-settings-card.collapsed {
  background: #fff;
}

.classroom-settings-card.collapsed .classroom-settings-card-body {
  display: none;
}

.classroom-settings-card-body {
  display: grid;
  gap: 12px;
}

.classroom-settings-card .panel-heading h3,
.classroom-settings-card .panel-heading p {
  margin: 0;
}

.classroom-settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.classroom-backup-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.classroom-backup-actions .secondary-button {
  min-width: 180px;
}

.classroom-settings-card .calendar-settings {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.classroom-calendar-context {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.classroom-calendar-context-main {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.classroom-calendar-context label {
  display: grid;
  gap: 6px;
  min-width: min(100%, 320px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.classroom-calendar-context select {
  min-height: 38px;
  border-color: #93c5fd;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.classroom-calendar-context p {
  margin: 0;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.tuition-controls {
  display: grid;
  grid-template-columns: auto minmax(120px, auto) auto 1fr;
  gap: 10px;
  align-items: center;
}

.tuition-controls strong {
  color: var(--text);
  font-size: 20px;
  text-align: center;
}

.tuition-controls span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tuition-rate-panel,
.tuition-student-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.tuition-student-card {
  display: block;
  cursor: pointer;
  position: relative;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.tuition-student-card:hover,
.tuition-student-card.open,
.tuition-student-card:has(.tuition-card-check:checked) {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.tuition-student-card.open,
.tuition-student-card:has(.tuition-card-check:checked) {
  cursor: default;
}

.tuition-student-card > summary {
  list-style: none;
  cursor: pointer;
}

.tuition-student-card > summary::-webkit-details-marker {
  display: none;
}

.tuition-card-check {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.tuition-rate-panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.tuition-rate-panel p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tuition-rate-grid,
.tuition-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tuition-price-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tuition-price-card.disabled {
  background: #f5f7fa;
  opacity: 0.72;
}

.tuition-price-card strong {
  color: var(--text);
  font-size: 13px;
}

.tuition-price-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.tuition-price-plan-list {
  display: grid;
  gap: 10px;
}

.tuition-pricing-scope-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid #d8e6f5;
  border-radius: 6px;
  background: #f8fbff;
}

.tuition-pricing-scope-row label {
  display: grid;
  gap: 6px;
  min-width: min(100%, 280px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tuition-pricing-scope-row select {
  min-height: 38px;
}

.tuition-pricing-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tuition-classroom-add-form,
.tuition-copy-tools,
.tuition-method-add-form,
.tuition-method-setting-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e6f5;
  border-radius: 6px;
  background: #fff;
}

.tuition-classroom-add-form label,
.tuition-copy-tools label,
.tuition-method-add-form label,
.tuition-method-setting-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-classroom-add-form input,
.tuition-classroom-add-form select,
.tuition-copy-tools select,
.tuition-method-add-form input,
.tuition-method-add-form select,
.tuition-method-setting-row input[type="text"],
.tuition-method-setting-row select {
  min-height: 36px;
}

.tuition-method-setting-row {
  grid-template-columns: auto minmax(130px, 1fr) minmax(130px, 1fr) auto;
  align-items: end;
}

.tuition-method-enabled {
  align-content: end;
}

.tuition-method-enabled input {
  width: 18px;
  height: 18px;
}

.tuition-pricing-scope-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tuition-price-plan {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tuition-price-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tuition-price-plan-head b {
  color: var(--text);
  font-size: 12px;
}

.tuition-tier-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tuition-tier-row {
  display: grid;
  grid-template-columns: auto minmax(54px, 1fr) auto minmax(78px, 1.2fr) auto auto;
  gap: 4px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.tuition-tier-row.is-duplicate {
  border-color: #ef4444;
  background: #fff7f7;
}

.tuition-tier-row input {
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.tuition-tier-row span {
  font-size: 11px;
}

.tuition-tier-warning {
  margin: 4px 0 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}

.tuition-unit-price-row {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.tuition-unit-price-row input {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.tuition-unit-price-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tuition-rate-grid label,
.tuition-adjustment-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-rate-grid input,
.tuition-adjustment-row input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.tuition-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tuition-summary-grid div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.tuition-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-summary-grid strong {
  color: var(--text);
  font-size: 22px;
}

.payroll-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.payroll-controls {
  grid-template-columns: auto minmax(120px, auto) auto minmax(120px, 1fr) minmax(240px, auto) auto;
}

.payroll-controls .mini-button {
  width: auto;
  min-width: 52px;
  justify-self: start;
  padding: 0 10px;
  white-space: nowrap;
}

.payroll-teacher-select {
  display: inline-grid;
  grid-template-columns: auto minmax(180px, 260px);
  gap: 8px;
  align-items: center;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-teacher-select select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.payroll-pdf-button {
  align-self: end;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.payroll-pdf-button:disabled {
  border-color: #d8dee7;
  background: #eef2f7;
  color: #64748b;
  cursor: not-allowed;
}

.payroll-pdf-note {
  margin: -4px 0 0;
}

.worklog-summary {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  gap: 10px;
}

.worklog-summary-row {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.worklog-summary-row .worklog-summary {
  min-width: 0;
}

.worklog-summary-row .teacher-payroll-download {
  min-width: 0;
  min-height: 100%;
}

.payroll-summary-grid div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.worklog-summary div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.worktype-pill {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #f8fafc;
}

.payroll-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worklog-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worktype-pill span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-summary-grid strong {
  color: var(--text);
  font-size: 22px;
}

.worklog-summary strong {
  color: var(--text);
  font-size: 22px;
}

.worktype-pill strong {
  color: var(--text);
  font-size: 18px;
}

.worktype-pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.worklog-teacher-select,
.worklog-self-label {
  display: grid;
  gap: 6px;
  max-width: 360px;
}

.worklog-rate-control {
  display: grid;
  gap: 8px;
  max-width: 560px;
}

.worklog-rate-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.teacher-rate-summary {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.teacher-rate-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #d8dee7;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.worklog-self-label {
  padding: 10px 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.teacher-payroll-download {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #f8fafc;
}

.teacher-payroll-download.ready {
  border-color: #b7d3f5;
  background: #eff6ff;
}

.teacher-payroll-download div {
  display: grid;
  gap: 4px;
}

.teacher-payroll-download > .payroll-unconfirmed-list {
  grid-column: 1 / -1;
}

.teacher-payroll-download strong {
  color: var(--text);
  font-size: 15px;
}

.teacher-payroll-download span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-pdf-warning {
  color: #b91c1c;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.autosave-status.payroll-pdf-warning,
.teacher-payroll-download .payroll-pdf-warning {
  display: none;
}

.payroll-unconfirmed-list {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
}

.payroll-unconfirmed-list strong {
  color: #991b1b;
  font-size: 13px;
}

.payroll-unconfirmed-list > .payroll-unconfirmed-title {
  display: block;
}

.payroll-unconfirmed-items {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  align-items: start;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.payroll-unconfirmed-items button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.payroll-unconfirmed-items button:hover {
  border-color: #ef4444;
  background: #fee2e2;
}

.worklog-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(104px, 0.7fr) minmax(104px, 0.7fr) minmax(240px, 1.6fr) minmax(130px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fbfcfe;
}

.worklog-inline-edit-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.worklog-inline-edit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.worklog-inline-edit-chip {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  flex: 0 0 auto;
}

.worklog-inline-edit-chip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.worklog-inline-edit-chip strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.worklog-inline-edit-chip.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(43, 104, 173, 0.12);
}

.worklog-inline-edit-picker {
  display: grid;
  gap: 4px;
  min-width: 92px;
}

.worklog-inline-edit-picker .time-pair,
.worklog-inline-edit-picker .time-picker {
  width: max-content;
}

.worklog-inline-edit-picker .time-picker-button {
  min-height: 30px;
  padding: 4px 8px;
}

.worklog-inline-field,
.worklog-inline-time-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, max-content));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.worklog-inline-field.worklog-note-field {
  grid-template-columns: minmax(240px, 1fr);
}

.worklog-inline-time-field {
  grid-template-columns: minmax(120px, max-content);
  width: fit-content;
}

.worklog-form label,
.worklog-teacher-select,
.worklog-inline-edit-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worklog-form label,
.worklog-inline-edit-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.worklog-editing-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid #b7d3f5;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.worklog-form input,
.worklog-form select,
.worklog-inline-edit-form input,
.worklog-inline-edit-form select,
.worklog-teacher-select select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.worklog-inline-edit-date {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.worklog-inline-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.worklog-inline-edit-form {
  grid-template-columns: 1fr;
}

.worklog-inline-edit-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 84px minmax(140px, 220px) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.worklog-inline-main {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--text);
  font-weight: 900;
}

.worklog-inline-time-text {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  white-space: nowrap;
}

.worklog-inline-separator {
  padding: 0 4px;
  color: var(--muted);
}

.worklog-inline-text-button {
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 2px 4px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.worklog-inline-text-button:hover,
.worklog-inline-text-button.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.worklog-inline-text-button.note-part {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  color: var(--muted);
}

.worklog-inline-time-picker {
  display: inline-flex;
  align-items: center;
}

.worklog-inline-time-picker .time-picker-button,
.worklog-inline-type-edit select,
.worklog-inline-note-edit input {
  min-height: 30px;
  border-radius: 6px;
  padding: 4px 8px;
}

.worklog-inline-type-edit,
.worklog-inline-note-edit {
  display: inline-flex;
}

.worklog-inline-type-edit select {
  width: 120px;
}

.worklog-inline-note-edit input {
  width: 220px;
}

.worklog-inline-hours {
  text-align: center;
  white-space: nowrap;
}

.worklog-inline-note-cell {
  min-width: 0;
}

@media (max-width: 900px) {
  .worklog-inline-edit-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .worklog-inline-hours {
    text-align: left;
  }

  .worklog-inline-edit-actions {
    justify-content: flex-start;
  }
}

.worklog-list,
.worklog-history-block,
.worklog-grouped-history,
.worklog-history-section,
.worklog-history-items,
.worklog-one-to-one-groups,
.worklog-student-group {
  display: grid;
  gap: 8px;
}

.worklog-calendar-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(180px, 0.35fr);
  gap: 12px;
  align-items: start;
}

.worklog-calendar-grid {
  width: min(720px, 100%);
}

.worklog-calendar-grid .day button {
  width: 100%;
  min-width: 0;
  border-radius: 6px;
}

.worklog-calendar-grid .day.worked {
  border-color: #b7d3f5;
  background: #eff6ff;
}

.worklog-calendar-grid .day.worked button {
  background: transparent;
  color: var(--brand);
}

.worklog-calendar-grid .day.focused {
  border-color: #f59e0b;
  background: #fff7ed;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.worklog-calendar-grid .day.focused button {
  color: #9a3412;
  font-weight: 900;
}

.worklog-selected-date {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.worklog-selected-date span,
.worklog-selected-date small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worklog-selected-date strong {
  color: var(--text);
  font-size: 18px;
}

.worklog-day-detail {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.worklog-day-detail.hidden {
  display: none;
}

.worklog-day-list,
.worklog-day-types {
  display: grid;
  gap: 8px;
}

.worklog-day-detail h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.worklog-history-block h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.worklog-payroll-combined {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.worklog-history-section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.worklog-history-section.single-row {
  padding: 0;
}

.worklog-history-section.single-row .worklog-history-items {
  gap: 0;
}

.worklog-history-section.single-row .worklog-card {
  border: 0;
  background: transparent;
}

.worklog-history-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 6px 4px;
}

.worklog-history-heading strong {
  color: var(--text);
  font-size: 16px;
}

.worklog-history-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.worklog-student-group {
  padding: 8px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fbfcfe;
}

.worklog-day-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.worklog-card {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 80px 150px 300px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.worklog-card.editing {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 104, 173, 0.14);
}

.worklog-card.inline-edit {
  grid-template-columns: 1fr;
}

.worklog-card.confirmed {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.worklog-history-section.confirmed-section {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.worklog-history-section.confirmed-section .worklog-card {
  background: #f3f4f6;
}

.worklog-history-section.confirmed-section.single-row .worklog-card {
  background: transparent;
}

.worklog-card.confirmed strong,
.worklog-card.confirmed b {
  color: #374151;
}

.worklog-history-section.confirmed-section {
  opacity: 0.92;
}

.worklog-history-section.focused-date {
  border-color: #f59e0b;
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.worklog-history-section.focused-date .worklog-history-heading strong,
.worklog-history-section.focused-date .worklog-history-heading span {
  color: #9a3412;
}

.worklog-history-section.focused-date .worklog-card {
  border-color: #fed7aa;
}

.worklog-history-section.focused-date .worklog-card.confirmed {
  border-color: #fbbf24;
  background: #fffbeb;
}

.worklog-history-section.jump-highlight {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(43, 104, 173, 0.16);
}

.worklog-confirmed-divider {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.worklog-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.worklog-card div {
  display: grid;
  gap: 4px;
}

.worklog-card .worklog-card-main strong {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  white-space: nowrap;
}

.worklog-inline-date {
  color: var(--text);
  font-weight: 900;
  margin-right: 8px;
}

.worklog-card > b {
  justify-self: center;
  min-width: 80px;
  text-align: center;
}

.worklog-card > small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worklog-card .worklog-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.worklog-card strong,
.worklog-card b {
  color: var(--text);
}

.worklog-card span,
.worklog-card small {
  color: var(--muted);
  font-weight: 800;
}

.worklog-confirm-button {
  min-height: 36px;
  min-width: 72px;
  border: 1px solid #1d4f86;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.worklog-confirm-button.confirmed {
  border-color: #9ca3af;
  background: #e5e7eb;
  color: #374151;
}

.payroll-list {
  display: grid;
  gap: 10px;
}

.payroll-year-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-teacher-history {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.payroll-teacher-history.collapsible {
  background: #fff;
  cursor: pointer;
}

.payroll-teacher-history.collapsed {
  display: block;
  padding: 10px 12px;
}

.payroll-teacher-history.collapsed .payroll-year-summary-head,
.payroll-teacher-history.collapsed .payroll-teacher-history-grid {
  display: none;
}

.payroll-history-toggle {
  justify-self: start;
  width: fit-content;
}

.payroll-audit-trail {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.payroll-audit-toggle {
  justify-self: start;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.payroll-audit-trail.collapsed {
  display: block;
  padding: 10px 12px;
  background: transparent;
}

.payroll-audit-trail.collapsed .payroll-year-summary-head,
.payroll-audit-trail.collapsed .payroll-audit-list {
  display: none;
}

.payroll-audit-list {
  display: grid;
  gap: 8px;
}

.payroll-audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-audit-item div {
  display: grid;
  gap: 3px;
}

.payroll-audit-item strong {
  color: var(--text);
  font-size: 14px;
}

.payroll-audit-item span,
.payroll-audit-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-year-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.payroll-year-summary-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.payroll-year-summary-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-year-summary-head > strong {
  color: var(--text);
  font-size: 20px;
}

.payroll-history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.payroll-history-actions strong {
  color: var(--text);
  font-size: 20px;
}

.payroll-history-empty {
  grid-column: 1 / -1;
}

.payroll-teacher-history-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.payroll-teacher-history-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.payroll-teacher-history-item.current {
  border-color: var(--brand);
  background: #eff6ff;
}

.payroll-teacher-history-item.paid {
  background: #f8fafc;
}

.payroll-teacher-history-item span,
.payroll-teacher-history-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-teacher-history-item.unpaid small {
  color: #b91c1c;
  font-weight: 900;
}

.payroll-teacher-history-item b {
  color: var(--text);
  font-size: 16px;
}

.payroll-year-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.payroll-year-table th,
.payroll-year-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.payroll-year-table td {
  color: var(--text);
  font-weight: 800;
}

.payroll-year-table tr.current {
  background: #eff6ff;
}

.payroll-year-table td.attention {
  color: #b91c1c;
  font-weight: 900;
}

.payroll-year-table tfoot th,
.payroll-year-table tfoot td {
  border-bottom: 0;
  background: #f8fafc;
  font-size: 14px;
}

.payroll-type-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payroll-rate-settings,
.worklog-rate-settings {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.payroll-rate-settings h3,
.worklog-rate-settings h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.payroll-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payroll-rate-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-rate-field {
  display: grid;
  gap: 8px;
}

.payroll-rate-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.payroll-rate-add-check {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 6px !important;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid #d8dee7;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text) !important;
  font-size: 12px !important;
}

.payroll-rate-add-check input {
  min-height: 0 !important;
  width: 14px;
  height: 14px;
  padding: 0;
}

.payroll-rate-grid input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.payroll-rate-add-check input[type="checkbox"] {
  min-height: 0 !important;
  width: 14px !important;
  height: 14px !important;
  padding: 0 !important;
}

.payroll-card {
  display: grid;
  grid-template-columns: minmax(340px, 1.35fr) minmax(120px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-card.paid {
  background: #f8fafc;
}

.payroll-teacher {
  display: grid;
  gap: 4px;
}

.payroll-teacher .mini-button {
  width: fit-content;
  margin-top: 8px;
}

.payroll-rate-row {
  grid-column: 1 / -1;
}

.payroll-teacher strong {
  color: var(--text);
  font-size: 17px;
}

.payroll-teacher span,
.payroll-card label span,
.payroll-logged-hours span,
.payroll-amount span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-card label,
.payroll-logged-hours,
.payroll-amount,
.payroll-worktype-breakdown {
  display: grid;
  gap: 5px;
}

.payroll-worktype-breakdown {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payroll-card input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.payroll-paid-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  align-self: center;
}

.payroll-amount strong {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 28px;
  font-weight: 950;
  line-height: 1.1;
}

.payroll-logged-hours strong {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 18px;
}

@media (max-width: 980px) {
  .payroll-summary-grid,
  .payroll-card,
  .payroll-rate-grid,
  .payroll-teacher-history-grid,
  .worklog-calendar-panel,
  .worklog-day-type-grid,
  .worklog-summary-row,
  .worklog-form,
  .worklog-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-note-field,
  .worklog-note-field {
    grid-column: 1 / -1;
  }
}

.tuition-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tuition-billing-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--text);
}

.tuition-billing-panel strong {
  font-size: 15px;
}

.tuition-billing-panel span {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.tuition-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tuition-billing-panel [data-toggle-tuition-pricing] {
  border: 1px solid #93c5fd;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.tuition-billing-panel [data-save-tuition-bills] {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.tuition-billing-panel [data-save-tuition-bills]:hover,
.tuition-billing-panel [data-save-tuition-bills]:focus {
  background: #1d4ed8;
  color: #fff;
}

.tuition-billing-panel [data-save-tuition-bills].saved {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.22);
}

.tuition-billing-panel [data-save-tuition-bills].saved:hover,
.tuition-billing-panel [data-save-tuition-bills].saved:focus {
  background: #115e59;
}

.tuition-billing-panel [data-save-tuition-bills][disabled] {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #64748b;
  box-shadow: none;
}

.tuition-billing-panel [data-toggle-tuition-adjustment-settings] {
  border: 1px solid #93c5fd;
  background: #fff;
  color: var(--brand);
}

.tuition-billing-panel [data-toggle-tuition-rules-settings] {
  border: 1px solid #93c5fd;
  background: #fff;
  color: var(--brand);
}

.tuition-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d8dee7;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.tuition-status-pill.unbilled {
  border-color: #fecaca;
  background: #fff1f1;
  color: #b91c1c;
}

.tuition-status-pill.billed {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.tuition-status-pill.paid {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.tuition-student-list {
  display: grid;
  gap: 10px;
}

.tuition-saved-bills-panel {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tuition-saved-bills-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.tuition-saved-bills-head strong {
  color: var(--text);
  font-size: 16px;
}

.tuition-saved-bills-head span {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.tuition-saved-bills-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tuition-saved-bills-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tuition-unpaid-summary {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #f8fafc;
}

.tuition-unpaid-summary.attention {
  border-color: #ef4444;
  background: #fff1f1;
}

.tuition-unpaid-summary.clear {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.tuition-unpaid-summary strong {
  color: var(--text);
  font-size: 17px;
}

.tuition-unpaid-summary.attention strong {
  color: #991b1b;
}

.tuition-unpaid-summary.clear strong {
  color: var(--brand);
}

.tuition-unpaid-summary span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.tuition-filter-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tuition-filter-button:hover,
.tuition-filter-button:focus {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--brand);
  outline: none;
}

.tuition-filter-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tuition-export-button {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--brand);
}

.tuition-accountant-bottom {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tuition-accountant-actions {
  display: flex;
  justify-content: flex-end;
}

.tuition-accountant-preview {
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.tuition-accountant-preview summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.tuition-accountant-preview summary small {
  padding: 3px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--brand);
  font-size: 12px;
}

.tuition-accountant-preview .muted {
  padding: 0 12px 12px;
}

.tuition-accountant-table-wrap {
  border-top: 1px solid var(--line);
}

.tuition-accountant-table {
  min-width: 760px;
}

.tuition-accountant-table th,
.tuition-accountant-table td {
  text-align: right;
  white-space: nowrap;
}

.tuition-accountant-table th:first-child,
.tuition-accountant-table td:first-child {
  text-align: left;
}

.tuition-accountant-total-row th,
.tuition-accountant-total-row td {
  background: #f8fafc;
  color: var(--text);
  font-weight: 900;
}

.tuition-saved-bills-group {
  display: grid;
  gap: 8px;
}

.tuition-saved-bills-group + .tuition-saved-bills-group {
  margin-top: 8px;
}

.tuition-saved-bills-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.tuition-saved-bills-group-head span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
}

.tuition-saved-bills-group.paid .tuition-saved-bills-group-head strong {
  color: #166534;
}

.tuition-saved-bills-list {
  display: grid;
  gap: 8px;
}

.tuition-saved-bill-card {
  display: grid;
  gap: 0;
}

.tuition-saved-bill-card.unpaid-overdue .tuition-saved-bill-row {
  border-color: #fecaca;
  background: #fff7f7;
}

.tuition-payment-unpaid {
  color: #b91c1c !important;
  font-weight: 900 !important;
}

.tuition-saved-bill-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  /* 押すと開閉できる場所は青色(枠外クリックでは閉じないため、ここが唯一の開閉口) */
  border: 1px solid #b9cdf5;
  border-radius: 8px;
  background: #eff6ff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.tuition-saved-bill-row:hover,
.tuition-saved-bill-row:focus,
.tuition-saved-bill-card.open .tuition-saved-bill-row {
  border-color: #93c5fd;
  background: #eff6ff;
  outline: none;
}

.tuition-saved-bill-card.open .tuition-saved-bill-row {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.tuition-saved-bill-row strong,
.tuition-saved-bill-row b {
  color: var(--text);
}

.tuition-saved-bill-row span,
.tuition-saved-bill-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-overdue-badge {
  justify-self: end;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c !important;
  font-weight: 900 !important;
}

.tuition-saved-bill-detail {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #93c5fd;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
}

.tuition-saved-bill-detail.hidden {
  display: none;
}

.tuition-saved-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tuition-saved-detail-summary span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-saved-detail-summary strong {
  color: var(--text);
  font-size: 16px;
}

.tuition-student-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* 一部欠席の時間入力フォーム(管理ホームの日別カード内) */
.partial-absence-form {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.partial-absence-form strong {
  font-size: 13px;
}

.partial-absence-times {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.partial-absence-times label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.partial-absence-times select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.partial-absence-form .temporary-message {
  display: none;
  color: #d02a2a;
  font-weight: 800;
  font-size: 15px;
  margin: 0;
}

.partial-absence-form .temporary-message.visible {
  display: block;
}

/* 生徒カードの見出し=開閉できる場所。青色で示す(枠外クリックでは閉じない) */
.tuition-student-head[data-toggle-tuition-card] {
  cursor: pointer;
  background: #eff6ff;
  border: 1px solid #b9cdf5;
  border-radius: 8px;
  padding: 8px 10px;
}

.tuition-student-head strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.tuition-student-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-student-name-button {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.tuition-student-name-button:hover strong,
.tuition-student-name-button:focus strong {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tuition-student-head b {
  color: var(--brand);
  font-size: 20px;
}

.tuition-head-amount {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.tuition-head-amount small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tuition-card-toggle {
  display: none;
}

.tuition-card-toggle-button {
  justify-self: end;
  width: fit-content;
}

.tuition-card-toggle {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--brand) !important;
}

.tuition-card-toggle .open-label {
  display: none;
}

.tuition-card-check:checked ~ .tuition-student-head .tuition-card-toggle .closed-label {
  display: none;
}

.tuition-card-check:checked ~ .tuition-student-head .tuition-card-toggle .open-label {
  display: inline;
}

.tuition-card-expand {
  display: grid;
  gap: 12px;
  cursor: default;
}

.tuition-card-expand.hidden {
  display: none;
}

@keyframes tuition-card-pop {
  from {
    opacity: 0;
    transform: scaleY(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

.tuition-card-history {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.tuition-card-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.tuition-card-history-head::-webkit-details-marker {
  display: none;
}

.tuition-card-history-head strong {
  color: var(--text);
  font-size: 14px;
}

.tuition-card-history-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-card-history-list {
  display: grid;
  gap: 6px;
}

.tuition-card-history-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(110px, auto) minmax(110px, auto) minmax(90px, auto);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.tuition-card-history-row strong {
  color: var(--text);
  font-size: 13px;
}

.tuition-card-history-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-card-history-row b {
  color: var(--brand);
  font-size: 14px;
}

.tuition-method-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tuition-method-list span {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tuition-method-list span.over-max {
  border-color: #fecaca;
  background: #fff7f7;
}

.tuition-method-list em {
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.tuition-method-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tuition-method-list select {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.tuition-method-list b,
.tuition-method-list strong {
  color: var(--muted);
  font-size: 12px;
}

.tuition-method-list strong {
  color: var(--text);
}

.tuition-adjustment-row,
.tuition-payment-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 10px;
}

.tuition-adjustment-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.tuition-adjustment-settings label {
  display: grid;
  min-width: min(420px, 100%);
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-adjustment-settings input,
.tuition-adjustment-settings textarea {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.tuition-adjustment-settings textarea {
  resize: vertical;
  line-height: 1.6;
}

.tuition-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.tuition-category-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #d8dee7;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.tuition-category-list .text-button {
  font-size: 11px;
}

.tuition-category-list button:disabled {
  color: #b8c0cc;
  cursor: default;
}

.tuition-payment-note-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tuition-payment-note-settings h3,
.tuition-payment-note-settings p {
  grid-column: 1 / -1;
  margin: 0;
}

.tuition-payment-note-settings h3 {
  color: var(--text);
  font-size: 15px;
}

.tuition-payment-note-settings p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-payment-classroom-settings {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tuition-payment-classroom-settings h3 {
  color: var(--text);
  font-size: 15px;
  margin: 0 0 4px;
}

.tuition-payment-classroom-settings p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
}

.payment-classroom-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.payment-classroom-row > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.payment-classroom-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.payment-method-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
}

.payment-method-check input {
  width: 18px;
  height: 18px;
}

.tuition-rules-settings {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fff;
}

.tuition-rules-settings h3,
.tuition-rules-settings h4,
.tuition-rules-settings p {
  margin: 0;
}

.tuition-rules-settings h3 {
  color: var(--text);
  font-size: 16px;
}

.tuition-rules-settings h4 {
  color: var(--text);
  font-size: 14px;
}

.tuition-rules-settings p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-rule-text,
.tuition-reminder-list {
  display: grid;
  gap: 10px;
}

.tuition-rule-text,
.tuition-reminder-list label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-rule-text textarea,
.tuition-reminder-list textarea {
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
}

.tuition-rule-text textarea {
  min-height: 120px;
}

.parent-month-inline-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.parent-month-inline-nav .mini-button {
  min-height: 30px;
  padding: 0 10px;
}

.parent-month-inline-nav .status-pill {
  min-height: 30px;
  padding: 0 12px;
}

.parent-tuition-card,
.parent-report-list-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-tuition-card.unpaid-overdue {
  border-color: #fecaca;
  background: #fffafa;
}

.parent-tuition-card.paid {
  border-color: #d8dee7;
}

.parent-tuition-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.parent-tuition-head::-webkit-details-marker {
  display: none;
}

.parent-tuition-head::after {
  content: "";
}

.parent-tuition-head strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.parent-tuition-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.parent-tuition-status-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.parent-tuition-status-row em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.parent-tuition-latest {
  background: #dbeafe;
  color: var(--brand);
}

.parent-tuition-status.unpaid {
  background: #fee2e2;
  color: #b91c1c;
}

.parent-tuition-status.paid {
  background: #dcfce7;
  color: #166534;
}

.parent-tuition-head b {
  color: var(--brand);
  font-size: 20px;
}

.parent-tuition-card:not([open]) .parent-tuition-total {
  display: none;
}

.parent-tuition-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.parent-tuition-methods span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.parent-tuition-methods em,
.parent-tuition-adjustments span,
.parent-report-list-button span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.parent-tuition-methods small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.parent-tuition-methods b,
.parent-tuition-methods strong {
  color: var(--text);
  font-size: 13px;
}

.parent-tuition-adjustments {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.parent-tuition-adjustments > strong {
  color: var(--text);
  font-size: 15px;
}

.parent-tuition-adjustments p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.parent-tuition-adjustments b {
  color: var(--text);
}

.parent-tuition-adjustments em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.parent-report-list-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.parent-report-list-button strong {
  color: var(--text);
  font-size: 14px;
}

.parent-report-list-card.open {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.tuition-adjustment-panel {
  display: grid;
  gap: 8px;
}

.tuition-adjustment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tuition-adjustment-head strong {
  color: var(--text);
  font-size: 13px;
}

.tuition-adjustment-list {
  display: grid;
  gap: 8px;
}

.tuition-adjustment-item {
  display: grid;
  grid-template-columns: minmax(90px, 130px) minmax(110px, 150px) minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.tuition-adjustment-item label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.tuition-adjustment-item input,
.tuition-adjustment-item select {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.tuition-adjustment-item .text-button.danger {
  color: #b91c1c;
}

.tuition-adjustment-item.auto {
  grid-template-columns: minmax(90px, 130px) minmax(110px, 150px) minmax(160px, 1fr) auto;
  align-items: center;
  background: #f8fbff;
}

.tuition-adjustment-item.auto span {
  display: grid;
  gap: 4px;
}

.tuition-adjustment-item.auto small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.tuition-adjustment-item.auto strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.tuition-adjustment-item.auto em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.tuition-payment-row {
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px);
}

.tuition-payment-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tuition-payment-row select,
.tuition-payment-row input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.tuition-payment-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(190px, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.tuition-payment-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tuition-payment-panel select,
.tuition-payment-panel input[type="date"] {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.tuition-payment-date-buttons {
  display: flex;
  gap: 6px;
  align-items: end;
  padding-bottom: 1px;
}

.mini-button.quiet {
  border-color: #e2e8f0;
  background: #fff;
  color: #334155;
}

.tuition-payment-panel p {
  grid-column: 1 / -1;
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.parent-tuition-payment {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.parent-tuition-payment p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-tuition-payment b {
  color: var(--text);
}

.parent-tuition-payment b.unpaid {
  color: #b91c1c;
}

.parent-tuition-payment em {
  color: #1d4ed8;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.parent-tuition-payment-note {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: #eff6ff;
}

.parent-tuition-payment-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

[data-admin-section="reports"]:not(.hidden) {
  display: block;
}

.office-switcher {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) 1fr;
  gap: 12px;
  align-items: end;
}

.office-switcher label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.office-note {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading.tight {
  align-items: center;
}

.parent-student-picker {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 170px;
}

.parent-selected-student-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

#parent-student-select {
  min-width: 190px;
  max-width: 260px;
}

.scan-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scan-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.scan-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
  max-width: 1120px;
  margin: 0 auto;
}

.scan-screen-main,
.scan-screen-side .scan-side-card,
.teacher-landing-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(37, 57, 87, 0.07);
}

.scan-screen-main {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 24px;
  align-content: center;
  min-height: 540px;
  padding: 36px 44px 40px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.scan-screen-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #2d659e 0%, #18a37a 100%);
}

.scan-screen-heading {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: left;
  gap: 12px;
}

.scan-screen-heading h2 {
  margin: 0;
  font-size: 46px;
  letter-spacing: 0;
  text-align: center;
}

.scan-screen-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.scan-clock-panel {
  display: inline-grid;
  justify-items: center;
  gap: 6px;
  min-width: 260px;
  min-height: 112px;
  padding: 16px 28px 18px;
  border: 1px solid #b8d3ef;
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: 0 12px 28px rgba(45, 101, 158, 0.12);
}

.scan-clock-panel span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
}

.scan-clock-panel strong {
  color: var(--brand);
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.scan-live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 6px;
  background: #eaf3ff;
  color: var(--brand);
  font-weight: 900;
  white-space: nowrap;
}

.scan-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7fb;
}

.scan-mode-toggle button {
  min-height: 58px;
  border-radius: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.scan-mode-toggle button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(45, 101, 158, 0.22);
}

.scan-big-input {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 680px);
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.scan-big-input::before {
  content: "";
  width: 84px;
  height: 4px;
  margin: 0 auto -2px;
  border-radius: 999px;
  background: #2d659e;
}

.scan-big-input input {
  min-height: 106px;
  border: 2px solid #b8d3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    inset 0 0 0 5px #f2f8ff,
    0 18px 36px rgba(45, 101, 158, 0.13);
  color: var(--text);
  caret-color: var(--brand);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.scan-big-input input:focus {
  border-color: var(--brand);
  outline: 5px solid rgba(45, 101, 158, 0.14);
}

.scan-main-button {
  min-height: 68px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.scan-result {
  --scan-bg: #1f2f46;
  --scan-rail: linear-gradient(180deg, #2563eb 0%, #18a37a 100%);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 680px);
  min-height: 64px;
  margin: 0 auto;
  padding: 15px 18px 15px 24px;
  border: 1px solid #1f2f46;
  border-left: 0;
  border-radius: 8px;
  background:
    var(--scan-rail) left top / 10px 100% no-repeat,
    var(--scan-bg);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(31, 47, 70, 0.16);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.scan-result::before {
  content: none;
}

.scan-result.is-success {
  --scan-bg: #ecfff5;
  --scan-rail: #059669;
  border-color: #8dd5b2;
  border-left-color: #059669;
  color: #087340;
}

.scan-result.is-success::before {
  background: #059669;
}

.scan-result.is-exit {
  --scan-bg: #f3f6fa;
  --scan-rail: #64748b;
  border-color: #b9c7d8;
  border-left-color: #64748b;
  color: #34445a;
}

.scan-result.is-exit::before {
  background: #64748b;
}

.scan-result.is-warning {
  --scan-bg: #edf6ff;
  --scan-rail: #2563eb;
  border-color: #8dbcf1;
  border-left-color: #2563eb;
  color: #155fa2;
}

.scan-result.is-warning::before {
  background: #2563eb;
}

.scan-result.is-error {
  --scan-bg: #fff1f1;
  --scan-rail: #dc2626;
  border-color: #f4a1a1;
  border-left-color: #dc2626;
  color: #b91c1c;
}

.scan-result.is-error::before {
  background: #dc2626;
}

.scan-popup {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(92%, 680px);
  padding: 38px 30px 42px;
  border: 3px solid #93c5fd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  color: #1d4ed8;
  text-align: center;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
}

.scan-popup:not([hidden]) {
  animation: scanPopupHop 4000ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.scan-popup.exit {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.scan-popup.warning {
  border-color: #8dbcf1;
  color: #155fa2;
}

.scan-popup.error {
  border-color: #f4a1a1;
  color: #b91c1c;
}

.scan-popup-name {
  color: var(--muted);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
}

.scan-popup strong {
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: clamp(62px, 9vw, 96px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
}

.scan-popup-time,
.scan-popup-action {
  display: block;
  white-space: nowrap;
}

.scan-popup-time {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.scan-popup-action {
  font-size: 0.72em;
}

.scan-popup em {
  color: currentColor;
  font-size: 30px;
  font-style: normal;
  font-weight: 900;
}

@keyframes scanPopupHop {
  0% {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.86);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -52%) scale(0.96);
  }
}

.scan-screen-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.scan-side-card {
  padding: 18px;
  border-left: 5px solid #dbeafe;
  box-shadow: 0 10px 24px rgba(37, 57, 87, 0.05);
}

.scan-side-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.scan-side-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
}

.scan-recent-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.scan-recent-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbe6f2;
  border-left: 4px solid #bcd7f3;
  border-radius: 8px;
  background: #f8fbff;
}

.scan-recent-item strong {
  color: var(--brand);
  font-size: 13px;
}

.scan-recent-item span {
  color: var(--text);
  font-weight: 800;
}

.scan-recent-item em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.teacher-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.teacher-shortcut-grid button {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  text-align: left;
}

.teacher-shortcut-grid button:hover {
  border-color: var(--brand);
  background: #f0f7ff;
}

.teacher-shortcut-grid strong {
  font-size: 18px;
}

.teacher-shortcut-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-grid label.contract-toggle,
.contract-hours-grid label.contract-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbff;
  color: var(--text);
}

.contract-toggle input[type="checkbox"] {
  min-height: auto;
  width: 16px;
  height: 16px;
}

.contract-toggle.disabled {
  opacity: 0.55;
}

.field-grid .wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
}

input[type="date"] {
  cursor: pointer;
}

.scan-row button,
.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.secondary-button {
  background: var(--brand-soft);
  color: var(--brand);
}

.muted {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.alert {
  background: #fff3e6;
  color: #a94f00;
}

.status-pill.complete {
  background: #eff6ff;
  color: #1d4ed8;
}

.home-grade-promotion-notice {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 12px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.home-grade-promotion-notice[hidden] {
  display: none;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.summary-cards div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.summary-cards strong {
  display: block;
  margin-bottom: 6px;
  font-size: 26px;
}

.summary-cards span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.student-edit-card .action-row .status-pill {
  display: none;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.mini-button.payroll-pdf-button {
  min-height: 38px;
  padding: 0 16px;
  border-color: #174f8a;
  background: #1f66ad;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.12);
}

.mini-button.payroll-pdf-button:hover {
  background: #174f8a;
}

.mini-button.payroll-pdf-button:disabled {
  border-color: #d8dee7;
  background: #eef2f7;
  color: #64748b;
  box-shadow: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.tag.planned,
.dot.planned {
  background: var(--red);
}

.tag.attended,
.dot.attended {
  background: var(--blue);
}

.tag.makeup,
.dot.makeup {
  background: var(--green);
}

.tag.action,
.dot.action {
  background: var(--orange);
}

.tag.unexpected {
  background: #ea8a00;
}

.tag.gray,
.tag.none {
  background: var(--gray);
}

.stack-list {
  display: grid;
  gap: 10px;
}

.list-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.list-card strong {
  display: block;
  margin-bottom: 5px;
}

.list-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.student-edit-card {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) 70px minmax(100px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  cursor: pointer;
}

.student-list-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  gap: 10px;
  margin: 0 0 12px;
}

.student-classroom-filter,
.student-search-input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.student-classroom-filter {
  font-weight: 700;
}

.student-edit-card:focus,
.student-edit-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 104, 173, 0.14);
}

.danger-button {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.student-edit-card p {
  display: none;
}

.student-edit-card p:nth-of-type(3) {
  display: block;
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.student-edit-card strong {
  margin-bottom: 0;
}

.student-edit-card strong,
.student-edit-card p:nth-of-type(3) {
  display: block;
  text-align: left;
}

.student-edit-card .subtext {
  display: inline-flex;
  margin-left: 8px;
}

.edit-form-delete {
  justify-self: start;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.schedule-detail-card {
  display: grid;
  gap: 10px;
}

.schedule-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-detail-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.schedule-detail-list {
  display: grid;
  gap: 8px;
}

.schedule-detail-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.schedule-detail-row.is-past {
  border-color: #b7d7f8;
  background: #f0f7ff;
}

.schedule-detail-row.has-report {
  border-color: #a7e0c2;
}

.schedule-detail-row summary {
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.schedule-detail-row summary::-webkit-details-marker {
  display: none;
}

.schedule-detail-row span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-status {
  display: inline-flex;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8 !important;
  font-weight: 700;
}

.schedule-detail-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.schedule-detail-body p {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  margin: 0;
}

.schedule-detail-body strong {
  font-size: 13px;
}

.student-detail-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.student-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.student-detail-head strong {
  font-size: 16px;
}

.student-detail-head span {
  color: var(--muted);
  font-weight: 700;
}

.month-select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 28px 4px 9px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.student-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
}

.student-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.student-detail-edit-form {
  display: grid;
  gap: 14px;
}

.student-detail-inline-list {
  display: grid;
  gap: 8px;
}

.student-detail-inline-field {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.student-detail-inline-field:hover,
.student-detail-inline-field:focus-visible {
  border-color: var(--brand);
  background: #f4f8ff;
  outline: none;
}

.student-detail-inline-field-static {
  cursor: default;
}

.student-detail-inline-field-static:hover {
  border-color: var(--line);
  background: #fff;
}

.student-detail-inline-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-detail-inline-field strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.student-detail-inline-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: #f7fbff;
}

.student-detail-inline-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.student-detail-section-title {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.student-detail-inline-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.student-detail-inline-actions [data-student-detail-inline-status] {
  margin-right: auto;
}

.student-detail-edit-grid,
.student-detail-contract-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.student-detail-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.student-detail-edit-form label.contract-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.student-detail-edit-form input:not([type="checkbox"]),
.student-detail-edit-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.student-detail-edit-form input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

.student-detail-edit-form .subject-check-list {
  align-items: center;
}

.student-detail-subjects {
  display: grid;
  gap: 10px;
}

.student-detail-edit-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.student-detail-edit-actions [data-student-detail-edit-status] {
  justify-self: end;
}

.student-detail-bottom-actions {
  display: flex;
  justify-content: flex-start;
  padding: 2px 0 0;
}

.student-detail-bottom-actions .danger-button {
  min-width: 120px;
}

@media (max-width: 760px) {
  .student-detail-edit-grid,
  .student-detail-contract-grid,
  .student-detail-edit-actions,
  .student-detail-inline-field,
  .student-detail-inline-editor-fields {
    grid-template-columns: 1fr;
  }

  .student-detail-edit-actions [data-student-detail-edit-status] {
    justify-self: start;
  }

  .student-detail-inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.student-tuition-history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.student-tuition-history-panel > summary.student-detail-head {
  cursor: pointer;
  list-style: none;
}

.student-tuition-history-panel > summary.student-detail-head::-webkit-details-marker {
  display: none;
}

.student-tuition-history-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.student-tuition-history-row summary,
.student-tuition-history-summary {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  list-style: none;
}

.student-tuition-history-row summary {
  cursor: pointer;
}

.student-tuition-history-row summary::-webkit-details-marker {
  display: none;
}

.student-tuition-history-row summary strong,
.student-tuition-history-summary strong {
  color: var(--text);
  font-size: 14px;
}

.student-tuition-history-row summary span,
.student-tuition-history-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-tuition-history-row summary b,
.student-tuition-history-summary b {
  color: var(--brand);
  font-size: 16px;
}

.student-tuition-history-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.student-tuition-history-body p {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
}

.student-tuition-history-body p span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-tuition-history-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.student-tuition-history-items span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.student-tuition-history-items em,
.student-tuition-history-items small {
  color: var(--muted);
  font-style: normal;
}

.contract-hours-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-account-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b7d4ef;
  border-radius: 8px;
  background: #f7fbff;
}

.parent-account-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.parent-account-list {
  display: grid;
  gap: 8px;
}

.parent-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.parent-account-row div {
  display: grid;
  gap: 2px;
}

.parent-account-row span {
  color: var(--muted);
  font-size: 12px;
}

.parent-link-status {
  width: fit-content;
  margin: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.parent-link-status.linked {
  background: #edf7f2;
  color: var(--green);
}

.parent-link-status.pending {
  background: #fff2f2;
  color: var(--red);
}

.form-error {
  margin: 0;
  color: #c52222;
  font-weight: 700;
}

.contract-hours-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.contract-hours-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contract-hours-grid input {
  min-width: 0;
}

.contract-hours-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.subject-check-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.subject-check-list strong {
  margin-right: 4px;
}

.subject-check-list label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.subtext {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.original-lesson-date {
  margin: 5px 0 0;
  color: var(--text);
  font-weight: 800;
}

.message-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
  text-align: left;
}

.message-item-wrap {
  position: relative;
}

.message-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.72;
  z-index: 2;
}

.message-delete-button:hover {
  background: #eef2f7;
  opacity: 1;
}

.message-item-wrap .message-item {
  padding-right: 44px;
}

.message-thread {
  display: grid;
  gap: 8px;
}

.message-composer {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.message-target-panel {
  align-self: start;
}

.message-target-checklist {
  display: grid;
  gap: 10px;
}

.message-target-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.message-target-student {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.message-target-student input {
  width: 16px;
  height: 16px;
}

.message-target-student em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.message-composer label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.message-search {
  display: grid;
  gap: 6px;
  max-width: 360px;
  margin: 0 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.message-composer textarea {
  min-height: 110px;
  resize: vertical;
}

.message-send-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message-image-preview {
  min-height: 0;
}

.message-image-chip {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-image-chip img {
  width: 92px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.message-image-chip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
}

.message-attachment-image {
  width: min(100%, 360px);
  max-height: 240px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.message-item span {
  color: var(--text);
  font-size: 13px;
}

.message-item em {
  color: var(--text);
  font-size: 12px;
  font-style: normal;
}

.message-read-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-read-summary b {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #d8dee7;
  background: #f5f7f8;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.message-read-summary b.unread {
  border-color: #fecaca;
  background: #fff1f1;
  color: #b91c1c;
}

.message-read-summary b.read {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.message-read-summary .message-unread-toggle {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fff1f1;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 900;
}

.message-read-summary .message-unread-toggle.read {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.message-unread-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.message-unread-detail > strong {
  color: #991b1b;
  font-size: 13px;
}

.message-unread-parent {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff;
}

.message-unread-parent.read {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.message-unread-parent b {
  color: #111827;
  font-size: 13px;
}

.message-unread-parent em,
.message-unread-parent small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.message-application-builder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.message-application-builder strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.message-application-builder p {
  margin: 2px 0 0;
}

.parent-notice-panel {
  border-color: #b9d6f2;
  background: #f8fbff;
}

.parent-message-thread {
  gap: 6px;
}

.parent-message-item {
  background: #fff;
}

.parent-message-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.unread-badge.read {
  background: #f5f7f8;
  color: var(--text);
}

.parent-message-thread.unread .parent-message-item {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.parent-message-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

.parent-message-body {
  display: block;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  line-height: 1.7;
  white-space: pre-wrap;
}

.parent-message-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0 14px 14px;
}

.parent-message-actions .secondary-button {
  width: auto;
}

.parent-message-item .message-attachment-image {
  margin-top: 4px;
}

.parent-feedback-panel {
  border-color: #c7d8ee;
  background: #fbfdff;
}

.parent-feedback-form {
  max-width: 900px;
}

.parent-feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.parent-feedback-form textarea {
  width: 100%;
  min-height: 150px;
  box-sizing: border-box;
  resize: vertical;
}

.parent-feedback-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.parent-student-registration-form {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.parent-student-registration-head {
  display: grid;
  gap: 4px;
}

.parent-student-registration-head h3 {
  margin: 0;
  font-size: 18px;
}

.parent-student-registration-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.parent-student-name-grid,
.parent-student-registration-hour-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.parent-student-registration-hours,
.parent-student-registration-subjects {
  display: grid;
  gap: 8px;
}

.parent-student-registration-hours > strong,
.parent-student-registration-subjects > strong {
  font-size: 13px;
}

.parent-student-registration-estimate {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  font-weight: 800;
}

.parent-student-registration-estimate div {
  display: grid;
  gap: 6px;
}

.parent-student-registration-estimate div > span {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eff6ff;
  font-size: 13px;
}

.parent-student-registration-estimate div > span > .estimate-info {
  min-width: 0;
  line-height: 1.5;
}

.parent-student-registration-estimate .estimate-method {
  display: block;
}

.parent-student-registration-estimate .estimate-hours {
  display: grid;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
}

.parent-student-registration-estimate .estimate-formula {
  overflow-wrap: anywhere;
}

.parent-student-registration-estimate .estimate-formula.first-month {
  color: var(--muted);
  font-size: 11px;
}

.parent-student-registration-estimate .estimate-nowrap {
  white-space: nowrap;
}

.parent-student-registration-estimate div > span > b {
  justify-self: end;
  white-space: nowrap;
}

.parent-student-registration-estimate small {
  color: var(--muted);
}

.parent-student-registration-estimate div > span > small {
  grid-column: 1 / -1;
  line-height: 1.4;
  font-weight: 600;
}

.primary-mini-button {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
}

.feedback-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feedback-card.unread {
  border-left: 5px solid #dc2626;
}

.feedback-card.checked {
  border-left: 5px solid var(--blue);
}

.feedback-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.feedback-card-body {
  white-space: pre-wrap;
  line-height: 1.7;
}

.feedback-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message-item .message-attachment-image {
  margin-top: 6px;
}

.message-item.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.message-detail-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-detail-card p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.attendance-list {
  display: grid;
  gap: 10px;
}

.attendance-item {
  display: grid;
  grid-template-columns: 130px minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  position: relative;
}

.attendance-item.unexpected-attendance-home-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 0;
  padding: 8px 10px 8px 14px;
  border-color: #f6c16b;
  background: #fff;
  box-shadow: inset 4px 0 0 #ea8a00;
}

.unexpected-attendance-home-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.unexpected-attendance-home-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.unexpected-attendance-home-row > strong:first-child {
  font-size: 15px;
  white-space: nowrap;
}

.unexpected-attendance-home-student {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.unexpected-attendance-home-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}

.unexpected-attendance-home-grade {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.unexpected-attendance-home-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.unexpected-attendance-home-status span + span::before {
  content: "/";
  margin-right: 4px;
  color: #cbd5e1;
}

.unexpected-attendance-home-row .mini-button {
  flex: 0 0 auto;
  min-height: 42px;
  min-width: 86px;
  padding-inline: 18px;
  border-color: #d97706;
  background: #ea8a00;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.unexpected-attendance-timeline-section {
  border-color: #f6c16b;
  background: #fffaf1;
}

.unexpected-attendance-home-list {
  display: grid;
  gap: 6px;
}

.attendance-item strong {
  display: block;
}

.attendance-item span {
  color: var(--text);
  font-size: 13px;
}

.attendance-item .tag {
  color: #fff;
}

.attendance-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lesson-change-notice {
  display: grid;
  grid-column: 1 / -1;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: var(--text);
  font-size: 12px;
}

.lesson-change-notice strong {
  color: #1d4ed8;
  font-size: 12px;
}

.lesson-change-notice em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.admin-lesson-change-form {
  display: grid;
  grid-column: 1 / -1;
  justify-self: start;
  width: min(100%, 760px);
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid #f2b7b7;
  border-radius: 8px;
  background: #fff7f7;
  box-shadow: inset 0 0 0 1px rgba(217, 75, 75, 0.12);
}

.admin-lesson-change-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-lesson-change-header strong {
  color: #9b1f1f;
  font-size: 13px;
  font-weight: 900;
}

.admin-lesson-change-form .field-grid {
  grid-template-columns: 180px 190px 190px;
  align-items: end;
  gap: 8px 10px;
}

.admin-lesson-change-form label {
  min-width: 0;
  gap: 4px;
  font-size: 12px;
}

.admin-lesson-change-form input,
.admin-lesson-change-form select,
.admin-lesson-change-form textarea {
  width: 100%;
  min-height: 38px;
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 9px;
  font-size: 13px;
}

.admin-lesson-change-form textarea {
  min-height: 64px;
  resize: vertical;
}

.admin-lesson-change-student {
  grid-column: 1 / -1;
  max-width: 460px;
}

.admin-lesson-change-date {
  max-width: 180px;
  grid-column: 1;
}

.admin-lesson-change-time {
  max-width: 190px;
}

.admin-lesson-change-method,
.admin-lesson-change-subject {
  max-width: 220px;
}

.admin-lesson-change-note {
  grid-column: 1 / -1;
  max-width: 640px;
}

.admin-lesson-change-form .time-pair {
  grid-template-columns: 70px 70px;
  gap: 6px;
}

.admin-lesson-change-form .time-picker-button {
  min-height: 38px;
  padding: 0 6px;
}

.admin-lesson-change-form input[name="subject"] {
  max-width: 100%;
}

.admin-lesson-change-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.calendar-workspace > :not(.calendar-detail) {
  order: 1;
}

.calendar-workspace > .calendar-detail {
  order: 2;
}

.calendar-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
}

.calendar-detail .attendance-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.calendar-detail .attendance-item {
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px;
}

.calendar-detail .attendance-item strong {
  font-size: 13px;
}

.calendar-detail .attendance-item span {
  font-size: 12px;
}

.calendar-detail .attendance-item .tag {
  min-height: 22px;
  font-size: 11px;
}

.home-day-timeline {
  display: grid;
  gap: 12px;
}

.home-day-timeline-sections {
  display: grid;
  gap: 6px;
}

.home-day-timeline-section {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.home-day-timeline-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-day-timeline-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-day-method-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.home-day-method-pill {
  min-height: 24px;
  display: inline-grid;
  align-items: center;
  justify-items: center;
  padding: 0 8px;
  border: 1px solid var(--method-border, var(--line));
  border-radius: 6px;
  background: var(--method-bg, #f8fafc);
  color: var(--method-text, var(--text));
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.home-day-method-pill.method-self-learning {
  --method-border: #f2b7b7;
  --method-bg: #fff7f7;
  --method-text: #b33333;
}

.home-day-method-pill.method-practice {
  --method-border: #b9cdf5;
  --method-bg: #f5f8ff;
  --method-text: #245cb0;
}

.home-day-method-pill.method-one-to-one {
  --method-border: #adddc6;
  --method-bg: #f3fbf7;
  --method-text: #23744f;
}

.home-day-method-pill.method-one-to-one-study {
  --method-border: #a5f3fc;
  --method-bg: #ecfeff;
  --method-text: #0e7490;
}

.home-day-method-pill.method-programming {
  --method-border: #f4d98a;
  --method-bg: #fff9e8;
  --method-text: #7a5b00;
}

.home-day-timeline-section.method-group-core {
  border-color: #d7e4fb;
}

.home-day-timeline-section.method-group-one-to-one {
  border-color: #bde8cf;
}

.home-day-timeline-section.method-group-programming {
  border-color: #ecd27a;
}

.home-day-timeline-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding: 2px 0 4px;
}

.home-day-timeline-canvas {
  position: relative;
  width: 100%;
  min-width: 0;
  height: calc(var(--timeline-height) + 24px);
}

.home-day-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  height: var(--timeline-height);
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.86)),
    repeating-linear-gradient(0deg, transparent 0 33px, rgba(205, 214, 226, 0.55) 33px 34px);
}

.home-day-quarter-line {
  position: absolute;
  left: var(--quarter-left);
  top: 24px;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    #d7e0ec 0 3px,
    transparent 3px 12px
  );
  pointer-events: none;
  z-index: 1;
}

.home-day-quarter-line.is-hour {
  background: #c3cede;
}

.home-day-hour-label {
  position: absolute;
  left: var(--quarter-left);
  top: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.home-day-hour-label.is-start {
  transform: translateX(0);
}

.home-day-hour-label.is-end {
  transform: translateX(-100%);
}

.home-day-event {
  --event-bg: #f6f8fb;
  --event-color: #64748b;
  --event-text: var(--text);
  position: absolute;
  left: var(--event-left);
  top: var(--event-top);
  width: var(--event-width);
  min-width: 0;
  height: 30px;
  container-type: inline-size;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, var(--event-color) 58%, white);
  border-left: 3px solid var(--event-color);
  border-radius: 6px;
  background: var(--event-bg);
  color: var(--event-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  text-align: left;
  z-index: 2;
}

.home-day-event:hover,
.home-day-event:focus {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.14);
}

.home-day-event.is-selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--event-color) 58%, white), 0 5px 14px rgba(15, 23, 42, 0.14);
}

.home-day-event.is-editing {
  box-shadow: 0 0 0 2px var(--brand), 0 5px 14px rgba(15, 23, 42, 0.14);
}

.home-day-event-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: clamp(7px, 20cqw, var(--event-name-size, 12px));
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

/* ブロック左端＝入室時刻、右端＝退室時刻 */
.home-day-event-time {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: color-mix(in srgb, var(--event-color) 75%, #1f2937);
}
.home-day-event-entry {
  text-align: left;
}
.home-day-event-exit {
  text-align: right;
}

.home-day-event.method-self-learning {
  --event-bg: #fff7f7;
  --event-color: #d94b4b;
  --event-text: #9b1f1f;
}

.home-day-event.method-practice {
  --event-bg: #f3f7ff;
  --event-color: #2f73d8;
  --event-text: #1f559d;
}

.home-day-event.method-one-to-one {
  --event-bg: #f0fbf5;
  --event-color: #2d9465;
  --event-text: #1f6b48;
}

.home-day-event.method-one-to-one-study {
  --event-bg: #f0fbf5;
  --event-color: #2d9465;
  --event-text: #1f6b48;
}

.home-day-event.method-programming {
  --event-bg: #fff8df;
  --event-color: #d6a500;
  --event-text: #856400;
}

.home-day-event.is-report-written {
  --event-bg: #fff;
}

.home-day-selected-editor {
  max-height: none;
  overflow: hidden;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease,
    padding-top 420ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 420ms ease,
    transform 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-day-selected-editor.is-closing {
  padding-top: 0;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.home-day-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #fff;
}

.home-day-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.home-day-detail-heading strong {
  display: block;
  font-size: 16px;
}

.home-day-detail-heading span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-day-detail-meta,
.home-day-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-day-report-summary {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.home-day-report-summary strong {
  font-size: 12px;
}

.home-day-report-summary p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.home-day-report-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.home-day-report-editor > strong {
  font-size: 13px;
}

.home-day-report-editor label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.home-day-report-editor textarea {
  min-height: 76px;
  resize: vertical;
  /* 文章量に合わせてJSで自動的に伸ばすため、スクロールバーは出さない */
  overflow-y: hidden;
}

.home-report-upload-row {
  align-items: center;
}

.home-report-publish-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.home-report-image-button {
  cursor: pointer;
}

.home-report-image-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #fff;
}

.home-report-image-preview img {
  width: 96px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
}

.home-report-image-preview strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-report-image-empty {
  margin: 0;
}

.student-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.student-line .tag {
  flex: 0 0 auto;
  max-width: 92px;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

.status-stack {
  display: grid;
  gap: 4px;
  margin-left: auto;
}

.status-stack .tag {
  max-width: none;
  justify-content: center;
}

.grade-chip {
  flex: 0 0 auto;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.report-button {
  justify-self: start;
  min-height: 28px;
  background: var(--brand-soft);
  color: var(--brand);
}

.report-button.published {
  background: #edf7f2;
  color: var(--green);
  cursor: default;
}

.report-button.scheduled {
  background: #fff7e8;
  color: #8a5a00;
  cursor: default;
}

.report-button.scheduled-action {
  background: #fff7e8;
  color: #8a5a00;
}

/* 授業前など公開できないときの「今すぐ公開する」＝グレーで押せない(公開済み/予約中は除外) */
.report-button:disabled:not(.published):not(.scheduled) {
  background: #eef0f2;
  color: #9aa4ab;
  cursor: not-allowed;
  opacity: 1;
}
.report-publish-note {
  color: #9aa4ab;
  font-size: 11px;
  font-weight: 700;
}
/* 授業報告書：予定時刻の右に出す実際の入退室時刻 */
.report-actual-times {
  color: #1f8a5b;
  font-weight: 700;
}

.report-status {
  justify-self: start;
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
  cursor: default;
}

.report-status.unpublished {
  background: #fff1f1;
  color: #c33131;
  border: 1px solid #ffd4d4;
  cursor: pointer;
}

.report-status.published {
  background: #eef2f6;
  color: var(--text);
  border: 1px solid #d8dee7;
  cursor: pointer;
}

.report-read-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
}

.report-read-status.unread {
  border-color: #fecaca;
  background: #fff1f1;
  color: #b91c1c;
}

.report-read-status.read {
  border-color: #d8dee7;
  background: #f5f7f8;
  color: var(--text);
}

.report-unread-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f1;
  color: #991b1b;
}

.report-unread-summary.visible {
  display: flex;
}

.report-unread-summary strong,
.report-unread-summary span {
  color: inherit;
}

.admin-action-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fbfcfe;
}

.admin-action-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-action-summary-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.admin-action-summary-heading > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--brand);
  font-weight: 900;
}

.admin-action-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-action-card {
  display: grid;
  gap: 4px;
  min-height: 98px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-action-card.attention {
  border-color: #fecaca;
  background: #fff1f1;
}

.admin-action-card.clear {
  background: #f8fafc;
}

.admin-action-card strong {
  color: inherit;
  font-size: 28px;
  line-height: 1;
}

.admin-action-card span {
  color: inherit;
  font-size: 13px;
  font-weight: 900;
}

.admin-action-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.report-filter-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fbfcfe;
}

.report-filter-bar div {
  display: grid;
  gap: 3px;
}

.report-filter-bar strong {
  color: var(--text);
  font-size: 15px;
}

.report-filter-bar span {
  color: var(--muted);
  font-size: 12px;
}

.report-filter-bar .mini-button.active {
  border-color: #fecaca;
  background: #fff1f1;
  color: #b91c1c;
}

.parent-report-preview {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #fbfcfe;
}

.parent-report-preview strong {
  font-size: 13px;
}

.parent-report-preview p {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.parent-report-preview span,
.parent-report-preview em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
/* ── 画像をクリック(タップ)で大きく表示 ──
   報告書の画像・メッセージの添付・添付プレビューで共通。閉じるのは「閉じる」ボタンかEscのみ。 */
.zoomable-image {
  cursor: zoom-in;
}

.image-zoom-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.82);
}

.image-zoom-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: min(100%, 980px);
  max-height: 100%;
}

.image-zoom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-zoom-name {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-zoom-close {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid #245cb0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.image-zoom-body {
  display: grid;
  place-items: center;
  overflow: auto;
  min-height: 0;
}

.image-zoom-body img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

body.image-zoom-open {
  overflow: hidden;
}

.parent-report-image {
  margin: 4px 0 2px;
}
.parent-report-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.report-popover {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% - 4px);
  z-index: 20;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
}

.report-popover strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.report-popover p {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.report-status.published:hover + .report-popover,
.report-status.published:focus + .report-popover {
  display: block;
}

.report-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.report-search {
  display: grid;
  gap: 6px;
  max-width: 360px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

#report-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.report-calendar-mini {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  display: grid;
  justify-items: center;
}

.report-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 5px;
  width: min(620px, 100%);
  margin-bottom: 10px;
}

/* 公開済み/公開予定/下書きの本数(月集計)。公開済みを主役に、内訳は控えめに。 */
.report-count-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.report-count-summary strong {
  font-size: 15px;
  color: #245cb0;
}

/* 選択日の見出し横の公開済み本数 */
.report-day-count {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #245cb0;
}

.report-calendar-header strong {
  grid-column: 3 / 6;
  text-align: center;
  font-size: 16px;
}

.report-calendar-header [data-report-month-prev] {
  grid-column: 1 / 2;
}

.report-calendar-header [data-report-month-next] {
  grid-column: 7 / 8;
}

.report-calendar-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  width: min(620px, 100%);
}

.report-calendar-grid .day {
  min-height: 34px;
}

.report-calendar-grid .day button {
  min-height: 30px;
  font-size: 11px;
}

.report-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 14px;
  align-items: start;
}

/* 左の一覧を廃し、報告書の編集カードを縦に並べる(未公開が上→公開済みは下) */
.report-workspace-stacked {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* その月の報告書を日付ごとにまとめて表示(新しい日が上) */
.report-day-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line, #e2e2e2);
  border-radius: 12px;
  background: #fbfcfe;
}
.report-day-group.is-selected-day {
  border-color: #2b6cb0;
  box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.18);
}
.report-day-group > h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.report-day-draft-badge {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: #fff4df;
  border-radius: 999px;
  padding: 2px 8px;
}

.report-list-pane,
.report-edit-pane {
  min-height: 360px;
}

.report-list-pane h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.report-pick-list,
.report-pick-section {
  display: grid;
  gap: 8px;
}

.report-pick-section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-pick-section > strong {
  font-size: 13px;
}

.report-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fbfcfe;
  color: var(--text);
  text-align: left;
}

.report-pick.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 104, 173, 0.14);
}

.report-pick.published {
  background: #f5f7f8;
}

.report-pick span,
.report-pick em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.report-pick .report-read-status {
  color: inherit;
  font-size: 11px;
}

.report-editor-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 10px;
}

.report-editor-heading strong,
.report-editor-heading span {
  display: block;
}

.report-editor-heading span,
.report-upload-row span,
.autosave-status {
  color: var(--text);
  font-size: 12px;
}

.autosave-status.status-danger {
  color: #b91c1c;
  font-weight: 800;
  font-size: 15px;
}

/* 授業変更フォームの保存結果は見逃されないよう大きめに表示する */
.admin-lesson-change-form .autosave-status {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
}

/* 画面下の小さなアプリ版表示(古いコードが動いていないか一目で確認する用) */
.app-version-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #8a939a;
  text-align: right;
}

.deadline-error-message {
  color: #b91c1c;
  font-size: 15px;
  font-weight: 800;
}

.report-editor label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.report-editor textarea {
  min-height: 84px;
  resize: vertical;
  /* 文章量に合わせてJSで自動的に伸ばすため、スクロールバーは出さない */
  overflow-y: hidden;
}

/* 勉強内容の見出し行に音声入力・校正ボタンを並べる（枠の上） */
.report-editor .report-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.report-field-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.report-editor .report-field-head .report-proofread-button {
  margin: 0;
}
.report-mic-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.report-mic-icon {
  flex: 0 0 auto;
}
/* 録音中は赤くして「停止」だと分かるように */
.report-mic-button.is-recording {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* 授業態度・連絡事項は縦幅を細く */
.report-editor textarea.report-field-short {
  min-height: 44px;
}

.report-editor textarea:disabled {
  background: #f3f5f7;
  color: var(--text);
}

.report-actions {
  /* 見出し(名前・日時)の下に回り、カード幅いっぱいでボタンを横並びにする */
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 8px;
}
.report-actions .mini-button {
  margin: 0;
}
.report-actions .revision-label,
.report-actions .report-read-status {
  margin: 0;
}

.revision-label {
  color: #8a5a00;
  font-size: 12px;
  font-weight: 700;
}

.report-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-button {
  justify-self: start;
  background: #fff7e8;
  color: #8a5a00;
}

.parent-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.side-column {
  display: grid;
  gap: 16px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-title {
  margin: 0 0 10px;
  min-width: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.calendar-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.calendar-controls .calendar-title {
  margin: 0;
}

.admin-calendar-controls {
  display: grid;
  grid-template-columns: 72px minmax(260px, 1fr) 72px 76px minmax(360px, 430px);
  align-items: center;
  column-gap: 28px;
  row-gap: 6px;
  width: 100%;
  margin: 0 0 10px;
}

.admin-calendar-controls [data-juku-month-prev] {
  grid-column: 1 / 2;
}

.admin-calendar-controls .calendar-title {
  grid-column: 2 / 3;
  text-align: center;
}

.admin-calendar-controls [data-juku-month-next] {
  grid-column: 3 / 4;
}

.admin-calendar-controls [data-juku-month-today] {
  grid-column: 4 / 5;
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.calendar-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
  width: 100%;
}

.calendar-classroom-control {
  display: flex;
  justify-content: stretch;
  min-width: 0;
  margin: 0;
  grid-column: 5 / 6;
  justify-self: end;
  width: 100%;
  max-width: 430px;
}

.calendar-filter-row .calendar-classroom-control {
  grid-column: auto;
  justify-self: stretch;
  max-width: none;
}

.calendar-filter-control {
  display: flex;
  min-width: 0;
}

.calendar-classroom-control label,
.calendar-filter-control label {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-classroom-control select,
.calendar-filter-control select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.calendar-link-setting {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(240px, 1fr);
  gap: 10px;
  align-items: end;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.calendar-link-setting label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-link-setting label:first-child {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}

.calendar-link-setting select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.calendar-workspace .calendar-legend span:has(.dot.planned),
.calendar-workspace .calendar-legend span:has(.dot.attended),
.calendar-workspace .calendar-legend span:has(.dot.makeup) {
  display: none;
}

.parent-calendar-controls {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
}

.parent-calendar-controls .calendar-title {
  text-align: center;
}

.calendar-settings {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.calendar-settings h3 {
  margin: 0;
  font-size: 16px;
}

.calendar-settings .secondary-button {
  justify-self: start;
}

.calendar-extra-date-settings {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.business-hours-settings {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.business-hours-settings h3 {
  margin: 0;
  font-size: 15px;
}

.business-hours-settings p {
  margin: 0;
}

.business-hours-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.25fr);
  gap: 14px;
  align-items: start;
}

.business-hours-standard-panel,
.business-hours-limited-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.business-hours-standard-panel h4,
.business-hours-limited-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.business-hours-limited-panel {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.business-hours-limited-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.business-hours-limited-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 8px;
}

.business-hours-limited-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.business-hours-list {
  display: grid;
  gap: 6px;
}

.business-hours-row {
  display: grid;
  grid-template-columns: 48px minmax(110px, 160px) minmax(110px, 160px);
  gap: 8px;
  align-items: center;
}

.business-hours-row strong {
  color: var(--text);
  font-size: 13px;
}

.business-hours-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.business-time-pair {
  width: 100%;
}

.business-time-select,
.business-time-part-select {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-weight: 800;
}

.business-hours-limited-list {
  display: grid;
  gap: 6px;
}

.business-hours-limited-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.business-hours-limited-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.business-hours-limited-card div:first-child {
  display: grid;
  gap: 2px;
}

.business-hours-limited-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.business-hours-limited-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: end;
}

@media (max-width: 900px) {
  .business-hours-layout,
  .business-hours-limited-fields {
    grid-template-columns: 1fr;
  }

  .business-hours-limited-panel {
    padding-left: 0;
    padding-top: 12px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.calendar-extra-date-settings p {
  margin: 0;
}

.calendar-setting-actions,
.inline-date-action,
.holiday-bulk-settings {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.inline-date-action label,
.holiday-bulk-settings label {
  display: grid;
  gap: 6px;
  min-width: 230px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.holiday-bulk-settings label {
  flex: 1 1 320px;
}

.holiday-bulk-settings textarea {
  min-height: 58px;
  resize: vertical;
}

.danger-soft-button {
  color: #b91c1c;
  background: #fff1f2;
}

.holiday-settings {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.holiday-settings h3 {
  margin: 0;
  font-size: 16px;
}

.calendar-settings > h3,
.holiday-settings > h3 {
  cursor: pointer;
  user-select: none;
}

.calendar-settings > h3::after,
.holiday-settings > h3::after {
  content: none;
  display: none;
}

.calendar-settings.collapsed > h3::after,
.holiday-settings.collapsed > h3::after {
  content: none;
}

.calendar-settings.collapsed > .calendar-setting-month,
.calendar-settings.collapsed > .field-grid,
.calendar-settings.collapsed > [data-apply-juku-month],
.calendar-settings.collapsed > .business-hours-settings,
.calendar-settings.collapsed > .calendar-extra-date-settings,
.calendar-settings.collapsed > .juku-month-list {
  display: none;
}

.holiday-settings.collapsed > :not(h3) {
  display: none;
}

.holiday-settings > .muted {
  margin: 0;
}

.holiday-picker-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.holiday-picker-calendar .weekday {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.holiday-picker-calendar .weekday.holiday-weekday-toggle {
  cursor: pointer;
}

.holiday-picker-calendar .weekday.holiday-weekday-toggle.selected {
  border-color: #94a3b8;
  background: #e5e7eb;
  color: #334155;
}

.holiday-picker-day {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.holiday-picker-day.selected {
  border-color: #94a3b8;
  background: #e5e7eb;
  color: #334155;
}

.holiday-picker-day.empty,
.day.gap-day,
.holiday-picker-day.gap-day {
  border: 1px solid var(--line);
  background: #f1f5f9;
  color: transparent;
  pointer-events: none;
}

.holiday-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.holiday-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e7eaee;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.weekly-holiday-chip {
  background: #dbeafe;
  color: #1d4ed8;
}

.holiday-chip button {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.extra-date-chip {
  background: #e0f2fe;
  color: #075985;
}

.calendar-setting-month {
  display: grid;
  grid-template-columns: minmax(170px, 220px) max-content minmax(160px, 220px);
  align-items: end;
  gap: 8px;
  max-width: 500px;
}

.calendar-setting-month label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.course-calendar-toggle {
  min-height: 40px;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 5px;
}

.course-calendar-toggle input {
  margin: 0;
}

.weekly-holiday-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.juku-month-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.juku-month-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.juku-month-list-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.juku-month-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.juku-month-list-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.juku-month-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.juku-month-list-select {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.juku-month-list-select span {
  font-size: 14px;
  font-weight: 900;
}

.juku-month-list-select em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.juku-month-list-select strong {
  justify-self: end;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5f0ff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.juku-month-list-item.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.juku-month-delete-button {
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .juku-month-list-item {
    grid-template-columns: 1fr auto;
    gap: 4px;
  }

  .juku-month-list-select {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .juku-month-list-select strong {
    justify-self: start;
  }
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday,
.day {
  min-height: 44px;
  display: grid;
  place-items: center;
}

.weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-loading {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.day {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  position: relative;
}

.day.empty {
  background: transparent;
  border-color: transparent;
}

.day.empty.gap-day {
  border: 1px solid var(--line);
  background: #f1f5f9;
}

.day button {
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-weight: 700;
}

.day.has-state button {
  color: #fff;
}

.day.planned button {
  background: var(--red);
}

.day.attended button {
  background: var(--blue);
}

.day.makeup button {
  background: var(--green);
}

.day.action button {
  background: var(--orange);
  border-radius: 6px;
}

#parent-view .day.has-state:not(.holiday) button {
  background: #fff;
  color: var(--text);
  border: 1px solid #d8dee7;
}

#parent-view .day.has-method {
  border-width: 2px;
}

#parent-view .day.method-day-self-learning,
#parent-view .day.method-day-self-learning button {
  border-color: #d94b4b;
  background: #fff7f7;
  color: #9b1f1f;
}

#parent-view .day.method-day-practice,
#parent-view .day.method-day-practice button {
  border-color: #2f73d8;
  background: #f5f8ff;
  color: #1f559d;
}

#parent-view .day.method-day-one-to-one,
#parent-view .day.method-day-one-to-one button {
  border-color: #2d9465;
  background: #f3fbf7;
  color: #1f6b48;
}

#parent-view .day.method-day-one-to-one-study,
#parent-view .day.method-day-one-to-one-study button {
  border-color: #0891b2;
  background: #ecfeff;
  color: #0e7490;
}

#parent-view .day.method-day-programming,
#parent-view .day.method-day-programming button {
  border-color: #d6a500;
  background: #fff9e8;
  color: #856400;
}

.method-markers {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  display: flex;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
}

.method-marker {
  width: 13px;
  height: 4px;
  border-radius: 999px;
  background: #9aa3b2;
}

.method-marker.method-self-learning,
.dot.method-self-learning {
  background: #d94b4b;
}

.method-marker.method-practice,
.dot.method-practice {
  background: #2f73d8;
}

.method-marker.method-one-to-one,
.dot.method-one-to-one {
  background: #2d9465;
}

.method-marker.method-one-to-one-study,
.dot.method-one-to-one-study {
  background: #06b6d4;
}

.method-marker.method-programming,
.dot.method-programming {
  background: #f2c94c;
}

.day.holiday {
  background: #e7eaee;
}

.day.holiday button {
  background: #717b8a;
  color: #fff;
  border-radius: 6px;
}

/* その日の授業が全部「振替待ち(欠席済み・振替日未定)」の日。方式カラーではなく休み色で示す。 */
.day.all-absent {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.day.all-absent button {
  color: #64748b;
}

.day.extra-month-day {
  border-style: solid;
  background: #f8fafc;
}

.day.extra-month-day button {
  border-radius: 6px;
}

/* 選択日は薄い青で塗るだけ(2026-08-08変更・青枠なし)。数字は濃紺で読みやすく。 */
.day.selected {
  background: #dbeafe;
}

.day.selected button {
  background: transparent;
  color: #1f3a63;
  font-weight: 800;
}

/* 選択して紺色になっても、数字の丸(授業あり=赤・出席=青・振替=緑・振替待ち=橙)は消さない */
.day.selected.planned button {
  background: var(--red);
  color: #fff;
}

.day.selected.attended button {
  background: var(--blue);
  color: #fff;
}

.day.selected.makeup button {
  background: var(--green);
  color: #fff;
}

.day.selected.action button {
  background: var(--orange);
  color: #fff;
}

/* 全部欠席(休み)の日は、青にせずグレーを少し濃くして選択を示す(青枠なし・2026-08-08)。 */
.day.selected.all-absent {
  border-color: #cbd5e1;
  background: #e2e8f0;
}

.day.selected.all-absent button {
  background: transparent;
  color: #64748b;
}

.closed-day-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f2f5;
}

.closed-day-card p {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
}

.parent-reservation-panel {
  position: static;
}

.parent-reservation-student {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.parent-reservation-student strong {
  font-size: 16px;
}

.parent-reservation-student span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-reservation-panel .lesson-balance {
  /* 最小幅を確保した可変列にして、狭い端末では1列になり文字が切れないようにする */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.parent-contract-choice-list .lesson-balance-card {
  width: 100%;
  min-height: 88px;
  text-align: left;
}

/* カード内の文字は折り返して切れないようにする */
.parent-contract-choice-list .lesson-balance-card span,
.parent-contract-choice-list .lesson-balance-card em,
.parent-contract-choice-list .lesson-balance-card strong {
  white-space: normal;
  overflow-wrap: anywhere;
}

.parent-reservation-subject-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}

.lesson-balance-card em.parent-reservation-remaining {
  margin-top: 6px;
  font-size: 15px;
}

.parent-reservation-balance .lesson-balance-card {
  text-align: center;
}

/* 授業登録の方式カードに「残りX時間」を表示 */
.parent-method-choice-list .lesson-balance-card .method-remaining {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 800;
  color: #1f559d;
}

.parent-method-choice-list .lesson-balance-card.selected .method-remaining {
  color: inherit;
}

.parent-method-choice-list .lesson-balance-card .method-remaining.is-zero {
  color: #c02626;
}

.parent-reservation-subject-hours span {
  padding: 2px 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  text-align: center;
}

.parent-contract-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-contract-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.parent-contract-edit-form input {
  min-height: 40px;
}

.parent-contract-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.parent-contract-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-reservation-balance > .parent-contract-help {
  display: none;
}

.parent-inline-makeup-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.parent-inline-makeup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.parent-inline-makeup-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.parent-inline-makeup-heading span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.parent-inline-makeup-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 5px 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.parent-inline-makeup-link {
  display: flex;
  justify-content: flex-start;
  cursor: pointer;
  font: inherit;
}

.parent-inline-makeup-link:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.parent-inline-makeup-collapsible {
  display: block;
  padding: 0;
  overflow: hidden;
}

.parent-inline-makeup-collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.parent-inline-makeup-collapsible > summary::-webkit-details-marker {
  display: none;
}

.parent-inline-makeup-collapsible > summary::after {
  content: "詳細";
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.parent-inline-makeup-collapsible[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.parent-inline-makeup-collapsible[open] > summary::after {
  content: "閉じる";
}

.parent-inline-makeup-detail-body {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px 8px;
  padding: 10px 12px 12px;
}

.parent-inline-makeup-item strong {
  font-size: 13px;
}

.parent-inline-makeup-item span:not(.parent-inline-makeup-badge),
.parent-inline-makeup-item em,
.parent-inline-makeup-item small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.parent-inline-makeup-item > span:not(.parent-inline-makeup-badge),
.parent-inline-makeup-item > em {
  grid-column: 2;
}

.parent-inline-makeup-item small {
  grid-column: 2;
}

.parent-inline-makeup-item > .mini-button:not(.parent-inline-makeup-none-button) {
  grid-column: 2;
  width: fit-content;
}

.parent-inline-makeup-detail-body > span:not(.parent-inline-makeup-badge),
.parent-inline-makeup-detail-body > em,
.parent-inline-makeup-detail-body > small,
.parent-inline-makeup-detail-body > .mini-button:not(.parent-inline-makeup-none-button),
.parent-inline-makeup-detail-body > .parent-inline-makeup-actions {
  grid-column: 2;
}

.parent-inline-makeup-detail-body > small {
  line-height: 1.45;
}

.parent-inline-makeup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.parent-inline-makeup-badge {
  grid-row: span 2;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf4ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.parent-inline-makeup-none-button {
  grid-row: span 2;
  width: fit-content;
  min-width: 72px;
  color: #b91c1c;
  background: #fff7f7;
  border-color: #fecaca;
  opacity: 1;
}

.parent-inline-no-makeup-details {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.parent-inline-no-makeup-section {
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.parent-inline-no-makeup-title {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 900;
}

.parent-inline-no-makeup-details > summary {
  width: fit-content;
  padding: 7px 12px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.parent-inline-no-makeup-details > summary::-webkit-details-marker {
  display: none;
}

.parent-inline-no-makeup-list {
  display: grid;
  gap: 8px;
}

.parent-inline-makeup-none-item {
  background: #fffafa;
}

.parent-inline-shortage-item {
  border-color: #fde68a;
  background: #fffbeb;
}

.parent-inline-shortage-item .parent-inline-makeup-badge {
  background: #fef3c7;
  color: #92400e;
}

.parent-inline-shortage-item strong {
  color: #92400e;
}

.contract-change-request-wrapper {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.parent-initial-contract-card {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.parent-initial-contract-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.parent-initial-contract-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.parent-initial-contract-card button {
  justify-self: start;
}

.contract-change-request-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.contract-change-request-toggle span {
  display: grid;
  gap: 3px;
}

.contract-change-request-toggle strong {
  color: var(--ink);
  font-size: 14px;
}

.contract-change-request-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.contract-change-request-toggle em {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.contract-change-request-wrapper.is-open .contract-change-request-toggle {
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.contract-change-request-body[hidden] {
  display: none;
}

.contract-change-request-body {
  padding: 12px;
  background: #fff;
}

.contract-change-request-form {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.contract-change-request-form > div {
  display: grid;
  gap: 3px;
}

.contract-change-request-form strong {
  color: var(--ink);
  font-size: 14px;
}

.contract-change-request-form p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contract-change-request-form .contract-change-lock-message {
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 900;
}

.contract-change-effective-note {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contract-change-effective-note span {
  color: var(--muted);
}

.contract-change-effective-note strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.contract-change-request-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.contract-change-request-form input,
.contract-change-request-form select,
.contract-change-request-form textarea {
  min-height: 38px;
}

.contract-change-request-form textarea {
  min-height: 68px;
  resize: vertical;
}

.contract-change-request-form .mini-button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.contract-change-tuition-estimate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.contract-change-tuition-estimate span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.contract-change-tuition-estimate strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.contract-change-tuition-estimate em {
  grid-row: span 2;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.contract-change-tuition-estimate.increase em {
  background: #fff1f2;
  color: #dc2626;
}

.contract-change-tuition-estimate.decrease em {
  background: #ecfdf5;
  color: #047857;
}

.contract-change-tuition-estimate small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.contract-change-submit-reminder {
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #b91c1c !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.5;
  text-align: center;
}

.contract-change-submit-button.has-drafts {
  border-color: #dc2626;
  box-shadow: none;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
}

.contract-change-request-form .temporary-message {
  white-space: pre-line;
}

.contract-change-draft-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.contract-change-draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.contract-change-draft-item span {
  color: var(--ink);
}

.contract-change-submitted-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.contract-change-request-wrapper > .contract-change-submitted-list {
  margin: 0 12px 12px;
}

.contract-change-request-wrapper:not(.is-open) > .contract-change-submitted-list {
  margin-top: 12px;
}

.contract-change-submitted-list > strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.contract-change-submitted-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 3px 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.contract-change-submitted-item.waiting {
  border: 1px solid #bfdbfe;
}

.contract-change-submitted-item.approved {
  border: 1px solid #bbf7d0;
}

.contract-change-submitted-item span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.contract-change-submitted-item em {
  color: #1d4ed8;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.contract-change-submitted-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.contract-change-submitted-item .tiny-danger-button {
  grid-row: 1 / 3;
  grid-column: 3;
  align-self: center;
}

.parent-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.parent-lesson-form .parent-bulk-actions {
  margin-top: 0;
}

.inline-makeup-message {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 6px;
  max-width: 360px;
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-line;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.inline-makeup-message.visible {
  opacity: 1;
}

.parent-reservation-balance {
  margin-bottom: 12px;
}

.parent-month-status {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.parent-month-status:empty {
  display: none;
}

.parent-month-status-toggle {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.parent-month-status-toggle > strong {
  font-size: 24px;
  line-height: 1.25;
}

.parent-month-status-toggle > span {
  font-size: 15px;
  font-weight: 700;
}

.parent-month-status-toggle > small {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.parent-month-status.warning {
  border-color: #991b1b;
  background: #fff;
}

.parent-month-status.warning .parent-month-status-toggle > strong,
.parent-month-status.warning .parent-month-status-toggle > span,
.parent-month-status.warning .parent-month-status-toggle > small {
  color: #991b1b;
}

.parent-month-status-action {
  justify-self: start;
}

.parent-month-status.warning .parent-month-status-action {
  border-color: #fff;
  background: #fff;
  color: #991b1b;
}

.parent-month-status.complete {
  border-color: #1d4ed8;
  background: #1e3a8a;
}

.parent-month-status.complete .parent-month-status-toggle > strong,
.parent-month-status.complete .parent-month-status-toggle > span {
  color: #fff;
}

.parent-month-status.complete .parent-month-status-toggle > small {
  color: #bfdbfe;
}

.parent-month-lesson-list {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.parent-month-status.warning .parent-month-lesson-list {
  border-color: #fecaca;
  background: #fffafa;
}

.parent-month-lesson-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.parent-month-lesson-list-heading strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.parent-month-lesson-list-heading span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.parent-month-lesson-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
}

.parent-month-lesson-row.is-clickable {
  cursor: pointer;
}

.parent-month-lesson-row.is-clickable:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.parent-month-lesson-row.is-clickable:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.parent-month-lesson-row.method-self-learning {
  border-left-color: #ef4444;
}

.parent-month-lesson-row.method-practice {
  border-left-color: #2563eb;
}

.parent-month-lesson-row.method-one-to-one {
  border-left-color: #059669;
}

.parent-month-lesson-row.method-one-to-one-study {
  border-left-color: #059669;
}

.parent-month-lesson-row.method-programming {
  border-left-color: #facc15;
}

.parent-month-lesson-date,
.parent-month-lesson-detail {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.parent-month-lesson-date strong,
.parent-month-lesson-detail strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.parent-month-lesson-date span,
.parent-month-lesson-detail small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.parent-month-lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.parent-month-lesson-tag {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.parent-month-lesson-tag.extra {
  background: #fff7ed;
  color: #c2410c;
}

.parent-month-lesson-tag.makeup {
  background: #ecfdf5;
  color: #047857;
}

.parent-month-lesson-tag.off-month {
  background: #f1f5f9;
  color: #475569;
}

.parent-tuition-rules {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
}

.parent-tuition-rules:empty {
  display: none;
}

.parent-tuition-rule-text {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  white-space: pre-wrap;
}

.parent-tuition-deadline-reminder {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: #eef6ff;
  color: #1f559d;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.55;
}

.parent-reservation-list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.parent-reservation-item {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  gap: 3px 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.parent-reservation-item strong {
  color: var(--text);
  font-size: 12px;
}

.parent-reservation-item span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.parent-reservation-item em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.day-detail-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-detail-card.lesson-established {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.day-detail-card + .day-detail-card {
  margin-top: 8px;
}

.day-detail-card span {
  color: var(--muted);
  font-size: 13px;
}

.day-detail-card .lesson-established-pill {
  width: fit-content;
  background: #e2e8f0;
  color: #334155;
}

.day-detail-card > .parent-day-no-makeup-button {
  justify-self: start;
  width: auto;
}

.lesson-lock-note {
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.lesson-established-notice {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.lesson-established-controls {
  align-items: flex-start;
}

.parent-lesson-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.parent-lesson-form h3 {
  margin: 0;
  font-size: 16px;
}

.admin-lesson-add-panel {
  margin-top: 12px;
  overflow: hidden;
  transform-origin: top;
  will-change: opacity;
}

.admin-lesson-add-panel.is-opening {
  pointer-events: none;
}

.admin-lesson-add-panel.is-closing {
  pointer-events: none;
}

.admin-lesson-add-panel.is-opening .admin-lesson-add-form {
  animation: adminLessonAddFormReveal 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-lesson-add-panel.is-closing .admin-lesson-add-form {
  animation: adminLessonAddFormHide 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes adminLessonAddFormReveal {
  from {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    transform: translateY(-8px) scaleY(0.985);
  }

  to {
    clip-path: inset(0);
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes adminLessonAddFormHide {
  from {
    clip-path: inset(0);
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }

  to {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    transform: translateY(-8px) scaleY(0.985);
  }
}

.admin-lesson-add-form {
  min-height: 0;
  margin-top: 0;
  border-color: #cbd5e1;
  background: #fff;
  overflow: hidden;
  transform-origin: top;
  will-change: clip-path, opacity, transform;
}

.admin-lesson-add-toggle {
  width: 100%;
  margin-top: 12px;
  min-height: 42px;
  justify-content: center;
}

.admin-lesson-add-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-lesson-add-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-lesson-add-student-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 190px));
  justify-content: start;
  gap: 10px;
}

.admin-lesson-add-grade,
.admin-lesson-add-student,
.admin-lesson-add-method,
.admin-lesson-add-options label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-lesson-add-grade select,
.admin-lesson-add-student select,
.admin-lesson-add-options input,
.admin-lesson-add-options select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.admin-method-choice-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.admin-method-choice-button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  text-align: center;
  justify-items: center;
  align-content: center;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.admin-method-choice-button:hover,
.admin-method-choice-button:focus {
  transform: translateY(-1px);
  border-color: #9db8dc;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  outline: none;
}

.admin-method-choice-button strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.15;
}

.admin-method-choice-button span {
  color: currentColor;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.72;
}

.admin-method-choice-button.method-self-learning {
  border-color: #f2b7b7;
  background: #fff7f7;
  color: #b33333;
}

.admin-method-choice-button.method-self-learning.selected {
  background: #ffe8e8;
  border-color: #d94b4b;
  box-shadow: inset 0 0 0 1px #d94b4b;
}

.admin-method-choice-button.method-practice {
  border-color: #b9cdf5;
  background: #f5f8ff;
  color: #245cb0;
}

.admin-method-choice-button.method-practice.selected {
  background: #e8f0ff;
  border-color: #2f73d8;
  box-shadow: inset 0 0 0 1px #2f73d8;
}

.admin-method-choice-button.method-one-to-one {
  border-color: #adddc6;
  background: #f3fbf7;
  color: #23744f;
}

.admin-method-choice-button.method-one-to-one.selected {
  background: #e4f7ed;
  border-color: #2d9465;
  box-shadow: inset 0 0 0 1px #2d9465;
}

.admin-method-choice-button.method-one-to-one-study {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #0e7490;
}

.admin-method-choice-button.method-one-to-one-study.selected {
  background: #cffafe;
  border-color: #0891b2;
  box-shadow: inset 0 0 0 1px #0891b2;
}

.admin-method-choice-button.method-programming {
  border-color: #f4d98a;
  background: #fff9e8;
  color: #7a5b00;
}

.admin-method-choice-button.method-programming.selected {
  background: #fff1bf;
  border-color: #d6a500;
  box-shadow: inset 0 0 0 1px #d6a500;
}

.admin-lesson-add-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-lesson-add-actions {
  grid-template-columns: 1fr;
}

.lesson-balance-card[data-admin-method-choice] {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.lesson-balance-card[data-admin-method-choice]:hover,
.lesson-balance-card[data-admin-method-choice]:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  outline: none;
}

.lesson-balance-card[data-admin-method-choice].selected,
.lesson-balance-card[data-admin-method-choice].selected strong,
.lesson-balance-card[data-admin-method-choice].selected span,
.lesson-balance-card[data-admin-method-choice].selected em {
  color: #fff;
}

.lesson-balance-card.method-self-learning[data-admin-method-choice].selected {
  background: #d94b4b;
}

.lesson-balance-card.method-practice[data-admin-method-choice].selected {
  background: #2f73d8;
}

.lesson-balance-card.method-one-to-one[data-admin-method-choice].selected {
  background: #2d9465;
}

.lesson-balance-card.method-one-to-one-study[data-admin-method-choice].selected {
  background: #0891b2;
}

.lesson-balance-card.method-programming[data-admin-method-choice].selected {
  background: #f97316;
  color: #fff;
}

.parent-break-note {
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.lesson-balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lesson-balance-card {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

/* 授業の種類は2列にして1つ1つを大きく＝隣を誤タップしにくくする */
.parent-method-choice-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.parent-method-choice-list .lesson-balance-card {
  min-height: 64px;
  align-content: center;
  justify-items: center;
  text-align: center;
  touch-action: manipulation;
}

.lesson-balance-card[data-parent-method-choice] {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

/* hoverはマウス環境だけ。タッチでベタついて別カードが選ばれて見えるのを防ぐ */
@media (hover: hover) {
  .lesson-balance-card[data-parent-method-choice]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  }
}

.lesson-balance-card[data-parent-method-choice]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.lesson-balance-card.selected {
  border-width: 2px;
  box-shadow:
    0 0 0 3px color-mix(in srgb, currentColor 22%, transparent),
    0 10px 24px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

.lesson-balance-card.method-self-learning {
  border-color: #f2b7b7;
  background: #fff7f7;
  color: #b33333;
}

.lesson-balance-card.method-self-learning.selected {
  background: #ffe8e8;
  border-color: #d94b4b;
}

.lesson-balance-card.method-self-learning strong,
.lesson-balance-card.method-self-learning em {
  color: #b33333;
}

.lesson-balance-card.method-practice {
  border-color: #b9cdf5;
  background: #f5f8ff;
  color: #245cb0;
}

.lesson-balance-card.method-practice.selected {
  background: #e8f0ff;
  border-color: #2f73d8;
}

.lesson-balance-card.method-practice strong,
.lesson-balance-card.method-practice em {
  color: #245cb0;
}

.lesson-balance-card.method-one-to-one {
  border-color: #adddc6;
  background: #f3fbf7;
  color: #23744f;
}

.lesson-balance-card.method-one-to-one.selected {
  background: #e4f7ed;
  border-color: #2d9465;
}

.lesson-balance-card.method-one-to-one strong,
.lesson-balance-card.method-one-to-one em {
  color: #23744f;
}

.lesson-balance-card.method-one-to-one-study {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #0e7490;
}

.lesson-balance-card.method-one-to-one-study.selected {
  background: #cffafe;
  border-color: #0891b2;
}

.lesson-balance-card.method-one-to-one-study strong,
.lesson-balance-card.method-one-to-one-study em {
  color: #0e7490;
}

.lesson-balance-card.method-programming {
  border-color: #f4d98a;
  background: #fff9e8;
  color: #7a5b00;
}

.lesson-balance-card.method-programming.selected {
  background: #fff1bf;
  border-color: #d6a500;
}

.lesson-balance-card.method-programming strong,
.lesson-balance-card.method-programming em {
  color: #7a5b00;
}

.lesson-balance-card.method-self-learning[data-parent-method-choice].selected {
  background: #ffe8e8;
  border-color: #d94b4b;
  box-shadow: inset 0 0 0 1px #d94b4b;
}

.lesson-balance-card.method-practice[data-parent-method-choice].selected {
  background: #e8f0ff;
  border-color: #2f73d8;
  box-shadow: inset 0 0 0 1px #2f73d8;
}

.lesson-balance-card.method-one-to-one[data-parent-method-choice].selected {
  background: #e4f7ed;
  border-color: #2d9465;
  box-shadow: inset 0 0 0 1px #2d9465;
}

.lesson-balance-card.method-one-to-one-study[data-parent-method-choice].selected {
  background: #cffafe;
  border-color: #0891b2;
  box-shadow: inset 0 0 0 1px #0891b2;
}

.lesson-balance-card.method-programming[data-parent-method-choice].selected {
  background: #fff1bf;
  border-color: #d6a500;
  box-shadow: inset 0 0 0 1px #d6a500;
}

.lesson-balance-card strong {
  font-size: 13px;
}

.lesson-balance-card span {
  color: var(--muted);
}

.lesson-balance-card em {
  color: var(--brand);
  font-style: normal;
  font-weight: 800;
}

.lesson-balance-card.method-self-learning[data-parent-method-choice],
.lesson-balance-card.method-self-learning[data-parent-method-choice] strong,
.lesson-balance-card.method-self-learning[data-parent-method-choice] span,
.lesson-balance-card.method-self-learning[data-parent-method-choice] em {
  color: #b33333;
}

.lesson-balance-card.method-practice[data-parent-method-choice],
.lesson-balance-card.method-practice[data-parent-method-choice] strong,
.lesson-balance-card.method-practice[data-parent-method-choice] span,
.lesson-balance-card.method-practice[data-parent-method-choice] em {
  color: #245cb0;
}

.lesson-balance-card.method-one-to-one[data-parent-method-choice],
.lesson-balance-card.method-one-to-one[data-parent-method-choice] strong,
.lesson-balance-card.method-one-to-one[data-parent-method-choice] span,
.lesson-balance-card.method-one-to-one[data-parent-method-choice] em {
  color: #23744f;
}

.lesson-balance-card.method-one-to-one-study[data-parent-method-choice],
.lesson-balance-card.method-one-to-one-study[data-parent-method-choice] strong,
.lesson-balance-card.method-one-to-one-study[data-parent-method-choice] span,
.lesson-balance-card.method-one-to-one-study[data-parent-method-choice] em {
  color: #0e7490;
}

.lesson-balance-card.method-programming[data-parent-method-choice],
.lesson-balance-card.method-programming[data-parent-method-choice] strong,
.lesson-balance-card.method-programming[data-parent-method-choice] span,
.lesson-balance-card.method-programming[data-parent-method-choice] em {
  color: #7a5b00;
}

.lesson-balance-card .lesson-balance-note {
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #245b9d;
  font-size: 12px;
  font-weight: 700;
}

.lesson-balance-card.over em {
  color: #b91c1c;
}

.parent-method-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.subject-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subject-choice-button {
  min-height: 38px;
  padding: 0 16px;
  /* 枠線は最初から2pxにして、選択しても太さが変わらない＝隣のボタンが動かない */
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  touch-action: manipulation;
}

.subject-choice-button.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(47, 115, 216, 0.14);
}

/* 国英数社理は1文字で大きく。横幅を詰めて5科目を1行に収める（2列折り返し防止） */
.subject-choice-button--char {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
  font-size: 21px;
  font-weight: 400;
}

.notification-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.notification-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.notification-summary span.notification-setting-ok {
  background: #e7f6ee;
  color: #0f7a4a;
}

.notification-summary span.notification-setting-wait {
  background: #fff4df;
  color: #9a5b00;
}

.notification-log-list {
  display: grid;
  gap: 10px;
}

.notification-log-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notification-log-card > div:first-child,
.notification-log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.notification-log-card strong {
  font-size: 14px;
}

.notification-log-card span,
.notification-log-card p {
  color: var(--muted);
  font-size: 13px;
}

.notification-log-card p {
  margin: 0;
  color: var(--text);
}

.notification-log-meta em {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.notification-log-meta em.pending {
  background: #fff7e8;
  color: #8a5a00;
}

.notification-log-meta em.sent {
  background: #edf7f2;
  color: var(--green);
}

.notification-log-meta em.failed {
  background: #fff1f1;
  color: #c33131;
}

.parent-notification-settings-panel {
  max-width: 860px;
}

.parent-notification-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--brand);
  border-radius: 8px;
  background: #f8fbff;
}

.parent-notification-hero.ok {
  border-left-color: var(--green);
  background: #f3fbf7;
}

.parent-notification-hero.waiting {
  border-left-color: var(--orange);
  background: #fffaf0;
}

.parent-notification-hero.blocked {
  border-left-color: var(--red);
  background: #fff5f5;
}

.parent-notification-hero span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-notification-hero strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
}

.parent-notification-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.parent-notification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.parent-notification-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-notification-inbox {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.parent-notification-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.parent-notification-card-head h3,
.parent-notification-card-head p {
  margin: 0;
}

.parent-notification-card-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-notification-list {
  display: grid;
  gap: 8px;
}

.parent-notification-item {
  display: grid;
  width: 100%;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.parent-notification-item.unread {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.parent-notification-item.read {
  background: #fff;
}

.parent-notification-item-top,
.parent-notification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.parent-notification-item-top strong {
  font-size: 14px;
}

.parent-notification-item-top em,
.parent-notification-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.parent-notification-item-top em.unread {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--brand);
}

.parent-notification-item-top em.read {
  border: 1px solid #d8dee7;
  background: #f5f7f8;
  color: var(--muted);
}

.parent-notification-body {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.parent-notification-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-notification-meta em.pending {
  background: #fff7e8;
  color: #8a5a00;
}

.parent-notification-meta em.sent {
  background: #edf7f2;
  color: var(--green);
}

.parent-notification-meta em.failed {
  background: #fff1f1;
  color: #c33131;
}

.parent-notification-card > h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.parent-notification-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.parent-notification-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--text);
  font-weight: 700;
}

.parent-notification-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.parent-lesson-reminder-card > p,
.parent-one-to-one-reminder-card > p {
  margin: -4px 0 12px;
  line-height: 1.6;
}

.parent-reminder-row-list {
  display: grid;
  gap: 8px;
}

.parent-reminder-row-list.disabled {
  opacity: 0.55;
}

.parent-reminder-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.75fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.parent-reminder-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-reminder-row select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.parent-reminder-fixed-label {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-reminder-remove-button {
  min-height: 38px;
  align-self: end;
}

.parent-reminder-add-button {
  margin-top: 10px;
}

.parent-reminder-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-reminder-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.parent-reminder-time-grid.disabled {
  opacity: 0.55;
}

.parent-reminder-time-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--text);
  font-weight: 800;
}

.parent-reminder-time-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.parent-quiet-hours {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}

.parent-quiet-hours label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-quiet-hours input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.parent-iphone-guide p {
  margin: 0 0 8px;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .parent-notification-hero {
    grid-template-columns: 1fr;
  }

  .parent-notification-actions {
    justify-content: stretch;
  }

  .parent-notification-actions button {
    flex: 1;
  }

  .parent-reminder-row {
    grid-template-columns: 1fr;
  }

  .parent-reminder-fixed-label,
  .parent-reminder-remove-button {
    width: 100%;
  }
}

.line-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.line-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf7f2;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.line-registration-list {
  display: grid;
  gap: 10px;
}

.line-registration-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 0.7fr) minmax(180px, 1fr) minmax(130px, 0.8fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.line-registration-card strong {
  display: block;
  margin-bottom: 4px;
}

.line-registration-card span {
  color: var(--muted);
  font-size: 13px;
}

.line-registration-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.registration-url-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.registration-url-box span,
.parent-registration-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.registration-url-box a {
  color: var(--brand);
  overflow-wrap: anywhere;
  font-weight: 800;
}

.parent-registration-qr-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: 10px 0 12px;
}

.parent-registration-qr-card,
.parent-registration-letter-note {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-registration-qr-card {
  justify-items: center;
  text-align: center;
}

.parent-registration-qr-card strong,
.parent-registration-letter-note strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.parent-registration-qr-card img {
  width: 132px;
  height: 132px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.parent-registration-qr-card span,
.parent-registration-letter-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.parent-registration-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  align-items: start;
}

/* 開いたカードは詳細を出すので全幅。閉じているカードは複数列で並ぶ。 */
.parent-registration-card.is-open {
  grid-column: 1 / -1;
}

.parent-registration-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}

.parent-registration-filter button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.parent-registration-filter button.active {
  border-color: #b7d4f2;
  background: #eef6ff;
  color: var(--brand);
}

.parent-registration-search {
  display: grid;
  gap: 5px;
  max-width: 520px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-registration-search input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.parent-registration-card {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(250px, 0.72fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-registration-card.is-collapsed {
  grid-template-columns: 1fr;
  cursor: pointer;
}

.parent-registration-card.is-collapsed:hover,
.parent-registration-card.is-collapsed:focus-within {
  border-color: #b7d4f2;
  background: #f8fbff;
}

.parent-registration-card.is-open {
  border-color: #b7d4f2;
}

.parent-registration-main {
  display: grid;
  gap: 6px !important;
  min-width: 0;
}

.parent-registration-card div {
  display: grid;
  gap: 4px;
}

.parent-registration-card span {
  color: var(--muted);
  font-size: 13px;
}

.parent-registration-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-registration-result {
  display: grid;
  gap: 8px;
  align-content: center;
  align-self: start;
  padding: 10px;
  border-left: 3px solid #dbeafe;
  border-radius: 6px;
  background: #f8fafc;
}

.parent-registration-result strong {
  color: var(--text);
  font-size: 13px;
}

.parent-registration-result small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.parent-registration-result-pending {
  border-left-color: #fecaca;
}

.parent-registration-approval-target {
  display: grid !important;
  gap: 4px !important;
  padding: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
}

.parent-registration-approval-target span {
  color: var(--blue) !important;
  font-size: 11px !important;
  font-weight: 900;
}

.parent-registration-approval-target strong {
  color: var(--text);
  font-size: 14px;
}

.parent-registration-approval-target small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.parent-registration-incomplete {
  width: fit-content;
  color: var(--red) !important;
  font-size: 12px;
  font-weight: 900;
}

.parent-registration-compact-status {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue) !important;
  font-size: 11px !important;
  font-weight: 900;
}

.parent-registration-compact-status-pending {
  background: #fff2f2;
  color: var(--red) !important;
}

.parent-registration-danger-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.parent-registration-name-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

/* 閉じているカードは「保護者名＋生徒名」だけ。他は開いたときに見せる。 */
.parent-registration-compact-student {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.parent-registration-card.is-open .parent-registration-compact-student {
  display: none;
}
.parent-registration-card.is-collapsed .parent-registration-name-actions,
.parent-registration-card.is-collapsed .parent-registration-detail-line,
.parent-registration-card.is-collapsed .parent-registration-compact-status {
  display: none !important;
}

.parent-registration-name-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.parent-registration-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.parent-registration-edit-form label {
  display: grid;
  gap: 4px;
}

.parent-registration-student-request {
  display: grid !important;
  gap: 4px !important;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #f8fbff;
}

.parent-registration-student-request strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.parent-registration-student-request span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.parent-registration-line-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  background: #eef6ff;
  color: var(--blue);
  text-align: left;
}

.parent-registration-line-summary span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.parent-registration-line-summary strong {
  color: var(--blue);
  font-size: 10px;
  white-space: nowrap;
}

.parent-registration-line-controls {
  display: grid !important;
  grid-template-columns: 110px minmax(130px, 1fr) 130px;
  gap: 6px;
  max-width: 640px;
  margin: 6px 0 4px;
  padding: 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.parent-registration-line-controls label {
  display: grid;
  gap: 3px;
}

.parent-registration-line-controls select,
.parent-registration-line-controls input {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.parent-registration-result .secondary-button {
  justify-self: end;
}

.parent-registration-result label {
  min-width: 0;
}

.parent-registration-login-controls {
  display: grid !important;
  gap: 7px !important;
  padding: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
}

.parent-registration-login-controls strong {
  color: var(--text);
  font-size: 13px;
}

.parent-registration-login-controls small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.parent-registration-login-controls input {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #d8dee7;
  border-radius: 6px;
  font-size: 13px;
}

.parent-registration-password-notice {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #f0fdf4;
  overflow: hidden;
}

.parent-registration-password-notice span {
  color: #166534 !important;
  font-size: 11px !important;
  font-weight: 900;
}

.parent-registration-line-message {
  width: 100%;
  max-width: 100%;
  min-height: 106px;
  padding: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.compact-action-row {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
}

.parent-registration-linked-student-list {
  display: grid !important;
  gap: 5px;
}

.parent-registration-card .parent-registration-linked-student {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fff;
  white-space: normal;
}

.parent-registration-linked-student strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.parent-registration-linked-student .tiny-danger-button {
  min-height: 16px;
  padding: 0 4px;
  font-size: 9px;
}

.tiny-danger-button {
  min-height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: #fff2f2;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tiny-danger-button:hover {
  background: #fff2f2;
}

.tiny-edit-button {
  min-height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tiny-edit-button:hover {
  background: #edf6ff;
}

.tiny-line-button {
  min-height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: #ecfdf3;
  color: #047857;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tiny-line-button:hover {
  background: #dcfce7;
}

.tiny-notification-button {
  min-height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: #eff6ff;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tiny-notification-button:hover {
  background: #dbeafe;
}

.tiny-notification-button:disabled {
  opacity: 0.75;
  cursor: default;
}

.parent-notification-admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px !important;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.parent-notification-admin-status.ok {
  background: #ecfdf3;
  color: #047857 !important;
}

.parent-notification-admin-status.wait {
  background: #eef6ff;
  color: var(--brand) !important;
}

.parent-notification-admin-status.off {
  background: #f1f5f9;
  color: #475569 !important;
}

.parent-notification-admin-status.blocked {
  background: #fff2f2;
  color: var(--red) !important;
}

.permission-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.permission-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.permission-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.permission-card-head strong {
  font-size: 14px;
  line-height: 1.35;
}

.permission-card-head span {
  color: var(--muted);
  font-size: 11px;
}

.panel-button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.teacher-registration-panel {
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.teacher-registration-panel.hidden {
  display: none;
}

.teacher-card-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 5px;
}

.permission-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.teacher-extra-settings {
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.teacher-extra-settings summary {
  min-height: 28px;
  padding-top: 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.teacher-extra-settings-body {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.teacher-classroom-actions,
.teacher-card-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.teacher-classroom-actions label,
.teacher-card-actions label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.teacher-classroom-actions select,
.teacher-card-actions input {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 8px;
  color: var(--text);
  font: inherit;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.classroom-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 5px;
}

.classroom-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.classroom-management-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.classroom-create-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.classroom-create-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.classroom-create-form select,
.classroom-create-form input,
.classroom-management-row input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text);
  font: inherit;
}

.classroom-management-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.brand-management-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand-management-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-management-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.brand-management-row input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.classroom-management-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(180px, 1.2fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.classroom-management-row div {
  display: grid;
  gap: 3px;
}

.classroom-management-row span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .parent-registration-card {
    grid-template-columns: 1fr;
  }

  .parent-registration-result .secondary-button {
    justify-self: stretch;
  }

  .parent-registration-edit-form,
  .parent-registration-line-controls {
    grid-template-columns: 1fr;
  }

  .parent-registration-password-notice .compact-action-row {
    align-items: stretch;
  }

  .parent-registration-password-notice .compact-action-row button {
    width: 100%;
  }

  .parent-registration-name-row,
  .parent-registration-card .parent-registration-linked-student {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }

  .permission-card-head {
    align-items: stretch;
  }

  .teacher-card-top-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .teacher-card-actions {
    grid-template-columns: 1fr;
  }

  .teacher-classroom-actions {
    grid-template-columns: 1fr;
  }

  .classroom-create-form,
  .classroom-management-row {
    grid-template-columns: 1fr;
  }
}

.time-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.time-range-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.time-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.time-picker {
  position: relative;
  min-width: 0;
}

.time-picker-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.time-picker-menu {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 30;
  width: max(82px, 100%);
  max-height: 150px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.time-picker-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.time-picker-menu button:hover {
  background: #eef4fb;
}

.parent-lesson-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.parent-lesson-actions.has-extra {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.parent-lesson-actions button {
  min-height: 46px;
  padding: 8px 6px;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  word-break: keep-all;
}

.parent-extra-lesson-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.parent-one-to-one-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.55;
  text-align: center;
}

.lesson-repeat-label {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.makeup-lesson-label {
  background: #e9f7ef;
  color: #1f6b48;
  border: 1px solid #b7e2c8;
}

.makeup-lesson-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.makeup-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.makeup-controls-reschedule {
  align-items: flex-start;
}

.makeup-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.makeup-list-card {
  --makeup-card-border: var(--line);
  --makeup-card-left: var(--blue);
  --makeup-focus-border: var(--makeup-card-border);
  --makeup-focus-bg: #fff;
  --makeup-focus-shadow: rgba(37, 99, 235, 0.12);
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--makeup-card-border);
  border-left: 5px solid var(--makeup-card-left);
  border-radius: 8px;
  background: #fff;
}

.makeup-list-card.none {
  --makeup-card-left: var(--gray);
}

.makeup-list-card.makeup {
  --makeup-card-left: var(--green);
}

.makeup-list-card.action {
  --makeup-card-left: var(--orange);
}

.makeup-list-card.available {
  --makeup-card-left: var(--blue);
}

.makeup-list-card.makeup-shortage-card {
  --makeup-card-border: #94a3b8;
  --makeup-card-left: #475569;
  --makeup-focus-border: #64748b;
  --makeup-focus-bg: #e2e8f0;
  --makeup-focus-shadow: rgba(71, 85, 105, 0.18);
  border-color: var(--makeup-card-border);
  background: #fff;
}

.makeup-list-card.makeup-shortage-card .status-pill {
  background: var(--brand-soft);
  color: var(--brand);
}

.makeup-list-card.makeup-list-collapsible {
  display: block;
  padding: 0;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 220ms ease;
}

.makeup-list-card.method-self-learning {
  --makeup-card-border: #f2b7b7;
  --makeup-card-left: #ef4444;
  --makeup-focus-border: #ef4444;
  --makeup-focus-bg: #fff1f2;
  --makeup-focus-shadow: rgba(239, 68, 68, 0.15);
}

.makeup-list-card.method-practice {
  --makeup-card-border: #b9cdf5;
  --makeup-card-left: #2563eb;
  --makeup-focus-border: #2563eb;
  --makeup-focus-bg: #eff6ff;
  --makeup-focus-shadow: rgba(37, 99, 235, 0.16);
}

.makeup-list-card.method-one-to-one {
  --makeup-card-border: #adddc6;
  --makeup-card-left: #059669;
  --makeup-focus-border: #059669;
  --makeup-focus-bg: #ecfdf5;
  --makeup-focus-shadow: rgba(5, 150, 105, 0.15);
}

.makeup-list-card.method-one-to-one-study {
  --makeup-card-border: #a5f3fc;
  --makeup-card-left: #0891b2;
  --makeup-focus-border: #0891b2;
  --makeup-focus-bg: #ecfeff;
  --makeup-focus-shadow: rgba(8, 145, 178, 0.15);
}

.makeup-list-card.method-programming {
  --makeup-card-border: #f4d98a;
  --makeup-card-left: #eab308;
  --makeup-focus-border: #eab308;
  --makeup-focus-bg: #fefce8;
  --makeup-focus-shadow: rgba(234, 179, 8, 0.17);
}

.makeup-list-card.makeup-list-collapsible[open],
.makeup-list-card.is-focused {
  border-color: var(--makeup-focus-border);
  background: var(--makeup-focus-bg);
  box-shadow: 0 0 0 3px var(--makeup-focus-shadow);
}

.makeup-list-card.makeup-list-collapsible[open] .makeup-list-summary,
.makeup-list-card.is-focused .makeup-list-summary {
  background: var(--makeup-focus-bg);
}

.makeup-list-card.makeup-shortage-card[open],
.makeup-list-card.makeup-shortage-card.is-focused {
  border-color: var(--makeup-focus-border);
  background: var(--makeup-focus-bg);
  box-shadow: 0 0 0 3px var(--makeup-focus-shadow);
}

.makeup-list-card.makeup-shortage-card[open] .makeup-list-summary,
.makeup-list-card.makeup-shortage-card.is-focused .makeup-list-summary {
  background: #e2e8f0;
}

.makeup-list-summary {
  display: block;
  padding: 13px;
  cursor: pointer;
  list-style: none;
  transition: background-color 180ms ease;
}

.makeup-list-summary::-webkit-details-marker {
  display: none;
}

.makeup-list-summary:hover {
  background: #f8fbff;
}

.makeup-list-body {
  display: grid;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  padding: 0 13px;
  border-top: 0 solid transparent;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 320ms cubic-bezier(0.22, 1, 0.36, 1),
    border-top-width 240ms ease,
    border-top-color 180ms ease,
    opacity 180ms ease,
    transform 240ms ease;
}

.makeup-list-card.makeup-list-collapsible:not([open]) .makeup-list-body {
  pointer-events: none;
}

.makeup-list-card.makeup-list-collapsible[open] .makeup-list-body {
  max-height: 900px;
  padding: 0 13px 13px;
  border-top-width: 1px;
  border-top-color: var(--line);
  opacity: 1;
  transform: translateY(0);
}

.makeup-none-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.makeup-none-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 10px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.makeup-none-group > summary::-webkit-details-marker {
  display: none;
}

.makeup-none-group > summary span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.makeup-none-group-list {
  display: grid;
  gap: 10px;
}

.makeup-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.makeup-list-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.makeup-deadline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.makeup-edit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.makeup-edit-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.makeup-edit-form label .business-time-select,
.makeup-edit-form label .business-time-part-select,
.makeup-edit-form label select,
.makeup-edit-form label input[type="date"] {
  font-size: 17px;
  min-height: 44px;
}

.makeup-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 管理者の日別カード内の振替フォームは、授業変更フォームと同じコンパクト寸法にする。
   (保護者のスマホ画面は押しやすさ優先で従来の大きさのまま) */
.home-day-detail-card .makeup-edit-form {
  grid-template-columns: 180px 190px 190px;
  align-items: end;
  gap: 8px 10px;
  justify-self: start;
  width: min(100%, 760px);
}

.home-day-detail-card .makeup-edit-form label {
  gap: 4px;
  font-size: 12px;
}

.home-day-detail-card .makeup-edit-form label select,
.home-day-detail-card .makeup-edit-form label input[type="date"],
.home-day-detail-card .makeup-edit-form label input[type="time"],
.home-day-detail-card .makeup-edit-form label .business-time-select,
.home-day-detail-card .makeup-edit-form label .business-time-part-select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 38px;
  padding: 7px 9px;
  font-size: 13px;
}

.home-day-detail-card .makeup-edit-form .business-time-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0;
  min-height: 0;
  border: none;
  background: none;
}

.home-day-detail-card .makeup-edit-actions {
  justify-content: flex-start;
}

.makeup-edit-form .temporary-message {
  grid-column: 1 / -1;
}

/* 授業前のボタン行: 削除は左で小さめ、修正(振替の編集)は右へ。編集を開いたら全幅。 */
.parent-lesson-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.parent-lesson-action-row > .makeup-controls {
  margin-left: auto;
}

.parent-lesson-action-row > .makeup-edit-form {
  flex: 1 1 100%;
}

/* 削除は左で小さめ・控えめ */
.parent-lesson-action-row > [data-delete-parent-lesson] {
  font-size: 13px;
  padding: 6px 12px;
}

/* 修正は右に寄せて主ボタンに */
.parent-lesson-action-row > [data-edit-parent-lesson] {
  margin-left: auto;
  padding: 8px 20px;
  font-weight: 800;
}

.temporary-message {
  min-height: 20px;
  margin: 0;
  color: #c02626;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.temporary-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.temporary-message.success {
  color: #047857;
}

.setup-required-notice {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fef9c3;
  color: #854d0e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

/* 今日の印＝太い青枠(2026-08-06変更・以前は数字を青丸で塗っていた)。
   枠はoutlineで描く: セルの枠線色は授業方式のインラインstyleで塗られるため、
   borderだと方式色に負けて青枠が出ない。数字は他の日と同じ見た目のまま。 */
.day.today {
  box-shadow: none;
  outline: 6px solid #2563eb;
  outline-offset: -3px;
}

.day.juku-month-day {
  background: #fffdf6;
}

.day.juku-month-day.today {
  box-shadow: none;
}

/* 今日を選択中: 今日の青枠(outline)はそのまま・塗りだけ薄い青 */
.day.today.selected {
  background: #dbeafe;
  box-shadow: none;
}

.day.today::before {
  content: "今日";
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 28px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.day.today::after {
  content: none;
}

.day.today::before {
  content: none;
  display: none;
}

/* 今日の数字は一切上書きしない(他の日とまったく同じ見た目)。
   transparentで上書きすると、授業がある日の赤丸まで消えてしまう。今日の印は青枠だけ。
   選択時の見た目も共通ルール(.day.selected系)に任せる=状態の丸は選択中も残る。 */

/* 選択日は薄い青で塗るだけ(青枠なし)。ホーム/保護者の juku-month-day 等の
   背景ルールに負けないよう複合セレクタで上書きする。 */
.day.juku-month-day.selected,
.day.extra-month-day.selected {
  background: #dbeafe;
}

.lesson-detail {
  display: grid;
  gap: 12px;
}

.one-to-one-request-card,
.contract-change-request-card {
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: start;
  gap: 16px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.one-to-one-request-card:hover,
.one-to-one-request-card.is-open,
.contract-change-request-card:hover,
.contract-change-request-card.is-open {
  border-color: #b9c8da;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.request-summary {
  display: grid;
  gap: 10px;
}

.request-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.request-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 7px 12px;
}

.request-detail-grid span {
  display: grid;
  gap: 2px;
}

.request-detail-grid b {
  color: var(--ink);
  font-size: 11px;
}

.request-detail-grid .request-detail-main {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.request-detail-grid .request-detail-main b {
  font-size: 13px;
}

.contract-change-method-list {
  display: grid;
  gap: 8px;
}

.contract-change-method-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) repeat(2, minmax(120px, 0.8fr)) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  background: #fbfcfe;
}

.contract-change-method-row strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.contract-change-method-row span {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.contract-change-method-row b {
  color: var(--muted);
  font-size: 11px;
}

.contract-change-method-row em {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.request-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.request-status-actions button {
  cursor: pointer;
}

.request-status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6fb;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.request-status-label.request-status-未対応 {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}

.request-status-label.request-status-対応済み {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.request-status-label.request-status-未対応 {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}

.general-makeup-admin-section {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  background: #fff;
}

.general-makeup-admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.unexpected-attendance-admin-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
}

.unexpected-attendance-admin-heading {
  color: #1d4ed8;
}

.unexpected-attendance-admin-card {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.unexpected-attendance-admin-card.is-open,
.unexpected-attendance-admin-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.unexpected-attendance-summary {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1fr) minmax(90px, 0.7fr) minmax(70px, 0.5fr) minmax(70px, 0.5fr);
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.unexpected-attendance-summary strong {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
}

.unexpected-attendance-summary small,
.unexpected-attendance-summary span,
.unexpected-attendance-summary em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.unexpected-attendance-summary b {
  justify-self: end;
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.unexpected-attendance-detail {
  border-top: 1px solid #dbeafe;
  padding-top: 10px;
  cursor: default;
}

.unexpected-attendance-form select,
.unexpected-attendance-form input[type="date"] {
  width: 100%;
  min-height: 42px;
}

.unexpected-attendance-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.unexpected-attendance-form > label {
  min-width: 0;
}

.unexpected-attendance-form > button {
  min-height: 42px;
  justify-self: start;
}

.unexpected-attendance-action-note {
  width: 100%;
  margin: 0;
  color: #9a6700;
  font-size: 12px;
  font-weight: 800;
}

.unexpected-attendance-guide-button,
.unexpected-attendance-complete-button {
  min-height: 40px;
  padding-inline: 16px;
  font-size: 13px;
  font-weight: 900;
}

.unexpected-attendance-guide-button {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1d4ed8;
}

.unexpected-attendance-message-preview {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.unexpected-attendance-message-preview strong {
  color: #1d4ed8;
  font-size: 12px;
}

.unexpected-attendance-message-preview p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.unexpected-attendance-message-preview-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.unexpected-attendance-message-preview-actions .mini-button {
  min-height: 38px;
  padding-inline: 16px;
  font-weight: 900;
}

.unexpected-attendance-guide-note {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.general-makeup-admin-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(120px, 1fr) minmax(150px, 1fr) minmax(92px, 0.7fr) minmax(130px, 0.9fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.general-makeup-admin-row:hover {
  border-color: #60a5fa;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.general-makeup-admin-student {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.general-makeup-admin-student small,
.general-makeup-admin-method,
.general-makeup-admin-date,
.general-makeup-admin-time,
.general-makeup-admin-deadline {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.general-makeup-admin-row .request-status-label {
  min-width: 76px;
  padding: 5px 8px;
  font-size: 12px;
}

.general-makeup-admin-status-normal {
  border-color: #d7e3f2;
  background: #fff;
  color: var(--muted);
}

.general-makeup-admin-status-unestablished {
  border-color: #d7e3f2;
  background: #fff;
  color: var(--muted);
}

@media (max-width: 980px) {
  .general-makeup-admin-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .unexpected-attendance-summary {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .unexpected-attendance-summary b {
    justify-self: start;
  }

  .general-makeup-admin-student,
  .general-makeup-admin-method,
  .general-makeup-admin-date,
  .general-makeup-admin-time,
  .general-makeup-admin-deadline {
    white-space: normal;
  }
}

.request-admin-note textarea {
  cursor: text;
}

.request-expanded-detail {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  cursor: default;
}

.request-detail-grid-secondary {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.one-to-one-admin-makeup-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  background: #f8fbff;
}

.configured-makeup-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.one-to-one-admin-makeup-form > strong {
  grid-column: 1 / -1;
  color: var(--ink);
}

.one-to-one-admin-makeup-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-time-selects select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.one-to-one-admin-makeup-form .autosave-status {
  grid-column: 1 / -1;
  font-weight: 800;
}

.one-to-one-admin-makeup-form.unexpected-attendance-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.one-to-one-admin-makeup-form.unexpected-attendance-form > strong,
.one-to-one-admin-makeup-form.unexpected-attendance-form .autosave-status {
  grid-column: 1 / -1;
}

.one-to-one-admin-makeup-form .autosave-status.error {
  color: #b91c1c;
}

.request-admin-note {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
}

.request-admin-note label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.request-admin-note textarea {
  min-height: 76px;
  resize: vertical;
}

.request-note-autosave {
  display: block;
  font-size: 12px;
}

.request-admin-note-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.request-admin-note-actions .inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.makeup-deadline-settings {
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.deadline-rule-list {
  display: grid;
  gap: 10px;
}

.deadline-rule-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.deadline-rule-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.deadline-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.makeup-request-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(230px, 0.95fr) minmax(150px, 0.75fr) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.makeup-request-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.makeup-request-filter-group {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.makeup-request-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.makeup-request-filter-buttons .mini-button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.makeup-request-filter-buttons .mini-button[data-makeup-request-filter="open"].active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.makeup-request-toolbar .muted {
  display: grid;
  gap: 2px;
  margin: 0 0 5px;
  text-align: right;
  font-size: 12px;
}

.makeup-request-toolbar .muted strong {
  color: #b91c1c;
  font-size: 14px;
}

.makeup-request-toolbar .muted span {
  color: var(--muted);
  font-weight: 700;
}

.request-status-actions .mini-button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.request-status-actions .request-status-未対応.active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.request-status-actions .request-status-対応済み.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.one-to-one-parent-status {
  opacity: 1;
}

.one-to-one-parent-status-未対応 {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.one-to-one-parent-status-対応済み {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.one-to-one-request-card .request-student-name,
.contract-change-request-card .request-student-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.35;
}

.one-to-one-request-card .request-student-name span,
.contract-change-request-card .request-student-name span {
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
}

.one-to-one-request-card .request-student-grade,
.contract-change-request-card .request-student-grade {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 900;
}

.one-to-one-request-card .request-subject-name,
.contract-change-request-card .request-subject-name {
  display: block;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .one-to-one-request-card,
  .contract-change-request-card {
    grid-template-columns: 1fr;
  }

  .request-status-actions {
    justify-content: flex-start;
  }

  .request-detail-grid-secondary {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .contract-change-method-row {
    grid-template-columns: 1fr;
  }

  .contract-change-method-row em {
    justify-self: start;
  }

  .one-to-one-admin-makeup-form {
    grid-template-columns: 1fr;
  }

  .one-to-one-admin-makeup-form.unexpected-attendance-form {
    grid-template-columns: 1fr;
  }
}

.report-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 115, 216, 0.12), transparent),
    repeating-linear-gradient(0deg, #fff, #fff 18px, #eef2f6 19px);
}

@media (max-width: 900px) {
  .login-role-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-grid,
  .parent-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-action-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .message-grid {
    grid-template-columns: 1fr;
  }

  .office-switcher {
    grid-template-columns: 1fr;
  }

  .teacher-scope-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-scope-bar label {
    min-width: 0;
  }

  .attendance-item {
    grid-template-columns: 1fr;
  }

  .attendance-item.unexpected-attendance-home-card {
    grid-template-columns: 1fr;
  }

  .unexpected-attendance-home-row {
    flex-wrap: wrap;
  }

  .calendar-workspace {
    grid-template-columns: 1fr;
  }

  .parent-reservation-panel {
    position: static;
  }

  .scan-screen {
    grid-template-columns: 1fr;
  }

  .teacher-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-detail .attendance-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deadline-rule-row {
    grid-template-columns: 1fr;
  }

  .makeup-request-toolbar {
    grid-template-columns: 1fr;
  }

  .makeup-request-toolbar .muted {
    text-align: left;
  }

  .tuition-adjustment-item {
    grid-template-columns: 1fr;
  }

  .tuition-adjustment-item.auto {
    grid-template-columns: 1fr;
  }

  .tuition-card-history-row {
    grid-template-columns: 1fr 1fr;
  }

  .tuition-pricing-tools,
  .tuition-method-setting-row {
    grid-template-columns: 1fr;
  }

  .parent-tuition-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-panel,
  .calendar-workspace,
  .calendar-detail,
  .side-column,
  .selected-day,
  .parent-reservation-panel {
    min-width: 0;
    max-width: 100%;
  }

  .calendar-controls {
    min-width: 0;
    max-width: 100%;
  }

  .admin-calendar-controls,
  .parent-calendar-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-calendar-controls .calendar-title,
  .parent-calendar-controls .calendar-title {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .admin-calendar-controls [data-juku-month-prev],
  .parent-calendar-controls [data-parent-month-prev] {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .admin-calendar-controls [data-juku-month-next] {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .parent-calendar-controls [data-parent-month-next] {
    grid-column: 3 / 4;
    grid-row: 2;
  }

  .admin-calendar-controls [data-juku-month-today] {
    grid-column: 3 / 4;
    grid-row: 2;
  }

  .calendar-filter-row {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: 1fr;
  }

  .calendar-classroom-control {
    justify-self: stretch;
    max-width: none;
  }

}

@media (max-width: 560px) {
  .login-card {
    padding: 22px;
  }

  .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 12px 9px 32px;
    overflow-x: hidden;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch button {
    flex: 1;
    min-width: 0;
  }

  .panel {
    padding: 14px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .admin-section[data-admin-section="scheduleBoard"].panel {
    padding: 0;
    overflow-x: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .admin-lesson-change-form {
    width: 100%;
  }

  .admin-lesson-change-form .field-grid {
    grid-template-columns: 1fr;
  }

  .admin-lesson-change-student,
  .admin-lesson-change-note {
    grid-column: auto;
  }

  .admin-lesson-add-student-row {
    grid-template-columns: 1fr;
  }

  .admin-lesson-change-student,
  .admin-lesson-change-date,
  .admin-lesson-change-time,
  .admin-lesson-change-method,
  .admin-lesson-change-subject,
  .admin-lesson-change-note {
    max-width: none;
  }

  .calendar {
    gap: 5px;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: hidden;
  }

  .weekday,
  .day {
    min-width: 0;
    min-height: 48px;
    overflow: hidden;
  }

  .weekday {
    font-size: 11px;
  }

  .day button {
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: 30px;
    padding: 0 4px;
    font-size: clamp(10px, 3vw, 14px);
    white-space: nowrap;
  }

  .method-markers {
    left: 4px;
    right: 4px;
    gap: 2px;
  }

  .method-marker {
    width: 10px;
  }

  .calendar-title {
    font-size: 17px;
    line-height: 1.35;
  }

  .calendar-title span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
  }

  .calendar-controls .mini-button,
  .admin-calendar-controls .mini-button,
  .parent-calendar-controls .mini-button {
    min-width: 0;
    width: 100%;
    padding-inline: 8px;
  }

  .calendar-classroom-control select {
    width: 100%;
  }

  .calendar-detail .attendance-list {
    grid-template-columns: 1fr;
  }

  .admin-lesson-add-options,
  .time-range-fields,
  .admin-lesson-add-actions {
    grid-template-columns: 1fr;
  }

  #report-list {
    grid-template-columns: 1fr;
  }

  .admin-action-summary-grid {
    grid-template-columns: 1fr;
  }

  .scan-screen-main {
    padding: 18px;
  }

  .scan-screen-heading {
    display: grid;
  }

  .scan-clock-panel {
    min-width: 0;
    width: 100%;
    min-height: 94px;
    padding: 12px 14px 14px;
  }

  .scan-clock-panel span {
    font-size: 15px;
  }

  .scan-clock-panel strong {
    font-size: 40px;
  }

  .scan-big-input input {
    min-height: 60px;
    font-size: 22px;
  }

  .scan-popup {
    width: calc(100% - 24px);
    padding: 30px 16px 34px;
  }

  .scan-popup-name {
    font-size: 20px;
  }

  .scan-popup strong {
    font-size: clamp(54px, 15vw, 78px);
  }

  .teacher-shortcut-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile stability: keep the page itself from drifting sideways. Wide widgets
   still get their own contained horizontal scroll where needed. */
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  width: 100%;
  overscroll-behavior-x: none;
}

img,
svg,
canvas,
video,
iframe {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.app-shell,
.view,
.panel,
.dashboard-grid,
.parent-layout,
.lower-grid,
.form-grid,
.calendar-panel,
.calendar-workspace,
.calendar-detail,
.side-column,
.selected-day,
.parent-reservation-panel,
.tuition-calculator,
.payroll-calculator,
.teacher-worklog-panel,
.stack-list {
  min-width: 0;
  max-width: 100%;
}

.table-wrap,
.tuition-accountant-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 760px) {
  .parent-registration-method-grid {
    grid-template-columns: 1fr;
  }

  .parent-registration-method-head {
    grid-template-columns: 1fr;
  }

  .parent-registration-method-card .subject-check-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions,
  .view-switch,
  .admin-menu,
  .admin-subtabs,
  .parent-page-tabs {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .view-switch,
  .admin-menu,
  .admin-subtabs,
  .parent-page-tabs {
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .view-switch button,
  .admin-menu button,
  .admin-subtabs button,
  .parent-page-tabs button,
  .parent-page-tabs a {
    flex: 0 0 auto;
  }

  /* 保護者の5タブはモバイルでも横スクロールさせず1行に均等で収める（左右に動かない） */
  .parent-page-tabs-compact {
    overflow-x: hidden;
  }
  .parent-page-tabs-compact button {
    flex: 1 1 0;
    min-width: 0;
  }

  .panel-heading,
  .schedule-detail-title,
  .tuition-student-head,
  .parent-tuition-head,
  .tuition-saved-bills-head,
  .tuition-adjustment-head {
    min-width: 0;
    flex-wrap: wrap;
  }

  .calendar-link-setting,
  .calendar-setting-month,
  .business-hours-row,
  .business-hours-limited-fields,
  .tuition-controls,
  .tuition-pricing-scope-row,
  .tuition-tier-list,
  .tuition-tier-row,
  .tuition-summary-grid,
  .tuition-saved-bill-row,
  .tuition-saved-detail-summary,
  .tuition-payment-row,
  .tuition-payment-panel,
  .office-switcher,
  .student-edit-card,
  .student-list-controls,
  .schedule-detail-row summary,
  .student-detail-grid,
  .student-detail-inline-field,
  .student-detail-inline-editor-fields,
  .student-detail-edit-grid,
  .student-detail-contract-grid,
  .parent-lesson-actions,
  .parent-lesson-actions.has-extra,
  .contract-change-tuition-estimate {
    grid-template-columns: 1fr;
  }

  .contract-change-tuition-estimate em,
  .tuition-overdue-badge {
    justify-self: start;
  }

  .parent-student-picker {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  #parent-student-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .admin-section[data-admin-section="students"].lower-grid > .panel {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .tuition-method-list,
  .parent-tuition-methods,
  .summary-cards {
    grid-template-columns: 1fr;
  }

  .parent-initial-two-grid,
  .parent-initial-registration-form .parent-student-registration-hour-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .login-screen {
    place-items: start center;
    overflow-y: auto;
    padding: 12px;
  }

  .login-card {
    margin: 0 auto;
    padding: 18px;
  }

  .login-card h1 {
    margin-bottom: 4px;
    font-size: 28px;
    line-height: 1.1;
  }

  .login-card .eyebrow,
  .login-card > .muted {
    margin-bottom: 4px;
  }

  .auth-login-form {
    gap: 8px;
    margin-top: 10px;
  }

  .auth-login-form input {
    padding: 10px 12px;
  }

  .auth-login-form button {
    padding: 10px 14px;
  }

  .login-note,
  .login-forgot-note {
    margin-top: 8px;
  }

  .login-role-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .login-role-grid button {
    min-height: 70px;
    padding: 10px;
  }

  .app-shell {
    padding-top: 10px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .admin-section[data-admin-section="students"].lower-grid > .panel {
    max-height: none;
  }

  .scan-screen {
    align-items: start;
  }

  .scan-screen-main {
    min-height: auto;
    align-content: start;
    gap: 12px;
    padding: 16px;
    overflow: visible;
  }

  .scan-screen-heading h2 {
    font-size: 32px;
  }

  .scan-clock-panel {
    min-height: 70px;
    padding: 10px 14px;
  }

  .scan-clock-panel strong {
    font-size: 34px;
  }

  .scan-big-input input {
    min-height: 58px;
    font-size: 24px;
  }

  .scan-main-button {
    min-height: 52px;
  }
}

/* Login screens have no intentional horizontal scroll. Keep them locked to the
   device width so the first screen does not drift on phones. */
.login-screen,
.login-card,
.auth-login-form,
.login-role-grid {
  min-width: 0;
  max-width: 100%;
}

.login-screen {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

.login-card {
  width: min(620px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  overflow-x: hidden;
}

/* 保護者の初回登録は受講内容のカードが多いので、PCでは少し広めにして字詰まりを防ぐ */
#parent-registration-screen .login-card {
  width: min(820px, calc(100vw - 48px));
}

.login-card h1,
.login-card p,
.login-note,
.login-forgot-note,
.login-role-grid strong,
.login-role-grid span,
.link-button {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.link-button {
  white-space: normal;
  text-align: left;
}

html.login-keyboard-open .login-screen {
  align-items: start;
  justify-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.login-keyboard-open .login-card {
  margin-top: 0;
}

html.app-keyboard-open .app-shell {
  padding-bottom: max(96px, calc(var(--keyboard-inset) + 56px));
}

html.app-keyboard-open input:focus,
html.app-keyboard-open textarea:focus,
html.app-keyboard-open select:focus {
  scroll-margin-top: 24px;
  scroll-margin-bottom: max(120px, calc(var(--keyboard-inset) + 88px));
}

@media (orientation: landscape) and (max-height: 520px) {
  html.login-input-focused #login-screen,
  html.login-input-focused #parent-password-setup-screen {
    padding: 8px;
  }

  html.login-input-focused #login-screen .login-card,
  html.login-input-focused #parent-password-setup-screen .login-card {
    width: min(560px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    padding: 10px 14px;
  }

  html.login-input-focused #login-screen .login-card > .eyebrow,
  html.login-input-focused #login-screen .login-card > h1,
  html.login-input-focused #login-screen .login-card > .muted,
  html.login-input-focused #login-screen .login-card > .login-note,
  html.login-input-focused #login-screen .login-card > .login-forgot-note,
  html.login-input-focused #login-screen .login-card > .link-button,
  html.login-input-focused #parent-password-setup-screen .login-card > .eyebrow,
  html.login-input-focused #parent-password-setup-screen .login-card > h1,
  html.login-input-focused #parent-password-setup-screen .login-card > .muted,
  html.login-input-focused #parent-password-setup-screen .login-card > .login-note,
  html.login-input-focused #login-screen [data-demo-login-note],
  html.login-input-focused #login-screen [data-demo-login-area] {
    display: none !important;
  }

  html.login-input-focused #login-screen .auth-login-form,
  html.login-input-focused #parent-password-setup-screen .auth-login-form {
    margin-top: 0;
    gap: 5px;
  }

  /* 保護者登録フォームはキーボード表示中もレイアウトを変えない。
     圧縮で教科チェックの位置が動くと、タップした瞬間に隣の教科へ
     チェックが入る誤操作が起きるため。 */
  html.login-input-focused #login-screen .auth-login-form input,
  html.login-input-focused #parent-password-setup-screen .auth-login-form input {
    min-height: 40px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  html.app-keyboard-open .app-shell {
    width: calc(100vw - 12px);
    padding-top: 8px;
    padding-bottom: max(180px, calc(var(--keyboard-inset) + 88px));
  }

  html.app-keyboard-open .dashboard-grid,
  html.app-keyboard-open .form-grid,
  html.app-keyboard-open .lower-grid,
  html.app-keyboard-open .parent-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .parent-registration-qr-panel {
    grid-template-columns: 1fr;
  }

  .login-screen {
    align-items: start;
    justify-items: center;
    padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow-y: auto;
  }

  .login-card {
    width: 100%;
    max-width: calc(100vw - 20px);
    padding: 18px;
  }

  .login-card h1 {
    font-size: clamp(22px, 7vw, 28px);
    line-height: 1.2;
  }

  .auth-login-form input,
  .auth-login-form button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .login-role-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .login-role-grid button {
    width: 100%;
    min-width: 0;
  }
}

/* ===== 一斉メッセージの回答フォーム ===== */
.message-form-builder { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0; background: #fafbfc; }
.message-form-builder > div > strong { font-size: 15px; }
.message-form-builder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.message-form-question { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; background: #fff; }
.message-form-question-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.message-form-question label { display: block; margin: 6px 0; font-size: 13px; }
.message-form-question textarea, .message-form-question input[type="text"] { width: 100%; box-sizing: border-box; }
.parent-answer-form { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #f7f9fc; display: flex; flex-direction: column; gap: 10px; }
.parent-form-question strong { display: block; }
.parent-form-question .muted { display: block; font-size: 12px; margin: 2px 0 6px; }
.form-option-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.form-option-chip { border: 1px solid #c7ced4; background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.form-option-chip.picked { background: var(--brand); border-color: var(--brand); color: #fff; }
.form-option-rank { font-size: 11px; font-weight: 800; background: rgba(255, 255, 255, 0.25); border-radius: 6px; padding: 1px 6px; }
.parent-form-status { font-size: 13px; color: var(--brand); font-weight: 700; }
.parent-form-child { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-top: 1px dashed var(--line); }
.parent-form-child:first-of-type { border-top: 0; }
.parent-form-child-name { font-weight: 700; font-size: 13px; }
.message-form-responses { margin: 8px 0 2px; }
.message-form-response-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: #fff; font-size: 13px; }
.message-form-response-card strong { display: block; margin-bottom: 4px; }
.meeting-slot-generator { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.slot-gen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 6px 0; }
.slot-gen-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.slot-gen-grid input { width: 100%; box-sizing: border-box; }
.slot-gen-weekday-label { font-size: 13px; margin: 6px 0 4px; }
.slot-gen-weekdays { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.slot-weekday-chip { border: 1px solid #c7ced4; background: #fff; border-radius: 999px; width: 34px; height: 34px; font-weight: 700; cursor: pointer; }
.slot-weekday-chip.selected { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot-grid-edit { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: #fff; }
.slot-grid-note { font-size: 12px; margin-bottom: 4px; }
.slot-grid-count { font-size: 12px; color: var(--brand); margin-bottom: 6px; }
.slot-grid-day { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; border-top: 1px dashed var(--line); }
.slot-grid-day:first-of-type { border-top: 0; }
.slot-grid-day-name { min-width: 72px; font-size: 13px; }
.slot-grid-day-toggle { cursor: pointer; font-weight: 800; border: 1px solid #dfe3e8; border-radius: 8px; padding: 7px 12px; background: #eef0f2; color: #9aa3ab; text-decoration: line-through; font-family: inherit; }
.slot-grid-day-toggle.on { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }
.slot-grid-times { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-grid-chip { border: 1px solid #dfe3e8; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer; background: #eef0f2; color: #9aa3ab; text-decoration: line-through; font-family: inherit; }
.slot-grid-chip.on { background: #eaf1ff; border-color: var(--brand); color: #1f559d; text-decoration: none; }
