/* =====================================================================
   BellReady planner — design system v2
   ===================================================================== */
/* Fonts are served from this site (no third-party requests). The "Fallback" faces resize Georgia/Arial
   to the measured width and line box of Fraunces/Inter, so the page doesn't jump when the real fonts arrive. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../assets/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(../assets/fonts/fraunces-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 500; font-display: swap; src: url(../assets/fonts/fraunces-italic-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Fallback'; font-weight: 400 500; src: local('Arial'), local('ArialMT'); size-adjust: 106.85%; ascent-override: 90.78%; descent-override: 22.46%; line-gap-override: 0%; }
@font-face { font-family: 'Inter Fallback'; font-weight: 600 800; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 102.15%; ascent-override: 94.96%; descent-override: 23.49%; line-gap-override: 0%; }
@font-face { font-family: 'Fraunces Fallback'; font-weight: 500; src: local('Georgia'); size-adjust: 88.03%; ascent-override: 111.32%; descent-override: 29.53%; line-gap-override: 0%; }
@font-face { font-family: 'Fraunces Fallback'; font-weight: 600 700; src: local('Georgia Bold'), local('Georgia-Bold'); size-adjust: 77.31%; ascent-override: 126.76%; descent-override: 33.63%; line-gap-override: 0%; }
@font-face { font-family: 'Fraunces Fallback'; font-style: italic; font-weight: 500; src: local('Georgia Italic'), local('Georgia-Italic'); size-adjust: 84.03%; ascent-override: 116.63%; descent-override: 30.94%; line-gap-override: 0%; }
:root {
  --night: #0b1222;
  --ink: #1f2a44;
  --ink-2: #4a5470;
  --muted: #5f6680; /* 5.6:1 on white: readable at 12px (WCAG AA) */
  --bg: #f7f3ea;
  --bg-2: #efe8da;
  --card: #ffffff;
  --line: #e7e0d1;
  --line-2: #d9d0bd;
  --bell: #f2b632;
  --bell-soft: #fdf0cf;
  --coral: #e4572e;
  --coral-soft: #fde8e2;
  --ok: #1fa88e;
  --ok-soft: #e3f6f1;
  --sky: #5b7cfa;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 42, 68, .05), 0 10px 30px -12px rgba(31, 42, 68, .14);
  --shadow-lg: 0 30px 60px -24px rgba(11, 18, 34, .35);
  --serif: 'Fraunces', 'Fraunces Fallback', Georgia, serif;
  --sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, Segoe UI, sans-serif;
  --side: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--sans); color: var(--ink); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 .4em; line-height: 1.12; letter-spacing: -.015em; }
h1 { font-size: 34px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .6em; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.spacer { flex: 1; }
svg use { pointer-events: none; }

/* ---------- shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40; display: flex; flex-direction: column; background: var(--night); color: #dfe3ef; padding: 18px 12px 14px; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; font: 600 21px var(--serif); text-decoration: none; color: #fff; padding: 4px 10px 16px; }
.nav p { margin: 16px 12px 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7f88a6; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; text-decoration: none; color: #c9cfe0; font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.nav a svg, .side-help svg, .tabbar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--bell); color: var(--night); font-weight: 700; box-shadow: 0 8px 20px -10px rgba(242, 182, 50, .7); }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-help { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; text-decoration: none; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #fff; }
.side-help:hover { background: rgba(255, 255, 255, .1); }
.side-help svg { stroke: var(--bell); width: 22px; height: 22px; }
.side-help b { display: block; font-size: 14px; }
.side-help small { color: #9aa3bf; font-size: 12px; }
.topbar, .tabbar, .scrim { display: none; }
main { margin-left: var(--side); padding: 30px clamp(18px, 3.4vw, 48px) 70px; min-width: 0; }
.view-inner { max-width: 1240px; margin: 0 auto; animation: view-in .25s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .13em; color: #b9401b; font-weight: 700; margin: 0 0 6px; }
.head-actions, .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > .card { margin-bottom: 18px; }
.banner { background: var(--bell-soft); border: 1px solid #f3d27e; padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.note { background: var(--bell-soft); padding: 12px 14px; border-radius: var(--radius-sm); border-left: 4px solid var(--bell); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); overflow: hidden; }
.stat b { display: block; font: 600 30px/1.1 var(--serif); letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat::after { content: ''; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--bg); }
.stat-dark { background: var(--night); color: #fff; border-color: var(--night); }
.stat-dark span { color: #aab2c8; }
.stat-dark::after { background: rgba(242, 182, 50, .22); }
.small-stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.small-stats .stat { box-shadow: none; background: var(--bg); }
.small-stats .stat::after { display: none; }
.small-stats .stat b { font-size: 22px; }

/* ---------- now / next ---------- */
.now-card { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px 28px; align-items: center; padding: 22px 24px 26px; margin-bottom: 18px; border-radius: 22px; background: var(--night); color: #fff; overflow: hidden; box-shadow: var(--shadow-lg); }
.now-card::before { content: ''; position: absolute; right: -90px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 182, 50, .35), transparent 65%); }
.now-card > * { position: relative; }
.nn-now { display: grid; gap: 10px; }
.nn-tag { display: inline-flex; align-items: center; gap: 8px; align-self: start; justify-self: start; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--night); background: var(--bell); padding: 5px 11px; border-radius: 999px; }
.nn-tag.nn-done { background: var(--ok); color: #fff; }
.nn-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(228, 87, 46, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(228, 87, 46, 0); } 100% { box-shadow: 0 0 0 0 rgba(228, 87, 46, 0); } }
.nn-left { margin-left: 10px; font-weight: 700; color: var(--bell); font-size: 14px; }
.nn-main { font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.nn-main a { color: var(--bell); font-weight: 600; }
.nn-lesson { font: 600 22px/1.2 var(--serif); }
.nn-next { padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: 14.5px; }
.nn-next .nn-lesson { font-size: 16px; }
.nn-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9aa3bf; margin-bottom: 6px; }
.now-card .chip { background: rgba(255, 255, 255, .12); color: #fff; }
.now-card .muted { color: #aab2c8; }
.now-card .res { background: rgba(242, 182, 50, .16); color: var(--bell); }
.nn-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, .08); }
.nn-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--bell), var(--coral)); border-radius: 0 3px 3px 0; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 9px 17px; font: 600 14px var(--sans); cursor: pointer; text-decoration: none; background: none; color: var(--ink); white-space: nowrap; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 8px 18px -10px rgba(31, 42, 68, .8); }
.btn-primary:hover { background: #2c3a5e; }
.btn-ghost { border-color: var(--line-2); background: var(--card); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-warn { background: var(--bell); color: var(--night); box-shadow: 0 8px 18px -10px rgba(242, 182, 50, .9); }
.btn-warn:hover { background: #ffc444; }
.btn-danger { background: var(--card); color: #b3261e; border-color: #f0c8c4; }
.btn-danger:hover { background: #fdf1f0; }
.btn:focus-visible, .link:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(242, 182, 50, .6); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--coral); color: var(--coral); }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; width: 28px; height: 28px; border-radius: 8px; }
.icon-btn:hover { background: var(--coral-soft); color: var(--coral); }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line-2); border-radius: 11px; padding: 9px 12px; background: var(--card); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bell); box-shadow: 0 0 0 4px rgba(242, 182, 50, .22); }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=color] { padding: 3px; height: 42px; }
.invalid { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(228, 87, 46, .15); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--ink-2); }
.field small { color: var(--muted); }
.field.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.field.inline span { margin: 0; }
.field.inline input { width: 74px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--ok); width: 17px; height: 17px; }
.toolbar select, .head-actions select, .head-actions input { width: auto; }
.inline-add { display: flex; gap: 8px; margin-top: 12px; align-items: flex-start; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; background: var(--card); }
.seg a { padding: 6px 14px; text-decoration: none; font-weight: 600; font-size: 13.5px; border-radius: 999px; color: var(--ink-2); }
.seg a.on { background: var(--ink); color: #fff; }

/* custom tick */
.tick { position: relative; display: inline-flex; flex: none; }
.tick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.tick span { width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 7px; display: inline-block; background: var(--card); transition: all .15s; }
.tick:hover span { border-color: var(--ok); }
.tick input:checked + span { background: var(--ok); border-color: var(--ok); }
.tick input:checked + span::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 800; display: block; text-align: center; line-height: 18px; }
.tick input:focus-visible + span { outline: 3px solid rgba(242, 182, 50, .6); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; padding: 3px 10px 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 58%, black); white-space: nowrap; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); cursor: default; font-family: inherit; color: var(--ink-2); }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--bell); background: var(--bell-soft); }
.res-row { display: flex; gap: 6px; flex-wrap: wrap; }
.res { font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 2px 9px; border-radius: 7px; background: var(--bell-soft); color: #8a5a00; }
.res:hover { background: var(--bell); color: var(--night); }

/* ---------- today ---------- */
.schedule { list-style: none; padding: 0; margin: 0; }
.sched-row { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 14px 4px 14px 14px; border-left: 4px solid var(--c); border-bottom: 1px solid var(--line); border-radius: 4px; transition: background .15s; }
.sched-row:hover { background: #fbf9f4; }
.sched-row time { font-weight: 800; font-size: 14px; }
.sched-row time small { display: block; font-weight: 500; color: var(--muted); }
.sched-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.sched-break { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 7px 0 7px 18px; color: var(--muted); font-size: 13px; font-weight: 600; background: repeating-linear-gradient(-45deg, transparent 0 6px, #f1ebde 6px 12px); border-radius: 8px; margin: 4px 0; }
.lesson { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 5px 0; }
.lesson .link { font-weight: 600; }
.lesson.done .link, .done > .link, li.done .grow { text-decoration: line-through; color: var(--muted); }
.due { padding: 12px 0; border-bottom: 1px solid var(--line); }
.due:last-child { border: 0; }
.due > a { font-weight: 600; }
.tasklist { list-style: none; padding: 0; margin: 0; }
.tasklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tasklist select { width: 116px; font-size: 12px; padding: 5px 6px; }

/* ---------- week grid ---------- */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px 4px; }
.weekgrid { width: 100%; border-collapse: separate; border-spacing: 5px; min-width: 680px; }
.weekgrid th { font-size: 13px; text-align: left; font-weight: 700; vertical-align: top; padding: 4px 6px; }
.weekgrid th small { display: block; color: var(--muted); font-weight: 500; }
.weekgrid th.is-today { color: #b9401b; }
.weekgrid th.is-today small { color: #b9401b; }
.weekgrid td { background: var(--bg); border-radius: 12px; padding: 9px 10px; vertical-align: top; font-size: 13px; height: 62px; position: relative; transition: box-shadow .15s; }
.weekgrid td.has { background: color-mix(in srgb, var(--c) 11%, white); border-left: 4px solid var(--c); }
.weekgrid td.has:hover { box-shadow: 0 8px 18px -12px rgba(31, 42, 68, .45); }
.weekgrid tr.brk td { background: none; height: 10px; padding: 0; }
.weekgrid tr.brk th { color: var(--muted); font-weight: 500; }
.cell-lesson { display: block; font-size: 12.5px; margin-top: 3px; font-weight: 500; }
.cell-lesson.done { color: var(--muted); text-decoration: line-through; }
.add-cell { position: absolute; right: 6px; bottom: 6px; border: 1px dashed var(--ink-2); background: var(--card); border-radius: 7px; width: 24px; height: 24px; cursor: pointer; opacity: .35; transition: opacity .15s; font-weight: 700; }
.weekgrid td:hover .add-cell, .add-cell:focus { opacity: 1; }
.tt-cell { cursor: pointer; }
.tt-cell:hover { outline: 2px solid var(--bell); }
.tt-cell b, .tt-cell small { display: block; }
.seq { padding-left: 22px; margin: 0; }
.seq li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.seq-date { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.periods { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.periods li { background: var(--bg); padding: 10px 14px; border-radius: 12px; display: flex; flex-direction: column; border: 1px solid transparent; }
.periods li:hover { border-color: var(--line-2); }

/* ---------- lists ---------- */
.classlist, .rowlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.classlist a, .rowlist a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 11px 12px; border-radius: 12px; text-decoration: none; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.classlist a:hover, .rowlist a:hover { background: var(--bg); }
.classlist li.on a, .rowlist li.on a { background: var(--bell-soft); border-color: #f3d27e; }
.classlist .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.classlist a .muted, .rowlist a .muted { width: 100%; }
.roster { columns: 2; padding-left: 24px; }
.roster li { break-inside: avoid; padding: 2px 0; }
.roster li span { margin-right: 4px; }
.checkgrid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.checkgrid li { padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.progress { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #4fd3b6); border-radius: 99px; transition: width .4s; }
.scores { width: 100%; border-collapse: collapse; margin-top: 12px; }
.scores td, .scores th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.scores th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.scores input[type=number] { width: 96px; }
.units { list-style: none; padding: 0; margin: 0; }
.units li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.log-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kanban .card { margin: 0; }
.empty { text-align: center; padding: 34px 14px; color: var(--ink-2); }
.empty::before { content: ''; display: block; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; background: var(--bell-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c88a0a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c-1.7 0-3 1.3-3 3v1.4C5.7 8.8 4 11.6 4 15v3l-1.5 2h19L20 18v-3c0-3.4-1.7-6.2-5-7.6V6c0-1.7-1.3-3-3-3z'/%3E%3C/svg%3E") center / 26px no-repeat; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 14px; }

/* ---------- grading bars ---------- */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; height: 240px; align-items: end; padding-top: 20px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-fill { width: 100%; max-width: 70px; background: linear-gradient(180deg, #2c3a5e, var(--ink)); border-radius: 10px 10px 3px 3px; min-height: 3px; }
.bar.hot .bar-fill { background: linear-gradient(180deg, #ff8a66, var(--coral)); }
.bar-val { font-weight: 800; font-size: 13.5px; margin-bottom: 5px; }
.bar-label { font-size: 12px; color: var(--muted); margin-top: 7px; font-weight: 600; }

/* ---------- seating ---------- */
.seating-wrap { overflow-x: auto; background: var(--bg); border-radius: 16px; padding: 14px; border: 1px solid var(--line); }
svg.seating { width: 100%; max-width: 780px; height: auto; display: block; margin: 0 auto; font-family: var(--sans); }
svg.seating .board { fill: var(--night); }
svg.seating .board-t { fill: #fff; font-size: 10px; letter-spacing: .1em; font-weight: 700; }
svg.seating .table { fill: #e9dcc2; }
svg.seating .desk rect { fill: #fff; stroke: #d3c8b1; stroke-width: 1.5; transition: fill .15s; }
svg.seating .desk.taken rect { fill: #fffaf0; stroke: var(--ink-2); }
svg.seating .desk[data-act]:hover rect { fill: var(--bell-soft); }
svg.seating .desk.sel rect { stroke: var(--coral); stroke-width: 3; fill: var(--coral-soft); }
svg.seating .desk[data-act] { cursor: pointer; }
svg.seating .desk text { font-size: 11px; fill: var(--ink); font-weight: 600; pointer-events: none; }
.unseated { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- sub plan ---------- */
.subplan { padding: 30px; }
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--night); margin-bottom: 16px; padding-bottom: 10px; }
.sp-brand { font: 700 14px var(--serif); color: var(--muted); }
.sp-info { background: var(--bell-soft); padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; }
.sp-table { width: 100%; border-collapse: collapse; }
.sp-table th, .sp-table td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 11px 8px; }
.sp-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sp-table td:first-child { width: 112px; white-space: nowrap; font-weight: 600; }
.sp-table td:nth-child(2) { width: 180px; }
.sp-table tr.brk td { color: var(--muted); background: var(--bg); padding: 5px 8px; }
.sp-table p { margin: 4px 0; }
.sp-class { margin-top: 24px; break-inside: avoid; }
.sp-class svg { max-width: 580px; }

/* ---------- welcome ---------- */
.welcome { max-width: 680px; margin: 24px auto; padding: 38px; border-radius: 26px; }
.welcome h1 { font-size: 36px; }
.choice { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.choice legend { font-weight: 700; margin-bottom: 10px; }
.choice label { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice label:hover { border-color: var(--line-2); }
.choice label:has(input:checked) { border-color: var(--ink); background: var(--bell-soft); }
.choice input { accent-color: var(--ink); }
.choice small { grid-column: 2; color: var(--muted); }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 18, 34, .58); display: grid; place-items: center; z-index: 70; padding: 16px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 22px; padding: 26px; width: min(540px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop-up .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop-up { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal h3 { font-size: 22px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 10px; position: sticky; bottom: -26px; background: var(--card); padding: 12px 0 2px; }
#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; width: max-content; max-width: calc(100% - 32px); }
.toast { transform: translateY(20px); opacity: 0; transition: .25s; background: var(--night); color: #fff; padding: 12px 18px; border-radius: 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); font-weight: 500; }
.toast.show { opacity: 1; transform: none; }
.toast .btn { color: var(--bell); border-color: rgba(255, 255, 255, .25); background: transparent; }

/* ---------- demo banner (/demo/) ---------- */
.demo-banner { position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 45; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: var(--night); color: #fff; font-size: 14px; box-shadow: 0 -8px 24px rgba(0, 0, 0, .15); }
.demo-banner b { color: var(--bell); }
body.is-demo main { padding-bottom: 100px; }
body.is-demo #toasts { bottom: 84px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now-card { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --side: 0px; }
  .sidebar { width: 280px; transform: translateX(-102%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 60px rgba(0, 0, 0, .3); padding-top: calc(18px + env(safe-area-inset-top)); }
  body.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(11, 18, 34, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--night); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar .brand { display: flex; }
  .topbar-title { font: 600 19px var(--serif); }
  main { margin-left: 0; padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; }
  .page-head { margin-bottom: 16px; gap: 10px; }
  .head-actions { width: 100%; }
  .card { padding: 16px; border-radius: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat b { font-size: 24px; }
  .now-card { padding: 18px 18px 22px; border-radius: 18px; }
  .nn-lesson { font-size: 19px; }
  .sched-row, .sched-break { grid-template-columns: 56px 1fr; gap: 10px; }
  .kanban { grid-template-columns: 1fr; }
  .roster { columns: 1; }
  .bars { gap: 6px; height: 190px; }
  .bar-label { font-size: 10.5px; text-align: center; }
  .add-cell { opacity: .6; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; font: 700 10.5px var(--sans); color: var(--muted); padding: 6px 0; border-radius: 12px; border: 0; background: none; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .active { color: var(--ink); background: var(--bg); }
  .tabbar .active svg { stroke: var(--coral); }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up .25s cubic-bezier(.2, .8, .2, 1); }
  .modal-actions { bottom: calc(-18px - env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .demo-banner { left: 0; bottom: calc(64px + env(safe-area-inset-bottom)); font-size: 13px; padding: 8px 12px; }
  body.is-demo main { padding-bottom: 150px; }
  body.is-demo #toasts { bottom: 150px; }
  .welcome { padding: 24px 18px; margin: 8px auto; }
  .welcome h1 { font-size: 28px; }
  .sp-table td:nth-child(2) { width: auto; }
  .subplan { padding: 18px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- motion ---------- */
@keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar-fill { transform-origin: bottom; animation: grow-up .7s cubic-bezier(.2, .8, .2, 1) both; }
.bar:nth-child(2) .bar-fill { animation-delay: .06s; } .bar:nth-child(3) .bar-fill { animation-delay: .12s; }
.bar:nth-child(4) .bar-fill { animation-delay: .18s; } .bar:nth-child(5) .bar-fill { animation-delay: .24s; }
.bar:nth-child(6) .bar-fill { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- print (sub plans, seating) ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .tabbar, .scrim, .no-print, #toasts, .head-actions, .toolbar, .demo-banner, .now-card { display: none !important; }
  main { margin: 0; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .seating-wrap { background: none; border: 0; }
  a { text-decoration: none; }
}

/* v2 fixes */
.nn-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .sidebar { z-index: 60; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .scrim { z-index: 55; }
}

/* v3 fixes: save alert, a11y, phone fit */
.save-alert { position: sticky; top: 0; z-index: 29; margin-left: var(--side); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px clamp(16px, 3.4vw, 48px); background: var(--coral-soft); border-bottom: 2px solid var(--coral); color: #7a1d0a; font-size: 14px; }
.save-alert[hidden] { display: none; }
.save-alert span { flex: 1 1 280px; }
.roster .icon-btn { min-width: 44px; min-height: 44px; vertical-align: middle; } /* comfortable tap target for a destructive action */
details pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.sp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-table td { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .save-alert { top: calc(46px + env(safe-area-inset-top)); padding: 10px 14px; font-size: 13px; }
  /* Off-canvas menu: hidden from Tab/screen readers while closed (inert is set in JS too). */
  .sidebar { visibility: hidden; transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s .25s; }
  body.nav-open .sidebar { visibility: visible; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  /* Sub plan: let the time column wrap so the table fits a 360px card. */
  .sp-table th, .sp-table td { padding: 9px 5px; }
  .sp-table td:first-child { width: 68px; white-space: normal; }
}
@media print {
  .save-alert { display: none !important; }
  .sp-scroll { overflow: visible; }
}

/* Demo: "try these 3 things" card on Today */
.demo-tour { border-color: #f3d27e; background: linear-gradient(180deg, var(--bell-soft), #fff 70%); margin-bottom: 16px; }
.demo-tour-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-tour h2 { font-size: 19px; margin: 0; }
.demo-tour ol { margin: 12px 0 8px; padding-left: 1.3em; display: grid; gap: 6px; }
.demo-tour li { line-height: 1.5; }
.demo-tour a { color: var(--ink); font-weight: 600; }
.demo-tour-foot { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }

/* ---------- School calendar: events, countdown, coming up, setup ---------- */
.countdown { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.countdown .cd-n { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--night); color: var(--bell); font: 700 13px var(--sans); }
.countdown b { color: var(--ink); }
.ev-banner { background: #fff4e6; border-color: #f6c38a; }
.ev-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.ev-row { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding-left: 10px; border-left: 3px solid var(--ec, var(--line)); }
.ev-when { font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.35; }
.ev-when small { font-weight: 500; color: var(--muted); }
.ev-what { min-width: 0; }
.ev-what .link { font-weight: 650; text-align: left; }
.ev-meta { display: block; font-size: 12.5px; color: var(--muted); }
.ev-meta b { color: #b45309; }
.ev-pill { display: block; width: 100%; margin: 2px 0 0; padding: 2px 6px; border: 0; border-left: 3px solid var(--ec); border-radius: 6px; background: color-mix(in srgb, var(--ec) 12%, white); color: color-mix(in srgb, var(--ec) 70%, black); font: 600 11.5px/1.35 var(--sans); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-pill:hover { background: color-mix(in srgb, var(--ec) 22%, white); }
.ev-pill .ev-t { font-weight: 800; margin-right: 4px; }
.ev-pill small { font-weight: 500; }
.ev-pill.ev-off { background: repeating-linear-gradient(-45deg, #f1efe9, #f1efe9 6px, #e8e4da 6px, #e8e4da 12px); color: var(--ink-2); }
.wk-ev { margin-top: 6px; font-weight: 400; text-align: left; }
.cu { display: grid; gap: 12px; }
.cu-day h3 { font: 700 11.5px var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 4px; }
.cu-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.cu-day li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.cu-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ec); flex: none; margin: 0 3px; }
.setup { border-color: #f3d27e; }
.setup-bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin: 6px 0 14px; }
.setup-bar span { display: block; height: 100%; background: var(--bell); border-radius: 99px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.setup-steps a { display: flex; gap: 10px; height: 100%; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--bg); }
.setup-steps a:hover { border-color: var(--ink-2); }
.setup-steps b { display: block; font-size: 14px; }
.setup-steps small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.setup-n { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--night); color: var(--bell); font-weight: 800; font-size: 13px; }
.setup-steps .is-done a { background: var(--ok-soft); border-color: #bfe8dd; }
.setup-steps .is-done .setup-n { background: var(--ok); color: #fff; }

/* Calendar page */
.ev-quick { padding: 14px 18px; }
.ev-quick p { margin: 0 0 8px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: 600 13px var(--sans); color: var(--ink); cursor: pointer; }
.tpl::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ec); }
.tpl:hover { border-color: var(--ec); background: color-mix(in srgb, var(--ec) 8%, white); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { margin: 0 6px; min-width: 9ch; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { padding: 6px 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.cal-cell { position: relative; min-height: 96px; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); min-width: 0; }
.cal-cell.wkend { background: #fbfaf6; }
.cal-cell.other { background: #faf8f3; }
.cal-cell.other .cal-day { color: var(--muted); opacity: .6; }
.cal-cell.off { background: repeating-linear-gradient(-45deg, #faf8f3, #faf8f3 7px, #f2eee5 7px, #f2eee5 14px); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; }
.cal-day:hover { background: var(--bg-2); }
.cal-cell.today .cal-day { background: var(--bell); color: var(--night); }
.cal-more { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.cal-dots { display: none; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--ec); }

@media (max-width: 1360px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-layout > .stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
  .cal-layout > .stack > .card { margin-bottom: 0; }
}
@media (max-width: 1100px) {
  .setup-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .cal-cell { min-height: 54px; padding: 3px 2px; text-align: center; }
  .cal-evs { display: none; }
  .cal-dots { display: flex; justify-content: center; gap: 3px; margin-top: 3px; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ec); }
  .cal-dow { padding: 6px 2px; text-align: center; font-size: 10.5px; letter-spacing: .04em; }
  .cal-day { min-width: 30px; height: 30px; }
  .cal-legend { display: none; }
  .ev-row { grid-template-columns: 74px 1fr; }
  .setup-steps { grid-template-columns: 1fr; }
  .countdown { font-size: 13px; }
}
@media print {
  .ev-quick, .cal-layout > aside { display: none !important; }
  .cal-layout { display: block; }
  .cal-cell { min-height: 90px; }
  .cal-evs { display: block !important; }
  .ev-pill { white-space: normal; }
}

/* Install the app (menu button + steps dialog) */
.side-install { width: 100%; margin-bottom: 8px; font: inherit; text-align: left; cursor: pointer; }
.side-install[hidden] { display: none; }
.install-steps { margin: 4px 0 12px; padding-left: 22px; line-height: 1.55; }
.install-steps li { margin: 6px 0; }
.install-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 10px 12px 12px; border-radius: 16px; background: var(--card); border: 1px solid rgba(242, 182, 50, .55); box-shadow: 0 10px 24px -16px rgba(11, 18, 34, .35); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-banner div { flex: 1; min-width: 0; line-height: 1.3; }
.install-banner b { display: block; font-size: 14px; }
.install-banner small { color: var(--muted); font-size: 12.5px; }
.install-banner .btn { flex: none; }
.ib-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.ib-close:hover { background: rgba(0, 0, 0, .05); }
