/* Paper, ink and working colour. Explicit theme values work without light-dark(). */
:root {
  color-scheme: light;
  --bg: #f5f1e9;
  --bg-2: #eae3d8;
  --surface: #ffffff;
  --surface-2: #eee8dd;
  --ink: #203249;
  --muted: #616570;
  --line: #d7d2c8;
  --control-line: #858891;
  --warn: #ac3c2d;
  --accent: #ad3d2b;
  --accent-ink: #ffffff;
  --accent-soft: #f7e4d9;
  --info: #3d647b;
  --success: #3f6a4c;
  --caution: #7e621f;
  --subject-sat: 35%;
  --subject-lum: 34%;
  --subject-soft-sat: 45%;
  --subject-soft-lum: 93%;
  --subject-line-lum: 72%;
  --rail: #1c3049; --rail-ink: #fff6e9; --rail-muted: #bdcadd; --rail-line: #4b5c72;
  --note: #f2e5cd; --note-ink: #463a2d; --note-muted: #685b49; --note-line: #cbbd9f;
  --radius: 4px; --radius-sm: 2px;
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem;
  --text-xs: .75rem; --text-sm: .875rem; --text-base: 1rem; --text-section: 1.125rem; --text-page: 2rem;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 12px 36px -12px rgba(0,0,0,.3);
  --accent-glow: transparent;
  --ease: cubic-bezier(.22,1,.36,1); --spring: var(--ease);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #161e2b;
  --bg-2: #222d3e;
  --surface: #1d2838;
  --surface-2: #253246;
  --ink: #f7f0e7;
  --muted: #b7c1d0;
  --line: #3e4c60;
  --control-line: #8292aa;
  --warn: #f2a48e;
  --accent: #f2a088;
  --accent-ink: #261b17;
  --accent-soft: #42302f;
  --info: #a0c1d4;
  --success: #acc7ad;
  --caution: #dbc28b;
  --note: #3a3028; --note-ink: #f4e8d5; --note-muted: #c9b89c; --note-line: #695b47;
  --subject-sat: 28%;
  --subject-lum: 75%;
  --subject-soft-sat: 24%;
  --subject-soft-lum: 22%;
  --subject-line-lum: 39%;
  }
}
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #161e2b;
  --bg-2: #222d3e;
  --surface: #1d2838;
  --surface-2: #253246;
  --ink: #f7f0e7;
  --muted: #b7c1d0;
  --line: #3e4c60;
  --control-line: #8292aa;
  --warn: #f2a48e;
  --accent: #f2a088;
  --accent-ink: #261b17;
  --accent-soft: #42302f;
  --info: #a0c1d4;
  --success: #acc7ad;
  --caution: #dbc28b;
  --note: #3a3028; --note-ink: #f4e8d5; --note-muted: #c9b89c; --note-line: #695b47;
  --subject-sat: 28%;
  --subject-lum: 75%;
  --subject-soft-sat: 24%;
  --subject-soft-lum: 22%;
  --subject-line-lum: 39%;
}
:root[data-accent="ochre"] { --accent: #62551e; --accent-soft: #f0edcf; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-accent="ochre"]:not([data-theme="light"]) { --accent: #ded4a0; --accent-soft: #3b3b2a; --accent-ink: #2c2a1c; } }
:root[data-accent="ochre"][data-theme="dark"] { --accent: #ded4a0; --accent-soft: #3b3b2a; --accent-ink: #2c2a1c; }
:root[data-accent="sage"] { --accent: #3f5947; --accent-soft: #e7ecdf; --accent-ink: #fffdf8; }
@media (prefers-color-scheme: dark) { :root[data-accent="sage"]:not([data-theme="light"]) { --accent: #b3c6a7; --accent-soft: #343e2e; --accent-ink: #1b2719; } }
:root[data-accent="sage"][data-theme="dark"] { --accent: #b3c6a7; --accent-soft: #343e2e; --accent-ink: #1b2719; }
:root[data-accent="ocean"] { --accent: #3d5e6e; --accent-soft: #e5ebec; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-accent="ocean"]:not([data-theme="light"]) { --accent: #abc6d0; --accent-soft: #2d3c40; --accent-ink: #18272d; } }
:root[data-accent="ocean"][data-theme="dark"] { --accent: #abc6d0; --accent-soft: #2d3c40; --accent-ink: #18272d; }
:root[data-accent="clay"] { --accent: #87513e; --accent-soft: #f0e5de; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-accent="clay"]:not([data-theme="light"]) { --accent: #d8ad98; --accent-soft: #45342b; --accent-ink: #2c2019; } }
:root[data-accent="clay"][data-theme="dark"] { --accent: #d8ad98; --accent-soft: #45342b; --accent-ink: #2c2019; }
:root[data-accent="plum"] { --accent: #69566c; --accent-soft: #ece5ea; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-accent="plum"]:not([data-theme="light"]) { --accent: #c8b4cc; --accent-soft: #3d303e; --accent-ink: #291d2b; } }
:root[data-accent="plum"][data-theme="dark"] { --accent: #c8b4cc; --accent-soft: #3d303e; --accent-ink: #291d2b; }
:root[data-accent="ink"] { --accent: #34372f; --accent-soft: #e7e7df; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-accent="ink"]:not([data-theme="light"]) { --accent: #deded2; --accent-soft: #383c31; --accent-ink: #20221c; } }
:root[data-accent="ink"][data-theme="dark"] { --accent: #deded2; --accent-soft: #383c31; --accent-ink: #20221c; }
/* ============ base ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom);
  transition: background .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-family: var(--serif); font-weight: 500; font-size: var(--text-page); line-height: 1.12; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ============ controls ============ */
.btn {
  position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: .55rem 1.05rem; min-height: 44px; font-weight: 500; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--spring), background .2s, box-shadow .2s, border-color .2s, filter .2s;
}
.btn:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: none; }
.btn:active { transform: none; box-shadow: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 18px -6px var(--accent-glow), var(--shadow-sm); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 10px 24px -8px var(--accent-glow); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.danger { color: var(--warn); }
.btn.sm { padding: .25rem .75rem; min-height: 44px; font-size: .875rem; border-radius: var(--radius); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; margin-left: 8px; display: inline-block; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;  }
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: .3rem; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .6rem .85rem; min-height: 44px;
  transition: border-color .2s, box-shadow .25s var(--ease), background .2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: vertical; min-height: 96px; }
.err { color: var(--warn); font-size: .9rem; min-height: 1.3em; margin: 0 0 .5rem; }


/* ============ auth ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 2rem 1.5rem 2.25rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  --hero: var(--bg-2); --hero-ink: var(--ink);
  background: var(--hero); color: var(--hero-ink);
}



.auth-hero > * { position: relative; }
.auth-hero .brand { color: inherit; margin: 0; }
.auth-hero h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 5vw, 3.1rem); line-height: 1.08; letter-spacing: -.025em; max-width: 12ch; }
.auth-hero .lede { opacity: .85; max-width: 34ch; margin-top: .75rem; }
.mock { display: none; gap: .6rem; flex-direction: column; max-width: 340px; }
.mock div { background: var(--surface-2);  border: 1px solid var(--surface-2); border-radius: var(--radius); padding: .65rem .9rem; display: flex; gap: .8rem; font-size: .9rem;  }
.mock div:nth-child(2) { margin-left: 1.5rem;  } .mock div:nth-child(3) {  margin-left: .5rem; }
.mock small { opacity: .7; min-width: 3.4rem; font-variant-numeric: tabular-nums; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem 3rem; }

@media (min-width: 900px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-hero { padding: 3rem; } .mock { display: flex; }
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; margin-bottom: 1.25rem; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.75rem; width: 100%; max-width: 440px;
}
.card.wide { max-width: 780px; overflow: hidden; }
.tabs { position: relative; display: flex; gap: 0; margin-bottom: 1.25rem; background: var(--bg-2); padding: 4px; border-radius: var(--radius); }
.tabs button { position: relative; z-index: 1; flex: 1; border: 0; background: transparent; border-radius: var(--radius); padding: .45rem; color: var(--muted); font-weight: 500; transition: color .25s, background .25s, box-shadow .25s; }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ============ wizard ============ */
.steps { display: flex; gap: 6px; margin-bottom: 1.5rem; }
.steps i { position: relative; flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.steps i::after { content: ""; position: absolute; inset: 0; background: var(--accent); border-radius: 3px; transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.steps i.on::after { transform: scaleX(1); }


.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.choice {
  position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .7rem .9rem; font-weight: 500;
  transition: transform .2s var(--spring), border-color .2s, background .25s, box-shadow .25s;
}
.choice:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
.choice:active { transform: none; }
.choice small { display: block; color: var(--muted); font-weight: 400; }
.choice[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.choice[aria-pressed=true]::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat;
  
}
.row { display: flex; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.wiz-actions { display: flex; justify-content: space-between; margin-top: 1.5rem; gap: .5rem; }
.periods { display: grid; gap: .4rem; margin-bottom: .75rem; }
.prow { display: grid; grid-template-columns: 1fr 100px 100px 110px 36px; gap: .4rem; align-items: center; }

.prow input, .prow select { min-height: 38px; padding: .3rem .55rem; border-radius: var(--radius); }
@media (max-width: 560px) { .prow { grid-template-columns: 1fr 1fr 1fr; } .prow input[data-f=label] { grid-column: 1 / -1; } }

/* ============ shell + nav ============ */
.shell { max-width: 1100px; margin: 0 auto; padding: 0 1.1rem 6.5rem; min-height: 100vh; }
.top { display: flex; align-items: flex-end; justify-content: space-between; padding: 1.4rem 0 .5rem; gap: 1rem; }
.nav {
  position: fixed; z-index: 10; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--surface);  
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.navin { position: relative; display: flex; gap: 2px; }
.nav .pill { position: absolute; top: 0; left: 0; height: 100%; border-radius: var(--radius); background: var(--accent-soft); transition: none; z-index: 0; }
.nav button {
  position: relative; z-index: 1; border: 0; background: transparent; border-radius: var(--radius); padding: .5rem .45rem; color: var(--muted); font-size: .68rem; font-weight: 500;
  display: grid; justify-items: center; gap: 2px; min-width: 52px; transition: color .25s, transform .2s var(--spring);
}
.nav button:active { transform: none; }
.nav button svg { width: 22px; height: 22px; transition: transform .35s var(--spring); }
.nav button[aria-current=page] { color: var(--accent); }
.nav button[aria-current=page] svg { transform: none; }
.nav .spacer { display: none; }
@media (min-width: 800px) {
  .nav { top: 14px; bottom: auto; left: 50%; }
  .nav button { grid-auto-flow: column; align-items: center; gap: 8px; padding: .5rem 1.05rem; font-size: .9rem; min-width: 0; }
  .nav button svg { width: 19px; height: 19px; }
  .shell { padding-top: 4.5rem; padding-bottom: 3rem; }
}

/* ============ entrance animation ============ */








/* ============ today ============ */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; padding: 1.2rem 0 .5rem; flex-wrap: wrap; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin: 0 0 .35rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.status-line { color: var(--muted); margin: .5rem 0 0; font-size: 1rem; }
.status-line b { color: var(--ink); font-weight: 600; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring circle.bg { stroke: var(--line); }
.ring circle.fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 226.2; stroke-dashoffset: calc(226.2 * (1 - var(--p, 0))); transition: stroke-dashoffset .8s var(--ease); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring .lbl b { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; }
.ring .lbl span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.daynav { display: flex; gap: .35rem; }
.chips { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .95rem; font-size: .8rem; color: var(--muted); box-shadow: var(--shadow-sm); }
.chip b { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; color: var(--ink); line-height: 1.2; }
.section { margin-top: 2rem; }
.section > h2 { margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.section > h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list { display: grid; gap: .6rem; }
.item {
  --sc: var(--accent); --sc-soft: var(--accent-soft);
  position: relative; display: flex; gap: .9rem; align-items: stretch; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .85rem 1.05rem .85rem 1.25rem; text-align: left; width: 100%; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease), border-color .25s;
}
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--sc); opacity: .85; transition: background .16s; }
button.item:hover { transform: none; box-shadow: var(--shadow); border-color: var(--sc-line, var(--line)); }
button.item:hover::before { width: 1px; }
button.item:active { transform: none; }
.item .time { min-width: 5.3rem; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.item .body { flex: 1; min-width: 0; }
.item .body strong { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem; font-size: 1.02rem; }
.item.minor { background: transparent; border: 1px dashed var(--line); box-shadow: none; padding: .4rem 1rem; color: var(--muted); font-size: .88rem; border-radius: var(--radius); }
.item.minor::before { display: none; }
.item.free { background: transparent; border-style: dashed; box-shadow: none; }
.item.free::before { background: var(--line); }
.item.free .body strong { color: var(--muted); font-weight: 400; }
.item.now { background: var(--bg); border-color: var(--sc); box-shadow: 0 0 0 1px var(--sc), 0 14px 34px -14px var(--accent-glow); }
.item.now::after { content: ""; position: absolute; right: 14px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--sc);  }
.item .bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: .65rem; overflow: hidden; }
.item .bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: 3px; background: var(--sc); transition: background .16s; }
.item .sub { color: var(--muted); font-size: .85rem; display: block; margin-top: 1px; }
.item .plan { font-size: .9rem; margin-top: .35rem; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--sc-soft, var(--accent-soft)); color: var(--sc, var(--accent)); margin-left: .5rem; letter-spacing: .02em; }
.tag.warn { background: transparent; color: var(--warn); border: 1px solid currentColor; }
.tag.solid { background: var(--accent); color: var(--accent-ink); }
.empty { text-align: center; color: var(--muted); padding: 1.6rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); display: grid; gap: .4rem; justify-items: center; }
.empty svg { width: 30px; height: 30px; opacity: .6; stroke: var(--accent); }

/* ============ tasks ============ */
.task { display: flex; align-items: center; gap: .85rem; padding: .7rem .35rem; border-bottom: 1px solid var(--line); max-height: 80px; overflow: hidden; transition: background .2s; }
.task:hover { background: var(--surface-2); }
.task .t { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; position: relative; transition: color .3s; background: var(--bg); }
.task.done .t { color: var(--muted); background-size: 100% 1.5px; transition: background-size .35s var(--ease), color .3s; }
.task .t + * { margin-left: auto; }

.task .x { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: .25rem .6rem; border-radius: 8px; opacity: .5; transition: opacity .2s, color .2s, background .2s; }
.task .x:hover { opacity: 1; color: var(--warn); background: var(--surface-2); }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; flex: none; border: 1.6px solid var(--muted); border-radius: 7px; background: transparent; display: inline-grid; place-content: center; transition: background .2s, border-color .2s, transform .25s var(--spring); cursor: pointer; }
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:active { transform: none; }
input[type=checkbox]::after { content: ""; width: 12px; height: 12px; background: var(--accent-ink); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 18%, 86% 4%, 38% 72%); transform: scale(0); transition: transform .3s var(--spring); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent);  }
input[type=checkbox]:checked::after { transform: scale(1); }
.addtask { display: grid; grid-template-columns: 1fr 160px auto; gap: .5rem; margin: 1rem 0; }
@media (max-width: 560px) { .addtask { grid-template-columns: 1fr auto; } .addtask input[type=date] { grid-column: 1; } }

/* ============ week grid ============ */
.weeknav { display: flex; align-items: center; gap: .4rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.weeknav h2 { flex: 1; min-width: 160px; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.gridwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 680px; table-layout: fixed; }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; vertical-align: top; }
.grid tr > :last-child { border-right: 0; } .grid tr:last-child > * { border-bottom: 0; }
.grid th { font-weight: 600; font-size: .82rem; padding: .6rem .6rem; text-align: left; color: var(--muted); background: var(--surface-2); }
.grid th.today { color: var(--accent); }
.grid th.today::after { content: ""; display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: var(--accent); width: 22px; }
.grid th.pl { width: 98px; font-weight: 500; }
.grid th.pl small { display: block; font-weight: 400; font-variant-numeric: tabular-nums; opacity: .85; }
.grid tr.minor th, .grid tr.minor td { background: var(--bg-2); color: var(--muted); font-size: .78rem; padding: .25rem .6rem; }
.cell { width: 100%; min-height: 68px; border: 0; background: transparent; text-align: left; padding: .5rem .6rem; display: block; position: relative; transition: background .2s, transform .25s var(--spring); }
.cell:hover { background: var(--accent-soft); }
.cell.filled { --sc: var(--accent); --sc-soft: var(--accent-soft); background: var(--sc-soft); margin: 4px; width: calc(100% - 8px); border-radius: var(--radius); box-shadow: none; min-height: 60px; }
.cell.filled:hover { transform: none; z-index: 2; box-shadow: none, 0 8px 20px -8px var(--accent-glow); }
.cell strong { display: block; font-size: .88rem; color: var(--sc, var(--ink)); overflow-wrap: anywhere; line-height: 1.25; }
.cell span { display: block; font-size: .75rem; color: var(--muted); }
.cell.today:not(.filled) { background: var(--accent-soft); }
.cell .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); margin-right: 5px; vertical-align: 1px; }
.cell .dot.done { background: transparent; border: 1.5px solid var(--sc); }
.cell.plus { color: transparent; font-size: 1.1rem; text-align: center; padding-top: 1.2rem; }
.cell.plus:hover { color: var(--accent); }

/* ============ modal + toast ============ */
#modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center; background: rgba(18, 16, 12, 0);  transition: background .3s, backdrop-filter .3s; }
#modal.open { background: rgba(18, 16, 12, .42);  }
#modal[hidden] { display: none; }
.sheet {
  background: var(--surface); width: 100%; max-width: 540px; border-radius: 12px 12px 0 0; padding: 1.4rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
  max-height: 92vh; overflow: auto; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .5s var(--spring);
}
#modal.open .sheet { transform: none; }
.sheet::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: -.5rem auto 1rem; }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin-bottom: .2rem; }
.sheet.colored { border-top: 1px solid var(--sc, var(--accent)); }
@media (min-width: 640px) {
  #modal { place-items: center; padding: 1rem; }
  .sheet { border-radius: var(--radius); transform: translateY(24px) scale(.96); opacity: 0; transition: transform .45s var(--spring), opacity .25s; }
  #modal.open .sheet { opacity: 1; }
  .sheet::before { display: none; }
}
#toast {
  position: fixed; left: 50%; bottom: 6.5rem; z-index: 60; background: var(--ink); color: var(--bg); padding: .6rem 1.1rem; border-radius: 99px; font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow-lg); transform: translate(-50%, 24px) scale(.9); opacity: 0; pointer-events: none; transition: transform .4s var(--spring), opacity .25s;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 800px) { #toast { bottom: 2rem; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 1.25rem; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: var(--accent-soft); border-radius: var(--radius); padding: .55rem .6rem .55rem 1rem; margin-top: .75rem; font-size: .9rem;  }
.banner.warn { background: transparent; border: 1px solid var(--warn); color: var(--warn); }

/* settings personalisation */
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; margin: .2rem 0 1.25rem; }
.swatch { width: 44px; min-width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: var(--c); transition: transform .3s var(--spring), box-shadow .25s; padding: 0; }
.swatch:hover { transform: none; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--c); transform: none; }
.seg { display: inline-flex; background: var(--bg-2); padding: 3px; border-radius: var(--radius); gap: 2px; margin: .2rem 0 1.25rem; }
.seg button { border: 0; background: transparent; padding: .35rem .9rem; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .875rem; transition: background .16s, color .16s; }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.label { font-size: .8rem; font-weight: 500; color: var(--muted); margin: 0; }

/* loading splash */
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash img { width: 56px; height: 56px; border-radius: var(--radius);  box-shadow: var(--shadow); }

/* subject colours: hue set per class, tones derived */
.sc0 { --h: 150 } .sc1 { --h: 205 } .sc2 { --h: 22 } .sc3 { --h: 285 }
.sc4 { --h: 345 } .sc5 { --h: 45 } .sc6 { --h: 178 } .sc7 { --h: 235 }
:root [class^="sc"], :root [class*=" sc"] {
  --sc: hsl(var(--h), var(--subject-sat), var(--subject-lum));
  --sc-soft: hsl(var(--h), var(--subject-soft-sat), var(--subject-soft-lum));
  --sc-line: hsl(var(--h), var(--subject-sat), var(--subject-line-lum));
}

/* ============ keyframes ============ */








@keyframes spin { to { transform: rotate(360deg); } }






@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {  animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ============ calendar ============ */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }


.cal .dow { background: var(--surface-2); padding: .55rem .6rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.day { background: var(--surface); min-height: 104px; padding: .4rem; text-align: left; border: 0; display: flex; flex-direction: column; gap: 4px; transition: background .2s; min-width: 0; }
.day:hover { background: var(--accent-soft); }
.day.out { opacity: .42; } .day.we { background: var(--surface-2); }
.day .n { font-size: .8rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; transition: transform .3s var(--spring); }
.day:hover .n { transform: none; }
.day.today .n { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px -3px var(--accent-glow); }
.evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev { display: block; font-size: .68rem; line-height: 1.3; padding: 1px 6px; border-radius: 6px; background: var(--sc-soft); color: var(--sc); border-left: 1px solid var(--sc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .more { font-size: .68rem; color: var(--muted); padding-left: 6px; }
@media (max-width: 600px) {
  .day { min-height: 58px; align-items: center; padding: .3rem .1rem; }
  .evs { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .ev { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--sc); }
  .day .more { display: none; }
}
.evdots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 1px; }
.evdot { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); display: inline-block; }
.evname { display: block; font-weight: 500; font-size: .7rem; color: var(--sc, var(--muted)); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 600px) { .weeknav h2 { flex-basis: 100%; } }

/* ============ class tracker ============ */
.prow2 { display: flex; gap: .4rem; align-items: center; }
.prow2 input { min-height: 40px; }
.tgridwrap { overflow-x: auto; }
.tg { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.tg th, .tg td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; }
.tg tr > :last-child { border-right: 0; } .tg tbody tr:last-child > * { border-bottom: 0; }
.tg th.pup { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: .55rem .85rem; min-width: 118px; font-weight: 500; font-size: .92rem; box-shadow: 1px 0 0 var(--line); }
.tg thead th { background: var(--surface-2); vertical-align: bottom; min-width: 112px; max-width: 160px; }
.tg thead th.pup { background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.tg tbody tr:hover th.pup, .tg tbody tr:hover td { background: var(--accent-soft); }
.ah { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .6rem .7rem; transition: background .2s; }
.ah:hover { background: var(--accent-soft); }
.ah strong { display: block; font-size: .85rem; line-height: 1.25; overflow-wrap: anywhere; }
.ah span { display: block; font-size: .7rem; color: var(--muted); text-transform: capitalize; }
.ah .cnt { color: var(--accent); text-transform: none; font-weight: 500; margin-top: 2px; }
.st { width: 100%; height: 46px; border: 0; background: transparent; display: grid; place-items: center; transition: background .2s; }
.st svg { width: 24px; height: 24px; transition: transform .25s var(--spring); }
.st:hover svg { transform: none; } .st:active svg { transform: none; }

.st[data-s=pending], .lg[data-s=pending] { color: var(--muted); } .st[data-s=pending] { opacity: .45; }
.st[data-s=in], .lg[data-s=in] { color: var(--info); }
.st[data-s=marked], .lg[data-s=marked] { color: var(--success); }
.st[data-s=missing], .lg[data-s=missing] { color: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-top: .85rem; align-items: center; font-size: .8rem; }
.lg { display: inline-flex; align-items: center; gap: 5px; } .lg svg { width: 18px; height: 18px; }
.top .btn.primary { margin-bottom: .2rem; }

/* ============ command palette ============ */
.searchbtn { position: fixed; z-index: 11; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: var(--radius); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted);
  background: var(--surface);   box-shadow: var(--shadow); transition: transform .25s var(--spring), color .2s, border-color .2s; }
.searchbtn svg { width: 19px; height: 19px; }
.searchbtn:hover { color: var(--accent); border-color: var(--accent); transform: none; }
.searchbtn:active { transform: none; }
@media (max-width: 799px) { .shell { padding-top: 3.6rem; } }
.sheet.palette { padding: .5rem; max-width: 600px; }
.sheet.palette::before { display: none; }
@media (min-width: 640px) { #modal:has(.palette) { place-items: start center; padding-top: 12vh; } }
.pal-bar { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-bar svg { width: 20px; height: 20px; flex: none; }
.pal-bar input { border: 0; background: transparent; min-height: 44px; padding: 0; font-size: 1.05rem; color: var(--ink); box-shadow: none !important; }
.pal-bar input:focus { box-shadow: none; }
kbd { font: 500 .7rem var(--sans); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.pal-list { max-height: min(52vh, 420px); overflow-y: auto; padding: .4rem .1rem .1rem; }
.pal-item { display: flex; align-items: center; gap: .75rem; width: 100%; border: 0; background: transparent; text-align: left; padding: .6rem .7rem; border-radius: var(--radius); transition: background .12s; }
.pal-item[aria-selected=true], .pal-item:hover { background: var(--accent-soft); }
.pal-item .pi { width: 32px; height: 32px; border-radius: var(--radius); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); font-weight: 600; flex: none; }
.pal-item .pi svg { width: 18px; height: 18px; }
.pal-item .pt { flex: 1; min-width: 0; }
.pal-item strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ offline / sync status ============ */
#netbar { position: fixed; z-index: 12; top: 14px; left: 14px; max-width: calc(100vw - 84px); padding: .4rem .85rem; border-radius: 99px; font-size: .78rem; font-weight: 500;
  background: var(--surface);   border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--warn); transform: translateY(-14px); opacity: 0; pointer-events: none; transition: transform .4s var(--spring), opacity .25s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#netbar.show { transform: none; opacity: 1; }

.calcard { margin: 1.25rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.calcard h3 { margin-bottom: .25rem; }
.calcard input[readonly] { font-size: .8rem; text-overflow: ellipsis; }
.calcard summary { cursor: pointer; }

/* ============ lesson mode ============ */
body.lm-open { overflow: hidden; }
.lm { --sc: var(--accent); --sc-soft: var(--accent-soft); position: fixed; inset: 0; z-index: 35; background: var(--bg); overflow-y: auto;  padding: 0 clamp(1rem, 3vw, 2.5rem) 2rem; }



.lm-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1.4rem 0 .6rem; flex-wrap: wrap; }
.lm-top h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.lm-cls { font-family: var(--sans); font-size: .45em; font-weight: 600; color: var(--sc); background: var(--sc-soft); padding: .15em .6em; border-radius: 99px; vertical-align: .3em; }
.lm-body { display: grid; gap: 2rem; margin-top: 1rem; }
@media (min-width: 900px) { .lm-body { grid-template-columns: minmax(300px, 420px) 1fr; gap: 3rem; align-items: start; } }
.lm-clock { position: relative; width: min(78vw, 340px); aspect-ratio: 1; margin: 0 auto; }
.lm-clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lm-clock circle { fill: none; stroke-width: 5; }
.lm-clock .bg { stroke: var(--line); }
.lm-clock .fg { stroke: var(--sc); stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: calc(276.5 * (1 - var(--p, 0))); transition: stroke-dashoffset .6s linear; }
.lm-time { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.lm-time b { font-family: var(--serif); font-weight: 500; font-size: clamp(2.6rem, 9vw, 4.4rem); letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.lm-time span { color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.lm-act { margin-top: 1.8rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-sm); }
.lm-actclock { font-family: var(--serif); font-size: 3rem; font-variant-numeric: tabular-nums; margin: .1rem 0 .7rem; letter-spacing: -.02em; }
.lm-tabs { margin: 0 0 1.2rem; }
.lm-tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); min-height: 320px; }
.lm-pick { text-align: center; padding: 1rem 0 .4rem; }
.lm-name { font-family: var(--serif); font-size: clamp(3rem, 10vw, 6rem); line-height: 1.05; letter-spacing: -.03em; min-height: 1.2em; margin-bottom: 1.2rem; color: var(--sc); word-break: break-word; }
.lm-name.spinning { opacity: .55; filter: blur(.4px); }

.btn.big { min-height: 52px; padding: .7rem 1.6rem; font-size: 1.05rem; border-radius: var(--radius); }
.lm-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.lm-chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: .3rem .8rem; font-size: .88rem; transition: background .16s, color .16s; }
.lm-chip:hover { border-color: var(--accent); }
.lm-chip.away { opacity: .4; text-decoration: line-through; }
.lm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin: 1.2rem 0 0; }
.lm-group { background: var(--sc-soft); border-left: 1px solid var(--sc); border-radius: var(--radius); padding: .8rem 1rem;   }
.lm-group h3 { color: var(--sc); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .3rem; }
.lm-group ul { list-style: none; margin: 0; padding: 0; } .lm-group li { padding: .12rem 0; }
.lm-plan-title { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin-bottom: .8rem; }
.lm-text { white-space: pre-wrap; margin: 0 0 1rem; font-size: 1.05rem; }

/* ============ sunday sweep ============ */
.lm.sweep { background: var(--bg); }
.lm.sweep > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.sweep-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: .6rem; }
.sweep-progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: background .16s; }
.sweep-card { --sc: var(--accent); --sc-soft: var(--accent-soft); background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--sc); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);  }
.sweep-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; margin-bottom: 1rem; }
.sweep-sug { background: var(--sc-soft); border-radius: var(--radius); padding: 1rem 1.1rem; }
.sweep-sug-title { font-weight: 600; font-size: 1.1rem; margin: 0; }
.sweep-done { text-align: center; padding-top: 14vh; }
.sweep-done h1 { margin: 1rem 0 .5rem; }
.sweep-check { width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 2.6rem;  box-shadow: 0 16px 40px -10px var(--accent-glow); }
.sweep-done .btn { margin-top: 1.5rem; }
.sweep-nudge { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1.5rem; }

/* ============ reflections + countdown ============ */
.reflect { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1.5rem; box-shadow: var(--shadow-sm); }
.reflect.done { justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; }
.moods { display: flex; gap: .5rem; }
.mood { --mc: var(--accent); display: grid; justify-items: center; gap: 2px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: .5rem .85rem; color: var(--mc); transition: transform .25s var(--spring), background .2s, border-color .2s; }
.mood span { width: 30px; height: 30px; display: block; } .mood svg { width: 100%; height: 100%; }
.mood small { font-size: .72rem; color: var(--muted); }
.mood:hover { transform: none; border-color: var(--mc); background: var(--surface-2); }
.mood:active { transform: none; }
.mood.m3 { --mc: var(--success); } .mood.m2 { --mc: var(--caution); } .mood.m1 { --mc: var(--warn); }
.mood.set { border: 0; background: var(--surface-2);  padding: .5rem; border-radius: 50%; }
.feel { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.feel-day { display: grid; justify-items: center; gap: 2px; } .feel-day small { font-size: .7rem; color: var(--muted); }
.feel-day i { width: 28px; height: 28px; border-radius: 50%; display: block; border: 1.5px dashed var(--line); color: var(--mc, var(--muted)); }
.feel-day i svg { width: 100%; height: 100%; }
.feel-day i.m3 { --mc: var(--success); border: 0; } .feel-day i.m2 { --mc: var(--caution); border: 0; } .feel-day i.m1 { --mc: var(--warn); border: 0; }

/* ============ seating plan ============ */
@media (max-width: 520px) { .seat { font-size: .68rem; min-height: 46px; padding: .15rem; } .seatgrid { gap: .3rem; } .lm-tool { padding: 1rem; } }
.seating-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .seating-layout { grid-template-columns: 1fr 220px; align-items: start; } }
.seatwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }
.seatfront { text-align: center; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: .35rem; margin-bottom: .8rem; }
.seatgrid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: .5rem; }
.seat { min-height: 54px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: transparent; padding: .3rem; font-size: .82rem; font-weight: 500; line-height: 1.2; display: grid; place-items: center; text-align: center; overflow-wrap: anywhere; transition: transform .2s var(--spring), background .2s, border-color .2s; }
button.seat:hover { border-color: var(--accent); background: var(--accent-soft); }
.seat.taken { border-style: solid; background: var(--accent-soft); border-color: var(--line); }
.seat.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); transform: none; }
.unseated .lm-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lm-seat { color: var(--muted); margin: -.8rem 0 1rem; min-height: 1.4em; }

/* ============ day arc, chase list, checklist ============ */
.arc { margin: -.1rem 0 1rem; }
.arc-bar { position: relative; display: flex; gap: 3px; height: 40px; }
.arc-seg { min-width: 0; border-radius: var(--radius); display: grid; align-items: center; padding: 0 .45rem; font-size: .7rem; font-weight: 600; overflow: hidden; white-space: nowrap; }
.arc-seg span { overflow: hidden; text-overflow: ellipsis; }
.arc-seg.on { background: var(--sc-soft); color: var(--sc); border-bottom: 1px solid var(--sc); }
.arc-seg:not(.on):not(.gap) { background: var(--bg-2); border: 1px dashed var(--line); }
.arc-seg.gap { background: var(--bg); border-radius: 6px; opacity: .8; }
.arc-now { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.arc-now::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink);  }
.arc-times { display: flex; justify-content: space-between; margin-top: 6px; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.checklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1.5rem; box-shadow: var(--shadow-sm); }
.checks { display: grid; gap: .25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.check { display: flex; gap: .7rem; align-items: center; text-align: left; border: 0; background: transparent; border-radius: var(--radius); padding: .5rem .5rem; transition: background .2s; }
button.check:not(:disabled):hover { background: var(--accent-soft); }
.check i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--muted); display: grid; place-items: center; transition: all .3s var(--spring); }
.check.done i { background: var(--accent); border-color: var(--accent); }
.check.done i::after { content: ""; width: 11px; height: 11px; background: var(--accent-ink); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 18%, 86% 4%, 38% 72%); }
.check b { display: block; font-weight: 500; font-size: .92rem; } .check small { color: var(--muted); font-size: .78rem; }
.check.done b { color: var(--muted); text-decoration: line-through; }
.check:disabled { cursor: default; }

/* ============ phone: a denser Today header so the timetable starts higher ============ */
@media (max-width: 600px) {
  .hero { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: .3rem 1rem; padding-top: .6rem; }
  .hero > .row { display: contents; }
  .hero .ring { grid-column: 2; grid-row: 1; width: 66px; height: 66px; }
  .hero .ring .lbl b { font-size: 1.05rem; }
  .hero .ring .lbl span { display: none; }
  .hero .daynav { grid-column: 1 / -1; grid-row: 2; }
  .chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin-top: .8rem; }
  .chip { padding: .45rem .5rem; font-size: .72rem; min-width: 0; }
  .chip b { font-size: 1.15rem; }
  .status-line { margin-top: .35rem; }
}

/* lesson mode on a phone: compact countdown, then the tools you actually use mid-lesson, then the timer */
@media (max-width: 899px) {
  .lm-body { display: flex; flex-direction: column; gap: 1.1rem; margin-top: .4rem; }
  .lm-left { display: contents; }
  .lm-clock { order: 1; width: min(46vw, 180px); }
  .lm-time b { font-size: 2.1rem; }
  .lm-time span { font-size: .72rem; }
  .lm-right { order: 2; }
  .lm-act { order: 3; margin-top: 0; }
  .lm-top h1 { font-size: 1.7rem; }
}

.tomorrow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--accent); border-radius: var(--radius); padding: .9rem 1.2rem; margin-top: 1.5rem; box-shadow: var(--shadow-sm); }

.taskgroup { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .2rem; font-weight: 600; }
.taskgroup.warn { color: var(--warn); }
.task .star { font-size: 1.05rem; opacity: .55; } .task .star.on { color: var(--accent); opacity: 1; }
.task .x { padding: .25rem .45rem; }

.alsobox { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem .8rem; margin: 0 0 1rem; }
.alsobox legend { padding: 0 .3rem; }
.also { display: inline-flex; align-items: center; gap: .4rem; margin: .25rem 1rem .25rem 0; cursor: pointer; font-size: .92rem; }

/* ============ v12: board, one timer, PPA, cancelled lessons, files, groups ============ */
[hidden] { display: none !important; }

/* PPA and cancelled lessons */
.item.ppa { --sc: var(--muted); --sc-soft: transparent; border-style: dashed; background: var(--bg); }
.item.ppa .tag { background: var(--bg-2); color: var(--muted); }
.item.cancelled { --sc: var(--warn); border-style: dashed; background: transparent; opacity: .85; }
.item.cancelled strong s { color: var(--muted); }
.cell.ppa { background: var(--bg); box-shadow: none; }
.cell.ppa strong { color: var(--muted); letter-spacing: .06em; }
.cell.cx { opacity: .75; } .cell.cx strong s { color: var(--muted); } .cell .cxnote { color: var(--warn); font-weight: 500; }
.arc-seg.ppa { background: var(--bg); color: var(--muted); border-radius: var(--radius); }
.arc-seg.cx { background: transparent; border: 1px dashed var(--warn); color: var(--warn); text-decoration: line-through; }
.cxbanner { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin: .6rem 0; font-size: .9rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* lesson editor extras */
details.more { border-top: 1px solid var(--line); padding: .55rem 0 .1rem; }
details.more > summary { cursor: pointer; font-weight: 500; padding: .2rem 0 .5rem; }
details.more[open] > summary { margin-bottom: .2rem; }
.chipline { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .7rem; }
.chipline .lm-chip { text-align: left; font-size: .78rem; }
.filerow { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; }
.filerow a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reslist { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.reslist a.lm-chip { text-decoration: none; color: var(--ink); }
.swc-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .3rem; }
.swc { position: relative; display: block; }
.swc input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.swc i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sc, var(--bg-2)); border: 2px solid transparent; font-style: normal; font-size: .75rem; font-weight: 600; color: var(--muted); transition: transform .2s var(--spring); }
.swc:hover i { transform: none; }
.swc input:checked + i { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
.swc input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* groups inside a class */
.groupbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1.1rem; }
.groupbox .addtask { grid-template-columns: 1fr auto; margin-bottom: 0; }
.lm-chip .x { border: 0; background: transparent; color: var(--muted); padding: 0 0 0 .3rem; font-size: .8rem; }
.gsel { min-height: 40px; width: auto; max-width: 9.5rem; }
.prow2 input[data-pupil] { flex: 1; min-width: 0; }

/* card-first trial gate */
.gate { max-width: 460px; }
.gate-list { margin: .6rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* one timer: lesson mode */
.lm-time small { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; max-width: 13rem; margin-inline: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-activity .lm-clock .fg { stroke: var(--accent); }
.tm-done .lm-time b { color: var(--warn);  }

.lm-act { margin-top: 1.4rem; }
.tm-controls-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; }
.tm-custom { display: inline-flex; gap: .3rem; align-items: center; }
.tm-custom input { width: 4.6rem; min-height: 44px; padding: .2rem .5rem; }
.lm-stages { margin-top: 1.2rem; }
.stage { display: flex; gap: .7rem; align-items: baseline; width: 100%; text-align: left; padding: .55rem .8rem; margin-bottom: .35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .2s, background .2s; }
.stage b { min-width: 3.6rem; color: var(--muted); font-weight: 600; font-size: .8rem; }
.stage:hover { border-color: var(--sc); }
.stage.on { border-color: var(--sc); background: var(--sc-soft); }
.stage.on span { font-weight: 600; }

/* full-screen big-digits timer */
.tmfull { --sc: var(--accent); --sc-soft: var(--accent-soft); position: fixed; inset: 0; z-index: 37; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; padding: 2rem 1rem 6rem; background: var(--bg); }

.tmfull-label { margin: 0; font-size: clamp(1.2rem, 3.5vw, 2.6rem); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tmfull-digits { font-family: var(--serif); font-size: min(30vw, 42vh); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; font-weight: 500; }
.tmfull.tm-done .tmfull-digits { color: var(--warn);  }
.tmfull-sub { margin: 0; font-size: clamp(1rem, 2.4vw, 1.8rem); color: var(--muted); }
.tmfull-ctl { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; box-shadow: var(--shadow); }

/* the board */
.bd { --sc: var(--accent); --sc-soft: var(--accent-soft); position: fixed; inset: 0; z-index: 36; display: flex; flex-direction: column; background: var(--bg);  overflow: hidden; }

.bd-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: clamp(.8rem, 2.4vw, 2.2rem); gap: clamp(.5rem, 1.6vw, 1.4rem); }
.bd-head { display: flex; align-items: baseline; gap: 1.2rem; flex-wrap: wrap; }
.bd-head .eyebrow { margin: 0; order: 2; }
.bd-head h1 { font-size: clamp(1.4rem, 3vw, 2.6rem); margin: 0; }
.bd-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 30vw); gap: clamp(1rem, 3vw, 3rem); }
.bd-main { min-height: 0; overflow: auto; display: flex; flex-direction: column; justify-content: center; gap: .6rem; padding-right: .5rem; }
.bd-side { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.2rem; min-width: 0; }
.bd-timer { width: 100%; display: grid; place-items: center; }
.bd .lm-clock { width: min(100%, 44vh); }
.bd .lm-time b { font-size: clamp(2.4rem, 6.4vw, 7rem); }
.bd .lm-time span { font-size: clamp(.8rem, 1.4vw, 1.4rem); }
.bd .lm-time small { font-size: clamp(.75rem, 1.4vw, 1.3rem); max-width: 80%; }
.bd-now { text-align: center; max-width: 100%; }
.bd-nowlabel { margin: 0; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bd-nowtext { margin: .15rem 0 0; font-family: var(--serif); font-size: clamp(1.4rem, 2.8vw, 3rem); line-height: 1.15; color: var(--sc); overflow-wrap: anywhere; }
.bd-title { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 6vw, 5.2rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.bd-kicker { margin: .6rem 0 0; font-size: clamp(.85rem, 1.5vw, 1.4rem); letter-spacing: .12em; text-transform: uppercase; color: var(--sc); font-weight: 600; }
.bd-obj, .bd-entry { margin: 0; font-size: clamp(1.3rem, 3.2vw, 3.2rem); line-height: 1.25; white-space: pre-wrap; overflow-wrap: anywhere; }
.bd-entry { font-family: var(--serif); font-size: clamp(1.8rem, 4.6vw, 4.6rem); line-height: 1.15; }
.bd-items { margin: .6rem 0 0; padding-left: 1.4em; font-size: clamp(1.3rem, 3vw, 3rem); line-height: 1.35; }
.bd-items li { padding: .15em 0; overflow-wrap: anywhere; }
.bd-stages { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .4rem; }
.bd-stages button { display: flex; gap: .9rem; align-items: baseline; width: 100%; text-align: left; border: 2px solid transparent; background: transparent; border-radius: var(--radius); padding: .35rem .7rem; font-size: clamp(1.05rem, 2vw, 2rem); color: var(--muted); }
.bd-stages button b { min-width: 4.6em; font-size: .7em; font-weight: 600; }
.bd-stages button.on { border-color: var(--sc); background: var(--sc-soft); color: var(--ink); font-weight: 600; }
.bd-stages button.past { text-decoration: line-through; opacity: .55; }
.bd-slides { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .4rem; height: 100%; }
.bd-slides iframe { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.bd-slidenote { margin: 0; font-size: .8rem; color: var(--muted); }
.bd-empty { display: grid; justify-items: start; gap: .8rem; }
.bd-controls { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .9rem; width: max-content; max-width: calc(100vw - 24px); padding: .55rem .8rem; background: var(--surface);  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: opacity .35s, transform .35s; }
.bd-controls .seg { margin: 0; }
.bd-controls input[data-bd-label] { min-height: 44px; width: 13rem; padding: .2rem .6rem; }
.bd.bd-idle .bd-controls { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(14px); }
.bd.bd-idle { cursor: none; }
@media (max-width: 820px) {
  .bd-grid { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .bd-side { order: -1; flex-direction: row; justify-content: space-between; gap: 1rem; }
  .bd .lm-clock { width: min(40vw, 30vh); }
  .bd-stage { padding-bottom: 7rem; }
}

/* Working surfaces: rules, readable measures and stable controls. */
html { scroll-behavior: auto; }
body { transition: background .16s, color .16s; }
h1 { line-height: 1.16; }
h2 { font-size: var(--text-section); }
button, input, select, textarea { font-variant-numeric: tabular-nums; }
button, summary { min-height: 44px; }
input, textarea { caret-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
a { text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; top: 8px; left: -999px; z-index: 100; padding: .6rem 1rem; background: var(--surface); }
.skip:focus { left: 8px; }
.btn, .btn.primary, .btn.primary:hover, .btn:hover, .btn:active { box-shadow: none; transform: none; filter: none; }
.btn { border-color: var(--control-line); border-radius: 4px; transition: background .16s, border-color .16s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.btn.sm { min-height: 44px; border-radius: 4px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.loading::after { animation: spin .8s linear infinite; }
.field > span { color: var(--ink); font-size: .875rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], select, textarea { border-color: var(--control-line); border-radius: 4px; }
input:focus, textarea:focus, select:focus { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 2px; }
.card { border-radius: 8px; padding: 2rem; }
.card.wide { max-width: 860px; }
.auth-hero { border-right: 1px solid var(--line); }
.auth-hero h2 { font-size: 3.2rem; max-width: 13ch; }
.auth-hero .lede { opacity: 1; color: var(--muted); }
.mock { gap: 0; max-width: 100%; }
.mock div { margin: 0 !important; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 1rem 0; background: transparent; }
.mock small { opacity: 1; color: var(--muted); }
.auth-main .card { background: transparent; border: 0; }
.brand img { border-radius: 0; box-shadow: none; }
.tabs, .seg { border-radius: 4px; flex-wrap: wrap; }
.tabs button, .seg button { min-height: 44px; border-radius: 2px; }
.choice { border-radius: 4px; padding: .9rem 2rem .9rem .9rem; }
.choice:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.choice[aria-pressed=true] { box-shadow: none; }
.choice small { line-height: 1.4; }
.prow { grid-template-columns: minmax(0,1fr) 116px 116px 120px 44px; }
.prow input, .prow select { min-height: 44px; }
.app-wordmark { position: fixed; top: 15px; left: 24px; z-index: 12; display: flex; align-items: center; gap: .55rem; height: 44px; color: var(--ink); font-weight: 600; text-decoration: none; }
.app-wordmark img { width: 30px; height: 30px; }
.nav { border-radius: 0; box-shadow: none; background: var(--bg); width: 100%; left: 0; transform: none; bottom: 0; border: 0; border-top: 1px solid var(--line); padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); }
.navin { justify-content: center; gap: 0; max-width: 720px; margin: 0 auto; }
.nav .pill { display: none; }
.nav button { flex: 1; min-width: 0; min-height: 54px; border-radius: 0; border-top: 2px solid transparent; }
.nav button[aria-current=page] { color: var(--ink); border-color: var(--accent); }
.nav button[aria-current=page] svg { transform: none; }
.searchbtn { top: 15px; right: 24px; width: 44px; height: 44px; background: var(--bg); border-radius: 4px; }
.shell { max-width: 1120px; padding-top: 5rem; padding-left: 2rem; padding-right: 2rem; }
.top { padding: 1.75rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.hero { padding-top: 2rem; }
.eyebrow { font-size: .8125rem; letter-spacing: .035em; text-transform: none; color: var(--muted); }
.chips { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 0; padding: .75rem 0; }
.chip { border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 0 1.5rem; background: transparent; }
.chip:first-child { padding-left: 0; }
.chip:last-child { border-right: 0; }
.chip b { font-family: var(--sans); font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring { width: 68px; height: 68px; }
.ring circle { stroke-width: 3px; }
.ring .lbl b { font-size: 1.125rem; font-family: var(--sans); }
.section { margin-top: 1.75rem; }
.section > h2 { margin-bottom: .8rem; }
.list { gap: 0; }
.item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1rem .8rem; background: transparent; }
.item::before { width: 1px; background: var(--sc); top: 1rem; bottom: 1rem; }
button.item:hover { transform: none; box-shadow: none; background: var(--surface-2); }
button.item:hover::before { width: 1px; }
.item.now, button.item.now:hover { background: var(--sc-soft); box-shadow: none; border-color: var(--sc-line); }
.item.now::after { width: 6px; height: 6px; }
.item .time { min-width: 6.2rem; font-size: .8125rem; }
.item .body strong { font-size: 1rem; font-weight: 600; }
.item.minor, .item.free { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .65rem .8rem; }
.item.ppa { background: var(--surface-2); border-bottom-style: dashed; }
.item .bar { height: 2px; }
.tag { border-radius: 3px; padding: 3px 7px; font-size: .6875rem; }
.empty { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; justify-items: start; padding: 1rem 0; }
.empty svg { display: none; }
.gridwrap { border-radius: 2px; }
.grid th { padding: .8rem .6rem; }
.grid th.pl small { opacity: 1; }
.cell.filled { margin: 0; width: 100%; min-height: 84px; border-radius: 0; padding: .7rem .6rem; box-shadow: none; }
.cell.filled:hover { transform: none; box-shadow: none; outline: 1px solid var(--sc); outline-offset: -1px; }
.cell span { color: var(--ink); margin-top: .15rem; }
.cell.ppa { background: var(--surface-2); border: 1px dashed var(--line); }
.arc-seg, .arc-seg.ppa, .arc-seg.gap { border-radius: 2px; }
.arc-seg.gap { background: var(--bg-2); }
.arc-seg.on { border-bottom-width: 1px; }
.task { min-height: 62px; max-height: none; gap: .5rem; }
.task .t { background: none; }
.task.done .t { text-decoration: line-through; }
.task .x { opacity: 1; min-width: 44px; height: 44px; padding: .5rem; }
.task .x svg { width: 18px; height: 18px; vertical-align: middle; }
input[type=checkbox] { position: relative; width: 44px; height: 44px; border: 0; border-radius: 4px; margin: 0; background: transparent; }
input[type=checkbox]::before { content: ""; position: absolute; inset: 11px; border: 1.5px solid var(--muted); border-radius: 3px; }
input[type=checkbox]::after { position: absolute; left: 16px; top: 16px; }
input[type=checkbox]:checked { background: transparent; }
input[type=checkbox]:checked::before { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { transform: scale(1); }
.st[data-s=pending] { opacity: 1; }
.lm, .lm.sweep, .tmfull, .bd { background: var(--bg); }
.lm-top { border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; }
.lm-tool { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 1.5rem 0; background: transparent; }
.lm-act { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.lm-group { border-left: 0; border-top: 1px solid var(--sc); border-radius: 0; }
.lm-chip { min-height: 44px; border-radius: 4px; }
.lm-chip.away { opacity: 1; color: var(--muted); background: transparent; }
.lm-time b, .tmfull-digits { font-family: var(--sans); font-weight: 500; }
.sweep-card { border-left-width: 1px; border-radius: 4px; }
.sweep-nudge, .tomorrow, .reflect, .checklist { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 1.2rem 0; }
.seatwrap { border-radius: 4px; }
.sweep-check { border-radius: 4px; background: transparent; color: var(--accent); box-shadow: none; }
.day.out { opacity: 1; color: var(--muted); background: var(--bg-2); }
.day.out .n { font-weight: 400; }
.bd-controls, .tmfull-ctl { background: var(--surface); border-radius: 6px; }
.bd-head { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.sheet { border-radius: 12px 12px 0 0; transition: transform .18s, opacity .18s; }
#modal.open { background: rgba(20,24,18,.48); }
#toast { border-radius: 4px; max-width: calc(100vw - 32px); width: max-content; }
.swc i { width: 44px; height: 44px; }
.swatch, .swatch[aria-pressed=true] { transform: none; }
.doc { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.doc h1 { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.doc h2 { font-family: var(--serif); font-size: 1.5rem; margin: 2rem 0 .65rem; }
.doc p, .doc li { line-height: 1.75; }
.doc li { margin-bottom: .5rem; }
@media (min-width: 800px) {
  .nav { top: 0; bottom: auto; padding: 12px 80px; border-top: 0; border-bottom: 1px solid var(--line); }
  .nav button { min-height: 48px; border-top: 0; border-bottom: 2px solid transparent; padding: .5rem .8rem; }
  .shell { padding-top: 5.5rem; }
  .sheet { border-radius: 8px; }
}
@media (max-width: 1100px) and (min-width: 800px) { .app-wordmark span { display: none; } }
@media (max-width: 799px) { .app-wordmark { left: 20px; top: 10px; } .searchbtn { right: 20px; top: 10px; } .shell { padding: 4.5rem 1.25rem 6rem; } .hero { padding-top: .8rem; } }
@media (max-width: 600px) {
  h1 { font-size: 1.75rem; }
  .hero { grid-template-columns: minmax(0,1fr) auto; }
  .hero .ring { width: 50px; height: 50px; }
  .hero .ring .lbl b { font-size: .875rem; }
  .hero .daynav { margin: .6rem 0 .2rem; }
  .chips { gap: 0; padding: .8rem 0; }
  .chip { padding: 0 .65rem; font-size: .6875rem; }
  .chip b { font-size: 1rem; }
  .item { padding: .85rem .5rem; gap: .65rem; }
  .item .time { min-width: 4.8rem; font-size: .7rem; }
  .item .sub { font-size: .78rem; }
  .item .plan { font-size: .875rem; }
  .card { padding: 1.25rem; }
  .card.wide { border: 0; background: transparent; padding: .4rem; }
  .center { padding-top: 1.5rem; align-items: start; }
  .prow { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 44px; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
  .prow input[data-f=label] { grid-column: 1 / -1; }
  .prow input[data-f=start] { grid-column: 1; }
  .prow select { grid-column: 1 / 3; }
  .task { flex-wrap: wrap; }
  .task .t { flex: 1; min-width: 130px; }
  .task .t + .tag { margin-left: 44px; }
  .task .tag { flex-basis: auto; }
  .task .x { min-width: 44px; }
  .auth-hero { padding: 1.5rem; gap: 1.5rem; }
  .auth-hero h2 { font-size: 2rem; }
  .auth-main { padding: 1.5rem .5rem; }
  .lm-tabs { display: flex; }
  .lm-tabs button { padding: .4rem .6rem; flex: 1; }
  .lm-top > .row { flex-wrap: wrap; }
  .lm-time b { font-size: 2rem; }
  .lm-group { padding: .75rem; }
  .bd-controls { gap: .25rem; padding: .4rem; }
  .bd-stage { padding-bottom: 9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.ui-icon { vertical-align: middle; flex: none; }

@media (max-width: 899px) { .lm-stages { order: 4; } }
@media (max-width: 600px) {
  .hero { display: block; position: relative; }
  .hero h1 { max-width: calc(100% - 58px); }
  .hero > .row { display: flex; margin-top: .5rem; }
  .hero .ring { position: absolute; top: 2rem; right: 0; }
  .task { display: grid; grid-template-columns: 44px minmax(0,1fr) repeat(3,44px); gap: .15rem .25rem; padding: .5rem 0; }
  .task > input { grid-column: 1; grid-row: 1; }
  .task .t { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
  .task .tag, .task .t + .tag { grid-column: 2; grid-row: 2; margin: 0; justify-self: start; }
  .task [data-act=taskstar] { grid-column: 3; grid-row: 2; margin: 0; }
  .task [data-act=taskedit] { grid-column: 4; grid-row: 2; }
  .task [data-act=taskdel] { grid-column: 5; grid-row: 2; }
}

/* The phone control panel reserves its own height; lesson content scrolls above it. */
@media (max-width: 820px) {
  .bd-controls { position: relative; left: auto; bottom: auto; transform: none; width: 100%; max-width: none; max-height: 45%; flex: none; overflow-y: auto; border-width: 1px 0 0; border-radius: 0; padding-bottom: calc(.55rem + env(safe-area-inset-bottom)); }
  .bd.bd-idle .bd-controls { transform: none; }
  .bd-stage { padding-bottom: 1rem; overflow: hidden; }
  .bd-main { justify-content: flex-start; }
}
/* The selected marker uses the theme's ink, including in dark mode. */
.choice[aria-pressed=true]::after { background: none; width: 9px; height: 14px; top: 12px; right: 13px; border: solid var(--accent); border-width: 0 2px 2px 0; border-radius: 0; transform: rotate(45deg); }

/* Halfterm: an ink-bound desk diary. Warm pages, navy index, vermilion actions. */
body { transition: none; }
::selection { background: var(--accent-soft); color: var(--ink); }
input, textarea { caret-color: var(--accent); }
* { scrollbar-color: var(--control-line) var(--surface-2); scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.btn { font-size: .875rem; padding: .55rem 1rem; border-radius: 4px; transition: background .15s, color .15s, border-color .15s; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); filter: brightness(.92); text-decoration: none; }
.btn.sm { border-radius: 4px; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 12; width: 232px; padding: 30px 20px 22px; display: flex; flex-direction: column; background: var(--rail); color: var(--rail-ink); border: 0; }
.app-wordmark { position: static; display: flex; min-height: 44px; height: auto; gap: 10px; padding: 0 6px; margin: 0 0 35px; font: 600 1.9rem/1.1 var(--serif); letter-spacing: -.035em; color: var(--rail-ink); }
.app-wordmark img { width: 29px; height: 29px; }
.app-wordmark span { display: inline; }
.searchbtn { position: static; display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; height: 44px; padding: 0 11px; margin-bottom: 28px; border: 1px solid var(--rail-line); background: transparent; border-radius: 4px; color: var(--rail-muted); }
.searchbtn:hover { color: var(--rail-ink); border-color: var(--rail-muted); }
.searchbtn svg { width: 16px; height: 16px; flex: none; }
.searchbtn span { font-size: .75rem; white-space: nowrap; }
.searchbtn kbd { font: 400 .6875rem var(--sans); background: transparent; border: 0; padding: 0; color: inherit; margin-left: auto; white-space: nowrap; }
.nav { position: static; width: 100%; transform: none; background: transparent; border: 0; padding: 0; }
.navin { display: flex; flex-direction: column; gap: 7px; margin: 0; }
.nav button { display: flex; align-items: center; justify-content: flex-start; min-height: 49px; gap: 14px; padding: 12px 14px; font-size: .875rem; font-weight: 400; border: 0; border-radius: 4px; color: var(--rail-muted); flex: none; }
.nav button svg { width: 19px; height: 19px; }
.nav button:hover { background: #2b405b; color: var(--rail-ink); }
.nav button[aria-current=page] { background: #f5e8d8; color: #203249; font-weight: 600; border: 0; }
.nav button[aria-current=page] svg { color: #ad3d2b; }
.nav button:last-child { margin-top: 22px; }
.app-sidebar :focus-visible { outline-color: #f2a088; }
.sidebar-foot { margin-top: auto; padding: 24px 10px 0; color: var(--rail-muted); font-size: .75rem; line-height: 1.6; }
.sidebar-foot a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; color: var(--rail-ink); font-size: .8125rem; text-decoration: none; border-top: 1px solid var(--rail-line); margin-top: 16px; }
.sidebar-foot a:hover { text-decoration: underline; }
.shell { max-width: 1580px; margin: 0 0 0 232px; padding: 40px 48px 60px; min-width: 0; }
.shell h1 { font: 500 2.75rem/1.12 var(--serif); letter-spacing: -.035em; }
.top { padding: 4px 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.top .btn { flex: none; }
.today-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.date-title { display: flex; align-items: center; gap: 22px; }
.date-leaf { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; min-width: 72px; height: 86px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--accent); }
.date-leaf b { font: 500 2.5rem/1.05 var(--serif); letter-spacing: -.035em; font-variant-numeric: lining-nums tabular-nums; }
.date-leaf span { font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.today-heading h1 { font-size: 3.25rem; }
.today-greeting { font-size: .875rem; color: var(--muted); margin: 7px 0 0; }
.daynav { gap: 0; border: 1px solid var(--control-line); border-radius: 4px; flex: none; overflow: hidden; }
.daynav .btn { min-width: 44px; border: 0; border-radius: 0; background: var(--surface); }
.daynav .btn + .btn { border-left: 1px solid var(--line); }
.daynav .btn:hover { background: var(--surface-2); }
.day-summary { padding: 20px 0 23px; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.day-summary p { display: flex; flex-wrap: wrap; gap: 8px 0; font-size: .8125rem; color: var(--muted); margin: 0; line-height: 1.8; }
.day-summary b { color: var(--ink); font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 4px; }
.day-summary .summary-item { padding: 0 20px; border-left: 1px solid var(--line); }
.day-summary .summary-item:first-child { padding-left: 0; border: 0; }
.summary-percent { font-size: .75rem; font-variant-numeric: tabular-nums; }
.today-layout { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(290px,1fr); gap: 36px; }
.today-primary, .today-aside { min-width: 0; }
.day-work { background: var(--surface); border: 1px solid var(--line); }
.day-work-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; padding: 24px 26px 0; }
.day-work-head h2 { font: 500 1.65rem/1.2 var(--serif); letter-spacing: -.025em; }
.day-work-head > .btn { padding-inline: 5px; font-size: .75rem; margin-top: -6px; color: var(--muted); }
.status-line { font-size: .8125rem; margin: 7px 0 0; line-height: 1.5; }
.lesson-launch { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 26px 0; }
.lesson-launch .btn { font-size: .8125rem; }
.day-work .arc { margin: 22px 26px 20px; }
.arc-bar { height: 34px; gap: 3px; }
.arc-seg { border-radius: 2px; }
.arc-seg span { font-size: .6875rem; }
.arc-times { font-size: .6875rem; }
.timetable-list { gap: 0; border-top: 1px solid var(--line); }
.timetable-list .item { border-bottom: 1px solid var(--line); padding: 22px 26px; gap: 22px; }
.timetable-list .item::before { display: none; }
.timetable-list .item .time { min-width: 62px; width: 62px; font-size: .75rem; line-height: 1.6; padding: 1px 0 0; color: var(--muted); text-align: left; }
.timetable-list .time b { display: block; font-size: .9375rem; font-weight: 600; color: var(--ink); }
.timetable-list .time span { display: block; font-size: .75rem; }
.timetable-list .item .body strong { color: var(--sc,var(--ink)); font-size: 1.0625rem; gap: 6px; font-weight: 600; }
.timetable-list .item .sub { font-size: .75rem; margin-top: 5px; }
.timetable-list .item .plan { font-size: .875rem; line-height: 1.5; margin-top: 10px; color: var(--ink); }
.timetable-list .item .bar { margin-top: 12px; }
.timetable-list .item.minor { padding-block: 8px; font-size: .75rem; background: var(--surface-2); }
.timetable-list .item.minor .time { display: flex; gap: 5px; min-width: 100px; width: 100px; }
.timetable-list .item.minor .time b, .timetable-list .item.minor .time span { font-size: .6875rem; font-weight: 400; color: var(--muted); }
.timetable-list .item.minor .time span::before { content: "– "; }
.timetable-list .item.now { background: var(--sc-soft); }
.timetable-list .item.now::after { right: 14px; top: 16px; }
.timetable-list .item:last-child { border-bottom: 0; }
.timetable-list .item.free { padding-block: 19px; }
.timetable-list .item:hover { background: var(--sc-soft,var(--surface-2)); }
.today-aside > .section { margin: 0 0 30px; padding: 0; }
.today-aside h2 { display: flex; align-items: baseline; gap: 10px; font: 500 1.5rem/1.25 var(--serif); letter-spacing: -.02em; margin-bottom: 14px; }
.today-aside .section > h2::after { display: none; }
.today-aside .due-tasks { padding: 22px 24px 12px; background: var(--note); color: var(--note-ink); --ink: var(--note-ink); --muted: var(--note-muted); --line: var(--note-line); --control-line: var(--note-muted); }
.section-count { font: 500 .8125rem var(--sans); color: var(--muted); }
.today-aside .list { border-top: 1px solid var(--line); }
.today-aside .item { padding: 16px 0; }
.today-aside .item::before { display: none; }
.today-aside .item .body strong { font-size: .9375rem; }
.today-aside .item .sub { font-size: .75rem; line-height: 1.6; margin-top: 5px; }
.today-aside .tag { font-size: .6875rem; padding: 3px 6px; }
.today-aside .empty { font-size: .875rem; padding-top: 0; }
.today-aside .task { display: grid; grid-template-columns: 34px minmax(0,1fr) repeat(3,44px); column-gap: 0; padding: 8px 0; font-size: .875rem; }
.today-aside .task > input { grid-column: 1; grid-row: 1; margin-left: -9px; }
.today-aside .task .t { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
.today-aside .task .tag { grid-column: 2; grid-row: 2; margin: 0; justify-self: start; color: var(--muted); border-color: var(--line); }
.today-aside .task [data-act=taskstar] { grid-column: 3; grid-row: 2; margin: 0; }
.today-aside .task [data-act=taskedit] { grid-column: 4; grid-row: 2; margin: 0; }
.today-aside .task [data-act=taskdel] { grid-column: 5; grid-row: 2; margin: 0; }
.today-aside .lm-chips { gap: 5px; }
.today-aside .lm-chip { min-width: 44px; font-size: .75rem; padding: 5px 8px; background: var(--surface); }
.today-aside .lm-chips > .btn { font-size: .75rem; }
.today-events { border-bottom: 1px solid var(--line); padding-bottom: 8px !important; }
.today-events .list { border-top: 0; }
.today-events .item { padding-top: 0; }
.today-primary .checklist { margin-top: 28px; border-top: 0; padding: 0; }
.today-primary .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.today-primary .check { font-size: .8125rem; padding: 7px 0; }
.today-primary .check small { font-size: .75rem; }
.today-primary .checklist > .row strong { font-size: .875rem; }
.today-primary .sweep-progress { height: 2px; }
.weeknav { margin-bottom: 24px; gap: 8px; }
.weeknav h2 { font-family: var(--sans); font-size: 1rem; letter-spacing: -.02em; }
.gridwrap { border-radius: 4px; }
.grid th { background: var(--surface); font-size: .8125rem; padding-block: 18px; color: var(--ink); }
.grid th.today { background: var(--accent-soft); color: var(--ink); }
.grid th.pl { width: 94px; }
.grid th.pl small { color: var(--muted); font-size: .6875rem; margin-top: 5px; }
.cell.filled { min-height: 108px; background: var(--sc-soft); padding: 16px 12px; border-top: 0; }
.cell.today.filled { background: var(--sc-soft); outline: 1px solid var(--sc-line); outline-offset: -1px; }
.cell strong { font-size: .875rem; font-weight: 600; }
.cell span { font-size: .75rem; color: var(--ink); margin-top: 6px; }
.cell.filled:hover { outline: 2px solid var(--sc); outline-offset: -2px; }
.tgridwrap { background: var(--surface); border-radius: 4px; }
.tgrid th { background: var(--surface-2); }
.shell[data-view=classes] > .list { background: var(--surface); border: 1px solid var(--line); }
.shell[data-view=classes] > .list > .item { padding: 24px; }
.shell[data-view=classes] > .list > .item::before { display: none; }
.shell[data-view=classes] > .list > .item strong { font: 500 1.75rem var(--serif); letter-spacing: -.03em; }
.shell[data-view=settings] { max-width: 1120px; }
.shell[data-view=tasks] { max-width: 1320px; }
.month { background: var(--surface); }
.auth { min-height: 100vh; }
.auth-hero { background: var(--rail); color: var(--rail-ink); border: 0; padding: 48px; }
.brand { font: 600 1.85rem/1.1 var(--serif); letter-spacing: -.035em; }
.brand img { width: 30px; height: 30px; }
.auth-hero h2 { font: 500 4.5rem/1.02 var(--serif); letter-spacing: -.04em; max-width: 11ch; }
.auth-hero .lede { max-width: 28ch; margin-top: 24px; color: var(--rail-muted); font-size: 1rem; line-height: 1.7; }
.auth-footnote { font-size: .8125rem; margin: 0; color: var(--rail-muted); }
.auth-main .card { max-width: 480px; padding: 32px; }
.auth-main h1 { font-family: var(--serif); letter-spacing: -.03em; }
.auth-main .tabs { margin-block: 24px; background: transparent; border-bottom: 1px solid var(--line); padding: 0; border-radius: 0; }
.auth-main .tabs button { border-bottom: 2px solid transparent; border-radius: 0; }
.auth-main .tabs button[aria-selected=true] { background: transparent; border-color: var(--accent); }
.card.wide { border-radius: 0; border-top: 3px solid var(--accent); padding: 36px; background: var(--surface); }
.wiz-body h1 { font-family: var(--serif); letter-spacing: -.03em; }
.lm-top h1, .sweep-top h1 { font-family: var(--serif); }
.lm { padding-top: 24px; }
.lm-tool { background: var(--surface); padding: 24px; border: 1px solid var(--line); }
.lm-stages { background: var(--surface-2); padding: 24px; border: 0; }
.lm-act { border: 0; padding-inline: 0; }
.bd-head .bd-subj { font-family: var(--serif); }
.doc h1 { font-family: var(--serif); font-size: 2.75rem; letter-spacing: -.035em; }
.doc h2 { font-family: var(--serif); font-size: 1.5rem; }
@media (min-width: 1920px) { .shell { margin-right: auto; margin-left: calc(232px + (100vw - 1920px)/2); } }
@media (max-width: 1280px) and (min-width: 800px) {
 .app-sidebar { width: 196px; padding-inline: 14px; }
 .app-wordmark { font-size: 1.65rem; gap: 7px; padding-left: 4px; }
 .app-wordmark img { width: 24px; height: 24px; }
 .searchbtn kbd { display: none; }
 .shell { margin-left: 196px; padding: 30px 28px 48px; }
 .today-layout { grid-template-columns: minmax(0,1.5fr) minmax(270px,1fr); gap: 24px; }
 .timetable-list .item { padding: 19px 20px; gap: 16px; }
 .day-work-head { padding-inline: 20px; flex-wrap: wrap; }
 .day-work-head > .btn { margin: -4px 0 0; }
 .lesson-launch { padding-inline: 20px; }
 .lesson-launch .btn { font-size: .75rem; padding-inline: 8px; }
 .day-work .arc { margin-inline: 20px; }
 .today-primary .checks { grid-template-columns: 1fr; }
 .today-aside .due-tasks { padding-inline: 18px; }
 .today-heading h1 { font-size: 2.75rem; }
 .date-title { gap: 16px; }
}
@media (max-width: 1000px) and (min-width: 800px) {
 .today-layout { display: block; }
 .today-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 32px; }
 .today-primary .checks { grid-template-columns: 1fr 1fr; }
 .day-summary .summary-item { padding-inline: 12px; }
}
@media (max-width: 799px) {
 .app-sidebar { inset: 0 0 auto; width: 100%; height: 68px; padding: 0 20px; flex-direction: row; align-items: center; justify-content: space-between; }
 .app-wordmark { margin: 0; padding: 0; font-size: 1.7rem; gap: 8px; }
 .app-wordmark img { width: 25px; height: 25px; }
 .searchbtn { width: 44px; height: 44px; margin: 0; padding: 0; justify-content: center; background: transparent; border: 0; }
 .searchbtn svg { width: 20px; height: 20px; }
 .searchbtn span, .searchbtn kbd, .sidebar-foot { display: none; }
 .nav { position: fixed; inset: auto 0 0; background: var(--rail); border-top: 1px solid var(--rail-line); padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); }
 .navin { flex-direction: row; gap: 3px; justify-content: space-between; }
 .nav button { flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 0; font-size: .625rem; }
 .nav button svg { width: 18px; height: 18px; }
 .nav button:last-child { margin: 0; }
 .nav button[aria-current=page] { border: 0; padding-top: 6px; }
 .shell { margin: 0; padding: 96px 24px 100px; max-width: none; }
 .shell[data-view=settings], .shell[data-view=tasks] { max-width: none; }
 .shell h1 { font-size: 2.5rem; }
 .today-layout { display: block; }
 .today-aside { margin-top: 28px; }
 .today-aside > .section { margin-bottom: 28px; }
 .today-heading { gap: 16px; align-items: center; flex-wrap: wrap; }
 .date-title { gap: 16px; }
 .date-leaf { width: 60px; min-width: 60px; height: 72px; }
 .date-leaf b { font-size: 2.15rem; }
 .today-greeting { font-size: .8125rem; }
 .day-summary { padding-block: 18px; margin-bottom: 22px; }
 .day-summary p { font-size: .75rem; }
 .day-summary .summary-item { padding-inline: 13px; }
 .timetable-list .item { padding: 20px; gap: 16px; }
 .day-work-head { padding: 20px 20px 0; }
 .day-work-head h2 { font-size: 1.5rem; }
 .lesson-launch { padding: 14px 20px 0; }
 .day-work .arc { margin-inline: 20px; }
 .today-aside .due-tasks { padding: 22px 20px 12px; }
 .auth-hero { padding: 28px; gap: 40px; }
 .auth-hero h2 { font-size: 3rem; max-width: none; }
 .auth-hero h2 br { display: none; }
 .auth-hero .lede { max-width: 35ch; font-size: .9375rem; margin-top: 16px; }
 .auth-footnote { display: none; }
 .auth-main { padding: 16px 4px 40px; }
 .auth-main .card { padding: 24px; }
 .card.wide { padding: 22px; }
 .top { padding-top: 0; }
 .lm-tool, .lm-stages { padding: 18px; }
}
@media (max-width: 480px) {
 .shell { padding-inline: 18px; }
 .today-heading { gap: 20px; }
 .today-heading .daynav { display: inline-flex; margin: 0; }
 .day-summary { padding-top: 18px; }
 .day-summary p { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
 .day-summary .summary-item { padding: 0; border: 0; }
 .day-work { margin-inline: -18px; border-left: 0; border-right: 0; }
 .day-work-head { flex-wrap: wrap; align-items: baseline; }
 .day-work-head > .btn { padding-inline: 0; margin: -4px 0 0; font-size: .75rem; }
 .status-line { font-size: .75rem; }
 .timetable-list .item .time { width: 52px; min-width: 52px; }
 .timetable-list .item .body strong { font-size: 1rem; }
 .timetable-list .item .sub { font-size: .6875rem; }
 .timetable-list .item .plan { font-size: .8125rem; }
 .timetable-list .item .tag { font-size: .6875rem; }
 .today-primary .checks { grid-template-columns: 1fr; }
 .card.wide { border-left: 0; border-right: 0; padding-inline: 12px; background: transparent; }
 .weeknav h2 { flex-basis: 100%; font-size: .9375rem; margin-bottom: 10px; }
 .doc { padding-top: 2rem; }
 .doc h1 { font-size: 2.25rem; }
}
@media (min-width: 800px) { .app-sidebar { overflow-y: auto; } }

/* The planning desk: a quiet canvas with distinct, responsive workspaces. */
:root { --motion-fast: 120ms; --motion-ui: 220ms; --ease-out: cubic-bezier(.16,1,.3,1); }
.btn, .x, .lm-chip { transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast); }
.btn:active, .rail-create:active, .sheet-close:active { transform: scale(.97); }
.btn { border-radius: 7px; }
.app-sidebar { padding-top: 25px; }
.app-wordmark { margin-bottom: 27px; }
.rail-tools { display: grid; gap: 10px; margin-bottom: 30px; }
.rail-create { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border: 1px solid #f5e8d8; border-radius: 8px; background: #f5e8d8; color: #203249; font-weight: 600; font-size: .875rem; transition: transform var(--motion-fast), background var(--motion-fast); }
.rail-create:hover { background: #fff4e7; }
.rail-tools .searchbtn { margin: 0; border-radius: 8px; }
.navin { position: relative; gap: 5px; }
.nav button { position: relative; z-index: 1; min-height: 47px; border-radius: 7px; transition: color var(--motion-ui), background var(--motion-fast); }
.nav .pill { display: block; background: #f5e8d8; border-radius: 7px; transition: transform 300ms var(--ease-out); }
.navin.indicator-ready button[aria-current=page] { background: transparent; }
.sidebar-foot { padding: 20px 0 0; }
.sidebar-foot a { padding: 8px 10px; margin-top: 0; border-bottom: 1px solid var(--rail-line); }
.profile-switch { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--rail-ink); width: 100%; text-align: left; padding: 17px 5px 0; min-height: 60px; }
.profile-initials { width: 36px; height: 36px; display: grid; place-items: center; flex: none; background: #354b66; border-radius: 50%; color: #f5e8d8; font-size: .75rem; font-weight: 600; }
.profile-switch strong { display: block; font-size: .8125rem; font-weight: 500; }
.profile-switch small { display: block; color: var(--rail-muted); font-size: .625rem; margin-top: 2px; }
.shell { padding-top: 34px; }
.today-heading h1 { font-size: 3rem; }
.date-leaf { border-radius: 0 0 8px 8px; border-top-width: 1px; position: relative; overflow: hidden; padding-top: 7px; transform-origin: center top; }
.date-leaf::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: var(--accent); }
.day-strip { display: grid; grid-template-columns: repeat(7,minmax(44px,1fr)); gap: 6px; margin-top: 28px; overflow-x: auto; padding: 3px; scrollbar-width: none; }
.day-strip button { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); transition: background var(--motion-ui), color var(--motion-ui), border-color var(--motion-ui); }
.day-strip span { font-size: .75rem; }
.day-strip b { font: 500 1.3rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink); }
.day-strip button:hover { background: var(--surface-2); border-color: var(--control-line); }
.day-strip [aria-current=date] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day-strip [aria-current=date] b { color: inherit; }
.day-strip [aria-current=date]:hover { background: var(--ink); }
.day-strip i { position: absolute; bottom: 7px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.day-summary { padding: 18px 3px 21px; margin-bottom: 23px; }
.today-layout { gap: 28px; }
.day-work { border-radius: 12px; overflow: hidden; }
.timetable-list .item { position: relative; padding-block: 19px; transition: background var(--motion-ui); }
.timetable-list .item .body { min-width: 0; }
.lesson-open { display: grid; place-items: center; width: 28px; height: 28px; flex: none; align-self: center; margin-left: auto; color: var(--muted); transition: transform var(--motion-ui), color var(--motion-ui); }
.lesson-open svg { width: 15px; height: 15px; }
.timetable-list .item:hover .lesson-open { transform: translateX(4px); color: var(--sc,var(--ink)); }
.timetable-list .item.is-editing { background: var(--sc-soft); box-shadow: inset 3px 0 var(--sc); }
.today-aside .due-tasks { border-radius: 12px; padding-top: 16px; }
.margin-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.margin-heading h2 { margin: 0; }
.margin-heading > button { padding: 0; min-width: 44px; color: var(--note-ink); }
.shell[data-view=classes] > .list, .month { border-radius: 10px; overflow: hidden; }
.gridwrap, .tgridwrap { border-radius: 10px; overflow-x: auto; }
.shell[data-view=tasks] .addtask { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; }

/* One overlay system. Layout is final immediately; WAAPI adds optional continuity. */
body.dialog-open, body.confirm-open { overflow: hidden; }
#modal, #modal:has(.palette) { padding: 24px; place-items: center; background: rgba(12,23,39,.42); transition: none; }
#modal.closing { pointer-events: none; background: transparent; }
#modal .sheet { display: flex; flex-direction: column; max-width: 560px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transform: none; opacity: 1; transition: none; box-shadow: 0 24px 80px #0b172b38; }
#modal .sheet::before { display: none; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex: none; padding: 26px 26px 21px; border-bottom: 1px solid var(--line); }
.sheet-title { min-width: 0; }
.sheet-heading h2 { font: 500 1.8rem/1.15 var(--serif); letter-spacing: -.025em; margin: 0; }
.sheet-heading p { margin: 8px 0 0; line-height: 1.65; font-size: .75rem; }
.sheet-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); margin: -6px -7px 0 0; transition: background var(--motion-fast), transform var(--motion-fast); }
.sheet-close:hover { background: var(--surface-2); color: var(--ink); }
.sheet-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 26px; }
.sheet-body form { margin: 0; }
.sheet-body input:not([type=checkbox]):not([type=file]), .sheet-body textarea, .sheet-body select { border-radius: 7px; background: var(--bg); font-size: .9375rem; transition: border-color var(--motion-fast), box-shadow var(--motion-fast); }
.sheet-body textarea { line-height: 1.65; }
.sheet-body .field > span { font-size: .75rem; font-weight: 600; margin-bottom: 8px; }
.sheet-actions { position: sticky; bottom: -24px; background: var(--surface); border-top: 1px solid var(--line); padding: 16px 0 0; margin-top: 24px; z-index: 2; }
.sheet-actions .btn { font-size: .8125rem; }
.sheet-actions kbd { margin-left: 12px; font-size: .6875rem; opacity: .8; border: 0; background: transparent; color: inherit; }
#modal[data-kind=lesson] { place-items: stretch end; padding: 12px; }
#modal[data-kind=lesson] .sheet { max-width: 656px; height: calc(100vh - 24px); height: calc(100dvh - 24px); max-height: none; }
#modal[data-kind=lesson] .sheet-heading { background: var(--sc-soft,var(--surface-2)); padding: 28px; }
#modal[data-kind=lesson] .sheet-heading h2 { color: var(--sc,var(--ink)); font-size: 2rem; }
#modal[data-kind=lesson] .sheet-close { background: var(--surface); }
#modal[data-kind=lesson] .sheet-body { padding: 0; display: flex; flex: 1; overflow: hidden; }
#modal[data-kind=lesson] form { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.editor-tabs { display: flex; flex: none; gap: 26px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.editor-tabs button { padding: 17px 0 14px; min-width: 44px; min-height: 52px; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: .8125rem; color: var(--muted); white-space: nowrap; transition: border-color var(--motion-ui), color var(--motion-ui); }
.editor-tabs [aria-selected=true] { border-bottom-color: var(--sc,var(--accent)); color: var(--sc,var(--ink)); font-weight: 600; }
.editor-panel { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 26px 28px 12px; }
.editor-panel[hidden] { display: none; }
.editor-panel .field { margin-bottom: 22px; }
.editor-panel .more { padding: 0 0 18px; margin: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.editor-panel .more summary { min-height: 48px; padding-block: 12px; font-size: .875rem; }
.editor-panel .more summary span { display: block; margin: 5px 0 0 16px; font-size: .6875rem; }
.editor-panel .more .field { margin-top: 16px; }
.lesson-tools { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.lesson-tools .btn { background: transparent; font-size: .75rem; }
#modal[data-kind=lesson] .sheet-actions { flex: none; position: static; padding: 18px 28px; margin: 0; box-shadow: 0 -6px 20px #0b172b04; }
#modal[data-kind=lesson] .sheet-actions > .btn { padding-inline: 0; border-color: transparent; background: transparent; }
#modal[data-kind=lesson] form[data-ppa] { padding: 24px 28px 0; overflow-y: auto; }
#modal[data-kind=lesson] form[data-ppa] .sheet-actions { margin-top: auto; padding-inline: 0; }
#modal[data-kind=lesson] .cxbanner { margin: 0; border-radius: 0; flex: none; padding: 12px 28px; }
.create-list { display: grid; gap: 3px; margin: -6px; }
.create-list button { display: flex; align-items: center; gap: 18px; width: 100%; padding: 17px 10px; background: none; border: 0; border-radius: 8px; text-align: left; color: var(--ink); transition: background var(--motion-fast); }
.create-list button:hover { background: var(--surface-2); }
.create-list button > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.create-list button > svg:last-child { margin-left: auto; width: 15px; color: var(--muted); }
.create-list strong { display: block; font-weight: 500; font-size: .9375rem; }
.create-list small { display: block; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.quick-priority { font-size: .875rem; }
#modal[data-kind=search] { place-items: start center; padding-top: max(24px,12vh); }
#modal .sheet.palette { max-width: 680px; }
.palette .sheet-body { padding: 0; }
.pal-bar { padding: 13px 20px; gap: 15px; }
.pal-bar input { background: transparent !important; font-size: 1rem !important; }
.pal-list { padding: 9px; max-height: min(56vh,480px); }
.pal-item { padding: 12px; gap: 14px; border-radius: 8px; }
.pal-item .pi { width: 38px; height: 38px; border: 0; border-radius: 8px; color: var(--ink); }
.pal-item strong { font-size: .875rem; }
.pal-item small { font-size: .6875rem; margin-top: 3px; }
.pal-hint { padding: 12px 20px; margin: 0; border-top: 1px solid var(--line); background: var(--surface-2); }
#confirmation { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 24px; background: rgba(12,23,39,.5); }
#confirmation[hidden] { display: none; }
.confirm-sheet { width: 100%; max-width: 420px; background: var(--surface); color: var(--ink); padding: 28px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 80px #0b172b38; }
.confirm-symbol { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 22px; }
.confirm-sheet h2 { font: 500 1.8rem/1.2 var(--serif); letter-spacing: -.025em; margin: 0 0 12px; }
.confirm-sheet p { font-size: .875rem; line-height: 1.7; color: var(--muted); margin: 0 0 25px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-actions .btn { flex: 1; font-size: .8125rem; }
#toast { display: flex; align-items: center; gap: 12px; padding: 5px 6px 5px 16px; min-height: 54px; border-radius: 11px; background: var(--ink); color: var(--bg); border: 1px solid var(--control-line); font-size: .8125rem; transform: translate(-50%,8px); transition: opacity 150ms, transform 150ms; }
#toast.show { pointer-events: auto; }
.toast-symbol { display: grid; place-items: center; flex: none; }
.toast-dismiss { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; border-radius: 7px; }
.toast-dismiss:hover { background: #ffffff1a; }
@media (max-width: 1280px) and (min-width: 800px) {
 .day-strip button { gap: 7px; }
 .today-layout { gap: 20px; }
 .lesson-open { width: 18px; }
}
@media (max-width: 799px) {
 .app-sidebar { padding-top: 0; }
 .app-wordmark { margin-bottom: 0; }
 .rail-tools { display: flex; align-items: center; gap: 7px; margin: 0; }
 .rail-create { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-color: var(--rail-line); background: transparent; color: var(--rail-ink); }
 .rail-create:hover { background: #354b66; }
 .rail-create span { display: none; }
 .rail-tools .searchbtn { border: 0; }
 .nav button { min-height: 52px; }
 .shell { padding-top: 94px; }
 .today-heading h1 { font-size: 2.5rem; }
 .day-strip { gap: 5px; margin-top: 22px; }
 .day-strip button { min-height: 68px; flex-direction: column; gap: 6px; }
 .day-strip span { font-size: .625rem; }
 .day-strip b { font-size: 1.25rem; }
 .day-summary { padding-block: 16px; }
 .sidebar-foot { display: none; }
}
@media (max-width: 699px) {
 #modal, #modal:has(.palette), #modal[data-kind=lesson] { padding: 0; place-items: end center; }
 #modal .sheet, #modal[data-kind=lesson] .sheet { max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
 #modal[data-kind=lesson] .sheet { height: calc(100vh - 24px); height: calc(100dvh - 24px); }
 .sheet-heading, #modal[data-kind=lesson] .sheet-heading { padding: 22px 20px 18px; }
 .sheet-heading h2, #modal[data-kind=lesson] .sheet-heading h2 { font-size: 1.6rem; }
 .sheet-heading p { font-size: .6875rem; }
 .sheet-close { margin-right: -3px; }
 .sheet-body { padding: 20px; }
 .sheet-body input:not([type=checkbox]):not([type=file]), .sheet-body textarea, .sheet-body select { font-size: 1rem; }
 .sheet-actions { bottom: -20px; padding-top: 14px; }
 .sheet-actions kbd { display: none; }
 .editor-tabs { padding: 0 20px; gap: 24px; }
 .editor-tabs button { font-size: .75rem; }
 .editor-panel { padding: 22px 20px 12px; }
 #modal[data-kind=lesson] .sheet-actions { padding: 12px 20px; gap: 8px; }
 #modal[data-kind=lesson] .sheet-actions .btn { padding-inline: 11px; font-size: .75rem; }
 #modal[data-kind=lesson] .sheet-actions > .btn { font-size: .6875rem; padding-inline: 0; }
 #modal[data-kind=search] { place-items: start center; padding: 12px; padding-top: max(12px,env(safe-area-inset-top)); }
 #modal .sheet.palette { border-radius: 14px; border-bottom: 1px solid var(--line); }
 .pal-bar { padding: 9px 14px; }
 #confirmation { padding: 20px; }
 .confirm-sheet { padding: 24px; }
 .confirm-actions { flex-wrap: wrap; }
 .confirm-actions .btn { min-width: 110px; }
}
@media (max-width: 480px) {
 .day-work { border-radius: 0; }
 .lesson-open { width: 15px; margin-left: 0; }
 .timetable-list .item { gap: 12px; }
 .day-strip { margin-inline: -3px; }
 .shell[data-view=tasks] .addtask { padding: 12px; }
 #modal[data-kind=lesson] .sheet-actions { flex-wrap: wrap; }
 #modal[data-kind=lesson] .sheet-actions > .row { margin-left: auto; }
}
