/* Markov.ink onboarding and learning home.
   Loaded only by onboarding.html and learn.html. Nothing here reaches the
   landing page, whiteboard, or deck. */

:root {
  --paper: #F6FAFD;
  --paper-2: #EDF3F9;
  --card: #FFFFFF;
  --ink: #0A1929;
  --ink-2: #1A2B40;
  --soft: #3F5366;
  --muted: #56667A;
  --hair: #DDE7F2;
  --hair-strong: #C3D3E4;
  --blue: #0284C7;
  --blue-bright: #0EA5E9;
  --royal: #2563EB;
  --mist: #E0F2FE;
  --pen-red: #C8313A;
  --demo: #8A3D0A;
  --demo-bg: #FFF6EC;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(10, 25, 41, .05), 0 6px 18px rgba(10, 25, 41, .05);
  --shadow-lift: 0 2px 4px rgba(10, 25, 41, .06), 0 14px 30px rgba(10, 25, 41, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-area="math"] { --accent: #2563EB; --accent-soft: #EAF0FE; --accent-ink: #1D4ED8; }
[data-area="science"] { --accent: #0E7C6B; --accent-soft: #E3F4F0; --accent-ink: #0B6657; }
[data-area="language"] { --accent: #B4530F; --accent-soft: #FCEFE4; --accent-ink: #92400E; }
[data-area="custom"] { --accent: #475569; --accent-soft: #EEF2F6; --accent-ink: #334155; }

*, *::before, *::after { box-sizing: border-box; }

body.mk {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(10, 25, 41, .07) 1px, transparent 1.2px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.mk a { color: var(--royal); }
.mk button, .mk input, .mk select { font: inherit; color: inherit; }
.mk :focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 2px; border-radius: 8px; }
.mk [tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex: none; }
.glyph { width: 30px; height: 30px; flex: none; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Wordmark and top bar ---------- */

.wordmark { display: inline-flex; align-items: baseline; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink) !important; }
.wm-dot { color: var(--blue-bright); }
.wm-ink { color: var(--blue); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(246, 250, 253, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.topbar .spacer { flex: 1; }
.toplink {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--soft) !important; text-decoration: none; font-size: 14px; font-weight: 500;
  background: none; border: 0; cursor: pointer;
}
.toplink:hover { background: var(--paper-2); color: var(--ink) !important; }

/* progress: one segment per step, filled with ink */
.progress { flex: 1; max-width: 420px; margin: 0 auto; display: flex; gap: 6px; align-items: center; }
.progress-seg { flex: 1; height: 4px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.progress-seg i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .35s var(--ease); }
.progress-seg.done i, .progress-seg.current i { width: 100%; }
.progress-seg.current i { background: var(--blue); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff !important; }
.btn-primary:hover { background: #12304F; }
.btn-ghost { background: var(--card); border-color: var(--hair-strong); color: var(--ink) !important; }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-quiet { background: none; color: var(--royal) !important; padding: 0 10px; min-height: 44px; }
.btn-quiet:hover { background: var(--mist); }
.btn-danger { background: none; color: var(--pen-red) !important; padding: 0 10px; min-height: 44px; }
.btn-danger:hover { background: #FDECEC; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Notes and badges ---------- */

.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius); background: var(--mist);
  border: 1px solid #BAE6FD; color: var(--ink-2); font-size: 14px;
}
.note .icon { margin-top: 2px; color: var(--blue); }
.note.warn { background: #FFF8EB; border-color: #F6D9A8; }
.note.warn .icon { color: #B45309; }
.note p { margin: 0; }
.note strong { font-weight: 600; }

.badge-demo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; border: 1.5px dashed #D8A06C;
  background: var(--demo-bg); color: var(--demo);
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--soft);
}
.tag .icon { width: 14px; height: 14px; }
.tag.school { background: #E8EEF8; color: #1E3A8A; }

/* ---------- Onboarding layout ---------- */

.flow { min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.flow-main { flex: 1; padding: clamp(28px, 6vh, 64px) clamp(16px, 4vw, 40px) 40px; }
.step { max-width: 640px; margin: 0 auto; }
.step.wide { max-width: 1000px; }
.step-enter { animation: stepIn .28s var(--ease) both; }
.step-enter.back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

.q {
  margin: 10px 0 0; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12;
  font-weight: 750; letter-spacing: -.028em; color: var(--ink); max-width: 22ch;
}
.step.wide .q { max-width: 26ch; }
.lede { margin: 14px 0 0; font-size: 17px; color: var(--soft); max-width: 54ch; }
.step-body { margin-top: 32px; }

.actionbar {
  position: sticky; bottom: 0; z-index: 10;
  background: rgba(246, 250, 253, .94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--hair);
  padding: 12px clamp(16px, 4vw, 40px) calc(12px + env(safe-area-inset-bottom));
}
.actionbar-inner { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.actionbar .grow { flex: 1; }
.actionbar .hint { font-size: 13px; color: var(--muted); }

.field-error {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  color: var(--pen-red); font-size: 14px; font-weight: 500;
}
.field-error[hidden] { display: none; }

/* text input */
.big-input {
  width: 100%; min-height: 64px; padding: 0 20px; border-radius: 16px;
  border: 1.5px solid var(--hair-strong); background: var(--card);
  font-size: 24px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.big-input::placeholder { color: #9AA8B8; font-weight: 500; }
.big-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(14, 165, 233, .18); }
.big-input[aria-invalid="true"] { border-color: var(--pen-red); }
.input-help { margin: 10px 2px 0; font-size: 14px; color: var(--muted); }

.select {
  width: 100%; min-height: 52px; padding: 0 44px 0 16px; border-radius: 12px;
  border: 1.5px solid var(--hair-strong); background: var(--card); font-size: 16px; font-weight: 500;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233F5366' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(14, 165, 233, .18); }
.label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 8px; }
.field + .field { margin-top: 22px; }
.text-input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px;
  border: 1.5px solid var(--hair-strong); background: var(--card); font-size: 16px;
}
.text-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(14, 165, 233, .18); }

/* ---------- Choice cards (radio) ---------- */

.choices { display: grid; gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-body {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px; border-radius: 16px; background: var(--card);
  border: 1.5px solid var(--hair); box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .2s, transform .15s var(--ease);
}
.choice:hover .choice-body { border-color: var(--hair-strong); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--blue-bright); outline-offset: 2px; }
.choice input:checked + .choice-body { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow-lift); }
.choice-mark {
  flex: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%;
  border: 2px solid var(--hair-strong); display: grid; place-items: center; transition: all .15s;
}
.choice-mark .icon { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.choice input:checked + .choice-body .choice-mark { background: var(--ink); border-color: var(--ink); }
.choice input:checked + .choice-body .choice-mark .icon { opacity: 1; transform: none; }
.choice-title { display: block; font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.choice-line { display: block; margin-top: 2px; color: var(--soft); font-size: 15px; }

/* the opening fork: two doors */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.door .choice-body { flex-direction: column; gap: 14px; padding: 24px; min-height: 230px; }
.door-art {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--paper-2); color: var(--ink);
}
.door-art .icon { width: 28px; height: 28px; }
.door .choice-mark { position: absolute; top: 22px; right: 22px; margin: 0; }
.door .choice-title { font-size: 20px; }
.door-foot { margin-top: auto; font-size: 13px; color: var(--muted); }

/* goals: stacked, roomy */
.goals .choice-body { padding: 20px 22px; align-items: center; }
.goal-num { flex: none; width: 36px; font-weight: 700; color: var(--muted); }
.goals .choice input:checked + .choice-body .goal-num { color: var(--blue); }
.goals .choice-text { flex: 1; }

/* ---------- Grade keys ---------- */

.grade-groups { display: grid; gap: 22px; }
.grade-group { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.grade-group-label { font-weight: 600; color: var(--soft); font-size: 15px; }
.keys { display: flex; flex-wrap: wrap; gap: 10px; }
.key { position: relative; }
.key input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.key span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 56px; padding: 0 16px; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--hair-strong);
  box-shadow: 0 3px 0 var(--hair-strong);
  font-size: 19px; font-weight: 700; cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .15s, color .15s, border-color .15s;
}
.key.wide span { font-size: 16px; font-weight: 600; }
.key:hover span { border-color: var(--ink-2); }
.key input:focus-visible + span { outline: 3px solid var(--blue-bright); outline-offset: 3px; }
.key input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 0 var(--ink); transform: translateY(2px); }

/* ---------- Courses ---------- */

.course-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filter { position: relative; }
.filter input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.filter span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--hair-strong); background: var(--card); font-size: 14px; font-weight: 600; color: var(--soft); cursor: pointer;
}
.filter input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter input:focus-visible + span { outline: 3px solid var(--blue-bright); outline-offset: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.tile { position: relative; display: block; }
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.tile-body {
  position: relative; display: flex; flex-direction: column; gap: 14px; height: 100%;
  min-height: 132px; padding: 16px 16px 18px; border-radius: 16px;
  background: var(--card); border: 1.5px solid var(--hair);
  transition: border-color .15s, background .2s, transform .15s var(--ease), box-shadow .2s;
}
.tile-body .glyph { color: var(--accent); width: 34px; height: 34px; }
.tile:hover .tile-body { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--hair-strong); }
.tile input:focus-visible + .tile-body { outline: 3px solid var(--blue-bright); outline-offset: 2px; }
.tile-title { font-weight: 650; font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
.tile-title b {
  font-weight: inherit;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px;
  transition: background-size .35s var(--ease);
}
.tile-meta { margin-top: auto; font-size: 13px; color: var(--muted); }
.tile-stamp {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  opacity: 0; transform: scale(.4) rotate(-20deg); transition: all .25s var(--ease);
}
.tile-stamp .icon { width: 16px; height: 16px; }
.tile input:checked + .tile-body { background: var(--accent-soft); border-color: var(--accent); }
.tile input:checked + .tile-body .tile-stamp { opacity: 1; transform: none; }
.tile input:checked + .tile-body .tile-title b { background-size: 100% 2px; }
.tile.locked .tile-body { background: var(--paper-2); border-style: dashed; cursor: default; }
.tile.locked:hover .tile-body { transform: none; box-shadow: none; }
.tile.locked .tile-meta { color: #1E3A8A; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.tile.locked .tile-meta .icon { width: 14px; height: 14px; }

.tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 16px; margin-bottom: 22px; border-radius: 16px; background: var(--card);
  border: 1.5px solid var(--hair); min-height: 64px;
}
.tray-label { font-weight: 600; font-size: 14px; color: var(--soft); margin-right: 6px; }
.tray-empty { color: var(--muted); font-size: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px 0 12px;
  border-radius: 999px; background: var(--accent-soft, var(--paper-2)); color: var(--accent-ink, var(--ink));
  font-size: 14px; font-weight: 600; border: 1px solid transparent;
  animation: chipIn .25s var(--ease) both;
}
.chip.school { padding-right: 12px; background: #E8EEF8; color: #1E3A8A; }
.chip .icon { width: 14px; height: 14px; }
.chip button {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.chip button:hover { background: rgba(10, 25, 41, .08); }
@keyframes chipIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

.custom-add { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; align-items: flex-end; }
.custom-add .field { flex: 1 1 260px; margin: 0; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 12px; }
.group-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.group-head p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Invitation card ---------- */

.invite {
  position: relative; border-radius: var(--radius-lg); background: var(--card);
  border: 1.5px solid var(--hair); box-shadow: var(--shadow-lift); overflow: hidden;
}
.invite-top { padding: 22px 24px; border-bottom: 1.5px dashed var(--hair-strong); display: flex; gap: 16px; align-items: center; }
.invite-seal { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #E8EEF8; color: #1E3A8A; flex: none; }
.invite-seal .icon { width: 26px; height: 26px; }
.invite-school { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.invite-sub { color: var(--muted); font-size: 14px; }
.invite-rows { margin: 0; padding: 8px 24px 20px; display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; }
.invite-rows dt { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.invite-rows dd { margin: 0; font-weight: 600; }
.invite-rows dd small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.split-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.split-explain div { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); font-size: 14px; color: var(--soft); }
.split-explain strong { display: flex; align-items: center; gap: 8px; color: var(--ink); margin-bottom: 4px; font-size: 15px; }

/* ---------- Review ---------- */

.review { border-radius: var(--radius-lg); background: var(--card); border: 1.5px solid var(--hair); box-shadow: var(--shadow); }
.review-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: start; padding: 18px 22px; border-top: 1px solid var(--hair); }
.review-row:first-child { border-top: 0; }
.review-row dt { padding-top: 4px; }
.review-row dd { margin: 0; font-weight: 600; font-size: 16px; }
.review-row dd small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 2px; }
.review-row .btn-quiet { min-height: 40px; }
.review-courses { display: flex; flex-wrap: wrap; gap: 8px; }
.review-courses .chip { padding-right: 12px; }

/* ---------- Learning home ---------- */

.home { max-width: 1080px; margin: 0 auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 40px) 64px; }
.home-head { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between; }
.home-title { margin: 6px 0 0; font-size: clamp(26px, 3vw, 34px); font-weight: 750; letter-spacing: -.025em; line-height: 1.15; }
.home-sub { margin: 6px 0 0; color: var(--soft); }
.goal-pill {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--hair); max-width: 100%;
}
.goal-pill .kicker { font-size: 11px; }
.goal-pill strong { display: block; font-size: 15px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

/* begin here: the one obvious next step */
.begin {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; margin-top: 28px;
  border-radius: 22px; overflow: hidden; background: var(--card); border: 1.5px solid var(--hair); box-shadow: var(--shadow-lift);
}
.begin-main { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.begin-main h2 { margin: 0; font-size: clamp(24px, 2.6vw, 30px); font-weight: 750; letter-spacing: -.025em; line-height: 1.15; }
.begin-main p { margin: 0; color: var(--soft); max-width: 46ch; }
.begin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.begin-art {
  position: relative; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; min-height: 220px;
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft)), radial-gradient(rgba(10, 25, 41, .08) 1px, transparent 1.2px);
  background-blend-mode: normal;
}
.begin-art::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(10, 25, 41, .09) 1px, transparent 1.2px); background-size: 18px 18px;
}
.begin-art .glyph { position: relative; width: 120px; height: 120px; stroke-width: 1.5; }
.begin-art .tag { position: absolute; left: 18px; top: 18px; background: rgba(255, 255, 255, .85); }

/* class: binder with a spine */
.classes { display: grid; gap: 14px; }
.class-card {
  display: grid; grid-template-columns: 10px 1fr 1fr; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1.5px solid var(--hair); box-shadow: var(--shadow);
}
.class-spine { background: var(--accent); }
.class-info { padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.class-info h3 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.class-meta { color: var(--soft); font-size: 15px; }
.class-meta b { color: var(--ink); font-weight: 600; }
.class-info .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.class-work { padding: 22px 24px; border-left: 1.5px dashed var(--hair-strong); background: #FBFDFF; display: flex; flex-direction: column; gap: 8px; }
.class-work h4 { margin: 0; font-size: 13px; }
.empty-work { display: flex; gap: 12px; align-items: flex-start; color: var(--soft); font-size: 14px; }
.empty-work .icon { width: 28px; height: 28px; color: var(--muted); flex: none; }

/* personal courses: an index of notebooks, not a card grid */
.shelf { list-style: none; margin: 0; padding: 0; border-radius: 18px; background: var(--card); border: 1.5px solid var(--hair); overflow: hidden; }
.shelf li { border-top: 1px solid var(--hair); }
.shelf li:first-child { border-top: 0; }
.shelf-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
  width: 100%; padding: 14px 18px; background: none; border: 0; text-align: left; cursor: pointer;
  transition: background .15s;
}
.shelf-row:hover { background: var(--accent-soft); }
.shelf-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.shelf-icon .glyph { width: 28px; height: 28px; }
.shelf-title { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.shelf-sub { font-size: 14px; color: var(--muted); }
.shelf-go { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.shelf-row:hover .shelf-go .icon { transform: translateX(3px); }
.shelf-go .icon { transition: transform .2s var(--ease); }

.quiet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.home-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
.home-foot p { margin: 0; max-width: 62ch; }

/* ---------- Dialogs ---------- */

dialog.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 0; border-radius: 22px; background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px rgba(10, 25, 41, .25);
}
dialog.sheet::backdrop { background: rgba(10, 25, 41, .38); }
dialog.sheet[open] { animation: sheetIn .25s var(--ease) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 22px 0; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.sheet-close { width: 44px; height: 44px; margin: -8px -8px 0 0; border-radius: 12px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--soft); }
.sheet-close:hover { background: var(--paper-2); }
.sheet-body { padding: 14px 22px 22px; }
.sheet-body > p { margin: 0 0 14px; color: var(--soft); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.profile-list { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 12px 20px; }
.profile-list dt { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.profile-list dd { margin: 0; font-weight: 600; }

.empty-home { max-width: 560px; margin: 12vh auto 0; text-align: center; padding: 0 16px; }
.empty-home h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.025em; margin: 10px 0; }
.empty-home p { color: var(--soft); }
.empty-home .begin-actions { justify-content: center; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .begin { grid-template-columns: 1fr; }
  .begin-art { min-height: 140px; order: -1; }
  .begin-art .glyph { width: 84px; height: 84px; }
  .class-card { grid-template-columns: 8px 1fr; }
  .class-work { grid-column: 2; border-left: 0; border-top: 1.5px dashed var(--hair-strong); }
}

@media (max-width: 640px) {
  .topbar { gap: 10px; }
  /* icon only on phones, but the label stays for screen readers */
  .topbar .toplink span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .progress { max-width: none; }
  .doors { grid-template-columns: 1fr; }
  .door .choice-body { min-height: 0; }
  .grade-group { grid-template-columns: 1fr; gap: 10px; }
  .key span { min-width: 52px; height: 52px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tile-body { min-height: 118px; padding: 14px; }
  .review-row { grid-template-columns: 1fr auto; }
  .review-row dt { grid-column: 1 / -1; padding: 0; }
  .split-explain { grid-template-columns: 1fr; }
  .invite-rows { grid-template-columns: 1fr; gap: 4px; }
  .invite-rows dd { margin-bottom: 10px; }
  .actionbar .hint { display: none; }
  .actionbar .btn { flex: 1; }
  .actionbar .grow { display: none; }
  .shelf-row { grid-template-columns: 48px 1fr; }
  .shelf-go { grid-column: 2; }
  .goal-pill { width: 100%; }
}

@media (max-width: 400px) {
  .actionbar .btn { padding: 0 12px; white-space: nowrap; font-size: 14px; }
}

/* fingers need bigger targets than mice */
@media (pointer: coarse) {
  .chip { min-height: 44px; }
  .chip button { width: 40px; height: 40px; }
}

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