/*
  Layout of the S1 pages. Colours and the type family come only from the
  design tokens (tokens.css, tokens/tokens.json) and the CSS system colours
  (Canvas, CanvasText); this file names no colour value of its own (VO-H03a,
  tools/token-lint.js).

  The frame: the header on top, the four navigation items and the page. On a
  narrow window (390 px) the navigation is a bar along the bottom edge, each
  item an equal share of the bar; from 860 px up, the design's navigation
  breakpoint (tokens --mm-bp-nav, app.dc.html line 587), it is a 240 px column
  at the side (--mm-sidebar). The page never scrolls sideways.

  The signed-in pages (body[data-entry="surface"]) and the capture page are
  drawn as app.dc.html and components.dc.html draw them; the line of the design
  file that gives a size, radius or padding the tokens do not carry is named
  beside it, and the rows of test/design-expectations/design-app-screens-a.json
  cite each value.
*/
:root { color-scheme: light; }
body { margin: 0; font-family: var(--font-family-base); line-height: 1.5; color: CanvasText; background: Canvas; }
[hidden] { display: none !important; }

/* The header carries the logo lock-up in the design's page and ink colours,
   so the wordmark reads in light and dark. */
/* The header's top and side padding are the design's mobile header (app.dc.html,
   line 163); the bottom padding keeps the logo's clear space free of the page
   and the navigation below it (VO-H03b, test/logo-clear-space.test.js). */
#banner { display: flex; align-items: center; gap: 0.5rem; padding: 16px 20px 0.5rem; background: var(--mm-page); color: var(--mm-ink); }
.brand { display: inline-flex; align-items: center; flex: none; font-weight: bold; font-size: 1.25rem; color: var(--mm-ink); text-decoration: none; }
.brand img { display: block; max-width: none; }

/* The foot of the page: the quiet "Send feedback" link (the side column's foot
   from 860 px) and, on the Profile pages, Sign out. Neither is a bar. */
#page-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin-top: 24px; }
#feedback-open { padding: 0; background: none; color: var(--mm-primary-text); font: 600 14px var(--mm-font); text-decoration: underline; text-underline-offset: 3px; }
#feedback textarea { display: block; width: 100%; }
#feedback-state { margin: 0.5rem 0; }

nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0; padding: 0; }
#section-nav { margin-top: 1rem; }

/* The four navigation items (app.dc.html, lines 152 and 537): 48 px items
   (--mm-touch-nav), the active one by weight, colour and a bar ahead of the
   label (the bar is the design's 4 x 18 px mark, 28 x 4 px on the bottom bar). */
#primary-nav li { min-width: 0; }
#primary-nav a { box-sizing: border-box; display: flex; align-items: center; min-height: var(--mm-touch-nav); text-decoration: none; color: var(--mm-ink-2); font: 600 15px/1.3 var(--mm-font); }
#primary-nav a::before { content: ""; flex: none; width: 4px; height: 18px; border-radius: 2px; background: transparent; }
#primary-nav a[aria-current="page"] { font-weight: 700; }
#primary-nav a[aria-current="page"]::before { background: var(--mm-primary-text); }

main { display: block; min-width: 0; padding: 0 1rem 2rem; max-width: 48rem; overflow-wrap: anywhere; }
a { color: var(--mm-primary-text); text-underline-offset: 3px; }
#rows { padding-left: 1.25rem; }
#rows li { margin: 0.5rem 0; }
#rows li[data-current="true"] { padding-left: 0.5rem; border-left: 4px solid var(--color-primary); }
.detail { display: block; }
#rows button { margin: 0.25rem 0.5rem 0.25rem 0; }

/* Provenance chips: a short label of what a row's evidence is. The words carry
   the meaning; an AI inference is also drawn with a dashed edge, so it differs
   without relying on colour. */
.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.25rem 0; }
.chip { display: inline-block; padding: 4px 8px; border: 1.5px solid var(--mm-ink); border-radius: 6px; background: var(--mm-card); color: var(--mm-ink); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.chip[data-chip="uncertain"] { border-style: dotted; }
.chip[data-chip="ai-inference"] { border-style: dashed; border-color: var(--mm-primary-text); background: var(--mm-primary-soft); color: var(--mm-primary-text); }
.form-message { margin: 0.25rem 0; }
#rows form textarea { display: block; width: 100%; }
input, select, textarea { max-width: 100%; box-sizing: border-box; }

/* A button is the design's secondary button (app.dc.html, lines 369 and 503:
   600 15px, 44 px, padding 0 16px, radius 12, the soft fill); a primary one is
   the design's primary button (line 65, the on-primary text). */
button { font: 600 15px/1 var(--mm-font); box-sizing: border-box; min-height: var(--mm-touch); padding: 0 16px; border: none; border-radius: var(--mm-radius-md); color: var(--mm-primary-text); background: var(--mm-primary-soft); cursor: pointer; }
button.primary { color: var(--mm-on-primary); background: var(--mm-primary); }
button:disabled { cursor: not-allowed; color: var(--mm-muted); background: var(--mm-surface); }
input, select, textarea { font: inherit; padding: 0.3rem; border: 1px solid CanvasText; }

/* The focus ring of the design (app.dc.html, line 17): the focus token as a
   ring; the outline is there for forced-colours modes and transparent otherwise. */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--mm-focus); }

/* Narrow window (under the design's 860 px navigation breakpoint): the
   navigation is the bottom bar, across the whole window (app.dc.html, line 534). */
@media (max-width: 859.98px) {
  #primary-nav { box-sizing: border-box; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--mm-z-nav); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--mm-card); border-top: 1px solid var(--mm-line); }
  #primary-nav ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  #primary-nav a { flex-direction: column; justify-content: center; gap: 5px; font-size: 12px; text-align: center; }
  #primary-nav a::before { width: 28px; height: 4px; }
  #primary-nav a[aria-current="page"] { color: var(--mm-primary-text); }
  main { padding-bottom: 5rem; }
  body[data-entry="surface"] main, .capture main { padding: 20px 20px 112px; }
}

/* Wide window: the navigation is the side column beside the page (app.dc.html,
   line 148: 240 px, the surface fill, a line on its edge, padding 24 / 14). */
@media (min-width: 860px) {
  body { display: grid; grid-template-columns: var(--mm-sidebar) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
  /* The components page is a sheet, not the app frame: no side column. */
  body.gallery { display: block; min-height: 0; }
  /* No bar across the window: the logo is the top of the side column, the four
     items follow it and the feedback link is at its foot (app.dc.html, line 148:
     padding 24 / 14, 28 px between the logo and the items). */
  #banner { box-sizing: border-box; grid-column: 1; grid-row: 1; background: var(--mm-surface); border-right: 1px solid var(--mm-line); }
  #primary-nav { box-sizing: border-box; grid-column: 1; grid-row: 2; padding: 24px 14px; background: var(--mm-surface); border-right: 1px solid var(--mm-line); }
  #primary-nav ul { flex-direction: column; flex-wrap: nowrap; gap: 2px; position: sticky; top: 0.5rem; }
  #primary-nav a { gap: 10px; padding: 0 12px; border-radius: 10px; color: var(--mm-ink); }
  #primary-nav a[aria-current="page"] { background: var(--mm-card); box-shadow: var(--mm-elev-1); }
  main { grid-column: 2; grid-row: 1 / span 2; }
  #primary-nav[hidden] ~ main { grid-column: 1 / -1; }
  body[data-entry="surface"] main, .capture main { padding: 40px 44px 64px; }
  /* The foot of the side column. */
  #page-foot { position: fixed; left: 14px; bottom: 20px; z-index: var(--mm-z-sticky); box-sizing: border-box; width: calc(var(--mm-sidebar) - 28px); margin: 0; padding: 0 12px; flex-direction: column; align-items: flex-start; gap: 0; }
  body:has(#primary-nav[hidden]) #page-foot { position: static; width: auto; padding: 0; flex-direction: row; }
  body:has(#primary-nav[hidden]) #banner { grid-column: 1 / -1; background: var(--mm-page); border-right: none; }
  body:has(#primary-nav[hidden]) main { grid-row: 2; }
}

/*
  The entry screens, as the seeded design draws them (vendor/design/mirimark-s1):
  sign-in and account creation (app.dc.html, Sign in), setup (app.dc.html,
  onboarding) and the age, refusal, notice, re-accept, declined and locked
  screens (screens.dc.html S01-S08 with screen-body.dc.html), and the
  recording notice on the capture page (S05). Colours, radii, spacing and type
  are the design tokens (--mm-*); a size, radius or padding the tokens do not
  carry is the inline style of the design file named beside it. The rows of
  test/design-expectations/design-entry-screens.json cite each value.
  The page ground and ink of an entry screen are the design's, so the screen
  reads in light and dark.
*/
body[data-entry="sign-in"], body[data-entry="notice"], body[data-entry="declined"], body[data-entry="welcome"] { background: var(--mm-page); color: var(--mm-ink); }
body[data-entry="sign-in"] a, body[data-entry="notice"] a, body[data-entry="declined"] a, body[data-entry="welcome"] a { color: var(--mm-primary-text); }

/* The design's text paragraph (screen-body.dc.html, line 14: 15px, ink-2). */
.entry-text, #declined-result { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }

/* The design's actions row (screen-body.dc.html, line 82: 16px/600, 48 px,
   padding 0 20px, radius 12, wrapping with a 10 px gap). */
.entry-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.entry-actions .ds-button { flex: 1 1 auto; min-height: var(--mm-touch-nav); padding: 0 20px; font-size: 16px; }

/* Sign-in: a centred column of cards 420 px wide (app.dc.html, lines 44-45). */
body[data-entry="sign-in"] main { display: flex; flex-direction: column; align-items: center; gap: var(--mm-space-5); max-width: none; padding: var(--mm-space-8) var(--mm-space-5); box-sizing: border-box; }
body[data-entry="sign-in"] main > * { box-sizing: border-box; width: 100%; max-width: 420px; }
body[data-entry="sign-in"] #title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: var(--mm-track-h1); }
body[data-entry="sign-in"] #sign-in { display: flex; flex-direction: column; gap: var(--mm-space-5); }
body[data-entry="sign-in"] #status { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
.entry-card { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--mm-space-5); padding: var(--mm-space-8); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-xl); background: var(--mm-card); color: var(--mm-ink); }
.entry-card p { margin: 0; }
.entry-card-title { margin: 0; font: var(--mm-type-title); }
.entry-card .ds-select { width: 100%; }
.entry-card .ds-button { width: 100%; font-size: 16px; }

/* A failed sign-in: the alert box in the danger-soft token (app.dc.html, line 52). */
body[data-entry="sign-in"] #state-holder .ds-state[data-ds-state="error"] { padding: 12px 14px; border: none; border-radius: var(--mm-radius-md); background: var(--mm-danger-soft); font-size: 14px; line-height: 1.5; }
body[data-entry="sign-in"] #state-holder .ds-state[data-ds-state="error"] .ds-state-title { font: var(--mm-type-body-sm); font-weight: 700; color: var(--mm-danger); }
body[data-entry="sign-in"] #state-holder .ds-state[data-ds-state="error"] .ds-state-message { font-size: 14px; line-height: 1.5; color: var(--mm-ink); }

/* The under-13 refusal (S02): a card of the design's text (screen-body.dc.html, lines 19 and 26). */
#surface[data-state="refused"] #status { padding: 18px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); font-size: 14px; line-height: 1.55; color: var(--mm-ink-2); }

/* Notices, re-accept and declined (S03, S04, S06, S07): the design's h1 is
   28 px, 34 px on the wide page (screens.dc.html, line 111). */
body[data-entry="notice"] #title, body[data-entry="declined"] #title { margin: 0 0 var(--mm-space-4); font-size: 28px; font-weight: 800; letter-spacing: var(--mm-track-h1); line-height: 1.25; }
@media (min-width: 1024px) {
  body[data-entry="notice"] #title, body[data-entry="declined"] #title { font-size: 34px; }
}
#notice, #declined { display: flex; flex-direction: column; gap: var(--mm-space-4); min-width: 0; }
#notice > p, #declined > p { margin: 0; }
#notice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--mm-space-4); }
#notice-list li, #guardian-slot, #declined-confirm { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); }
#guardian-slot { border-style: dashed; border-color: var(--mm-line-strong); }
#notice-list h2, #guardian-heading { margin: 0; font: var(--mm-type-title); }
#notice-list .notice-body, #guardian-text, #declined-warning { margin: 0; font-size: 14px; line-height: 1.55; color: var(--mm-ink-2); }
#guardian-slot p, #declined-confirm p { margin: 0; }
#notice-backup { font-size: 14px; }

/* The locked feature (S08): the warning banner of the design, with the
   border screen-body.dc.html gives every banner (lines 16 and screens.dc.html 113). */
#locked { border: 1px solid var(--mm-line); }
#locked p { margin: 0; }
#locked-text { color: var(--mm-ink-2); }

/* Setup (app.dc.html, onboarding, lines 76-90): a 560 px column, the step
   bar, and each step a 24 px card with the OPTIONAL eyebrow. */
#welcome { display: flex; flex-direction: column; gap: var(--mm-space-6); max-width: 560px; width: 100%; margin: 0 auto; box-sizing: border-box; }
#welcome > p, #welcome > h2, #welcome > div { margin: 0; }
#skip-all-holder { display: flex; justify-content: flex-end; }
#skip-all { padding: 0 16px; }
#step-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#step-bar li { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--mm-ink-2); overflow-wrap: anywhere; }
#step-bar li[aria-current="step"] { color: var(--mm-ink); }
#step-bar .bar { display: block; height: 4px; border-radius: 2px; background: var(--mm-line-strong); }
#step-bar li[aria-current="step"] .bar, #step-bar li:not([data-step="open"]) .bar { background: var(--mm-primary); }
#steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--mm-space-6); }
#steps > li { display: flex; flex-direction: column; gap: var(--mm-space-5); padding: 28px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-xl); background: var(--mm-card); color: var(--mm-ink); }
#steps > li p, #steps > li h3 { margin: 0; }
#steps > li > p { font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
#steps > li h3 { font-size: 26px; font-weight: 800; letter-spacing: var(--mm-track-h1); line-height: 1.2; }
#steps form { display: flex; flex-direction: column; gap: var(--mm-space-5); }
.eyebrow { font: var(--mm-type-eyebrow); letter-spacing: var(--mm-track-eyebrow); text-transform: uppercase; color: var(--mm-muted); }
#steps .ds-field { margin: 0; }

/* The recording notice (S05) on the capture page. */
.capture #notice { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); color: var(--mm-ink); }
.capture #notice h2 { margin: 0; font: var(--mm-type-title); }
.capture #notice p { margin: 0; }
.capture #notice-text { font-size: 14px; line-height: 1.55; color: var(--mm-ink-2); }
.capture #notice label { display: flex; align-items: flex-start; gap: var(--mm-space-3); font-size: 15px; font-weight: 600; }
.capture #notice input[type="checkbox"] { flex-shrink: 0; width: 22px; height: 22px; margin: 1px 0 0; }

/*
  The signed-in screens, as the seeded design draws them (app.dc.html with
  components.dc.html): the page ground and ink, the page title, the rows of a
  screen as cards, Today's next action (the dark hero variant, with the hero
  tokens), the course tabs, the web record flow on the capture page and the
  feedback form. Loading, empty, error and offline are the design system's
  state components (ds/components.css) and are not restyled here.
*/
body[data-entry="surface"], body.capture { background: var(--mm-page); color: var(--mm-ink); font-family: var(--mm-font); }
body[data-entry="surface"] a, body.capture a { color: var(--mm-primary-text); text-underline-offset: 3px; }

/* The page (app.dc.html, line 166): a column of sections, 32 px apart, at most
   1200 px wide (--mm-content-max). */
body[data-entry="surface"] main { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--mm-space-8); width: 100%; max-width: var(--mm-content-max); }
body[data-entry="surface"] #section-nav { margin: 0; }

/* The page title: 36 px / 800 (line 257), 34 px on a course (line 364). */
body[data-entry="surface"] #title { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: var(--mm-track-h1); line-height: 1.2; }
body:has(#surface[data-surface^="course-"]) #title { font-size: 34px; }

/* The screen: the sentence under the title (line 258: 16 px, ink-2), then the rows. */
body[data-entry="surface"] #surface { display: flex; flex-direction: column; gap: var(--mm-space-3); }
body[data-entry="surface"] #state-holder:empty, body[data-entry="surface"] #status:empty { display: none; }
body[data-entry="surface"] #status, body[data-entry="surface"] #summary, body[data-entry="surface"] #note { margin: 0; font-size: 16px; line-height: 1.5; color: var(--mm-ink-2); }
body[data-entry="surface"] #explainers { margin: 0; font-size: 14px; color: var(--mm-ink-2); }

/* A row is the design's list card (line 400: 1 px line, radius 14 to 16, padding
   16 / 18, the card fill); its words are 15 px / 600 and what it adds 14 px, muted. */
body[data-entry="surface"] #rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
body[data-entry="surface"] #rows > li { box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; padding: 16px 18px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); color: var(--mm-ink); }
body[data-entry="surface"] #rows > li[data-current="true"] { border-left: 4px solid var(--mm-primary-text); }
body[data-entry="surface"] #rows .row-text { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--mm-ink); text-decoration: none; }
body[data-entry="surface"] #rows a.row-text:hover { color: var(--mm-primary-hover); }
body[data-entry="surface"] #rows .detail { font-size: 14px; line-height: 1.5; color: var(--mm-muted); }
body[data-entry="surface"] #rows .row-items { margin: 0; padding-left: 1.25rem; font-size: 14px; line-height: 1.5; color: var(--mm-ink-2); }
body[data-entry="surface"] #rows .chips { margin: 0; }
body[data-entry="surface"] #rows button { margin: 0 8px 0 0; }
body[data-entry="surface"] #rows form, body[data-entry="surface"] #rows .ask { display: flex; flex-direction: column; align-items: flex-start; gap: var(--mm-space-3); width: 100%; margin: 0; }
body[data-entry="surface"] #rows label { font-size: 14px; font-weight: 600; }
body[data-entry="surface"] #rows input, body[data-entry="surface"] #rows textarea { box-sizing: border-box; width: 100%; min-height: var(--mm-touch-nav); padding: 12px 14px; border: 1px solid var(--mm-input-border); border-radius: var(--mm-radius-md); background: var(--mm-card); color: var(--mm-ink); font: 400 16px/1.5 var(--mm-font); }
body[data-entry="surface"] #rows .form-message { margin: 0; font-size: 14px; color: var(--mm-danger); }

/* Today (lines 265-285): the next action is the dark hero card, 20 px radius, 26 px
   padding, the hero fill and its text tokens; the rows after it are the bounded
   secondary list. */
#surface[data-surface="today"] #rows > li[data-kind="primary"] { gap: var(--mm-space-3); padding: 26px; border: none; border-radius: 20px; background: var(--mm-hero); color: var(--mm-hero-text); }
#surface[data-surface="today"] #rows > li[data-kind="primary"] .row-text { font-size: 24px; font-weight: 700; letter-spacing: var(--mm-track-h2); line-height: 1.3; color: var(--mm-hero-text); }
#surface[data-surface="today"] #rows > li[data-kind="primary"] .detail { font-size: 15px; line-height: 1.55; color: var(--mm-hero-muted); }
#surface[data-surface="today"] #rows > li[data-kind="primary"] .row-items { color: var(--mm-hero-muted); }

/* A focused item of the navigation shows the design's ring, also on the current item (line 17). */
#primary-nav a:focus-visible { box-shadow: var(--mm-focus); }

/* A course (line 365: its sentence is 15 px; line 387: a class's detail is 13 px)
   and Study (line 471: a unit is a card of 20 px radius and 24 px padding). */
body:has(#surface[data-surface^="course-"]) #summary { font-size: 15px; }
#surface[data-surface="course-timeline"] #rows > li[data-kind="class"] .detail { font-size: 13px; }
#surface[data-surface="study"] #rows > li { gap: var(--mm-space-3); padding: 24px; border-radius: 20px; }

/* Courses (line 341): a course is a card of 18 / 20 padding, its name 17 px / 700. */
#surface[data-surface="courses"] #rows > li { padding: 18px 20px; }
#surface[data-surface="courses"] #rows .row-text { font-size: 17px; font-weight: 700; }

/* The course tabs (line 372): the links of a course's screens as a row of tabs
   along a line, the current one in ink with a bar of 2 px under it. */
body[data-entry="surface"] #section-nav #section-links { display: flex; flex-wrap: nowrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--mm-line); overflow-x: auto; overflow-y: hidden; }
body[data-entry="surface"] #section-nav a { box-sizing: border-box; display: inline-flex; align-items: center; min-height: var(--mm-touch); padding: 0 10px; border-bottom: 2px solid transparent; background: none; color: var(--mm-ink-2); font: 600 15px/1.3 var(--mm-font); text-decoration: none; white-space: nowrap; }
body[data-entry="surface"] #section-nav a[aria-current="page"] { border-bottom-color: var(--mm-primary-text); color: var(--mm-ink); }
@media (min-width: 860px) {
  body[data-entry="surface"] #section-nav a { padding: 0 16px; }
}
/* The other pages' related links: quiet links at the end of the page, not tabs
   and not a row under the title. */
#page-more { margin-top: 24px; }
#page-more #section-links { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; padding: 0; list-style: none; }
#page-more a { display: inline-flex; align-items: center; min-height: var(--mm-touch); color: var(--mm-primary-text); font: 600 14px var(--mm-font); text-decoration: underline; text-underline-offset: 3px; }
#page-more a[aria-current="page"] { color: var(--mm-ink); text-decoration: none; }

/* The page head: the title, the one-line purpose and the page's actions on one
   row (app.dc.html, line 325: space between, centred, 16 px gap, wrapping; the
   sentence under the title is 16 px, ink-2, 6 px below it, line 258). */
#page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
#page-head-text { min-width: 0; }
#purpose { margin: 6px 0 0; font-size: 16px; color: var(--mm-ink-2); }
body:has(#surface[data-surface^="course-"]) #purpose { font-size: 15px; }
#page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#page-actions:empty { display: none; }
/* A page action is the design's primary button (app.dc.html, line 327). */
#page-actions a { box-sizing: border-box; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--mm-primary); color: var(--mm-on-primary); font: 600 15px var(--mm-font); text-decoration: none; }

/* The page body: the screen, and from 1440 px the aside card beside it (app.dc.html,
   line 260: two columns 2fr and 1fr, the second at least 260 px, 24 px apart). */
#page-body { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (min-width: 1440px) {
  #page-body:has(#page-aside:not([hidden])) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
}

/* The feedback form and its dialog (components.dc.html, the dialog: 20 px radius,
   24 px padding, the card fill, the third elevation, a title of the h3 type, a body
   of 15 px / 1.55 in ink-2). */
#feedback { box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; max-width: 640px; padding: 24px; border: 1px solid var(--mm-line); border-radius: 20px; background: var(--mm-card); color: var(--mm-ink); box-shadow: var(--mm-elev-3); }
#feedback p, #feedback h2 { margin: 0; }
#feedback-title { font: var(--mm-type-h3); }
#feedback-form { display: flex; flex-direction: column; gap: 14px; }
#feedback label { font: var(--mm-type-label); }
#feedback textarea { box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--mm-input-border); border-radius: var(--mm-radius-md); background: var(--mm-card); color: var(--mm-ink); font: 400 16px/1.5 var(--mm-font); }
#feedback-note, #feedback-status { font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
#feedback-send { min-height: var(--mm-touch-nav); padding: 0 20px; }
#feedback-state { margin: 0; }

/* The web record flow on the capture page (app.dc.html, lines 168-252): a column
   640 px wide, its title 32 px / 800, each state a card of 20 px radius and 24 px
   padding; with the microphone off the title is 30 px / 800 and the state has no
   card; while recording the state is the dark hero of 28 px radius. */
.capture main { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--mm-space-8); width: 100%; }
.capture main > section { margin-top: 0; }
.capture main > h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: var(--mm-track-h1); line-height: 1.2; }
.capture main h2 { margin: 0; font-size: 18px; font-weight: 700; }
.capture #state { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--mm-space-3); padding: 24px; border: 1px solid var(--mm-line); border-radius: 20px; background: var(--mm-card); color: var(--mm-ink); }
.capture #state p, .capture #state h2 { margin: 0; }
.capture #state-title { font: var(--mm-type-title); }
.capture #state-text { font-size: 15px; line-height: 1.6; color: var(--mm-ink-2); }
.capture #state.no-audio { padding: 0; border: none; border-radius: 0; background: none; }
.capture #state.no-audio #state-title { font-size: 30px; font-weight: 800; letter-spacing: var(--mm-track-h1); line-height: 1.2; }
.capture #state.no-audio #state-text { font-size: 16px; }
.capture #state[data-state="recording"] { padding: 32px 24px; border: none; border-radius: 28px; background: var(--mm-hero); color: var(--mm-hero-text); }
.capture #state[data-state="recording"] #state-title { font-size: 15px; font-weight: 700; color: var(--mm-hero-text); }
.capture #state[data-state="recording"] #state-text { font-size: 14px; line-height: 1.5; color: var(--mm-hero-muted); }
.capture #start { padding: 0 24px; font-size: 16px; }
.capture #sent { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--mm-space-3); padding: 22px; border: 1px solid var(--mm-line); border-radius: 20px; background: var(--mm-card); color: var(--mm-ink); }
.capture #sent p { margin: 0; font-size: 15px; line-height: 1.55; }
.capture #connection { margin: 0; padding: 12px 20px; font-size: 14px; line-height: 1.5; background: var(--mm-warning-soft); color: var(--mm-ink); }

/*
  Profile, language, privacy, export, deletion, grades, record view and the
  metric explainers (screens S09 to S22 of screens.dc.html, drawn with
  screen-body.dc.html), and the Profile page itself (app.dc.html, line 523).
  The screens of the Profile section, a course's Grades screen, the transcript
  screens and the gap report are one group here; the page names its section
  (body[data-section]) and its screen (#surface[data-surface]). A size, radius or
  padding the tokens do not carry is the inline style of the design file named
  beside it; the rows of test/design-expectations/design-app-screens-b.json cite
  each value.
*/

/* The title (screens.dc.html, line 111: 28 px, 34 px on the wide page; 800, tight). */
:is(body[data-section="profile"]:has(#surface:not([data-surface="profile"])), body:has(#surface[data-surface="source-transcript"]), body:has(#surface[data-surface="recording-transcript"]), body:has(#surface[data-surface="grade-gaps"])) #title { font-size: 28px; line-height: 1.25; }
@media (min-width: 860px) {
  :is(body[data-section="profile"]:has(#surface:not([data-surface="profile"])), body:has(#surface[data-surface="source-transcript"]), body:has(#surface[data-surface="recording-transcript"]), body:has(#surface[data-surface="grade-gaps"])) #title { font-size: 34px; }
}
/* A course's Grades screen keeps the title of a course (app.dc.html, line 364: 34 px). */

/* The column of the screen (screens.dc.html, line 281: 720 px, 880 px for S09, S14, S16 and S22). */
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) { box-sizing: border-box; width: 100%; max-width: 720px; }
body[data-entry="surface"][data-section] :is(#surface[data-surface="profile-delete"], #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="metrics"], #surface[data-surface^="metric-"]) { max-width: 880px; }

/* The sentence and the note: the design's paragraph (screen-body.dc.html, line 14: 15 px, ink-2). */
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) :is(#summary, #note, #status) { font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }

/* A row is the design's card (screen-body.dc.html, line 19: 16 px radius, 18 px padding,
   10 px between its parts); its words are the item title (line 52: 15 px / 600) and
   what it adds the item description (13 px, ink-2). */
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows > li { gap: 10px; padding: 18px; }
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows .detail { font-size: 13px; color: var(--mm-ink-2); }
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows .row-items { font-size: 13px; color: var(--mm-ink-2); }

/* The line of a transcript a locator names is the highlighted one (screens.dc.html, line 118: primary-soft). */
:is(#surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"]) #rows > li[data-current="true"] { background: var(--mm-primary-soft); }

/* The Profile page (app.dc.html, line 523: a card of 20 px radius, 22 px padding, 14 px
   between its parts, at most 640 px wide). */
#surface[data-surface="profile"] #rows > li { gap: 14px; max-width: 640px; padding: 22px; border-radius: 20px; }

/* The buttons of a card (screen-body.dc.html, line 75: 600 15px, 44 px, padding 0 18px,
   radius 12): the soft button by default, the primary one to send a form (the
   re-authentication form too), the destructive one for what removes something
   (components.dc.html, line 363: the danger fill, the text of the primary button). */
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows button { padding: 0 18px; }
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows form button[type="submit"] { background: var(--mm-primary); color: var(--mm-on-primary); }
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows button[data-variant="destructive"] { background: var(--mm-danger-fill); color: var(--mm-on-primary); }

/* The fields of a card (screen-body.dc.html, lines 68 to 70: a 14 px / 600 label, a field of
   48 px, padding 0 14px, radius 12, the input border) and what a field says when it is
   wrong (components.dc.html, line 165: 13 px, 500, danger). */
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows input { padding: 0 14px; }
:is(body[data-section="profile"] #surface:not([data-surface="profile"]), #surface[data-surface="course-grades"], #surface[data-surface="source-transcript"], #surface[data-surface="recording-transcript"], #surface[data-surface="grade-gaps"]) #rows .form-message { font-size: 13px; font-weight: 500; }

/* The question before something is removed or an export is handed over is the design's
   dialog (components.dc.html, line 357: 20 px radius, 24 px padding, 14 px between its
   parts, the third elevation; its words 15 px / 1.55 in ink-2; the buttons 16 px apart,
   the one that keeps everything an outlined one, line 362). */
body[data-entry="surface"] #rows > li .ask { box-sizing: border-box; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 16px; width: 100%; padding: 24px; border: 1px solid var(--mm-line); border-radius: 20px; background: var(--mm-card); color: var(--mm-ink); box-shadow: var(--mm-elev-3); }
body[data-entry="surface"] #rows > li .ask .ask-text { flex: 1 1 100%; margin: 0; font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
body[data-entry="surface"] #rows > li .ask button { margin: 0; }
body[data-entry="surface"] #rows > li .ask button:not([data-variant]):not([type="submit"]) { border: 1px solid var(--mm-line-strong); background: var(--mm-card); color: var(--mm-ink); }
body[data-entry="surface"] #rows > li .ask form { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; width: 100%; margin: 0; }
body[data-entry="surface"] #rows > li .ask form > :is(label, input, .form-message) { flex: 1 1 100%; }

/* The integrity redirect (S20; screens.dc.html line 246, drawn by screen-body.dc.html): not a
   card but the design's flow of an eyebrow, the heading (the title), a paragraph and full-width
   buttons, 16 px apart. The eyebrow is the note (line 10: 12 px / 700, 0.12em, upper case, ink-2),
   the heading the title (line 12: 28 px, 34 px on the wide page, 800, tight), the paragraphs
   15 px in ink-2 (line 14), the buttons 16 px / 600, 48 px, padding 0 20 px, radius 12 (line 82). */
body:has(#surface[data-surface="integrity-redirect"]) #title { font-size: 28px; font-weight: 800; letter-spacing: var(--mm-track-h1); line-height: 1.25; color: var(--mm-ink); }
@media (min-width: 860px) {
  body:has(#surface[data-surface="integrity-redirect"]) #title { font-size: 34px; }
}
body[data-entry="surface"] #surface[data-surface="integrity-redirect"] { box-sizing: border-box; width: 100%; max-width: 720px; gap: var(--mm-space-4); }
#surface[data-surface="integrity-redirect"] #note { order: -1; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: var(--mm-track-eyebrow); text-transform: uppercase; color: var(--mm-ink-2); }
#surface[data-surface="integrity-redirect"] :is(#summary, #status) { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
#surface[data-surface="integrity-redirect"] #rows > li { gap: 0; padding: 0; border: none; border-radius: 0; background: none; }
#surface[data-surface="integrity-redirect"] #rows > li[data-kind="integrity-intro"] .row-text,
#surface[data-surface="integrity-redirect"] #rows > li[data-kind="integrity-note"] .detail { font-size: 15px; font-weight: 400; line-height: 1.55; color: var(--mm-ink-2); }
#surface[data-surface="integrity-redirect"] #rows > li[data-kind="integrity-alternative"] { align-items: stretch; }
#surface[data-surface="integrity-redirect"] #rows > li[data-kind="integrity-alternative"] button { margin: 0; width: 100%; min-height: var(--mm-touch-nav); padding: 0 20px; border-radius: var(--mm-radius-md); font-size: 16px; font-weight: 600; text-align: left; color: var(--mm-primary-text); background: var(--mm-primary-soft); }
#surface[data-surface="integrity-redirect"] #rows > li[data-kind="integrity-note"] { flex-direction: column-reverse; }

/* Email and password (app.dc.html, lines 56-70): the password field is a bordered
   row, 48 px high, radius 12, with the Show button at its end (min width 72,
   600 14 px, on the surface colour); the links row is 14 px and spreads. */
.pw-field { box-sizing: border-box; display: flex; min-height: 48px; border: 1px solid var(--mm-input-border); border-radius: var(--mm-radius-md); background: var(--mm-card); }
.pw-field input { box-sizing: border-box; flex: 1; min-width: 0; padding: 0 14px; border: none; border-radius: var(--mm-radius-md) 0 0 var(--mm-radius-md); background: transparent; color: var(--mm-ink); font: 400 16px var(--mm-font); }
.pw-field .pw-toggle { min-width: 72px; padding: 0 14px; border: none; border-radius: 0 var(--mm-radius-md) var(--mm-radius-md) 0; background: var(--mm-surface); color: var(--mm-primary-text); font: 600 14px var(--mm-font); cursor: pointer; }
.entry-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; }
.entry-hint { font-size: 13px; line-height: 1.5; color: var(--mm-muted); }
#forgot-form .entry-text { white-space: normal; }

/* The sign-in card as the design draws it (app.dc.html, lines 43-72): one card,
   420 px wide, 32 px padding, 24 px radius, the logo, the title and the line
   under it, then the fields. The logo is the page header and the rest is the
   page, so the header is the top of the card and the page its body, joined
   without a seam. The form inside has no frame of its own. */
body[data-entry="sign-in"] { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 20px; box-sizing: border-box; }
body[data-entry="sign-in"]:has(#primary-nav[hidden]) #banner { grid-column: auto; box-sizing: border-box; width: 100%; max-width: 420px; padding: 16px 16px 0; background: var(--mm-card); border: 1px solid var(--mm-line); border-bottom: none; border-radius: 24px 24px 0 0; }
body[data-entry="sign-in"]:has(#primary-nav[hidden]) main { grid-column: auto; grid-row: auto; box-sizing: border-box; width: 100%; max-width: 420px; padding: 8px 32px 32px; background: var(--mm-card); border: 1px solid var(--mm-line); border-top: none; border-radius: 0 0 24px 24px; align-items: stretch; gap: 0; }
body[data-entry="sign-in"] #page-body { margin: 0; }
body[data-entry="sign-in"] #sign-in { margin-top: 20px; }
body[data-entry="sign-in"] main > * { max-width: none; }
body[data-entry="sign-in"] #page-head { margin: 0; }
body[data-entry="sign-in"] #status { margin: 6px 0 0; font-size: 15px; }
body[data-entry="sign-in"] #surface { display: flex; flex-direction: column; gap: 0; }
body[data-entry="sign-in"] #rows:empty, body[data-entry="sign-in"] #explainers { display: none; }
body[data-entry="sign-in"] .entry-card { padding: 0; border: none; border-radius: 0; background: none; }
body[data-entry="sign-in"] #page-foot { display: none; }

/* The card's logo as the design draws it there (app.dc.html line 47: the Logo at 36 px with its wordmark, for the design's own gradient variant; another configured variant keeps its own minimum; the wordmark and
   gap are the design's formulas of the icon size, logo.dc.html: text 0.6, gap 0.32 of the icon). The clear space stays. */
body[data-entry="sign-in"] #home .ds-logo img[data-variant="gradient"] { width: 36px !important; min-width: 36px !important; }
body[data-entry="sign-in"] #home .ds-logo:has(img[data-variant="gradient"]) { gap: 12px !important; }
body[data-entry="sign-in"] #home .ds-logo:has(img[data-variant="gradient"]) .ds-wordmark { font-size: 22px !important; }
/* The line under the title is the muted text on the card (app.dc.html line 49; 4.83:1 on the card). */
body[data-entry="sign-in"] #status { color: var(--mm-muted); }
/* Line heights as the design sets them (none: the font's normal line height), so the heights of the title, the line under
   it and the labels are the design's (34, 19 and 17 px at these sizes). */
body[data-entry="sign-in"] #title, body[data-entry="sign-in"] #status, body[data-entry="sign-in"] .ds-label, body[data-entry="sign-in"] .entry-links { line-height: normal; }
/* The design's password row sits 1 px lower than the field above it (its border is outside the 6 px label gap) and its
   button 1 px lower again (app.dc.html lines 60 and 65). */
body[data-entry="sign-in"] .pw-field { margin-top: 1px; }
body[data-entry="sign-in"] .entry-card p:has(> button[type="submit"]) { margin-top: 1px; }

/* The forms of the Courses tab (WP-25, manage.js): a semester, a course, a class, a file. They sit below the list as the design's
   form cards (UI-CRS-02: single column on a phone, a card on the wide page), in the same fields and buttons the rows use. */
#manage { margin-top: var(--mm-space-5); display: flex; flex-direction: column; gap: 14px; }
#manage:empty { display: none; }
#manage .manage-form, .manage-openable .manage-form { box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; gap: var(--mm-space-3); width: 100%; max-width: 640px; padding: 20px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); color: var(--mm-ink); }
.manage-form[hidden] { display: none; }
.manage-form .manage-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--mm-ink); }
.manage-form .manage-field { display: flex; flex-direction: column; gap: 6px; width: 100%; margin: 0; }
.manage-form label { font-size: 14px; font-weight: 600; }
.manage-form :is(input, select) { box-sizing: border-box; width: 100%; min-height: var(--mm-touch-nav); padding: 10px 14px; border: 1px solid var(--mm-input-border); border-radius: var(--mm-radius-md); background: var(--mm-card); color: var(--mm-ink); font: 400 16px/1.5 var(--mm-font); }
.manage-form .detail { font-size: 14px; line-height: 1.5; color: var(--mm-muted); }
.manage-form .form-message { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--mm-danger); }
.manage-form .form-message[data-ok="true"] { color: var(--mm-ink-2); }
.manage-openable { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; margin-top: 6px; }
.manage-openable > button { margin: 0; }
.manage-more button, #manage .manage-link a { min-height: var(--mm-touch-nav); display: inline-flex; align-items: center; }
#rows .manage-form { max-width: 100%; padding: 14px; }
.manage-kinds { box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 0; padding: 0; border: none; }
.manage-kinds legend { padding: 0; margin-bottom: 10px; font-size: 17px; font-weight: 700; color: var(--mm-ink); }
.manage-kind { display: flex; align-items: center; gap: 12px; box-sizing: border-box; width: 100%; min-height: var(--mm-touch-nav); padding: 10px 14px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-md); background: var(--mm-card); font-size: 15px; font-weight: 600; color: var(--mm-ink); }
.manage-kind:has(input:checked) { border-color: var(--mm-primary-text); }
.manage-kind input { width: auto; min-height: 0; margin: 0; }
.manage-callout { margin: 4px 0 0; padding: 12px 14px; border-left: 4px solid var(--mm-primary-text); border-radius: var(--mm-radius-md); background: var(--mm-primary-soft); font-size: 14px; line-height: 1.5; color: var(--mm-ink-2); }
/* The check (WP-20): the labels of the revealed sentence and of what the learner wrote. */
.check-label { margin: 0.75rem 0 0.1rem; font-weight: 600; }
.check-prompt { margin: 0.75rem 0; }

/* ---- The Profile tab, Settings, and the compact card of switches (design tokens only) ---- */
/* The back arrow of a Settings screen, left of its title. */
.page-back { box-sizing: border-box; display: inline-flex; flex: none; align-items: center; justify-content: center; order: -1; width: 44px; height: 44px; margin-left: -10px; border-radius: 12px; color: var(--mm-ink); text-decoration: none; font: 400 30px/1 var(--mm-font); }
.page-back[hidden] { display: none; }
.page-back::before { content: "\2039"; }
.page-back:hover { background: var(--mm-primary-soft); }
.page-back + #page-head-text { flex: 1 1 0; }
/* The menu icon beside the Profile title (the Courses action is a filled button; this one is a bare icon). */
#page-actions a.icon-action { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; background: transparent; color: var(--mm-ink); }
#page-actions a.icon-action:hover { background: var(--mm-primary-soft); }

/* The wrappers of the new rows are not cards of their own; the lists inside them are. */
body[data-entry="surface"] #rows > li[data-kind="profile-header"],
body[data-entry="surface"] #rows > li[data-kind="profile-stats"],
body[data-entry="surface"] #rows > li[data-kind="profile-buttons"],
body[data-entry="surface"] #rows > li[data-kind="settings-list"],
body[data-entry="surface"] #rows > li[data-kind="switch-card"] { width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; }
body[data-entry="surface"] #rows > li[data-kind="profile-header"] { flex-direction: row; align-items: center; gap: 14px; }
.avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--mm-primary-soft); color: var(--mm-primary-text); }
.profile-age { margin: 0; color: var(--mm-ink-2); font: 500 15px var(--mm-font); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.profile-stats li { margin: 0; }
.profile-stats a { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--mm-touch); padding: 10px 4px; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-md); background: var(--mm-card); color: var(--mm-ink); text-decoration: none; }
.stat-count { font: 700 20px/1.2 var(--mm-font); }
.stat-label { color: var(--mm-ink-2); font: 500 13px var(--mm-font); }
.profile-buttons { display: flex; gap: 10px; width: 100%; }
.profile-buttons .ds-button { flex: 1 1 0; justify-content: center; min-height: 44px; text-decoration: none; }

/* The Settings list: one grouped list, a row per place. */
.settings-list { display: flex; flex-direction: column; gap: var(--mm-space-5); width: 100%; }
.settings-list section h2 { margin: 0 0 6px 4px; color: var(--mm-ink-2); font: 600 13px var(--mm-font); }
.settings-list ul { margin: 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); }
#rows .settings-list li, .settings-list li { margin: 0; }
.settings-list li + li { border-top: 1px solid var(--mm-line); }
.settings-row, #rows .settings-row { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 8px 16px; border: 0; border-radius: 0; background: transparent; color: var(--mm-ink); font: 500 16px var(--mm-font); text-align: left; text-decoration: none; cursor: pointer; }
.settings-row:hover { background: var(--mm-surface); }
.settings-row[aria-current="page"] { background: var(--mm-primary-soft); }
.settings-row[data-danger="true"] { color: var(--mm-danger); }
.settings-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-detail { color: var(--mm-ink-2); font: 400 13px var(--mm-font); }
.chevron { flex: none; color: var(--mm-muted); font: 400 22px/1 var(--mm-font); }

/* One compact card of switches (Privacy, AI processing, Language). */
.card-title { margin: 0 0 6px 4px; color: var(--mm-ink-2); font: 600 13px var(--mm-font); }
.switch-list { width: 100%; margin: 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); }
#rows .switch-item, .switch-item { box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 10px 16px; min-height: 56px; }
.switch-item + .switch-item { border-top: 1px solid var(--mm-line); }
.switch-text { display: flex; flex: 1 1 160px; flex-direction: column; gap: 2px; min-width: 0; }
.switch-label { font: 600 15px/1.3 var(--mm-font); }
.switch-detail { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--mm-ink-2); font: 400 13px/1.35 var(--mm-font); }
.switch, #rows .switch { position: relative; flex: none; box-sizing: border-box; width: 52px; min-width: 52px; height: 32px; min-height: 32px; margin: 0; padding: 0; border: 0; border-radius: 16px; background: var(--mm-line-strong); cursor: pointer; }
.switch::after { content: ""; position: absolute; inset: -8px -4px; }
.switch[aria-checked="true"] { background: var(--mm-primary); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--mm-card); box-shadow: var(--mm-elev-1); transition: transform 0.15s; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
.switch:disabled { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .switch-knob { transition: none; } }
.segmented { display: inline-flex; flex: none; overflow: hidden; border: 1px solid var(--mm-line-strong); border-radius: 10px; }
#rows .segmented button, .segmented button { min-height: 36px; margin: 0; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: var(--mm-ink); font: 600 14px var(--mm-font); }
.segmented button[aria-pressed="true"] { background: var(--mm-primary); color: var(--mm-on-primary); }
#rows .clear, .clear { min-height: 36px; margin: 0; padding: 0 8px; border: 0; background: transparent; color: var(--mm-primary-text); font: 600 13px var(--mm-font); text-decoration: underline; }

/* The Profile pages keep to one column of 720 px; in a wide window Settings is a list (320 px) beside the screen it opened. */
body[data-section="profile"] #page-head, body[data-section="profile"] #page-body { max-width: 720px; }
#settings-nav[hidden] { display: none; }
@media (max-width: 859.98px) { #settings-nav { display: none; } }
@media (min-width: 860px) {
  body[data-settings="detail"] main { display: grid; grid-template-columns: 320px minmax(0, 720px); align-content: start; column-gap: 32px; }
  body[data-settings="detail"] main > * { grid-column: 2; }
  body[data-settings="detail"] main > #settings-nav { grid-column: 1; grid-row: 1 / span 4; margin-top: 8px; }
}
#steps > li[hidden] { display: none; }
.profile-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-who p { margin: 0; overflow-wrap: anywhere; }
.profile-name { font: 700 18px var(--mm-font); }
.profile-email { color: var(--mm-ink-2); font: 400 14px var(--mm-font); }
.avatar.initials { font: 700 20px var(--mm-font); }

/* The five tabs: an icon above a short label; Study is the centre one and is a little stronger (no floating button). */
#primary-nav a svg { flex: none; width: 24px; height: 24px; }
#primary-nav .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#primary-nav li[data-emphasis="true"] a { color: var(--mm-ink); }
#primary-nav li[data-emphasis="true"] a svg { width: 28px; height: 28px; stroke-width: 2.25; }
#primary-nav li[data-emphasis="true"] .nav-label { font-weight: 700; }
#primary-nav li[data-emphasis="true"] a[aria-current="page"] { color: var(--mm-primary-text); }
@media (max-width: 859.98px) {
  #primary-nav a { min-height: 48px; padding: 2px 0; font-size: 11px; }
  #primary-nav li[data-emphasis="true"] a { background: var(--mm-primary-soft); border-radius: 14px; }
}
@media (min-width: 860px) { #primary-nav a svg { width: 20px; height: 20px; } #primary-nav li[data-emphasis="true"] a svg { width: 22px; height: 22px; } }
/* The Profile header, counts and buttons sit on the page, not in cards: they line up with the course cards below them. */
#surface[data-surface="profile"] #rows > li:is([data-kind="profile-header"], [data-kind="profile-stats"], [data-kind="profile-buttons"]) { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; max-width: 640px; }
/* Settings rows and entry rows are one column of full-width rows, whatever the list rules of the page say. */
.settings-list ul { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; }
.settings-list ul > li { display: block; width: 100%; max-width: none; padding: 0; border-left: 0; border-right: 0; border-bottom: 0; border-radius: 0; background: transparent; box-shadow: none; }
.settings-list ul > li + li { border-top: 1px solid var(--mm-line); }
.settings-list .settings-row { width: 100%; }

/* The + button of Courses and its menu. */
.menu-holder { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--mm-z-nav); min-width: 240px; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--mm-line); border-radius: var(--mm-radius-lg); background: var(--mm-card); box-shadow: var(--mm-elev-3); }
.menu-list[hidden] { display: none; }
.menu-list li { margin: 0; }
.menu-item, #page-actions .menu-item { box-sizing: border-box; display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--mm-ink); font: 500 16px var(--mm-font); text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--mm-primary-soft); }
#add-panel { box-sizing: border-box; width: 100%; max-width: 640px; margin: 0 0 var(--mm-space-5); }
#add-panel[hidden], #add-panel [data-add][hidden] { display: none; }
#add-panel [data-add] { display: flex; flex-direction: column; align-items: flex-start; gap: var(--mm-space-3); }
#page-actions button.icon-action { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--mm-primary-soft); color: var(--mm-primary-text); cursor: pointer; }

/* Invite a friend: the link and code shown once, each a read-only field with its Copy button. */
#rows .copyable { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
#rows .copyable label { flex: 1 0 100%; font-size: 13px; font-weight: 600; }
#rows .copyable input { flex: 1 1 200px; min-width: 0; font: inherit; font-size: 14px; padding: 8px 10px; }
