/* Teaching portal: shared desktop and mobile visual system. */
:root {
  --brand: #206b5d;
  --brand-deep: #154d43;
  --brand-bright: #c19b64;
  --brand-soft: #edf4ef;
  --brand-mist: #f5f7f2;
  --ink: #34453f;
  --ink-strong: #163c35;
  --muted: #65716a;
  --muted-strong: #485c53;
  --line: #e0e5dd;
  --line-strong: #c9d4c9;
  --page: #f7f6f0;
  --surface: #fff;
  --surface-subtle: #f6f7f2;
  --shadow-sm: 0 4px 18px rgba(27, 52, 37, .035);
  --shadow-md: 0 14px 32px rgba(27, 52, 37, .075);
  --shadow-lg: 0 24px 70px rgba(27, 52, 37, .16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --container: 1360px;
  --header-height: 80px;
}
body { background: var(--page); }
body::before { display: none; }
:focus-visible { outline-color: #a87e47; }
.app-header { background: #143f3a; border: 0; box-shadow: none; }
.app-header__inner { gap: 1.5rem; }
.brand, .brand:hover { color: #fff; }
.brand__mark { width: 43px; height: 43px; border: 0; box-shadow: none; border-radius: 12px; }
.brand__name { font-size: 1.05rem; letter-spacing: -.025em; }
.brand__tagline { color: #c2d1c6; font-size: .66rem; letter-spacing: .075em; }
.app-header__actions { gap: .8rem; flex-wrap: wrap; }
.app-header__actions .button--secondary { color: #fff; border-color: #64857a; background: transparent; }
.app-header__actions .button--secondary:hover { color: #fff; background: #2b574f; }
.app-header__actions .button--ghost { color: #d4e1d8; }
.app-header__actions .button--primary { background: #dfc194; color: #183d35; box-shadow: none; }
.admin-pill, .session-pill { color: #d2e5d6; border-color: #477164; background: #244f46; min-height: 32px; }
.admin-pill::before { background: #a1c796; box-shadow: none; }
.header-nav { display: flex; gap: .25rem; }
.header-nav a { color: #d3e0d7; padding: .65rem .85rem; border-radius: 8px; text-decoration: none; font-size: .85rem; font-weight: 650; }
.header-nav a:hover, .header-nav a[aria-current] { background: #2c5a4f; color: #fff; }
.page-shell { padding-top: 2.8rem; }
.page-shell--narrow { max-width: 1180px; }
.page-title, .portal-intro__title { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: -.045em; line-height: 1.08; }
.page-title { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.page-subtitle { color: var(--muted); max-width: 58ch; }
.eyebrow { font-size: .68rem; letter-spacing: .15em; font-weight: 700; }
.eyebrow::before { display: none; }
.portal-intro { background: #e9eee2; border: 1px solid #e0e5d7; box-shadow: none; padding: clamp(1.5rem, 4vw, 3rem); min-height: 290px; gap: 3rem; }
.portal-intro::before, .portal-intro::after { display: none; }
.portal-intro__title { font-size: clamp(2.6rem, 4.8vw, 4.3rem); }
.portal-intro__subtitle { color: #536352; font-size: .95rem; max-width: 46ch; }
.rhythm-art { display: flex; align-items: center; gap: 8px; height: 190px; transform: rotate(-14deg); padding: 1rem; }
.rhythm-art span { display: block; width: 21px; height: 100%; border-radius: 6px; background: #305c49; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 4px 7px 0 #c8d2bb; }
.rhythm-art span:nth-child(2) { height: 92%; background: #426d51; }
.rhythm-art span:nth-child(3) { height: 84%; background: #5b7b58; }
.rhythm-art span:nth-child(4) { height: 76%; background: #78835b; }
.rhythm-art span:nth-child(5) { height: 68%; background: #9e915e; }
.rhythm-art span:nth-child(6) { height: 60%; background: #b19a69; }
.rhythm-art span:nth-child(7) { height: 52%; background: #c5ac7f; }
.rhythm-art span:nth-child(8) { height: 44%; background: #d6bd95; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.2rem; gap: 1rem; }
.section-heading .eyebrow { margin-bottom: .3rem; }
.school-section-title { margin: 0; font-size: 1.35rem; letter-spacing: -.035em; }
.section-count { color: var(--muted); font-size: .8rem; padding-bottom: .2rem; }
.school-card { background: #fff; border: 1px solid var(--line); box-shadow: none; min-height: 230px; grid-template-rows: 150px auto; }
.school-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.school-card__logo-wrap { background: #f0f2eb; min-height: 150px; }
.school-card__logo-wrap::after { display: none; }
.school-card__logo { filter: none; height: 96px; }
.school-card__body { padding: 1.15rem 2.2rem 1.2rem 1.15rem; background: #fff; border-color: var(--line); }
.school-card__title { white-space: normal; font-size: .96rem; line-height: 1.35; font-weight: 750; }
.school-card__meta { font-size: .72rem; margin-top: .35rem; }
.school-card__profile-label { margin-top: .25rem; }
.school-card__arrow { position: absolute; right: 1rem; bottom: 1.15rem; color: var(--brand); font-size: 1.25rem; }
.overview-shortcuts { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.6rem 0 1.5rem; }
.overview-shortcuts a { padding: .6rem 1rem; background: #fff; color: var(--muted-strong); font-size: .8rem; font-weight: 650; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.overview-shortcuts a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.panel, .card, .surface { border: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--shadow-sm); background: #fff; }
.panel { padding: 1.5rem; }
.panel__header { margin-bottom: 1.3rem; }
.panel__title { font-size: 1.08rem; font-weight: 750; }
.panel__subtitle { font-size: .82rem; line-height: 1.65; max-width: 66ch; }
.dashboard-toolbar { border-radius: 12px; box-shadow: none; padding: 1rem 1.25rem; }
.stat-grid { gap: 1rem; margin-block: 1.4rem 1.8rem; }
.stat-card { border: 1px solid var(--line); background: #fff; border-radius: 16px; box-shadow: none; padding: 1.3rem; }
.stat-card::before, .stat-card::after { display: none; }
.stat-card--brand { background: #204d40; border-color: #204d40; color: #fff; }
.stat-card--brand .stat-card__label, .stat-card--brand .stat-card__detail { color: #d0dfd1; }
.stat-card--brand .stat-card__value { color: #fff; }
.stat-card__label { text-transform: uppercase; font-size: .66rem; letter-spacing: .09em; font-weight: 700; }
.stat-card__value { font-size: 2.25rem; letter-spacing: -.045em; font-weight: 600; }
.stat-card__detail { font-size: .75rem; }
.button { border-radius: 9px; font-weight: 650; }
.button--primary { background: var(--brand); border-color: var(--brand); box-shadow: none; }
.button--primary:hover:not(:disabled) { background: var(--brand-deep); border-color: var(--brand-deep); box-shadow: none; }
.button--secondary { background: #f7f8f3; border-color: var(--line-strong); }
.button--secondary:hover:not(:disabled) { background: var(--brand-soft); border-color: #a7beb0; }
input:not([type="hidden"]), select, textarea { border-color: var(--line-strong); border-radius: 9px; box-shadow: none; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(32,107,93,.12); }
.badge--brand { color: var(--brand-deep); background: var(--brand-soft); border-color: #d0dfd0; }
.data-table th { background: #f4f6f0; color: var(--muted-strong); }
.data-table td, .data-table th { border-color: var(--line); padding-block: .95rem; }
.data-table tbody tr:hover { background: #fafbf7; }
.table-wrap { border-color: var(--line); border-radius: 12px; }
.code-card { background: #f8f9f5; border-color: var(--line); box-shadow: none; border-radius: 12px; }
.guest-code { color: var(--brand-deep); background: #eaf0e6; border-color: #d1ddcb; }
.connection-status { display: flex; gap: .85rem; align-items: center; padding: 1rem; background: #f3f7ef; border: 1px solid #dce6d4; border-radius: 12px; }
.connection-status__dot { width: 10px; height: 10px; background: var(--success); border-radius: 50%; flex: 0 0 auto; }
.connection-status strong, .connection-status span { display: block; }
.connection-status strong { font-size: .85rem; }
.connection-status span { color: var(--muted); font-size: .75rem; }
.connection-status + .connection-status { margin-top: .65rem; }
.connection-status.has-warning { background: var(--warning-soft); border-color: #e8d1a2; }
.connection-status.has-warning .connection-status__dot { background: var(--warning); }
.name-sync-job { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.name-sync-job strong { font-size: .85rem; }
.name-sync-job p { color: var(--muted); font-size: .77rem; margin: .3rem 0 0; }
.learner-name-edit { display: block; padding: .2rem 0; color: var(--brand); font-size: .7rem; border: 0; background: transparent; text-decoration: underline; cursor: pointer; min-height: 44px; }
.connection-setup { max-width: 850px; }
.connection-steps { padding-left: 1.4rem; line-height: 1.7; }
.connection-steps li + li { margin-top: .8rem; }
.connection-setup input[readonly] { font-family: monospace; }
.name-sync-hint { margin-top: 1rem; line-height: 1.6; }
.diary-day { background: #f7f8f3; border-color: var(--line); border-radius: 12px; }
.diary-day__header { background: #eef2e8; border-color: var(--line); }
.diary-date { background: #fff; box-shadow: none; border-color: var(--line); border-radius: 10px; }
.diary-date.is-upcoming { border-color: #d2dfd2; background: #fff; }
.diary-school-row { border-color: var(--line); background: #f8faf5; }
.school-hero { background: #edf1e7; border-color: #dce4d4; box-shadow: none; }
.school-hero h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.65rem); letter-spacing: -.035em; }
.school-hero__logo { background: #fff; border-color: var(--line); box-shadow: none; border-radius: 16px; }
.class-tabs { background: #e9eee3; border-color: #dae2d2; border-radius: 12px; padding: .4rem; gap: .5rem; }
.class-tab { min-height: 52px; padding: .7rem 1rem; }
.class-tab.is-active { background: #fff; box-shadow: 0 2px 5px #183c3510; color: var(--brand-deep); }
.class-tab__copy small { font-size: .7rem; }
.lesson-strip { background: #f6f8f2; border-color: var(--line); border-radius: 12px; }
.lesson-tile.is-selected, .lesson-tile[aria-current] { background: var(--brand-soft); border-color: var(--brand); }
.class-register-wrap { border-color: var(--line); border-radius: 12px; }
.class-register th, .class-register td { border-color: var(--line); }
.class-register__date-heading { background: #f2f5ec; }
.class-register__date-heading.is-selected, .class-register__cell.is-selected { background: #eaf2e5; }
.class-register__student, .class-register__student-heading { background: #fff; }
.attendance-guidance { background: #f1f5eb; }
.song-chip { border-color: #d6e0cf; color: var(--brand-deep); background: #f2f5eb; border-radius: 8px; }
.auth-card { border: 1px solid var(--line); background: #fff; border-radius: 22px; box-shadow: var(--shadow-md); }
.auth-card__top { background: #e9eee2; border-color: var(--line); }
.auth-card__title { font-family: Georgia, serif; font-weight: 400; font-size: 2rem; letter-spacing: -.04em; }
.pin-key { background: #f6f8f1; border-color: #dce4d4; box-shadow: none; border-radius: 12px; }
.pin-key:hover { background: #eaf2e4; }
.pin-key--action { background: #edf2e6; }
.modal { border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg); }
.modal__header { background: #f6f8f1; border-color: var(--line); }
.modal__footer { border-color: var(--line); }
.app-footer { border-color: var(--line); background: #f0f2e9; }
section[id] { scroll-margin-top: 100px; }
@media (max-width: 1100px) {
  .brand__tagline { font-size: .6rem; }
  .admin-pill { display: none; }
  .rhythm-art { gap: 6px; height: 165px; }
  .rhythm-art span { width: 18px; }
}
@media (max-width: 820px) {
  .app-header__inner { padding-block: .85rem; min-height: 76px; gap: .8rem; }
  .brand__name { max-width: none; font-size: .96rem; }
  .brand__tagline { display: block; font-size: .58rem; }
  .app-header__actions { gap: .35rem; }
  .app-header__actions .button, .header-nav a { padding-inline: .65rem; font-size: .75rem; min-height: 44px; }
  .page-shell { padding-block: 1.6rem 2.5rem; }
  .panel { padding: 1.15rem; }
  .portal-intro { grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; min-height: 250px; }
  .rhythm-art { height: 120px; gap: 5px; padding: .5rem; }
  .rhythm-art span { width: 12px; }
  .panel__header { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .app-header { position: static; }
  .app-header__inner { flex-wrap: wrap; width: calc(100% - 2rem); padding-block: 1rem .8rem; }
  .brand__name { font-size: 1rem; }
  .brand__tagline { font-size: .61rem; }
  .app-header__actions { width: 100%; justify-content: space-between; gap: .5rem; }
  .header-nav { order: -1; flex: 1; }
  .app-header__actions form { margin: 0; }
  .app-header__actions [data-modal-open] { order: 2; flex: 1 0 100%; }
  .page-shell { width: calc(100% - 2rem); }
  .page-title { font-size: 2.5rem; }
  .page-subtitle { font-size: .9rem; }
  .page-heading { margin-bottom: 1.4rem; }
  .portal-intro { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 1.6rem; }
  .portal-intro__title { font-size: 2.7rem; }
  .portal-intro__subtitle { font-size: .9rem; }
  .rhythm-art { position: absolute; right: -9px; top: 10px; opacity: .08; height: 145px; pointer-events: none; }
  .portal-intro__content { max-width: 100%; }
  .school-grid { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .school-card { grid-template-columns: 90px minmax(0, 1fr); grid-template-rows: auto; min-height: 116px; border-radius: 16px; }
  .school-card__logo-wrap { min-height: 116px; padding: .75rem; }
  .school-card__logo, .school-card[data-school="wbjs"] .school-card__logo, .school-card[data-school="maara"] .school-card__logo { max-width: 100%; height: 68px; }
  .school-card__body { padding: .9rem 2rem .9rem 1rem; border-top: 0; border-left: 1px solid var(--line); }
  .school-card__title { font-size: .94rem; }
  .section-heading { align-items: center; }
  .section-count { white-space: nowrap; }
  .school-section-title { font-size: 1.2rem; }
  .overview-shortcuts { gap: .4rem; margin-bottom: 1.2rem; }
  .overview-shortcuts a { font-size: .74rem; padding: .6rem .85rem; }
  .dashboard-toolbar { padding: 1rem; }
  .dashboard-toolbar form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: .6rem; }
  .dashboard-toolbar form .button { grid-column: 1 / -1; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .stat-card { padding: 1rem; min-width: 0; border-radius: 14px; }
  .stat-card__value { font-size: 1.9rem; }
  .stat-card__label { font-size: .6rem; }
  .stat-card__detail { font-size: .7rem; line-height: 1.45; }
  .panel { padding: 1rem; border-radius: 16px; }
  .panel__header { gap: .8rem; }
  .panel__header > form { width: 100%; }
  .panel__header > form .button { width: 100%; }
  .lesson-diary__viewport { scrollbar-width: thin; }
  .school-summary-table, .school-summary-table tbody { display: block; min-width: 0; width: 100%; }
  .school-summary-table thead { display: none; }
  .school-summary-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .8rem; padding: 1rem; border-bottom: 1px solid var(--line); }
  .school-summary-table td { display: block; border: 0; padding: 0; white-space: normal; font-size: .8rem; }
  .school-summary-table td:first-child, .school-summary-table td:last-child { grid-column: 1 / -1; }
  .school-summary-table td:first-child { margin-bottom: .25rem; font-size: .95rem; }
  .school-summary-table td[data-label]::before { content: attr(data-label); display: block; font-size: .65rem; color: var(--muted); margin-bottom: .15rem; }
  .school-summary-table td:last-child { margin-top: .35rem; }
  .school-summary-table .button { width: 100%; justify-content: space-between; }
  .school-hero { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: .8rem; padding: 1.15rem; }
  .school-hero__logo { width: 60px; height: 70px; padding: .55rem; }
  .school-hero__copy h1 { font-size: 1.65rem; }
  .school-hero__copy .eyebrow { font-size: .59rem; }
  .school-hero__actions { grid-column: 1 / -1; justify-content: start; }
  .school-hero__meta { font-size: .72rem; gap: .3rem; }
  .class-tab { min-height: 58px; }
  .class-register { min-width: 820px; }
  .class-register__student, .class-register__student-heading { min-width: 136px; width: 136px; }
  .class-register__student strong { font-size: .78rem; }
  .class-register__student span { font-size: .65rem; }
  .register-entry select { min-height: 44px; }
  .modal { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); border-radius: 18px; }
  .modal__body { overflow-y: auto; }
  .modal__footer { flex-wrap: wrap; }
  .modal__footer .button { flex: 1; }
  .auth-card__title { font-size: 1.85rem; }
  .page-shell--auth { min-height: 0; padding-block: 1.5rem 2.5rem; }
  section[id] { scroll-margin-top: 1rem; }
}
@media print {
  .header-nav, .overview-shortcuts, .rhythm-art { display: none; }
  .school-summary-table, .school-summary-table tbody { display: table; }
  .school-summary-table thead { display: table-header-group; }
  .school-summary-table tr { display: table-row; }
  .school-summary-table td { display: table-cell; }
  .school-summary-table td::before { display: none !important; }
  .stat-card--brand { color: #163c35; background: #fff; }
  .stat-card--brand .stat-card__value, .stat-card--brand .stat-card__label, .stat-card--brand .stat-card__detail { color: #163c35; }
}

.connection-template { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; background: var(--surface-soft); border-radius: 10px; font-size: .8rem; }
.class-register--awaiting { min-width: 0; width: 100%; }
.class-register--awaiting .class-register__student { width: 50%; min-width: 140px; }
.class-register--awaiting .class-register__date-heading,
.class-register--awaiting .class-register__cell { width: auto; min-width: 0; }
