:root {
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --ink: #18302d;
  --muted: #67736f;
  --line: #d9d8cf;
  --teal: #0d6b63;
  --teal-dark: #07514b;
  --mint: #dcece6;
  --saffron: #e8a525;
  --saffron-soft: #fff1cd;
  --shadow: 0 18px 50px rgba(25, 48, 45, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
.is-hidden { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body.locked { overflow: hidden; }
body.locked .shell { filter: blur(5px); pointer-events: none; user-select: none; }
.access-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; background: rgba(24,48,45,.62); backdrop-filter: blur(9px); }
.access-gate[hidden] { display: none; }
.access-card { width: min(540px, 100%); display: grid; gap: 12px; padding: 25px; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: var(--surface); box-shadow: 0 30px 100px rgba(10,28,25,.34); max-height: calc(100vh - 36px); overflow-y: auto; }
.access-card .brand-mark { margin-bottom: 2px; }
.access-card h1 { margin: 0; font-size: 33px; }
.access-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.access-card .access-error { min-height: 20px; color: #a64037; font-weight: 750; }
.access-card button { width: 100%; padding: 11px 14px; }
.access-head { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: center; }
.access-head .brand-mark { grid-row: 1 / span 2; }
.access-head .eyebrow { align-self: end; }
.access-head h1 { align-self: start; }
.access-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 11px; background: #eceae2; }
.access-tabs button { padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.access-tabs button.active { background: var(--surface); color: var(--teal); box-shadow: 0 3px 10px rgba(24,48,45,.08); }
.access-form { display: grid; gap: 10px; }
.access-form label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.access-form label small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }
.access-form input { width: 100%; }
.access-recovery { width: 100%; margin-top: 2px; }
.access-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.access-form-grid .wide { grid-column: 1 / -1; }
.access-divider { display: grid; grid-template-columns: 1fr auto 1fr; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; }
.access-divider::before, .access-divider::after { content: ""; height: 1px; background: var(--line); }
.public-entry { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.public-entry button { width: auto; }
.migration-choice { display: flex !important; grid-template-columns: none !important; gap: 8px !important; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #faf9f3; }
.migration-choice input { width: auto; margin-top: 2px; }
.access-notice { padding: 9px 10px; border-radius: 9px; background: var(--saffron-soft); color: #6f4d12 !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(232,165,37,.35); outline-offset: 2px; }
.shell { min-height: 100vh; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.86); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: white; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 20px; }
.app-version { display: inline-block; margin-left: 5px; color: var(--teal); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .02em; vertical-align: 2px; }
.brand small { color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.saved { color: var(--muted); font-size: 13px; margin-right: 8px; }
.saved span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2b9a71; margin-right: 7px; }
.account-summary { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.primary, .secondary, .danger-button { border-radius: 9px; padding: 8px 12px; border: 1px solid var(--line); font-weight: 700; }
.primary { background: var(--teal); color: white; border-color: var(--teal); box-shadow: 0 8px 20px rgba(13,107,99,.18); }
.primary:hover { background: var(--teal-dark); }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.secondary { background: var(--surface); color: var(--ink); }
.secondary:hover { border-color: #aeb9b5; background: #faf9f3; }
.danger-button { border-color: #d7aaa5; background: #fff8f6; color: #9e463d; }
.danger-button:hover { border-color: #b96f66; background: #fae9e6; }
.danger { color: #a64037 !important; }
.icon-button { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 7px 9px; }
.icon-button:hover { background: #ecebe4; color: var(--ink); }
main { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.sidebar nav { display: grid; gap: 3px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; font-weight: 650; }
.nav-item span { font-size: 10px; letter-spacing: .08em; opacity: .65; }
.nav-item.active { background: var(--surface); color: var(--teal); box-shadow: 0 6px 18px rgba(25,48,45,.06); }
.sidebar-note { background: var(--ink); color: white; border-radius: 12px; padding: 13px; }
.sidebar-note p { margin: 8px 0 0; color: #bfd0cc; font-size: 13px; line-height: 1.5; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.sidebar-note .eyebrow { color: #7bd0c3; display: block; margin-bottom: 8px; }
.workspace { padding: 24px clamp(16px, 2.2vw, 30px) 38px; max-width: none; width: 100%; min-width: 0; }
.workspace.busy { opacity: .64; pointer-events: none; }
.message-dialog { width: min(540px, calc(100vw - 20px)); }
.message-dialog .dialog-body { max-height: calc(100dvh - 90px); }
.message-dialog h2 { font-family: inherit; font-size: 1.2rem; }
.message-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.5; }
.message-dialog input { width: 100%; }
.message-dialog .dialog-actions { flex-direction: row-reverse; }
.workspace-head { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: end; gap: 24px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.04; max-width: 780px; margin: 8px 0 10px; }
.workspace-head p { max-width: 720px; color: var(--muted); line-height: 1.5; margin: 0; }
.quality-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.quality-card span, .quality-card small { color: var(--muted); font-size: 12px; }
.quality-card strong { float: right; color: var(--teal); }
.progress { height: 8px; border-radius: 10px; background: #e3e5df; margin: 18px 0 10px; overflow: hidden; }
.progress i { display: block; width: 82%; height: 100%; background: linear-gradient(90deg, var(--teal), #3b9e87); border-radius: inherit; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 12px; }
.school-card { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.school-identity-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 110px minmax(180px, .55fr); gap: 8px; align-items: end; }
.school-card label { display: grid; gap: 4px; color: var(--ink); font-size: 12px; font-weight: 700; }
.school-card input { font-size: 16px; font-weight: 700; }
.school-card span { color: var(--muted); font-size: 12px; }
.class-code-input { width: 42px; min-width: 42px; padding: 6px 5px; text-align: center; text-transform: uppercase; font-weight: 800; }
.stat-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.stat-grid span, .stat-grid small { display: block; color: var(--muted); font-size: 12px; }
.stat-grid strong { display: block; font-family: Georgia, serif; font-size: 34px; margin: 8px 0 4px; }
.stat-grid .accent { background: var(--saffron-soft); border-color: #ebd49f; }
.content-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; gap: 16px; }
.panel h2 { font-size: 22px; margin: 5px 0 12px; }
.status { align-self: flex-start; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 7px 10px; }
.status.good { color: #166149; background: #dff1e8; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.check-list li { display: flex; gap: 9px; align-items: center; padding: 8px; border-radius: 9px; background: #f8f7f1; }
.check-list i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--teal); font-style: normal; font-weight: 900; }
.check-list strong, .check-list small { display: block; }
.check-list small { color: var(--muted); margin-top: 3px; }
.primary-rule { background: var(--ink); color: white; }
.primary-rule .eyebrow { color: #80d5c7; }
.primary-rule p { color: #c3cfcc; line-height: 1.6; }
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 15px 0; }
.timeline span { min-height: 46px; display: grid; place-items: center; border: 1px solid #48615d; border-radius: 9px; color: #9db0ac; }
.timeline .edge { background: var(--saffron); border-color: var(--saffron); color: #2e2b22; font-weight: 800; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { font-size: clamp(28px, 3vw, 40px); margin: 5px 0 0; }
.page-head p { color: var(--muted); margin: 8px 0 0; max-width: 700px; line-height: 1.55; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.mini { padding: 8px 11px; font-size: 12px; border-radius: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-bottom: 10px; }
.toolbar .search { width: min(320px, 100%); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 7px 9px; }
input:hover, select:hover, textarea:hover { border-color: #aeb9b5; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.field-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.class-name-preview { margin: -2px 0 0; color: var(--muted); font-size: 12px; }
.class-name-preview strong { color: var(--teal); font-size: 15px; }
.request-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 0; }
.request-box legend { color: var(--ink); font-size: 12px; font-weight: 800; padding: 0 6px; }
.request-box p { margin: 10px 0 0; }
.flex-request-list { display: grid; gap: 7px; margin-bottom: 10px; }
.flex-request-row { display: grid; grid-template-columns: 110px 1fr 1.2fr auto; gap: 9px; align-items: end; padding: 9px; border-radius: 10px; background: #f7f5ed; }
.subject-grid { display: flex; flex-wrap: wrap; gap: 5px; max-height: 145px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #f7f5ed; }
.subject-choice { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; }
.subject-choice:hover { border-color: #9ebbb3; color: var(--ink); }
.subject-choice.active { background: var(--teal); border-color: var(--teal); color: white; }
.subject-choice:disabled { cursor: not-allowed; opacity: .78; }
.teacher-class-section { margin: 0; }
.teacher-class-grid { display: grid; gap: 4px; }
.teacher-class-row { display: grid; grid-template-columns: minmax(135px, .45fr) minmax(0, 2.55fr); gap: 6px; align-items: stretch; padding: 4px; border-radius: 8px; background: #f7f5ed; }
.teacher-class-name { display: flex; flex-direction: column; justify-content: flex-start; padding: 9px 7px 5px; }
.teacher-class-name strong, .teacher-class-name small { display: block; }
.teacher-class-name small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.teacher-subject-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px; }
.teacher-subject-entry { display: grid; grid-template-columns: minmax(105px, .8fr) 58px minmax(135px, 1fr); gap: 5px; align-items: end; padding: 5px; border: 1px solid transparent; border-radius: 7px; background: var(--surface); }
.teacher-subject-entry.active { border-color: #91c5b6; background: #eef8f4; }
.teacher-subject-toggle { display: flex; align-items: center; gap: 6px; min-height: 32px; color: var(--ink); cursor: pointer; }
.teacher-subject-toggle input { width: auto; }
.teacher-subject-toggle input:disabled { cursor: not-allowed; }
.teacher-subject-toggle strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-form-note { margin: 0; }
.allocation-matrix { display: grid; gap: 4px; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 5px; background: #f7f5ed; }
.allocation-row { display: grid; grid-template-columns: minmax(210px, 1fr) 78px minmax(220px, .9fr); gap: 6px; align-items: end; padding: 6px; border: 1px solid transparent; border-radius: 8px; background: var(--surface); }
.allocation-row.active { border-color: #b6d5cb; background: #f2faf7; }
.class-check { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--ink); }
.class-check input { width: auto; }
.class-check strong, .class-check small { display: block; }
.class-check small { color: var(--muted); margin-top: 2px; }
.allocation-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.allocation-chip { display: inline-block; padding: 6px 8px; border-radius: 8px; background: #f2f1ea; }
.allocation-chip strong, .allocation-chip small { display: block; }
.allocation-chip strong { font-size: 11px; }
.allocation-chip small { color: var(--muted); font-size: 9px; margin-top: 2px; }
dialog { width: min(620px, calc(100vw - 20px)); max-height: calc(100vh - 16px); overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); padding: 0; box-shadow: 0 28px 90px rgba(24,48,45,.24); }
dialog.wide-dialog { width: min(1120px, calc(100vw - 20px)); }
dialog::backdrop { background: rgba(17,37,34,.46); backdrop-filter: blur(4px); }
.dialog-body { padding: 14px; max-height: calc(100vh - 70px); overflow: auto; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dialog-head h2 { margin: 4px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); background: #f7f5ed; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: white; border-radius: 11px; padding: 11px 16px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #f3f1e9; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 7px 8px; border-bottom: 1px solid #ebe9e1; font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fffefb; }
.data-table td:last-child { white-space: nowrap; }
.teachers-table th:nth-child(1) { width: 28%; }
.teachers-table th:nth-child(2) { width: 28%; }
.teachers-table th:nth-child(3) { width: 18%; }
.teachers-table th:nth-child(4) { width: 1%; }
.teachers-table .icon-button { padding: 6px 7px; }
.cell-main { font-weight: 750; }
.cell-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.class-summary-table { min-width: 980px; }
.class-summary-table th:nth-child(3) { min-width: 300px; }
.hours-summary { display: flex; flex-wrap: wrap; gap: 4px; max-width: 520px; }
.hours-summary span { display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 6px; border-radius: 7px; background: #f2f1ea; color: var(--muted); font-size: 10px; white-space: nowrap; }
.hours-summary strong { color: var(--teal-dark); font-size: 11px; }
.hours-summary span.complete { background: #e5f3ed; }
.hours-summary span.problem { background: #f9e8e5; color: #8e4038; }
.hours-summary span.problem strong { color: #9e463d; }
.hours-summary span.accepted { background: #dfeaf7; color: #244f7c; }
.hours-summary span.accepted strong { color: #244f7c; }
.hours-summary-empty { color: var(--muted); font-size: 11px; }
.plan-level-list { display: grid; gap: 10px; }
.plan-level-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.plan-level-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f5ed; }
.plan-level-card h2 { margin: 0; font-size: 20px; }
.plan-level-card header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.plan-level-card .table-wrap { border: 0; border-radius: 0; }
.plan-table { min-width: 650px; }
.plan-status { display: inline-flex; align-items: center; width: max-content; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.plan-status.ok { background: #dff1e8; color: #166149; }
.plan-status.warn { background: var(--saffron-soft); color: #76510d; }
.plan-status.error { background: #f5dfdc; color: #963e35; }
.plan-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.plan-edit-row { display: grid; grid-template-columns: minmax(120px, 1fr) 74px; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 8px; background: #f7f5ed; }
.plan-edit-row span { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.plan-edit-row input { text-align: center; }
.plan-edit-total { margin: 10px 0 0; color: var(--muted); font-size: 12px; text-align: right; }
.daily-period-grid { display: grid; grid-template-columns: repeat(5, minmax(72px, 1fr)); gap: 6px; }
.daily-period-grid label { min-width: 0; }
.daily-period-grid input { padding: 8px 6px; text-align: center; }
.validation-summary { display: grid; grid-template-columns: auto auto auto minmax(220px, 1fr); align-items: center; gap: 10px; margin-bottom: 10px; }
.validation-summary > div:not(.segment) { display: flex; align-items: baseline; gap: 5px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.validation-summary > div > strong { font-size: 19px; }
.validation-summary > div > span { color: var(--muted); font-size: 11px; }
.validation-list { display: grid; gap: 8px; }
.validation-list .validation-item { display: grid; gap: 9px; padding: 11px 12px; }
.validation-item > header { display: flex; align-items: center; gap: 8px; }
.validation-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 7px; }
.validation-detail-grid > div { padding: 8px 9px; border: 1px solid rgba(24,48,45,.09); border-radius: 8px; background: rgba(255,255,255,.52); }
.validation-detail-grid span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.validation-detail-grid p { margin: 0; font-size: 11px; line-height: 1.45; }
.validation-item > .secondary { justify-self: start; }
.validation-detail-grid .validation-entities { margin-top: 5px; font-weight: 600; }
.validation-actions { justify-content: flex-start; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.validation-summary .segment { flex-wrap: wrap; }
.plan-status.accepted { background: #dfeaf7; color: #244f7c; }
.validation-item.accepted { border-color: #b9cfe5; background: #eff5fb; }
.correction-highlight { outline: 2px solid #dc970f; outline-offset: -2px; background-color: #fff0bb !important; scroll-margin-block: 90px; }
tr.correction-highlight > td { background-color: #fff0bb !important; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; background: var(--mint); color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.badge.primary-cycle { background: var(--saffron-soft); color: #76510d; }
.empty { display: grid; place-items: center; text-align: center; min-height: 280px; padding: 40px; border: 1px dashed #c7cbc3; border-radius: var(--radius); color: var(--muted); }
.empty strong { color: var(--ink); font-family: Georgia, serif; font-size: 24px; display: block; margin-bottom: 8px; }

.segment { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #eceae2; }
.segment button { border: 0; background: transparent; border-radius: 8px; padding: 8px 12px; color: var(--muted); font-size: 12px; font-weight: 750; }
.segment button.active { background: var(--surface); color: var(--teal); box-shadow: 0 3px 10px rgba(24,48,45,.08); }
.availability-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 8px; }
.selector-list { display: grid; gap: 3px; max-height: calc(100vh - 205px); overflow: auto; }
.selector-list button { text-align: left; border: 1px solid transparent; border-radius: 8px; padding: 7px 8px; background: transparent; color: var(--ink); line-height: 1.15; }
.selector-list button:hover { background: #f2f0e8; }
.selector-list button.active { background: var(--mint); border-color: #bdd8d0; color: var(--teal-dark); }
.selector-list strong { font-size: 12px; }
.selector-list small { display: block; color: var(--muted); margin-top: 1px; font-size: 9px; line-height: 1.2; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.availability-grid, .schedule-grid { width: 100%; border-collapse: separate; border-spacing: 5px; min-width: 700px; }
.availability-grid th, .schedule-grid th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 7px; }
.availability-grid th:first-child { width: 82px; }
.availability-grid th small, .schedule-grid th small, .primary-editor-grid th small, .online-week-wrap th small { display: block; margin-top: 2px; font-size: 9px; font-weight: 650; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.availability-grid td { height: 48px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: 11px; font-weight: 800; cursor: pointer; user-select: none; }
.availability-grid td.available { background: #f7f5ee; color: #88918e; }
.availability-grid td.avoid { background: var(--saffron-soft); border-color: #e8cf92; color: #865c12; }
.availability-grid td.unavailable { background: #efe1df; border-color: #dab5b0; color: #9e463d; }
.availability-grid td.blocked { background: #e9e9e5; color: #a0a5a2; text-decoration: line-through; }
.primary-free-grid { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.primary-free-grid th { padding: 4px; color: var(--muted); font-size: 10px; text-align: center; }
.primary-free-grid th:first-child { width: 92px; }
.primary-free-grid td { height: 35px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #f7f5ee; text-align: center; }
.primary-free-grid td.requested { border-color: #d6a43b; background: var(--saffron-soft); }
.primary-requirements-editor { display: grid; gap: 10px; }
.primary-requirement-list { display: grid; gap: 8px; }
.primary-requirement-row { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(110px, .8fr) minmax(105px, .65fr) minmax(120px, .75fr) 38px; gap: 8px; align-items: end; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.primary-requirement-row label { min-width: 0; }
.primary-requirement-row label > span { display: block; margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.primary-requirement-row select, .primary-requirement-row input { width: 100%; min-height: 40px; }
.primary-requirement-row .icon-button { margin-bottom: 1px; }
.primary-fixed-request-details { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.primary-fixed-request-details summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.primary-fixed-request-details[open] summary { margin-bottom: 10px; }
@media (max-width: 900px) {
  .primary-requirement-row { grid-template-columns: 1fr 1fr; }
  .primary-requirement-type { grid-column: 1 / -1; }
  .primary-requirement-row .icon-button { justify-self: end; }
}
.primary-free-grid td.blocked { background: #e9e9e5; color: #a0a5a2; }
.primary-free-choice { position: relative; display: grid; width: 100%; height: 100%; min-height: 35px; place-items: center; cursor: pointer; }
.primary-free-choice input { position: absolute; opacity: 0; pointer-events: none; }
.primary-free-choice span { font-size: 10px; font-weight: 800; color: var(--muted); }
.primary-free-choice:has(input:checked) span { color: #76510d; }
.primary-free-choice:has(input:disabled) { cursor: default; }
.compact-note { margin: 0 0 7px !important; padding: 8px 10px; }

.validation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 10px 0; }
.validation-item { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: #f9f8f3; }
.validation-item strong, .validation-item small { display: block; }
.validation-item strong { font-size: 13px; }
.validation-item small { color: var(--muted); margin-top: 5px; line-height: 1.4; }
.validation-item.error { border-color: #deb7b2; background: #fbefed; }
.validation-item.warn { border-color: #e6d098; background: #fff7df; }
.validation-item.insight { border-color: #b9cfe5; background: #f1f6fb; }
.validation-item.ok { border-color: #b9d8cc; background: #eff8f4; }
.generate-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 19px; border-radius: var(--radius); background: var(--ink); color: white; }
.generate-card h2 { margin: 7px 0 9px; font-size: 30px; }
.generate-card p { color: #c5d0cd; max-width: 680px; line-height: 1.6; margin: 0; }
.generate-card .primary { background: var(--saffron); border-color: var(--saffron); color: #2e2b22; min-width: 180px; }
.generate-actions { display: grid; min-width: min(390px, 42vw); gap: 9px; }
.generate-actions > label { display: grid; grid-template-columns: 118px minmax(150px, 1fr); align-items: center; gap: 5px 8px; color: white; font-size: 13px; font-weight: 800; }
.generate-actions select { width: 100%; min-height: 39px; padding: 7px 34px 7px 10px; }
.generate-actions small { grid-column: 1 / -1; max-width: 390px; color: #c5d0cd; font-size: 10px; font-weight: 500; line-height: 1.4; }
.generate-actions .button-row { justify-content: flex-end; }
.rules-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.rules-summary strong { color: var(--ink); }
.generation-rule-section { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.generation-rule-section > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border-bottom: 1px solid var(--line); background: #f7f5ed; }
.generation-rule-section > header > div { display: flex; align-items: center; gap: 9px; }
.generation-rule-section h2 { margin: 0; font-size: 19px; }
.generation-rule-section header p { margin: 0; color: var(--muted); font-size: 12px; }
.generation-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.generation-rule-card { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; align-items: start; min-height: 82px; padding: 11px 12px; background: var(--surface); cursor: pointer; }
.generation-rule-card.absolute { cursor: default; background: #f7f8f6; }
.generation-rule-card > input { position: absolute; opacity: 0; pointer-events: none; }
.generation-rule-check { position: relative; width: 20px; height: 20px; margin-top: 1px; border: 1px solid #9caaa6; border-radius: 6px; background: white; }
.generation-rule-card input:checked + .generation-rule-check { border-color: var(--teal); background: var(--teal); }
.generation-rule-card input:checked + .generation-rule-check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.generation-rule-card input:focus-visible + .generation-rule-check { outline: 3px solid rgba(20, 119, 111, .22); outline-offset: 2px; }
.generation-rule-copy { display: grid; gap: 3px; }
.generation-rule-copy strong { font-size: 14px; line-height: 1.25; }
.generation-rule-copy > span { color: var(--ink); font-size: 12px; line-height: 1.35; }
.generation-rule-copy small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.data-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.data-card h2 { margin: 0 0 6px; font-size: 21px; }
.data-card p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 650px; font-size: 13px; }
.sync-card { align-items: flex-end; border-color: #c9ddd8; background: #f6faf9; }
.sync-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sync-title h2 { margin-bottom: 0; }
.sync-state { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.sync-state.ok { background: #dceddf; color: #25633c; }
.sync-state.different { background: #fff0cc; color: #865c12; }
.sync-state.offline { background: #e9e9e5; color: #68736f; }
.sync-card > div:first-child > p { margin-top: 7px; }
.sync-details { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.sync-details span { display: grid; min-width: 190px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.sync-details b { color: var(--teal-dark); font-size: 11px; }
.sync-details small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.sync-actions { flex-wrap: wrap; justify-content: flex-end; }
.time-settings-card { margin: 10px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.time-settings-card header { margin-bottom: 9px; }
.time-settings-card h2 { margin: 0 0 3px; font-size: 21px; }
.time-settings-card p { max-width: 850px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.period-time-grid { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); gap: 5px; }
.period-time-row { min-width: 0; padding: 7px; border-radius: 8px; background: #f3f1e9; }
.period-time-row > strong { display: block; margin-bottom: 5px; color: var(--teal-dark); font-size: 11px; }
.period-time-row > div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 3px; }
.period-time-row input { min-width: 0; padding: 6px 4px; font-size: 11px; }
.publication-card { align-items: flex-end; }
.publication-controls { display: grid; grid-template-columns: minmax(180px, 240px) minmax(170px, 230px) auto; gap: 8px; align-items: end; }
.publication-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.publication-controls .is-hidden { display: none; }
.publication-link { display: block; margin-top: 6px; color: var(--teal); font-size: 12px; overflow-wrap: anywhere; }
.duty-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.duty-toolbar label { display: grid; min-width: 190px; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.duty-toolbar > span { margin-left: auto; padding-bottom: 8px; color: var(--muted); font-size: 12px; }
.duty-roster-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.duty-roster-table th, .duty-roster-table td { border-bottom: 1px solid #ebe9e1; padding: 5px; text-align: left; }
.duty-roster-table thead th { background: #f3f1e9; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.duty-roster-table th:first-child { width: 110px; color: var(--muted); font-size: 11px; }
.duty-roster-table th small { display: block; margin-top: 2px; font-size: 9px; font-weight: 650; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.duty-person-input { width: 100%; min-width: 0; padding: 8px 9px; }
.duty-publication-card { align-items: flex-end; }
.duty-publication-controls { display: grid; min-width: min(420px, 100%); grid-template-columns: minmax(210px, 1fr) auto; gap: 8px; align-items: end; }
.duty-publication-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.contact-card { align-items: center; }
.contact-email { color: var(--teal); font-size: clamp(18px, 2vw, 25px); font-weight: 800; text-decoration: none; }
.contact-email:hover { text-decoration: underline; }
.save-warning span { background: var(--saffron) !important; }
.save-error { color: #a64037 !important; }
.save-error span { background: #a64037 !important; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -4px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.result-controls select { width: auto; min-width: 180px; }
.entity-stepper { display: inline-grid; grid-template-columns: 36px minmax(180px, auto) 36px; align-items: stretch; gap: 5px; }
.entity-stepper select { min-width: 180px; }
.entity-arrow { min-width: 36px; padding: 7px 8px; font-size: 18px; line-height: 1; }
.generation-complete { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; background: #dff1e8; color: #166149; font-size: 12px; font-weight: 800; }
.generation-status { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; align-items: flex-start; gap: 11px; width: min(430px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid #2e776e; border-radius: 13px; background: var(--teal-dark); color: white; box-shadow: 0 18px 45px rgba(10,37,34,.28); }
.generation-status[hidden] { display: none; }
.generation-status .spinner { flex: 0 0 auto; margin-top: 2px; }
.generation-status strong, .generation-status small { display: block; }
.generation-status strong { margin-bottom: 4px; font-size: 14px; }
.generation-status small { color: #d6e9e5; font-size: 11px; line-height: 1.45; }
.schedule-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 8px; }
.schedule-grid { table-layout: fixed; }
.schedule-grid th:first-child { width: 82px; }
.schedule-grid td { height: 82px; vertical-align: top; border: 1px solid #e5e3da; border-radius: 9px; background: #fbfaf5; padding: 5px; }
.schedule-grid td.off { background: #eeede8; }
.schedule-grid td.manual-edit-cell { cursor: pointer; }
.schedule-grid td.manual-edit-cell:hover { border-color: #72aa9f; background: #f0f8f5; box-shadow: inset 0 0 0 1px #72aa9f; }
.schedule-grid td.manual-edit-cell:empty::after { content: "+"; display: grid; min-height: 66px; place-items: center; color: #8eaaa4; font-size: 22px; font-weight: 500; opacity: .65; }
.lesson { position: relative; min-height: 68px; border-left: 4px solid var(--teal); border-radius: 7px; background: var(--mint); padding: 8px 26px 7px 8px; color: var(--teal-dark); overflow: hidden; }
.lesson.primary-lesson { border-left-color: var(--saffron); background: var(--saffron-soft); color: #6e4b0d; }
.lesson.manual { box-shadow: inset 0 0 0 1px rgba(13,107,99,.28); }
.lesson strong, .lesson small { display: block; }
.lesson strong { font-size: 12px; line-height: 1.25; }
.lesson small { margin-top: 4px; font-size: 10px; opacity: .75; }
.lesson button { position: absolute; right: 3px; top: 3px; border: 0; background: transparent; padding: 4px; border-radius: 5px; color: currentColor; opacity: .65; }
.lesson button:hover { background: rgba(255,255,255,.6); opacity: 1; }
.lesson.locked { outline: 2px solid var(--saffron); }
.lesson.locked button { opacity: 1; }
.lock-summary { color: var(--muted); font-size: 11px; font-weight: 700; }
.variant-tabs { display: flex; gap: 7px; max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
.variant-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 9px; padding: 8px 11px; font-weight: 700; }
.variant-tabs button.active { background: var(--teal); color: white; border-color: var(--teal); }

.manual-draft-panel { margin: 0 0 12px; padding: 12px 14px; border: 1px solid #dfc98e; border-radius: 12px; background: #fff8e5; }
.manual-draft-panel.complete { border-color: #a9d0c4; background: #eef8f4; }
.manual-draft-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.manual-draft-panel h2 { margin: 3px 0 0; font-size: 18px; }
.manual-draft-panel > header > strong { flex: 0 0 auto; color: var(--teal-dark); font-size: 17px; }
.manual-progress { height: 6px; margin: 9px 0; overflow: hidden; border-radius: 999px; background: rgba(24,48,45,.12); }
.manual-progress span { display: block; height: 100%; border-radius: inherit; background: var(--saffron); }
.manual-draft-panel.complete .manual-progress span { background: var(--teal); }
.manual-draft-panel details { margin-top: 6px; }
.manual-draft-panel summary { cursor: pointer; color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.manual-draft-panel ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-height: 180px; margin: 8px 0 0; padding: 0; overflow: auto; list-style: none; }
.manual-draft-panel li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; background: rgba(255,255,255,.68); }
.manual-draft-panel li span, .manual-draft-panel li strong, .manual-draft-panel li small { display: block; }
.manual-draft-panel li strong { font-size: 11px; }
.manual-draft-panel li small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.manual-draft-panel li b { flex: 0 0 auto; color: #865c12; font-size: 10px; }
.manual-draft-panel li.problem b { color: #9e463d; }
.manual-draft-panel > p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.manual-lesson-summary { display: grid; gap: 3px; margin-bottom: 10px; padding: 10px; border-radius: 9px; background: var(--mint); }
.manual-lesson-summary strong { color: var(--teal-dark); }
.manual-lesson-summary span { color: var(--muted); font-size: 11px; }

.diagnostic { border: 1px solid #e4c49a; border-radius: var(--radius); background: #fff8e8; padding: 24px; }
.diagnostic h2 { margin: 6px 0 10px; }
.diagnostic > p { color: #705f43; line-height: 1.55; }
.diagnostic-list { display: grid; gap: 9px; margin: 18px 0; }
.diagnostic-item { padding: 13px; border-radius: 11px; background: rgba(255,255,255,.65); border: 1px solid #ead7b8; }
.diagnostic-item strong, .diagnostic-item small { display: block; }
.diagnostic-item small { color: #796b54; margin-top: 5px; line-height: 1.45; }
.chat-panel { margin-top: 16px; border-radius: 13px; background: var(--ink); color: white; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.chat-panel p { color: #c5d0cd; margin: 5px 0 0; font-size: 12px; }
.chat-panel .button-row { flex-wrap: wrap; justify-content: flex-end; }

.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0 14px; }
.metric { border-radius: 9px; padding: 9px; background: #f3f1e9; }
.metric span, .metric small { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; font-size: 23px; font-family: Georgia, serif; margin: 5px 0 2px; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--saffron-soft); color: #71531b; font-size: 12px; line-height: 1.5; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.primary-schedule-toolbar { justify-content: flex-start; }
.primary-schedule-toolbar label { grid-template-columns: auto minmax(100px, 180px); align-items: center; gap: 8px; }
.primary-editor-grid { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; }
.primary-editor-grid th, .primary-editor-grid td { border: 1px solid var(--line); padding: 4px; }
.primary-editor-grid thead th { background: #f3f1e9; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.primary-editor-grid th:first-child { width: 82px; color: var(--muted); font-size: 11px; }
.primary-editor-grid td { background: var(--surface); }
.primary-cell-select { min-height: 42px; padding: 5px 7px; }
.primary-fixed-lesson { min-height: 42px; display: flex; flex-direction: column; justify-content: center; padding: 6px 8px; border-left: 3px solid var(--saffron); border-radius: 6px; background: var(--saffron-soft); }
.primary-fixed-lesson strong, .primary-fixed-lesson small { display: block; }
.primary-fixed-lesson strong { font-size: 12px; }
.primary-fixed-lesson small { margin-top: 2px; color: #76510d; font-size: 10px; }

.online-view { max-width: 1680px; margin: 0 auto; }
.online-section-tabs { display: inline-flex; gap: 4px; margin: 0 0 9px; padding: 4px; border-radius: 10px; background: #e8e7df; }
.online-section-tabs button { padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.online-section-tabs button.active { background: var(--surface); color: var(--teal); box-shadow: 0 3px 10px rgba(24,48,45,.08); }
.online-toolbar { position: sticky; top: 64px; z-index: 3; display: grid; grid-template-columns: minmax(220px, 360px) 1fr; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(245,241,232,.94); backdrop-filter: blur(10px); }
.online-toolbar-title { padding-left: 4px; color: var(--muted); font-size: 12px; }
.online-days { display: flex; justify-content: flex-end; gap: 4px; overflow-x: auto; }
.online-days button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; }
.online-days button.active { background: var(--teal); border-color: var(--teal); color: white; }
.online-days button.today:not(.active) { border-color: var(--saffron); color: #76510d; }
.online-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.online-grid.weekly-grid { grid-template-columns: 1fr; }
.online-class-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); break-inside: avoid; }
.online-class-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f3f1e9; }
.online-class-card h2 { display: inline; margin: 0; font-size: 19px; }
.online-class-card header span { margin-left: 7px; color: var(--muted); font-size: 10px; }
.online-class-card header > strong { color: var(--teal); font-size: 11px; }
.online-class-card ol { list-style: none; margin: 0; padding: 0; }
.online-class-card li { display: grid; grid-template-columns: 88px 1fr; align-items: center; min-height: 42px; border-bottom: 1px solid #ebe9e1; }
.online-class-card li:last-child { border-bottom: 0; }
.online-class-card li.has-lesson { background: #fbfdfb; }
.online-hour { align-self: stretch; display: grid; grid-template-columns: 18px 1fr; place-items: center; gap: 3px; padding: 0 5px; border-right: 1px solid #ebe9e1; color: var(--muted); font-size: 10px; font-weight: 800; }
.online-hour small { font-size: 9px; font-weight: 650; white-space: nowrap; }
.online-lesson { display: block; padding: 5px 8px; }
.online-lesson strong, .online-lesson small { display: block; }
.online-lesson strong { font-size: 12px; }
.online-lesson small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.online-empty { display: block; padding: 5px 8px; color: #b4b8b4; }
.online-week-wrap { overflow-x: auto; }
.online-week-wrap table { width: 100%; min-width: 700px; border-collapse: collapse; table-layout: fixed; }
.online-week-wrap th, .online-week-wrap td { border: 1px solid #ebe9e1; padding: 4px; vertical-align: top; }
.online-week-wrap th { background: #f8f6ef; color: var(--muted); font-size: 10px; }
.online-week-wrap th:first-child { width: 82px; }
.online-week-wrap .today { background: #fff6dd; }
.online-duty-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.online-duty-card.today { border-color: #ddb65f; }
.online-duty-card > header { padding: 9px 11px; border-bottom: 1px solid var(--line); background: #f3f1e9; }
.online-duty-card.today > header { background: var(--saffron-soft); }
.online-duty-card h2 { margin: 0; font-size: 20px; }
.online-duty-wrap { overflow-x: auto; }
.online-duty-wrap table { width: 100%; min-width: 650px; border-collapse: collapse; table-layout: fixed; }
.online-duty-wrap th, .online-duty-wrap td { height: 46px; border: 1px solid #ebe9e1; padding: 6px 8px; text-align: left; }
.online-duty-wrap thead th { height: auto; background: #f8f6ef; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.online-duty-wrap th:first-child { width: 105px; color: var(--muted); font-size: 11px; }
.online-duty-wrap th small { display: block; margin-top: 2px; font-size: 9px; font-weight: 650; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.online-duty-wrap td strong { font-size: 13px; }
.public-view main { display: block; }
.public-view .sidebar, .public-view .top-actions { display: none; }
.public-view .topbar { justify-content: center; }
.public-view .workspace { max-width: 1680px; margin: 0 auto; }

.collection-deadline { min-width: 150px; text-align: left; }
.collection-intro { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.collection-intro strong { font-size: 18px; }
.collection-intro p { margin: 0; color: var(--muted); line-height: 1.55; }
.collection-summary { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 8px; margin-bottom: 10px; }
.collection-summary > div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.collection-summary > div.problem { border-color: #e2b4ad; background: #fff5f3; }
.collection-summary strong, .collection-summary span { display: block; }
.collection-summary strong { font-family: Georgia, serif; font-size: 27px; }
.collection-summary span { color: var(--muted); font-size: 12px; }
.collection-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.collection-teacher-list { display: grid; gap: 5px; }
.collection-teacher-row { display: grid; grid-template-columns: minmax(190px, .8fr) 170px minmax(240px, 1.4fr) auto; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.collection-teacher-row strong, .collection-teacher-row small { display: block; }
.collection-teacher-row small { margin-top: 2px; color: var(--muted); }
.collection-status { width: max-content; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.collection-status.ok { color: #166149; background: #dff1e8; }
.collection-status.problem { color: #963e35; background: #f5dfdc; }
.collection-status.warn { color: #76510d; background: var(--saffron-soft); }
.collection-status.pending { color: var(--muted); background: #ecece7; }
.collection-observations { display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.collection-observations span { overflow-wrap: anywhere; }
.sport-collection-card { display: grid; grid-template-columns: minmax(260px, 1.3fr) minmax(260px, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 10px; padding: 12px; border: 1px solid #bad7cf; border-radius: 12px; background: #eef8f4; }
.sport-collection-card.muted { grid-template-columns: 1fr; border-color: var(--line); background: #f7f5ed; }
.sport-collection-card h2 { margin: 3px 0 4px; font-size: 20px; }
.sport-collection-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sport-collection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.sport-teacher-key { display: flex; flex-wrap: wrap; gap: 5px; }
.sport-teacher-key > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; }
.sport-teacher-key b { display: inline-grid; min-width: 26px; min-height: 26px; place-items: center; border-radius: 7px; background: var(--teal); color: white; font-size: 10px; }

body.teacher-form-view { background: var(--paper); }
body.teacher-form-view .shell { display: none; }
body.teacher-form-view .access-gate { place-items: start center; padding: 14px; overflow-y: auto; background: var(--paper); backdrop-filter: none; }
.access-card.teacher-portal-card { width: min(820px, 100%); max-height: calc(100dvh - 28px); gap: 10px; padding: 18px 20px; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; border-color: var(--line); box-shadow: 0 20px 65px rgba(10,28,25,.13); }
.teacher-portal-card .access-head h1 { font-size: 28px; }
.teacher-school-name { margin-top: -5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.teacher-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; margin: 3px 0 4px; }
.teacher-progress span { color: #929b98; font-size: 12px; font-weight: 800; }
.teacher-progress span.active { color: var(--teal); }
.teacher-progress i { height: 2px; background: var(--line); }
.teacher-portal-form, .teacher-step { display: grid; gap: 10px; }
.teacher-step > header h2 { margin: 0 0 3px; font-size: 22px; }
.teacher-step > header p { font-size: 14px; }
.teacher-assignment-list { display: grid; gap: 7px; }
.teacher-assignment-card { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #faf9f3; }
.teacher-assignment-title { display: grid; grid-template-columns: 27px 1fr; gap: 8px; align-items: center; }
.teacher-assignment-title > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--teal); font-size: 12px; font-weight: 900; }
.teacher-assignment-title strong, .teacher-assignment-title small { display: block; }
.teacher-assignment-title strong { font-size: 15px; }
.teacher-assignment-title small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.teacher-assignment-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.teacher-assignment-choice label { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; }
.teacher-assignment-choice label.selected { border-color: #82bbac; background: #edf8f4; }
.teacher-assignment-choice label.selected.problem { border-color: #dca79f; background: #fff1ef; }
.teacher-assignment-choice input { width: auto; margin: 0; }
.teacher-assignment-note { color: #93443b; font-size: 13px; }
.teacher-assignment-note textarea, .teacher-general-note textarea { min-height: 62px; resize: vertical; font-size: 16px; }
.teacher-status-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.teacher-status-legend span { padding: 7px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: 11px; font-weight: 800; }
.teacher-status-legend .available, .teacher-availability-state.available { background: #f7f5ee; color: #68736f; }
.teacher-status-legend .avoid, .teacher-availability-state.avoid { border-color: #e8cf92; background: var(--saffron-soft); color: #865c12; }
.teacher-status-legend .unavailable, .teacher-availability-state.unavailable { border-color: #dab5b0; background: #efe1df; color: #9e463d; }
.teacher-availability-summary { padding: 10px; border: 1px solid #c9ddd8; border-radius: 12px; background: #f1f8f6; }
.teacher-availability-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.teacher-availability-numbers span { display: grid; align-content: center; min-height: 52px; padding: 6px; border-radius: 9px; background: #fff; text-align: center; }
.teacher-availability-numbers b { font-size: 20px; line-height: 1; color: var(--ink); }
.teacher-availability-numbers small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.2; }
.teacher-availability-summary p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; margin: 7px 1px 0; font-size: 12px; }
.teacher-availability-summary .enough { color: var(--teal); }
.teacher-availability-summary .needs-more { color: #9e463d; }
.teacher-days-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.teacher-day-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.teacher-day-card > header { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 9px; border-bottom: 1px solid var(--line); background: #f7f5ed; }
.teacher-day-card h3 { margin: 0; font-family: Georgia, serif; font-size: 17px; }
.teacher-day-card > header > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.teacher-portal-card .teacher-day-action { width: auto; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; }
.teacher-portal-card .teacher-day-action:hover { background: #e9e8e1; color: var(--ink); }
.teacher-availability-row { display: grid; grid-template-columns: minmax(115px, 1fr) 135px; gap: 8px; align-items: center; min-height: 47px; padding: 5px 8px; border-bottom: 1px solid #ecebe5; }
.teacher-availability-row:last-child { border-bottom: 0; }
.teacher-availability-row > span strong, .teacher-availability-row > span small { display: block; }
.teacher-availability-row > span strong { font-size: 13px; }
.teacher-availability-row > span small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.teacher-portal-card .teacher-availability-state { min-height: 37px; padding: 7px 8px; border: 1px solid var(--line); box-shadow: none; font-size: 12px; }
.teacher-general-note { margin-top: 2px; font-size: 13px; }
.teacher-form-error { min-height: 19px; color: #a64037 !important; font-size: 13px !important; font-weight: 750; }
.teacher-form-actions { position: sticky; bottom: -18px; z-index: 2; display: flex; justify-content: flex-end; gap: 7px; margin: 0 -4px; padding: 9px 4px 2px; background: linear-gradient(180deg, rgba(255,253,248,0), var(--surface) 28%); }
.teacher-form-actions button { width: auto; min-width: 180px; }
.teacher-portal-message { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f3; }
.teacher-portal-message.success { border-color: #9ac9ba; background: #eef8f4; }
.teacher-portal-message.success > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: white; font-weight: 900; }
.teacher-portal-message strong { font-size: 18px; }
.teacher-portal-message p { font-size: 14px; }
.sport-portal-card { width: min(1040px, 100%) !important; }
.sport-portal-form > header h2 { margin: 0 0 4px; font-size: 22px; }
.sport-portal-form > header p { font-size: 14px; }
.sport-days-list { grid-template-columns: 1fr; }
.sport-slot-row { display: grid; grid-template-columns: 105px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 54px; padding: 6px 8px; border-bottom: 1px solid #ecebe5; }
.sport-slot-row:last-child { border-bottom: 0; }
.sport-slot-time strong, .sport-slot-time small { display: block; }
.sport-slot-time strong { font-size: 13px; }
.sport-slot-time small { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.sport-slot-teachers { display: flex; flex-wrap: wrap; gap: 5px; }
.sport-initial-choice { display: inline-flex; align-items: center; gap: 5px; min-height: 37px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.sport-initial-choice.selected { border-color: #78b8a6; background: #ddf1ea; }
.sport-initial-choice input { position: absolute; opacity: 0; pointer-events: none; }
.sport-initial-choice b { display: grid; min-width: 27px; min-height: 27px; place-items: center; border-radius: 7px; background: #e8ebe6; color: var(--ink); font-size: 10px; }
.sport-initial-choice.selected b { background: var(--teal); color: white; }
.sport-initial-choice span { max-width: 135px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.print-all-classes { display: none; }

@page { size: A3 landscape; margin: 6mm; }
@media print {
  .topbar, .sidebar, .access-gate, .page-head .button-row, .result-controls, .variant-tabs, .lesson button, .online-toolbar, .online-section-tabs, .manual-draft-panel, .note { display: none !important; }
  main { display: block; }
  .workspace { padding: 0; max-width: none; }
  body { background: white; font-size: 9pt; }
  .page-head { margin: 0 0 3mm; }
  .page-head h1 { margin: 0; font-size: 20pt; }
  .page-head p, .page-head .eyebrow { font-size: 8pt; }
  .metric-row { margin: 2mm 0; gap: 2mm; }
  .metric { padding: 2mm; }
  .metric strong { font-size: 15pt; margin: 1mm 0 0; }
  .schedule-wrap { border: 0; overflow: visible; padding: 0; }
  .schedule-grid { min-width: 0; border-spacing: 1mm; }
  .schedule-grid th { padding: 1mm; }
  .schedule-grid td { height: 21mm; padding: 1mm; }
  .lesson { min-height: 18mm; padding: 1.5mm; border-left-width: 1mm; }
  .lesson strong { font-size: 8pt; }
  .lesson small { margin-top: 1mm; font-size: 7pt; }
  .online-grid { grid-template-columns: repeat(3, 1fr); gap: 2mm; }
  .online-grid.weekly-grid { grid-template-columns: 1fr; }
  .online-class-card { border-radius: 0; }
  .online-class-card > header { padding: 1.5mm 2mm; }
  .online-class-card h2 { font-size: 12pt; }
  .online-class-card li { min-height: 9mm; grid-template-columns: 21mm 1fr; }
  .online-lesson { padding: 1mm 1.5mm; }
  .online-lesson strong { font-size: 7.5pt; }
  .online-lesson small { font-size: 6.5pt; }
  .online-week-wrap table { min-width: 0; }
  .online-week-wrap th, .online-week-wrap td { padding: 1mm; }
  .online-duty-card { border-radius: 0; }
  .online-duty-wrap table { min-width: 0; }
  .online-duty-wrap th, .online-duty-wrap td { height: 12mm; padding: 1.5mm 2mm; }
  .hide-for-class-print { display: none !important; }
  .print-all-classes { display: flex; flex-direction: column; width: 100%; height: 284mm; overflow: hidden; color: #111; }
  .print-cycle-page { break-after: page; page-break-after: always; }
  .print-cycle-page:last-child { break-after: auto; page-break-after: auto; }
  .print-all-classes > header { flex: 0 0 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 4mm; height: 8mm; margin: 0 0 1mm; }
  .print-all-classes > header h1 { margin: 0; font-family: Georgia, serif; font-size: 12pt; }
  .print-all-classes > header p { margin: 0; font-size: 7pt; }
  .print-all-classes-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(var(--print-class-columns), minmax(0, 1fr)); grid-template-rows: repeat(var(--print-class-rows), minmax(0, 1fr)); gap: 1mm; }
  .print-class-card { min-width: 0; min-height: 0; overflow: hidden; border: .25mm solid #555; break-inside: avoid; }
  .print-class-card h2 { height: 5mm; margin: 0; padding: .6mm 1.2mm; border-bottom: .2mm solid #777; font-family: Georgia, serif; font-size: var(--print-title-font); line-height: 3.8mm; }
  .print-class-card table { width: 100%; height: calc(100% - 5mm); border-collapse: collapse; table-layout: fixed; }
  .print-class-card th, .print-class-card td { overflow: hidden; border: .15mm solid #aaa; padding: .3mm .45mm; text-align: center; vertical-align: middle; line-height: 1.08; }
  .print-class-card thead th { height: 3.2mm; background: #eee; font-size: var(--print-header-font); }
  .print-class-card th:first-child { width: 12mm; }
  .print-class-card tbody th span, .print-class-card tbody th small, .print-class-card td strong, .print-class-card td small { display: block; }
  .print-class-card tbody th span { font-size: var(--print-header-font); }
  .print-class-card tbody th small { font-size: var(--print-secondary-font); font-weight: 400; }
  .print-class-card td { font-size: var(--print-secondary-font); }
  .print-class-card td strong { font-size: var(--print-main-font); }
  .print-class-card td small { margin-top: .25mm; font-size: var(--print-secondary-font); }
  .print-class-card td.off { color: #aaa; background: #eee; }
}

@media (max-width: 900px) {
  .saved { display: none; }
  main { display: block; }
  .sidebar { position: sticky; top: 64px; z-index: 4; display: block; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(245,241,232,.96); backdrop-filter: blur(10px); }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
  .nav-item { width: auto; flex: 0 0 auto; padding: 7px 10px; }
  .workspace-head { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .school-identity-grid { grid-template-columns: minmax(230px, 1fr) 100px minmax(170px, .7fr); }
  .content-grid { grid-template-columns: 1fr; }
  .availability-layout, .split { grid-template-columns: 1fr; }
  .validation-grid, .metric-row { grid-template-columns: repeat(2, 1fr); }
  .validation-detail-grid { grid-template-columns: 1fr; }
  .period-time-grid { grid-template-columns: repeat(4, minmax(118px, 1fr)); }
  .validation-summary { grid-template-columns: auto auto 1fr; }
  .validation-summary .search { grid-column: 1 / -1; }
  .generate-card { grid-template-columns: 1fr; }
  .generate-actions { width: 100%; min-width: 0; }
  .data-card { align-items: flex-start; flex-direction: column; }
  .publication-controls { width: 100%; grid-template-columns: 1fr 1fr auto; }
  .duty-publication-controls { width: 100%; }
  .teacher-class-row { grid-template-columns: 130px minmax(0, 1fr); }
  .online-toolbar { top: 112px; grid-template-columns: 1fr; }
  .online-days { justify-content: flex-start; }
  .public-view .online-toolbar { top: 64px; }
  .collection-teacher-row { grid-template-columns: minmax(180px, 1fr) 170px minmax(220px, 1fr) auto; }
  .sport-collection-card { grid-template-columns: 1fr 1fr; }
  .sport-collection-card > .collection-status, .sport-collection-actions { grid-column: 1 / -1; }
  .generation-rule-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 10px; }
  .brand { gap: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand strong { font-size: 16px; }
  .brand small, .top-actions .secondary { display: none; }
  .workspace { padding: 18px 10px 40px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .school-identity-grid { grid-template-columns: 1fr; }
  h1 { font-size: 31px; }
  .form-grid, .validation-grid, .metric-row { grid-template-columns: 1fr; }
  .plan-level-card > header { align-items: flex-start; flex-direction: column; }
  .plan-edit-grid { grid-template-columns: 1fr; }
  .validation-summary { grid-template-columns: 1fr 1fr; }
  .validation-summary .segment, .validation-summary .search { grid-column: 1 / -1; }
  .period-time-grid { grid-template-columns: repeat(2, minmax(118px, 1fr)); }
  .allocation-row { grid-template-columns: 1fr; }
  .flex-request-row { grid-template-columns: 1fr; }
  .teacher-class-row { grid-template-columns: 1fr; }
  .daily-period-grid { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
  .teacher-class-name { padding-bottom: 1px; }
  .teacher-subject-entry { grid-template-columns: minmax(100px, .8fr) 54px minmax(125px, 1fr); }
  .manual-draft-panel ul { grid-template-columns: 1fr; }
  .manual-draft-panel > header { flex-direction: column; gap: 6px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .rules-summary, .generation-rule-section > header { align-items: flex-start; flex-direction: column; }
  .top-actions .primary { padding: 10px 12px; }
  .online-grid { grid-template-columns: 1fr; }
  .online-toolbar { top: 109px; }
  .online-class-card li { min-height: 39px; }
  .access-card { padding: 20px; }
  .access-card h1 { font-size: 29px; }
  .access-form-grid, .publication-controls, .duty-publication-controls { grid-template-columns: 1fr; }
  .publication-controls button, .duty-publication-controls button { width: 100%; }
  .duty-toolbar > span { width: 100%; margin-left: 0; padding-bottom: 0; }
  .chat-panel { align-items: stretch; flex-direction: column; }
  .chat-panel .button-row { justify-content: flex-start; }
  .collection-summary { grid-template-columns: 1fr 1fr; }
  .collection-teacher-row { grid-template-columns: 1fr auto; gap: 6px; }
  .collection-teacher-row .collection-observations { grid-column: 1 / -1; }
  .collection-teacher-row > button { grid-column: 1 / -1; width: 100%; }
  .sport-collection-card { grid-template-columns: 1fr; }
  .sport-collection-card > .collection-status, .sport-collection-actions { grid-column: auto; }
  .sport-collection-actions { justify-content: stretch; }
  .sport-collection-actions button { flex: 1; }
  body.teacher-form-view .access-gate { display: block; min-height: 100dvh; padding: 0; overflow-y: auto; }
  .access-card.teacher-portal-card { width: 100%; min-height: 100dvh; height: auto; max-height: none; padding: 14px 12px 18px; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .teacher-portal-card .access-head { grid-template-columns: 34px 1fr; column-gap: 9px; }
  .teacher-portal-card .access-head h1 { font-size: 25px; }
  .teacher-assignment-choice { grid-template-columns: 1fr; }
  .teacher-assignment-choice label { min-height: 46px; font-size: 14px; }
  .teacher-days-list { grid-template-columns: 1fr; }
  .teacher-day-card > header { align-items: flex-start; flex-direction: column; }
  .teacher-day-card > header > div { justify-content: flex-start; }
  .teacher-availability-row { grid-template-columns: 1fr 145px; min-height: 52px; }
  .teacher-portal-card .teacher-availability-state { min-height: 42px; font-size: 13px; }
  .teacher-status-legend span { padding: 6px 3px; font-size: 10px; }
  .teacher-form-actions { bottom: -18px; margin: 0 -12px; padding: 17px 12px 0; }
  .teacher-form-actions button { flex: 1; min-width: 0; min-height: 46px; }
  .sport-slot-row { grid-template-columns: 78px 1fr; gap: 5px; }
  .sport-slot-row > .teacher-day-action { grid-column: 1 / -1; justify-self: end; }
  .sport-initial-choice span { display: none; }
}
/* Ghid local, disponibil și fără conexiune la internet. */
.guide-dialog { width: min(1200px, 96vw); height: 92vh; padding: 16px; }
.guide-dialog form { height: 100%; display: flex; flex-direction: column; }
.guide-dialog .dialog-head { flex: 0 0 auto; margin-bottom: 8px; }
.guide-frame { flex: 1; width: 100%; min-height: 0; border: 0; border-radius: 8px; }
a.publication-link { color: var(--teal, #0d6f67); text-decoration: underline; overflow-wrap: anywhere; }
