/* ============================================================================
   THE SHARED SHEET — what every page on the new system stands on.

   Load order on a page:  tokens.css → fonts.css → base.css → <page>.css
   (The landing still loads app.css as well, BEFORE this sheet, until it is
   taken off it; nothing here may change how the landing renders — that was
   proved by diffing every element's computed style before and after.)

   What lives here, and nothing else:
     1. THE FOUNDATION   the box model, the body, links, buttons, focus —
                         enough for a page that no longer loads app.css
     2. TYPE AND MEASURE the wrap, the mono label, the one h1, the lede
     3. THE PRIMITIVES   buttons, rows, chips — one definition each
     4. THE APP FRAME    .shell; the bar itself is frame.css's (F2)
     5. APP COMPONENTS   the pieces more than one app screen draws: the
                         panel and its head, the progress bar, the subject
                         glyph, the status pill

   Sections 4 and 5 are PORTED from app.css onto the scales, not redesigned:
   a page that swaps app.css for this sheet keeps its chrome and its panels,
   with each value snapped to its nearest step (ties round down).

   WORKING IN PARALLEL. Several sessions build pages at once, and this is the
   one stylesheet they all load. So:
     · a component used by ONE page goes in that page's sheet, not here;
     · promote something here only when a second page needs it, in a small
       change of its own, merged quickly, so the other sessions pick it up;
     · change an existing rule here only in the session that owns it — the
       app frame and components (4, 5) belong to the student-page session,
       the rest to the landing session. See HANDOVER.md, "Working in parallel".
   ========================================================================= */


/* ---- 1 · the foundation ------------------------------------------------ */
*{box-sizing:border-box;}
html, body{margin:0; padding:0;}
body{font-family:var(--font-body); font-size:var(--ty-5); color:var(--ink); background:var(--panel);
  -webkit-font-smoothing:antialiased; word-break:keep-all;}
a{color:var(--blue); text-decoration:none;}
button{font:inherit; color:inherit; background:none; border:none; padding:0; cursor:pointer; text-align:left;}
/* A keyboard user must be able to see where they are. The ring is drawn
   outside the element so it never shifts layout, and only for keyboard
   focus, so a mouse click does not leave a box behind. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible{
  outline:2px solid var(--blue); outline-offset:2px;}

/* Two type helpers the markup leans on: set a word in the metadata face or
   the argument face without inventing a class for it. */
.mono{font-family:var(--font-mono);}
.serif{font-family:var(--font-head);}


/* ---- 2 · type and measure ---------------------------------------------- */
/* One measure: every band on a page divides this same width. */
.wrap{max-width:1200px; margin:0 auto; padding:0 var(--gutter);}

.tag{font-family:var(--font-mono); font-size:var(--ty-1); letter-spacing:var(--ls-caps-xl);
  text-transform:uppercase; color:var(--muted); margin:0;}
h1{font-family:var(--font-head); letter-spacing:var(--ls-tighter); margin:0;
  font-size:clamp(28px,3.2vw,38px); font-weight:var(--fw-semibold); line-height:var(--lh-1);}
.lede{font-size:var(--ty-4); line-height:var(--lh-5); color:var(--muted); margin:var(--sp-4) 0 0; max-width:44ch;}


/* ============================================================================
   3 · THE PRIMITIVES — buttons, rows, chips. One definition each.

   A component never sets a button's padding or a row's rule any more; it
   picks a variant. Before this the landing drew eight buttons under six
   class names with five different paddings, four radii and three font sizes,
   and four lists drew the same label-and-value row four different ways. That
   is what made every change a per-component tweak: there was nothing to
   inherit.

   The old app screens used `.cta` and `.cta.ghost` for buttons. On the new
   system those are `.btn .btn-sm .btn-primary` and `.btn .btn-sm .btn-quiet`.
   ========================================================================= */

/* ---- buttons ----
   Base sets shape and alignment. A size sets three variables and nothing
   else. An intent sets colour and nothing else. Nothing sets both. */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:var(--sp-3);
  padding:var(--btn-y) var(--btn-x); font-size:var(--btn-t); min-height:var(--btn-h);
  border:1px solid transparent; border-radius:var(--r-2);
  font-family:inherit; font-weight:var(--fw-semibold); line-height:var(--lh-1);
  white-space:nowrap; cursor:pointer;
  --btn-y:var(--sp-4); --btn-x:var(--sp-6); --btn-t:var(--ty-4); --btn-h:36px;}
.btn-sm{--btn-y:var(--sp-3); --btn-x:var(--sp-5); --btn-t:var(--ty-3); --btn-h:28px;}
.btn-lg{--btn-y:var(--sp-5); --btn-x:var(--sp-7); --btn-t:var(--ty-5); --btn-h:44px;}

.btn-primary{background:var(--blue); border-color:var(--blue); color:#FFF;}
.btn-primary:hover{background:var(--blue-deep); border-color:var(--blue-deep);}
.btn-quiet{background:var(--card); border-color:var(--line); color:var(--ink);}
.btn-quiet:hover{border-color:var(--ink);}
/* A text button still needs a target you can hit: no box, but 24px of height,
   which is the floor WCAG 2.5.8 asks for. */
.btn-plain{background:transparent; border-color:transparent; color:var(--blue);
  font-weight:var(--fw-medium); --btn-x:0; --btn-y:var(--sp-1); --btn-h:24px;}
.btn-plain:hover{color:var(--ink);}
.btn-on-dark{background:transparent; border-color:rgba(255,255,255,.4); color:#FFF;}
.btn-on-dark:hover{border-color:#FFF; background:rgba(255,255,255,.1);}

/* ---- rows ----
   One shape, repeated all over a page: a key on the left, a line of text,
   a value on the right, on a hairline. --row-key is how wide the key column
   is, because that is the only thing that legitimately differs between them.
   Its default is declared here, on :root, so a list overrides it once on its
   container and a page that never sets it still has one — the old form was
   `var(--row-key,74px)`, a fallback the scale check cannot see and the rules
   forbid, and it flagged the first page that used a row without a key. */
:root{--row-key:74px;}
.row-line{display:flex; align-items:baseline; gap:var(--sp-4);
  padding:var(--row-y) 0; font-size:var(--row-t); line-height:var(--lh-3);
  color:var(--ink-soft);
  --row-y:var(--sp-3); --row-t:var(--ty-3);}
.row-line + .row-line{border-top:1px solid var(--border);}
.row-line > i{flex:0 0 var(--row-key); font-style:normal; font-size:var(--ty-1);
  letter-spacing:var(--ls-wide); text-transform:uppercase; color:var(--muted);}
.row-line > b{margin-left:auto; font-weight:var(--fw-semibold); color:var(--ink);
  font-variant-numeric:tabular-nums;}

/* ---- chips ---- a small bordered pill. Three were drawn separately. */
.chip{display:inline-flex; align-items:center; gap:var(--sp-2);
  padding:var(--sp-2) var(--sp-4); border-radius:var(--r-pill);
  border:1px solid var(--border); background:var(--card);
  font-size:var(--ty-2); line-height:var(--lh-1); color:var(--ink-soft);}
.chip-blue{border-color:var(--blue-pale); color:var(--blue-deep);}
.chip-blue:hover{border-color:var(--blue); background:var(--blue-tint);}
.chip-amber{border-color:transparent; background:var(--amber-tint); color:var(--amber);}

.acts{display:flex; gap:var(--sp-4); flex-wrap:wrap; margin-top:var(--sp-6);}


/* ============================================================================
   4 · THE APP FRAME — .shell, the page every signed-in screen wraps its
   content in. The bar frame.js puts at its top, the sidebar, the visitor
   header and the legal footer are drawn by styles/frame.css since
   2 October 2026 (roadmap 31 F2): one sheet for the frame, loaded after
   this one, that stands on its own so a product page (which does not load
   this sheet) can wear the same frame.
   ========================================================================= */
.shell{max-width:1320px; margin:0 auto;
  padding:var(--sp-6) clamp(var(--sp-6), 3vw, var(--sp-10)) var(--sp-13);}


/* ============================================================================
   5 · APP COMPONENTS — drawn by more than one app screen.

   Ported from app.css onto the scales. A component only one screen draws
   stays in that screen's sheet.
   ========================================================================= */

/* ---- the panel: the card every app screen is built from ---- */
.panel{border:1px solid var(--border); border-radius:var(--r-4); background:var(--card); overflow:hidden;}
/* Its head: a short rule ABOVE the title, the way a section mark sits over a
   heading in print; a hairline to the control; a mono count in a chip. */
.panel-head{display:flex; align-items:center; gap:var(--sp-5); flex-wrap:wrap;
  padding:var(--sp-7) var(--sp-6) var(--sp-5);}
.panel-head .title{position:relative; font-family:var(--font-head); font-size:var(--ty-7);
  font-weight:var(--fw-semibold); letter-spacing:var(--ls-tighter); line-height:var(--lh-2);}
.panel-head .title::before{content:''; position:absolute; left:0; top:-11px; width:22px; height:2px;
  border-radius:var(--r-1); background:var(--blue);}
.panel-head .spacer{flex:1 1 20px; min-width:16px; height:1px; align-self:center; background:var(--border);}
.panel-head .note{font-family:var(--font-mono); font-size:var(--ty-2); color:var(--muted);
  padding:var(--sp-2) var(--sp-4); border-radius:var(--r-pill); background:var(--border-soft); white-space:nowrap;}
/* A 15px line is not a target. The padding grows the hit area to 27px and
   the negative margin gives it back, so the head does not get taller. */
.panel-head .link{font-size:var(--ty-4); font-weight:var(--fw-medium); color:var(--blue);
  padding:var(--sp-3) 0; margin:calc(-1 * var(--sp-3)) 0;}
.panel-head .link:hover{color:var(--ink);}

/* ---- the progress bar ---- */
.bar-track{flex:1; display:block; height:5px; border-radius:var(--r-1); background:var(--card); overflow:hidden;}
.bar-track.on-panel{background:var(--border-soft);}
.bar-fill{display:block; height:100%; background:var(--blue);}

/* ---- the subject glyph: a symbol from chrome.js's sprite on its tint ---- */
.subj-icon{width:22px; height:22px; flex:0 0 auto; display:inline-flex; align-items:center;
  justify-content:center; border-radius:var(--r-2);}
.subj-icon.lg{width:30px; height:30px; border-radius:var(--r-3);}
.subj-icon svg{width:100%; height:100%; display:block;}
.subj-icon.maths{background:var(--blue-tint);}
.subj-icon.english{background:var(--amber-tint);}
.subj-icon.science{background:var(--green-tint);}
.subj-icon.korean{background:var(--purple-tint);}
.subj-icon.mixed{background:var(--neutral-tint);}

/* ---- the status pill: a state as a tint, not a badge ---- */
.status-pill{padding:var(--sp-1) var(--sp-4); border-radius:var(--r-pill); font-size:var(--ty-2);
  font-weight:var(--fw-medium); white-space:nowrap;}
.status-pill.on{background:var(--blue-tint); color:var(--blue-deep);}
.status-pill.behind{background:var(--amber-tint); color:var(--amber-deep);}
.status-pill.neutral{background:var(--neutral-tint); color:var(--neutral-ink);}
