/* MwanaLearn admin studio.
   A calm, editorial control room for the learning data: warm paper, one blue,
   tabular numbers and hairline rules. The child's app stays portrait and
   thumb-sized; this is the desk a guardian opens on a laptop. */

@font-face {
  font-family: "Satoshi";
  src: url("/assets/fonts/satoshi-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #12182a;
  --ink-2: #2c344a;
  --muted: #6b7386;
  --faint: #98a0b1;
  --paper: #fffdf8;
  --paper-2: #fbf9f3;
  --canvas: #f3f2eb;
  --canvas-deep: #e8e6dc;
  --line: #e6e4da;
  --line-soft: #efede4;
  --blue: #3f63d2;
  --blue-deep: #2a49a8;
  --blue-wash: #edf1ff;
  --green: #4f9160;
  --green-wash: #edf6ef;
  --rose: #ab4356;
  --rose-wash: #fbeeef;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 1px rgba(18, 24, 42, .04), 0 1px 2px rgba(18, 24, 42, .05);
  --shadow-2: 0 1px 2px rgba(18, 24, 42, .04), 0 14px 34px -18px rgba(18, 24, 42, .22);
  --shadow-3: 0 24px 64px -24px rgba(18, 24, 42, .38);
  --font: "Satoshi", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 12% -12%, #e9efff 0, transparent 58%),
    radial-gradient(800px 420px at 100% 0%, #fbf3e5 0, transparent 52%),
    var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p, dl, dt, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 7px; }
::selection { background: #d9e1ff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------------ shell --- */

.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 16px 20px;
  background: linear-gradient(180deg, #fffdf8 0%, #f9f7ef 55%, #f4f2e9 100%);
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { flex: none; width: 38px; height: 38px; border-radius: 11px; overflow: hidden; box-shadow: var(--shadow-1); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 15px; letter-spacing: -.2px; }
.brand-copy small { font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

.rail-label {
  padding: 0 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav { display: grid; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.nav-item svg { flex: none; width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: rgba(255, 255, 255, .74); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--paper); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-1); }
.nav-item[aria-current="page"] svg { stroke: var(--blue); }
.nav-item em {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--blue-wash);
  color: var(--blue-deep);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
}
.nav-item em:empty { display: none; }

.rail-spacer { flex: 1; }

.rail-note { display: grid; gap: 6px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.note-copy { font-size: 11.5px; line-height: 1.55; color: var(--muted); }

.rail-foot { display: grid; gap: 5px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.who { overflow: hidden; font-size: 12px; font-weight: 700; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.rail-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}
.rail-link svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rail-link:hover { color: var(--ink); text-decoration: none; }

/* ------------------------------------------------------------------- main --- */

.main { min-width: 0; padding: 36px clamp(22px, 3.6vw, 52px) 80px; }

.content { display: grid; max-width: 1320px; margin: 0 auto; gap: 22px; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 2px;
}

.eyebrow { font-size: 9.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--blue-deep); }

.page-title h1 {
  margin-top: 7px;
  font-size: clamp(26px, 2.6vw, 36px);
  letter-spacing: -.9px;
  line-height: 1.06;
}
.page-copy { max-width: 62ch; margin-top: 9px; font-size: 13px; color: var(--muted); }

.page-actions { display: flex; align-items: center; gap: 10px; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  box-shadow: var(--shadow-1);
}
.live-pill em { font-style: normal; font-weight: 700; color: var(--faint); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }

/* ------------------------------------------------------------------ atoms --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .12s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: linear-gradient(180deg, #4c70e2, var(--blue)); color: #fff; box-shadow: 0 10px 22px -12px rgba(63, 99, 210, .85); }
.btn-primary:hover { background: linear-gradient(180deg, #557ae9, #3a5dcc); }
.btn-quiet { background: var(--paper); border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-1); }
.btn-quiet:hover { border-color: #d9d6ca; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not([disabled]) { background: var(--paper); }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--blue-deep);
  font-size: 11.5px;
  font-weight: 750;
}
.text-link svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.panel { display: grid; gap: 16px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }

/* The drawer asks for one family's record while it opens. */
.boot { display: flex; align-items: center; gap: 9px; padding: 14px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--canvas-deep); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}
.card-head h2 { font-size: 14px; letter-spacing: -.2px; }
.card-head p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }

.empty { padding: 26px 18px; font-size: 12px; color: var(--faint); }

/* ------------------------------------------------------------------- kpis --- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }

.kpi {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 16px 16px 12px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), rgba(63, 99, 210, 0));
}
.kpi-label { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.kpi-value { margin-top: 5px; font-size: 27px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.05; }
.kpi-note { margin-top: 2px; font-size: 11px; color: var(--muted); }
.kpi-spark { height: 30px; margin-top: 8px; color: var(--blue); }
.kpi-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ------------------------------------------------------------------ chart --- */

.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.segmented button { padding: 5px 11px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 11px; font-weight: 750; }
.segmented button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }

.chart { padding: 2px 16px 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-family: var(--font); font-size: 9.5px; font-weight: 700; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .point circle { fill: var(--paper); stroke: var(--blue); stroke-width: 2; transition: transform .16s var(--ease), fill .16s var(--ease); }
.chart .point { transform-box: fill-box; transform-origin: center; }
.chart .point:hover circle { transform: scale(1.5); fill: var(--blue); }
.chart .point.today circle { fill: var(--blue); }
.chart .point.today circle { transform: scale(1.25); }

.chart-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line-soft);
}
.chart-fact { display: grid; gap: 1px; }
.chart-fact span { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.chart-fact strong { font-size: 12.5px; font-weight: 750; }

/* ----------------------------------------------------------------- tables --- */

.table-wrap { overflow-x: auto; padding: 0 6px 4px; }

table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th.num, table.data td.num { text-align: right; }
table.data td.num { font-weight: 750; }
table.data tr.row { cursor: pointer; transition: background .15s var(--ease); }
table.data tr.row:hover, table.data tr.row:focus-visible { background: var(--blue-wash); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 9px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}
.cell-main { font-weight: 700; }
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .03em;
}
.muted { margin-left: 4px; color: var(--faint); font-weight: 600; }

.meter {
  display: inline-block;
  width: 72px;
  height: 5px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--canvas-deep);
  vertical-align: middle;
}
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), #7d97ee); }
.meter-copy { font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* ----------------------------------------------------------------- search --- */

.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--faint);
}
.search:focus-within { border-color: #c9d5ff; background: var(--paper); box-shadow: 0 0 0 3px var(--blue-wash); }
.search svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.search input { width: 190px; border: 0; background: none; color: var(--ink); font-size: 12.5px; }
.search input:focus-visible { outline: none; }
.search input::placeholder { color: var(--faint); }
.search kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
}
.pager-copy { font-size: 11.5px; color: var(--muted); }
.pager-actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------- curriculum --- */

.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(292px, 1fr)); gap: 14px; }

.area { display: grid; align-content: start; }
.area-head { display: grid; gap: 3px; padding: 17px 18px 12px; }
.area-head h2 { font-size: 14px; letter-spacing: -.2px; }
.area-head p { font-size: 11.5px; line-height: 1.5; color: var(--muted); }

.area-subject { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line-soft); }
.subject-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-wash);
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.subject-copy { display: grid; gap: 1px; min-width: 0; }
.subject-copy strong { font-size: 12.5px; }
.subject-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.area-subject .pill { margin-left: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.pill.live { background: var(--green-wash); color: #2f6b3d; }
.pill.next { background: var(--canvas); color: var(--muted); }

.checklist { display: grid; gap: 0; padding: 0 18px 16px; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.checklist li:first-child { border-top: 0; }
.check-dot {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--green-wash);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.checklist strong { font-size: 12.5px; }
.checklist small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------------ gates --- */

.stage { display: grid; min-height: calc(100vh - 116px); place-items: center; }

.gate {
  display: grid;
  width: min(462px, 100%);
  padding: 30px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-2);
}
.gate h1 { margin-top: 8px; font-size: 25px; letter-spacing: -.8px; line-height: 1.14; }
.gate-copy { margin-top: 10px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

/* ------------------------------------------------------- authentication --- */

/* The studio opens on this portal: a brand wall on the left, the form on the
   right, and no lesson data asked for until the app confirms a session. */
.stage-auth { padding: 30px 0; }

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  width: min(1060px, 100%);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-3);
}

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 42px 40px 36px;
  overflow: hidden;
  background:
    radial-gradient(520px 320px at 88% -10%, rgba(242, 180, 92, .32), transparent 62%),
    radial-gradient(420px 320px at 0% 108%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(158deg, #152148 0%, #26449c 56%, #3f63d2 100%);
  color: #fff;
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(120% 90% at 100% 0%, #000 20%, transparent 78%);
}
.auth-aside > * { position: relative; z-index: 1; }

.auth-mark { width: 52px; height: 52px; overflow: hidden; border-radius: 15px; box-shadow: 0 20px 34px -22px rgba(0, 0, 0, .8); }
.auth-mark svg { display: block; width: 100%; height: 100%; }
.auth-kicker { margin-top: 6px; color: #c7d3ff; font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.auth-headline { margin-top: 2px; font-size: clamp(24px, 2.4vw, 31px); font-weight: 800; letter-spacing: -1px; line-height: 1.12; }
.auth-headline em { font-style: normal; color: #ffd79c; }
.auth-lede { max-width: 36ch; margin-top: 4px; color: #d7e0ff; font-size: 12.5px; line-height: 1.66; }

.auth-proof { display: grid; margin-top: 10px; }
.auth-proof li { display: grid; gap: 1px; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.auth-proof strong { font-size: 12.5px; font-weight: 750; }
.auth-proof span { color: #b9c8ff; font-size: 11px; }
.auth-foot { margin-top: auto; padding-top: 12px; color: #a9bafc; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.auth-main { display: grid; align-content: center; gap: 18px; padding: 44px clamp(26px, 3.6vw, 52px); }
.auth-card { width: 100%; max-width: 384px; margin: 0 auto; }
.auth-title { margin-top: 8px; font-size: 27px; letter-spacing: -.9px; line-height: 1.1; }
.auth-copy { margin-top: 7px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.auth-help { margin-top: 16px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.auth-note { max-width: 384px; margin: 0 auto; color: var(--faint); font-size: 11px; line-height: 1.6; text-align: center; }
.auth-note a { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.auth-note svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-block { width: 100%; }

.secret { position: relative; display: block; }
.secret input { width: 100%; padding-right: 62px; }
.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateY(-50%);
}
.reveal:hover { background: var(--canvas); color: var(--ink-2); }

.form { display: grid; gap: 12px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.field input {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  font-size: 13px;
  font-weight: 600;
}
.field input:focus { border-color: #c9d5ff; background: var(--paper); outline: none; box-shadow: 0 0 0 3px var(--blue-wash); }
.form .btn { justify-self: start; margin-top: 4px; }

.form-error { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--rose-wash); color: var(--rose); font-size: 11.5px; font-weight: 700; line-height: 1.5; }

.gate-back { margin-top: 20px; color: var(--muted); font-size: 12px; font-weight: 650; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.steps-list { display: grid; gap: 9px; margin-top: 18px; counter-reset: step; }
.steps-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.steps-list li::before {
  content: counter(step);
  counter-increment: step;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--canvas);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--canvas); font-family: var(--mono); font-size: 11px; }

/* --------------------------------------------------------------- skeleton --- */

.skeleton { display: grid; width: min(980px, 100%); gap: 14px; }
.sk {
  border-radius: var(--radius);
  background: linear-gradient(100deg, #efede5 30%, #f8f6ef 50%, #efede5 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.sk-head { width: 48%; height: 56px; }
.sk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sk-row { height: 96px; }
.sk-body { height: 260px; border-radius: var(--radius-lg); }

@keyframes shimmer { to { background-position: -120% 0; } }

/* ----------------------------------------------------------------- drawer --- */

.scrim { position: fixed; inset: 0; background: rgba(18, 24, 42, .3); backdrop-filter: blur(2px); }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(524px, 94vw);
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  animation: drawer-in .22s var(--ease);
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(20px); } }

.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin-top: 6px; font-size: 18px; letter-spacing: -.5px; }
.drawer-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }

.close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
}
.close:hover { color: var(--ink); }

.drawer-body { display: grid; gap: 18px; padding: 18px 22px 28px; overflow-y: auto; }
.drawer-body h3 { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts div { display: grid; gap: 2px; padding: 10px 12px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.facts dt { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.facts dd { font-size: 12.5px; font-weight: 650; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 11px;
  font-weight: 700;
}
.chip em { font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.chip.is-mastered { background: var(--green-wash); border-color: #d8eada; }
.chip.is-mastered em { color: #2f6b3d; }

.timeline { display: grid; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.timeline li:first-child { border-top: 0; }
.timeline .dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--canvas-deep); }
.timeline .dot.is-mastered { background: var(--green); }
.timeline strong { font-size: 12px; }
.timeline span { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.timeline time { color: var(--faint); font-size: 10px; font-weight: 800; white-space: nowrap; }

.drawer-note { padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 11px; line-height: 1.6; }

/* -------------------------------------------------------------- responsive --- */

@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-label, .rail-note, .rail-spacer { display: none; }
  .nav { grid-auto-flow: column; }
  .rail-foot { grid-auto-flow: column; align-items: center; gap: 12px; padding: 0; border-top: 0; }
  .who { display: none; }
  .main { padding-top: 26px; }
  .stage { min-height: calc(100vh - 200px); }
  .facts { grid-template-columns: 1fr; }
  .gate { padding: 24px; }

  /* The portal stacks: the brand wall becomes a header, the form the page. */
  .auth { grid-template-columns: 1fr; border-radius: 24px; }
  .auth-aside { gap: 10px; padding: 26px 24px; }
  .auth-headline { font-size: 23px; }
  .auth-proof { display: none; }
  .auth-foot { margin-top: 2px; padding-top: 0; }
  .auth-main { padding: 26px 22px 30px; }
  .auth-card { max-width: none; }
}

@media (max-width: 620px) {
  .nav-item span { display: none; }
  .nav-item { padding: 9px 11px; }
  .search input { width: 132px; }
  .search kbd { display: none; }
  .chart .axis.x { font-size: 8px; }
}

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