:root {
  --ink: #16201f; --ink-2: #4b5755; --muted: #6b7674; --line: #e3e7e5; --bg: #f5f6f3; --card: #fff;
  --brand: #0f3d3e; --brand-2: #155e5f; --accent: #e8a33d; --accent-ink: #5a3b07;
  --good: #12805c; --good-bg: #e3f4ec; --warn: #9a5b00; --warn-bg: #fdf1dc; --bad: #b42318; --bad-bg: #fde8e6; --info: #1d5fa8; --info-bg: #e5effa;
  --series-1: #2a78d6; --ref: #9aa29f; --track: #e6ebe9;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 32, 31, .06), 0 1px 1px rgba(16, 32, 31, .04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--brand); }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", sans-serif; color: var(--ink); background: var(--bg); }
.safe-top { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--brand); z-index: 50; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .2rem 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
h4 { margin: 1rem 0 .25rem; font-size: .85rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
p { margin: .4rem 0 .8rem; }
code { background: #eef1ef; padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.good-text { color: var(--good); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--brand) 240px, var(--bg) 240px); }
@media (max-width: 860px) { .shell { background: var(--bg); } }
.side { background: var(--brand); color: #dce9e7; padding: calc(18px + env(safe-area-inset-top)) 14px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none !important; padding: 0 6px; }
.brand b { display: block; font-size: .95rem; line-height: 1.2; }
.brand small { color: #9fc1bd; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #cfe0dd; padding: 8px 10px; border-radius: 8px; font-size: .93rem; text-decoration: none; }
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.me { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding: 12px 6px 0; font-size: .85rem; }
.me b { display: block; color: #fff; } .me small { color: #9fc1bd; word-break: break-all; }
.me .link { color: var(--accent); padding: 6px 0 0; }
.main { padding: 22px clamp(14px, 3vw, 36px) 60px; min-width: 0; max-width: 1280px; }
.demo-banner { background: var(--warn-bg); color: var(--accent-ink); font-size: .8rem; padding: 6px 12px; border-radius: 8px; margin-bottom: 16px; display: inline-block; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; padding: calc(10px + env(safe-area-inset-top)) 12px 0; gap: 8px; z-index: 40; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 10px; scrollbar-width: none; }
  .side nav a { white-space: nowrap; padding: 7px 11px; background: rgba(255, 255, 255, .06); }
  .side nav a.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .me { display: none; }
  .brand small { display: none; }
  .main { padding-top: 14px; }
}

/* page structure */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.subtle { background: #fbfbf9; box-shadow: none; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.card.center { text-align: center; }
.pad { padding: 16px 18px 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card-grid > .card { margin: 0; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }
.row.tight { gap: 6px; align-items: center; }
.row > label { flex: 1 1 140px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty { text-align: center; color: var(--muted); padding: 24px !important; }
.dim { opacity: .55; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.tile small { color: var(--muted); display: block; }
.tile b { display: block; font-size: 1.55rem; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.tile span { font-size: .8rem; color: var(--muted); }
.tile.alert { border-color: #f3c3bd; background: #fffafa; }
.tile.alert b { color: var(--bad); }
.notice-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { background: var(--info-bg); color: var(--info); padding: 6px 12px; border-radius: 99px; font-size: .88rem; font-weight: 600; }

/* forms */
label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #cfd6d3; border-radius: 8px; padding: 9px 11px; min-height: 40px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand-2); }
input[type=color] { padding: 3px; height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8cc7c1; outline-offset: 1px; border-color: var(--brand-2); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .86rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.inner { padding: 14px; background: #f8faf9; border-radius: 10px; border: 1px dashed var(--line); }
.form-grid h2 { margin: 6px 0 0; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .9rem; padding: 9px 15px; min-height: 40px;
  border-radius: 9px; border: 1px solid #cfd6d3; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #f2f5f4; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: var(--brand); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: .82rem; }
.btn.wide { width: 100%; }
.btn.wa { background: #e7f8ee; border-color: #b9e6cb; color: #116c3b; }
.btn.ghost.light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-2); cursor: pointer; font-weight: 600; }
.link.bad-text { color: var(--bad); }

/* flash & badges */
.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 12px; font-size: .92rem; border: 1px solid transparent; }
.flash.ok { background: var(--good-bg); color: #0b5a40; border-color: #bfe6d3; }
.flash.bad { background: var(--bad-bg); color: #8a1c12; border-color: #f6c7c1; }
.flash.warn { background: var(--warn-bg); color: var(--accent-ink); border-color: #f2d7a6; }
.flash.info { background: var(--info-bg); color: #164d88; border-color: #c7dcf3; }
body.bare > .flash { max-width: 560px; margin: 16px auto; }
.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #edf0ef; color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.b-good { background: var(--good-bg); color: var(--good); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); } .b-info { background: var(--info-bg); color: var(--info); }
.badge.s-present { background: var(--good-bg); color: var(--good); } .badge.s-late { background: var(--warn-bg); color: var(--warn); }
.badge.s-absent { background: var(--bad-bg); color: var(--bad); } .badge.s-excused { background: var(--info-bg); color: var(--info); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; padding: 4px 11px; border-radius: 99px; background: #eef2f0; color: var(--ink-2); border: 1px solid transparent; }
a.chip:hover { text-decoration: none; border-color: #cfd6d3; }
.chip.on { background: var(--brand-2); color: #fff; }
label.chip { flex-direction: row; cursor: pointer; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #eef1ef; vertical-align: top; }
tbody tr:hover td { background: #fafcfb; }
tfoot td { font-weight: 700; background: #fafbfa; border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.mini td { padding: 6px 4px; }

/* lists */
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1ef; }
ul.rows li:last-child { border-bottom: 0; }
ul.rows.tight li { padding: 6px 0; }

/* legend & charts */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin: 0 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.dash { height: 0; width: 16px; border-top: 2px dashed var(--ref); border-radius: 0; }
.legend.small { font-size: .76rem; margin: 6px 0 0; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 128px; align-items: center; gap: 10px; color: var(--ink); font-size: .86rem; }
.bar-row:hover { text-decoration: none; }
.bar-track { height: 18px; }
.bar-billed { display: block; height: 100%; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-paid { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; box-shadow: 2px 0 0 #fff; }
.bar-row:hover .bar-paid { filter: brightness(.92); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cap { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: .86rem; }
.cap:hover { text-decoration: none; border-color: #c9d2cf; }
.meter { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.meter span.full { background: var(--accent); }

svg.chart { width: 100%; height: auto; display: block; margin: 4px 0; overflow: visible; }
svg.chart .grid { stroke: #e9edeb; stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 10px; }
svg.chart .val { fill: var(--ink); font-size: 11px; font-weight: 700; }
svg.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .ref { fill: none; stroke: var(--ref); stroke-width: 1.5; stroke-dasharray: 4 4; }
svg.chart .dotp { fill: var(--series-1); stroke: #fff; stroke-width: 2; }
svg.chart .hit { fill: transparent; cursor: pointer; }
svg.chart .pt:hover .dotp { r: 6; }

/* performance */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.perf-grid > .card { margin: 0; }
.perf header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.perf.ended { opacity: .7; }
.grade { font-weight: 800; font-size: 1.1rem; min-width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.gchip { display: inline-block; font-weight: 800; font-size: .76rem; padding: 1px 7px; border-radius: 6px; background: #eef1ef; }
.g-a { background: var(--good-bg); color: var(--good); } .g-b { background: var(--info-bg); color: var(--info); }
.g-c { background: var(--warn-bg); color: var(--warn); } .g-d { background: var(--bad-bg); color: var(--bad); }
blockquote { margin: 8px 0; padding: 8px 12px; background: #f6f8f7; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; font-size: .88rem; }
.att-line { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; margin-top: 10px; border-top: 1px solid #eef1ef; font-size: .9rem; }
details { margin-top: 8px; font-size: .88rem; }
summary { cursor: pointer; color: var(--brand-2); font-weight: 600; }
ul.lessons { padding-left: 0; list-style: none; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }

/* timetable */
.tt-wrap { overflow-x: auto; }
.tt { display: grid; grid-template-columns: 56px repeat(7, minmax(120px, 1fr)); min-width: 900px; position: relative; }
.tt-corner { grid-row: 1; grid-column: 1; }
.tt-day { grid-row: 1; text-align: center; font-weight: 700; font-size: .85rem; padding: 10px 0; border-bottom: 1px solid var(--line); background: #fafbfa; }
.tt-day.today { color: var(--brand-2); box-shadow: inset 0 -3px 0 var(--accent); }
.tt-hour { grid-column: 1; font-size: .72rem; color: var(--muted); text-align: right; padding: 2px 8px 0 0; border-top: 1px solid #eef1ef; }
.tt-cell { border-top: 1px solid #eef1ef; border-left: 1px solid #f1f3f2; }
.tt-block { margin: 2px 3px; padding: 5px 7px; border-radius: 7px; background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 4px solid var(--c); color: var(--ink);
  font-size: .76rem; line-height: 1.25; overflow: hidden; display: flex; flex-direction: column; z-index: 1; box-shadow: 0 0 0 2px #fff; }
a.tt-block:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 24%, #fff); }
.tt-block b { font-size: .8rem; }
.tt-meta, .tt-kid { color: var(--ink-2); }
.tt-kid { font-weight: 600; }
.tt-list { display: none; }
.tt-row { display: flex; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; margin-bottom: 8px; color: var(--ink); }
.tt-row .time { width: 64px; flex: none; font-weight: 700; font-size: .88rem; }
@media (max-width: 860px) { .tt-wrap { display: none; } .tt-list { display: block; } }

/* attendance */
.att-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) auto minmax(140px, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef1ef; }
.seg { display: inline-flex; border: 1px solid #cfd6d3; border-radius: 10px; overflow: hidden; }
.seg label { flex-direction: row; cursor: pointer; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { padding: 8px 12px; font-size: .84rem; font-weight: 600; color: var(--ink-2); border-right: 1px solid #e3e7e5; min-height: 38px; display: flex; align-items: center; }
.seg label:last-child span { border-right: 0; }
.seg input:focus-visible + span { outline: 2px solid #8cc7c1; outline-offset: -2px; }
.seg .s-present input:checked + span { background: var(--good); color: #fff; }
.seg .s-late input:checked + span { background: #c27a00; color: #fff; }
.seg .s-absent input:checked + span { background: var(--bad); color: #fff; }
.seg .s-excused input:checked + span { background: var(--info); color: #fff; }
.att-form h2 { margin-top: 18px; }
@media (max-width: 760px) { .att-row { grid-template-columns: 1fr; } .seg { display: flex; } .seg label { flex: 1 1 0; } .seg span { flex: 1; justify-content: center; padding: 10px 4px; } }
.score-table input.score { width: 90px; }

/* teacher */
.today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.today-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; }
.teacher-card { border-top: 4px solid var(--c); color: var(--ink); }
.teacher-card:hover { text-decoration: none; border-color: #c9d2cf; border-top-color: var(--c); }
dl.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 10px 0; }
dl.kv.col { grid-template-columns: 1fr; }
dl.kv div { display: flex; flex-direction: column; }
dl.kv.col div { flex-direction: row; justify-content: space-between; border-bottom: 1px solid #eef1ef; padding-bottom: 6px; }
dt { font-size: .76rem; color: var(--muted); } dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* parent */
.kid { color: var(--ink); display: flex; flex-direction: column; }
.kid:hover { text-decoration: none; border-color: #c9d2cf; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; }
.due-card { border-color: #f2d7a6; background: #fffdf8; }

/* payment */
.paymethod { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid #cfd6d3; border-radius: 10px; cursor: pointer; font-weight: 400; }
.paymethod:has(input:checked) { border-color: var(--brand-2); background: #f2f9f8; box-shadow: inset 0 0 0 1px var(--brand-2); }
.paymethod span { display: flex; flex-direction: column; } .paymethod b { color: var(--ink); } .paymethod small { color: var(--muted); }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; padding-left: 4px; }
.bank { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: .84rem; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.bank:has(input:checked) { border-color: var(--brand-2); background: #f2f9f8; }
.gateway { min-height: 100vh; background: #eef1f6; }
.gw-bar { background: #1f2a44; color: #fff; padding: calc(12px + env(safe-area-inset-top)) 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.gw-bar small { color: #aab4cf; }
.gw-card { max-width: 420px; margin: 28px auto; background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 8px 30px rgba(31, 42, 68, .12); text-align: center; }
.big-amount { font-size: 2rem; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.gw-bank { display: flex; flex-direction: column; gap: 4px; background: #f4f6fa; border-radius: 10px; padding: 14px; margin: 14px 0; }
.gw-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px 0; }
.gw-qr svg { background: #fff; padding: 8px; border: 1px solid #dde2ea; border-radius: 8px; fill: #111; }
.big-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--good-bg); color: var(--good); font-size: 2rem; font-weight: 800; display: grid; place-items: center; margin: 0 auto 8px; }
.big-tick.bad { background: var(--bad-bg); color: var(--bad); }

/* documents */
.doc { max-width: 820px; padding: clamp(18px, 4vw, 40px); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid var(--brand); padding-bottom: 14px; margin-bottom: 16px; }
.doc-head h2 { margin: 6px 0 2px; }
.doc-meta { text-align: right; }
.doc-meta h1 { font-size: 1.3rem; letter-spacing: .08em; color: var(--brand); }
.doc-to { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; font-size: .92rem; }
.doc-table th { background: #f3f6f5; }
.doc-table tfoot td { background: none; font-weight: 500; border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.doc-table tfoot tr.strong td { font-weight: 800; border-top: 1px solid var(--line); }
.doc-table tr.remark td { border-bottom: 1px solid #eef1ef; padding-top: 0; color: var(--ink-2); }
.doc-foot { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
.print-page { max-width: 860px; margin: 0 auto; padding: 18px; }
.print-page .doc { margin-top: 12px; }
@media (max-width: 600px) { .doc-to { grid-template-columns: 1fr; } .doc-meta { text-align: left; } .doc-table th, .doc-table td { padding: 8px 5px; } .doc-table th { font-size: .68rem; } .doc { padding: 14px; } }
@media print {
  html, body { background: #fff; }
  .side, .demo-banner, .no-print, .flash, .safe-top { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .print-page { padding: 0; }
}

/* login */
body.bare { background: var(--bg); }
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero { background: linear-gradient(160deg, var(--brand) 0%, #1b5b56 100%); color: #e6f1ef; padding: clamp(28px, 6vw, 72px); padding-top: calc(clamp(28px, 6vw, 72px) + env(safe-area-inset-top)); display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.login-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.login-hero p { max-width: 520px; color: #cfe2df; }
.login-hero .btn { align-self: flex-start; margin-top: 12px; }
.ticks { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.ticks li { padding-left: 26px; position: relative; color: #dcebe8; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.login-box { padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.demo-logins { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.demo-logins h3 { display: flex; justify-content: space-between; align-items: baseline; }
.demo-btn { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.demo-btn:hover { border-color: var(--brand-2); background: #f6fbfa; }
.demo-btn span { color: var(--muted); font-size: .84rem; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { padding-bottom: 28px; } }

/* demo role switcher */
body { padding-bottom: 76px; }
.demo-switch { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80; font-size: .88rem; }
.demo-switch > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; background: #1f2a44; color: #fff;
  padding: 9px 14px 9px 12px; border-radius: 99px; box-shadow: 0 6px 24px rgba(16, 24, 40, .28); user-select: none; max-width: min(380px, calc(100vw - 32px)); }
.demo-switch > summary::-webkit-details-marker { display: none; }
.ds-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(232, 163, 61, .25); flex: none; }
.ds-now { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ds-now small { color: #aab4cf; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.ds-now b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-caret { color: #aab4cf; transition: transform .15s; }
.demo-switch[open] .ds-caret { transform: rotate(180deg); }
.ds-panel { position: absolute; right: 0; bottom: calc(100% + 10px); width: min(380px, calc(100vw - 32px)); max-height: min(72vh, 640px); overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 48px rgba(16, 24, 40, .22); padding: 8px; }
.ds-head { padding: 8px 10px 6px; display: flex; flex-direction: column; gap: 2px; }
.ds-head small { color: var(--muted); }
kbd { font: 600 .7rem/1 system-ui, sans-serif; background: #eef1ef; border: 1px solid #d5dbd8; border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--ink-2); }
.ds-group { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.ds-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.ds-item:hover { background: #f2f6f5; }
.ds-item.on { background: #e9f4f2; cursor: default; box-shadow: inset 3px 0 0 var(--brand-2); }
.ds-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; background: var(--brand-2); }
.ds-teacher .ds-avatar { background: #2a78d6; } .ds-parent .ds-avatar { background: #c27a00; }
.ds-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ds-text b { font-size: .88rem; } .ds-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-foot { display: flex; justify-content: space-between; padding: 10px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.demo-hop { display: inline; }
.demo-hop .btn { background: #1f2a44; border-color: #1f2a44; color: #fff; }
.demo-hop .btn:hover { background: #2c3a5c; }
@media (max-width: 600px) { .demo-switch { left: 12px; right: 12px; } .demo-switch > summary { max-width: none; } .ds-panel { width: 100%; } }
@media print { .demo-switch, .demo-hop { display: none !important; } body { padding-bottom: 0; } }@media (hover: none) { .ds-head small, .ds-item kbd { display: none; } }
