/* Nobbo School demo - flat, matte, Paper/Night, Instrument Sans + Anek Bangla. One stylesheet for the whole app. */
@font-face { font-family: "Instrument Sans"; src: url("/static/fonts/instrument-sans-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Anek Bangla"; src: url("/static/fonts/anek-bangla-bengali.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0980-09FF; }

:root {
  --font: "Instrument Sans", "Anek Bangla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px; --r-sm: 7px; --r-pill: 999px;
  --bg: #F4F5F0; --surface: #FFFFFF; --surface-2: #EEEFEA; --surface-3: #E3E4DE;
  --ink: #0B1238; --ink-2: #3A3F58; --muted: #6E7488; --line: rgba(11, 18, 56, .11); --line-2: rgba(11, 18, 56, .24);
  --on-ink: #FFFFFF; --accent: #1D5DD9; --accent-2: #E6EEFC; --on-accent: #FFFFFF;
  --ok: #2E7D52; --ok-2: #E3F1E8; --warn: #B07213; --warn-2: #FBF0DC; --err: #B84A3F; --err-2: #F9E4E1; --info: #2D6FA6; --info-2: #E2EDF7;
  --side-w: 248px; --top-h: 58px; --sh: 0 1px 0 rgba(11, 18, 56, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0E1A; --surface: #141729; --surface-2: #1B1F33; --surface-3: #252A42;
    --ink: #EEF0F6; --ink-2: #C9CDDC; --muted: #8C92A8; --line: rgba(238, 240, 246, .12); --line-2: rgba(238, 240, 246, .26);
    --on-ink: #0C0E1A; --accent: #6B9FE0; --accent-2: #1C2A45; --on-accent: #0B1238;
    --ok: #56B585; --ok-2: #16301F; --warn: #D9A13F; --warn-2: #332813; --err: #E1786B; --err-2: #3A1B18; --info: #6AA5DC; --info-2: #16283A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
p { margin: 0 0 .6em; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
b { font-weight: 600; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; overflow: auto; font-size: 13px; }

/* ---- shell */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 15px; }
.brand small { color: var(--muted); font-size: 11.5px; }
.nav { padding: 4px 10px 16px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.on { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.nav-item .ic { color: inherit; opacity: .85; }
.nav-badge { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: var(--r-pill); }
.side-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.side-close { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.side-open { display: none; }
.top-search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 520px; }
.top-search .ic { color: var(--muted); }
.top-search input { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-pill); padding: 7px 14px; outline: none; }
.top-search input:focus { border-color: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { background: none; border: 0; border-radius: var(--r-sm); padding: 7px; color: var(--ink-2); cursor: pointer; display: inline-flex; position: relative; }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.bell .dot { position: absolute; top: 2px; right: 2px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; min-width: 16px; text-align: center; border-radius: var(--r-pill); padding: 0 4px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: var(--r-sm); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--surface-2); }
.who-name { display: flex; flex-direction: column; line-height: 1.15; }
.who-name b { font-size: 13.5px; } .who-name small { color: var(--muted); font-size: 11.5px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 220px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); z-index: 30; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-sm); color: var(--ink); text-align: left; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-2); color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.child-switch select { border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 12px; background: var(--bg); }
.acting-bar { background: var(--warn-2); color: var(--ink); border-bottom: 1px solid var(--line); padding: 8px 20px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acting-bar .link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }
.content { padding: 22px 24px 60px; max-width: 1180px; width: 100%; }
.content.wide { max-width: none; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.crumbs .here { color: var(--ink-2); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flash { padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 16px; background: var(--info-2); border: 1px solid var(--line); transition: opacity .6s; }
.flash.ok { background: var(--ok-2); } .flash.err { background: var(--err-2); } .flash.warn { background: var(--warn-2); }
.flash.gone { opacity: 0; }

/* ---- plain (sign-in) */
.plain-body { background: var(--bg); }
.plain-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login .brand { margin-bottom: 18px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.demo-accounts { display: grid; gap: 6px; margin: 16px 0 4px; }
.demo-accounts button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); cursor: pointer; }
.demo-accounts button:hover { border-color: var(--accent); background: var(--accent-2); }
.demo-accounts b { font-size: 14px; } .demo-accounts small { color: var(--muted); display: block; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 6px; }

/* ---- cards, grids, stats */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--sh); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; border-left: 3px solid var(--line-2); }
.stat.ok { border-left-color: var(--ok); } .stat.warn { border-left-color: var(--warn); } .stat.err { border-left-color: var(--err); } .stat.info, .stat.accent { border-left-color: var(--accent); }
.stat-v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-n { font-size: 12.5px; margin-top: 4px; color: var(--ink-2); }
.empty { padding: 40px 20px; text-align: center; }
.empty h1 { margin-bottom: 8px; }
.small-empty { padding: 22px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.list .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; margin-left: auto; }
.list.tight li { padding: 7px 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13.5px; } .kv dd { margin: 0; }
.person { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.person:hover { text-decoration: none; }
.person span { display: flex; flex-direction: column; line-height: 1.2; }
.person small { color: var(--muted); font-size: 12px; }
.person:hover b { text-decoration: underline; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- badges */
.badge { display: inline-block; padding: 1px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-2); color: var(--ok); } .badge.warn { background: var(--warn-2); color: var(--warn); } .badge.err { background: var(--err-2); color: var(--err); }
.badge.info { background: var(--info-2); color: var(--info); } .badge.accent { background: var(--accent-2); color: var(--accent); } .badge.muted { color: var(--muted); }
.badge.big { font-size: 15px; padding: 3px 12px; }
.tag { display: inline-block; font-size: 12px; background: var(--surface-2); padding: 1px 8px; border-radius: 4px; color: var(--ink-2); }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1.3; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-2); }
.btn.danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn.danger:hover { background: var(--err-2); }
.btn.ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.xs { padding: 2px 8px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }

/* ---- tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td { padding: 5px 8px; }
.table.sticky-first th:first-child, .table.sticky-first td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.table .row-link { color: inherit; display: block; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 13px; gap: 10px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 6px; }

/* ---- forms */
.form { max-width: 720px; }
.form.wide { max-width: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field.span { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field label i { color: var(--err); font-style: normal; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; background: var(--surface); width: 100%; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.field textarea { resize: vertical; min-height: 80px; }
.field .help { color: var(--muted); font-size: 12.5px; }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filters .field { margin-bottom: 0; min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }

/* ---- charts */
.chart { width: 100%; height: 190px; display: block; }
.chart.line { height: 170px; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .bar.ok { fill: var(--ok); } .chart .bar.warn { fill: var(--warn); } .chart .bar.err { fill: var(--err); }
.chart .bar-l { font-size: 3.4px; fill: var(--muted); }
.chart .bar-v { font-size: 3.3px; fill: var(--ink-2); font-weight: 600; }
.chart.line .bar-l { font-size: 9px; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .pt { fill: var(--accent); }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 130px; height: 130px; flex: none; }
.donut-bg { stroke: var(--surface-2); }
.donut .seg { stroke: var(--accent); }
.donut .seg.ok { stroke: var(--ok); } .donut .seg.warn { stroke: var(--warn); } .donut .seg.err { stroke: var(--err); } .donut .seg.info { stroke: var(--info); } .donut .seg.muted { stroke: var(--line-2); }
.donut-c { font-size: 6px; font-weight: 700; fill: var(--ink); }
.legend { list-style: none; margin: 0; padding: 0; font-size: 13.5px; display: grid; gap: 4px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); margin-right: 8px; vertical-align: -1px; }
.legend .sw.ok { background: var(--ok); } .legend .sw.warn { background: var(--warn); } .legend .sw.err { background: var(--err); } .legend .sw.info { background: var(--info); } .legend .sw.muted { background: var(--line-2); }
.progress { height: 8px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; min-width: 60px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.progress.ok span { background: var(--ok); } .progress.warn span { background: var(--warn); } .progress.err span { background: var(--err); }
.spark { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; }
.spark i { width: 4px; background: var(--accent); opacity: .7; border-radius: 1px; }

/* ---- timetable */
.tt { display: grid; grid-template-columns: 70px repeat(5, minmax(0, 1fr)); gap: 4px; font-size: 13px; }
.tt .h { font-weight: 600; text-align: center; padding: 6px 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tt .p { color: var(--muted); font-size: 12px; padding: 8px 4px; text-align: right; }
.tt .c { background: var(--surface-2); border-radius: 6px; padding: 7px 8px; min-height: 52px; }
.tt .c b { display: block; font-size: 13px; }
.tt .c small { color: var(--muted); display: block; }
.tt .c.now { background: var(--accent-2); outline: 2px solid var(--accent); }
.tt .c.me { background: var(--ok-2); }
.tt .brk { grid-column: 2 / -1; background: var(--surface-3); border-radius: 6px; text-align: center; color: var(--muted); padding: 4px; font-size: 12px; }

/* ---- attendance roster */
.roster td .seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.roster .seg button { border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); }
.roster .seg button:last-child { border-right: 0; }
.roster .seg button.on[data-status=present] { background: var(--ok); color: #fff; }
.roster .seg button.on[data-status=absent] { background: var(--err); color: #fff; }
.roster .seg button.on[data-status=late] { background: var(--warn); color: #fff; }
.roster .seg button.on[data-status=excused] { background: var(--info); color: #fff; }
.code-box { font-family: ui-monospace, monospace; font-size: 34px; letter-spacing: .25em; font-weight: 700; background: var(--accent-2); color: var(--accent); padding: 14px 20px; border-radius: var(--r); display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-grid .d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 12.5px; background: var(--surface-2); }
.cal-grid .d.present { background: var(--ok-2); color: var(--ok); } .cal-grid .d.absent { background: var(--err-2); color: var(--err); } .cal-grid .d.late { background: var(--warn-2); color: var(--warn); }
.cal-grid .d.excused { background: var(--info-2); color: var(--info); } .cal-grid .d.off { opacity: .35; } .cal-grid .d.today { outline: 2px solid var(--accent); }
.cal-grid .h { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-grid .cell { min-height: 78px; background: var(--surface-2); border-radius: 6px; padding: 6px; font-size: 12.5px; }
.month-grid .cell .n { font-weight: 600; color: var(--muted); }
.month-grid .cell.today { outline: 2px solid var(--accent); }
.month-grid .cell.off { opacity: .55; }
.month-grid .ev { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 4px; background: var(--accent-2); color: var(--accent); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-grid .ev.holiday { background: var(--err-2); color: var(--err); } .month-grid .ev.exam { background: var(--warn-2); color: var(--warn); }

/* ---- quiz */
.quiz-bar { position: sticky; top: var(--top-h); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; z-index: 5; }
.timer { font-family: ui-monospace, monospace; font-size: 20px; font-weight: 700; }
.timer.urgent { color: var(--err); }
.q { border-left: 3px solid var(--line-2); padding-left: 14px; margin-bottom: 20px; }
.q.answered { border-left-color: var(--ok); }
.q .qt { font-weight: 600; margin-bottom: 8px; }
.q .opts label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 6px; cursor: pointer; }
.q .opts label:hover { background: var(--surface-2); }
.q .opts label.right { border-color: var(--ok); background: var(--ok-2); } .q .opts label.wrong { border-color: var(--err); background: var(--err-2); }
.q .why { font-size: 13px; color: var(--muted); margin-top: 6px; }
.score-big { font-size: 40px; font-weight: 700; letter-spacing: -.02em; }

/* ---- misc */
.md p { margin: 0 0 .7em; } .md h3 { margin: 14px 0 6px; } .md h4 { margin: 12px 0 4px; } .md ul, .md ol { margin: 0 0 .7em 1.2em; padding: 0; }
.note { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; }
.note.warn { background: var(--warn-2); } .note.ok { background: var(--ok-2); } .note.err { background: var(--err-2); } .note.info { background: var(--info-2); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline li.warn::before { background: var(--warn); } .timeline li.err::before { background: var(--err); } .timeline li.ok::before { background: var(--ok); }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.assistant-log { max-height: 420px; overflow: auto; display: grid; gap: 10px; padding: 4px 0; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.bubble.me { margin-left: auto; background: var(--accent-2); }
.bubble small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-pill); padding: 4px 12px; font-size: 13px; cursor: pointer; }
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.key { font-family: ui-monospace, monospace; background: var(--surface-2); padding: 6px 10px; border-radius: var(--r-sm); font-size: 13px; word-break: break-all; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--err); margin-right: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.placeholder { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 16px; color: var(--muted); font-size: 14px; background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(0, 0, 0, .025) 8px 16px); }
.placeholder b { color: var(--ink-2); }
.id-card { width: 340px; border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; background: var(--surface); display: grid; grid-template-columns: 90px 1fr; gap: 14px; }
.id-card .photo { width: 90px; height: 110px; background: var(--surface-2); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.grade-grid div { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px; text-align: center; }
.grade-grid b { display: block; font-size: 18px; }

/* ---- print documents */
.print-body { background: #fff; color: #000; }
.print-bar { display: flex; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #ddd; }
.print-page { max-width: 820px; margin: 0 auto; padding: 32px 28px; }
.doc-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; border-bottom: 2px solid #0B1238; padding-bottom: 14px; margin-bottom: 18px; }
.doc-head h1 { font-size: 22px; }
.doc-head .doc-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border: 1px solid #0B1238; padding: 6px 12px; border-radius: 6px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0; }
.doc-table th, .doc-table td { border: 1px solid #333; padding: 6px 8px; }
.doc-table th { background: #f0f0f0; text-align: left; }
.doc-table .num { text-align: right; }
.sig-row { display: flex; justify-content: space-between; margin-top: 56px; font-size: 13px; }
.sig-row div { border-top: 1px solid #333; padding-top: 6px; min-width: 150px; text-align: center; }
.doc-foot { margin-top: 28px; font-size: 12px; color: #555; border-top: 1px solid #ddd; padding-top: 8px; }
@media print {
  .no-print, .side, .top, .acting-bar, .page-head .actions, .filters, .tabs, .pager { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; box-shadow: none; break-inside: avoid; }
  .print-page { padding: 0; max-width: none; }
  a { color: inherit; }
}

/* ---- phones */
@media (max-width: 920px) {
  .grid.two, .grid.three, .grid.side, .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
}
@media (max-width: 760px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .side.open { transform: none; }
  .side-close { display: inline-flex; } .side-open { display: inline-flex; }
  .top { padding: 0 12px; }
  .who-name { display: none; }
  .content { padding: 16px 14px 48px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .card { padding: 14px; }
  .tt { grid-template-columns: 56px repeat(5, minmax(90px, 1fr)); overflow-x: auto; }
  .page-head h1 { font-size: 20px; }
  .top-search input { font-size: 16px; }
}

ol.steps{margin:0;padding-left:22px;display:grid;gap:8px}ol.steps li a{color:inherit;text-decoration:none}ol.steps li a:hover{text-decoration:underline;color:var(--accent)}
