/* Rowtrail SQL — layout of the views (D.2, §16, wireframes C.4): bar, Home, Learn in reading and in exercises, the
   runner's parts, Practice/Review/Sandbox/Settings. Tokens only; the one px is the 900px breakpoint of
   build/px-allowlist.json, under which the columns stack. */
.bar { position: sticky; top: 0; z-index: var(--z-bar); display: flex; align-items: center; gap: var(--space-4); min-height: var(--layout-bar-height); padding: 0 var(--space-4); background: var(--color-surface-alt); border-bottom: var(--border-1) solid var(--color-border); font-size: var(--text-sm); }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-reading); font-weight: var(--weight-semibold); color: var(--color-text); text-decoration: none; }
.brand .mark { width: var(--mark-size); height: var(--mark-size); color: var(--color-accent); flex: none; }
/* v1.11 (design-system.md §9): «Rowtrail» takes the brand face; «SQL» in the UI face, regular, muted. */
.brand-sql { font-family: var(--font-ui); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.sections { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.section-link { color: var(--color-text-muted); text-decoration: none; padding: var(--space-2) 0; border-bottom: var(--border-2) solid transparent; }
.section-link[aria-current="page"] { color: var(--color-text); font-weight: var(--weight-semibold); border-bottom-color: var(--color-accent); }
.data-state { margin-left: auto; min-height: var(--control-height); padding: 0 var(--space-2); background: transparent; border: var(--border-1) solid var(--color-border); border-radius: var(--radius-md); font: inherit; font-family: var(--font-ui); font-size: var(--text-xs); color: var(--color-text-2); cursor: pointer; }
.view { max-width: var(--layout-max); margin: 0 auto; padding: var(--space-5) var(--space-4); }
.page { padding: var(--space-5) 0; }
.narrow { max-width: var(--measure-narrow); margin: 0 auto; display: grid; gap: var(--space-4); }

/* Home */
.home { display: grid; gap: var(--space-5); }
.home-body { max-width: var(--layout-max); width: 100%; margin: 0 auto; display: grid; gap: var(--space-5); }
.home-title { font-size: var(--text-xl); line-height: var(--leading-xl); }
.resume-title { font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-semibold); }
.legend { font-size: var(--text-sm); color: var(--color-text-muted); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.legend-item { display: inline-flex; align-items: center; gap: var(--space-2); }

/* Learn, reading */
.reading-page { position: relative; display: grid; gap: var(--space-3); }
.schema-toggle { justify-self: end; }
.schema-panel { background: var(--color-surface); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-3); }
.reading { max-width: var(--measure-reading); margin: 0 auto; font-family: var(--font-reading); line-height: var(--leading-reading); display: grid; gap: var(--space-5); }
.lesson-title { font-size: var(--text-xl); line-height: var(--leading-xl); }
.lesson-summary { color: var(--color-text-2); }
.gate-line { font-size: var(--text-sm); color: var(--color-text-muted); display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.lesson-model pre { margin: var(--space-1) 0 0; white-space: pre-wrap; }
.para { display: grid; gap: var(--space-3); }
.para-title { font-size: var(--text-lg); line-height: var(--leading-lg); }
.example { border-left: var(--border-3) solid var(--color-border); padding-left: var(--space-4); display: grid; gap: var(--space-2); }
/* Session 43: the reading and its examples are grids with one column, which by default grows to the narrowest width of
   its widest child; on a phone a wide result table pushed the page sideways instead of scrolling in its own box. */
.reading, .example, .example-error { grid-template-columns: minmax(0, 1fr); }
.example-sql { margin: 0; white-space: pre-wrap; }
.example-empty { color: var(--color-text-muted); font-style: italic; }
.example-error { display: grid; gap: var(--space-1); }
.preview-table { margin-bottom: var(--space-2); }
.lesson-go { display: flex; gap: var(--space-3); align-items: center; }

/* Learn, exercises: theory | exercise | schema */
/* D.3 (design-system.md §10.4): the side columns are margins of the page, one tone darker and set off by a rule; the centre is the paper. */
.three-col { display: grid; grid-template-columns: var(--layout-col-theory) minmax(0, 1fr) var(--layout-col-schema); gap: 0; align-items: stretch; border: var(--border-1) solid var(--color-border-strong); border-radius: var(--radius-lg); overflow: hidden; }
.three-col > .col-theory { background: var(--color-surface-side); border-right: var(--border-1) solid var(--color-border-strong); padding: var(--space-4); }
.three-col > .col-schema { background: var(--color-surface-side); border-left: var(--border-1) solid var(--color-border-strong); padding: var(--space-4); }
.three-col > .col-main { background: var(--color-surface); padding: var(--space-4) var(--space-5); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) var(--layout-col-schema); gap: var(--layout-gap); align-items: start; }
.col-theory, .col-main, .col-schema { display: grid; gap: var(--space-3); min-width: 0; align-content: start; }
.lesson-box { display: grid; gap: var(--space-2); justify-items: start; font-size: var(--text-sm); padding-bottom: var(--space-4); border-bottom: var(--border-1) solid var(--color-border); }
.lesson-box-title { font-weight: var(--weight-semibold); font-size: var(--text-lg); line-height: var(--leading-lg); }
.lesson-box-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.theory { display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.theory-block { color: var(--color-text-muted); padding-left: var(--space-3); border-left: var(--border-3) solid transparent; }
.theory-block.is-teaches { color: var(--color-text); border-left-color: var(--color-accent); }
.theory-block.is-see { color: var(--color-text); border-left-color: var(--color-accent); border-left-style: dashed; }
.theory-see { padding-left: var(--space-3); }
.theory-mark { font-size: var(--text-xs); color: var(--color-text-muted); }
.theory-title { font-weight: var(--weight-semibold); }

.exbox { border: var(--border-1) solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.exbox-head { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); background: var(--color-surface-alt); font-size: var(--text-sm); color: var(--color-text-muted); }
.dots { display: inline-flex; gap: var(--space-2); align-items: center; }
button.dot { padding: 0; cursor: pointer; }
button.dot[aria-current="true"] { outline: var(--border-2) solid var(--color-accent); outline-offset: var(--border-2); }
button.dot:disabled { background: var(--color-neutral-bg); border-color: var(--color-neutral); border-style: dashed; cursor: default; }
.exbox-body { height: var(--exbox-body-height); overflow-y: auto; padding: var(--space-3); display: grid; gap: var(--space-2); align-content: start; }
.exbox-prompt { font-size: var(--text-md); }
.exbox-hint { font-size: var(--text-sm); color: var(--color-text-2); }
.exbox-work { padding: 0 var(--space-3) var(--space-3); display: grid; gap: var(--space-2); border-top: var(--border-1) solid var(--color-border-soft); padding-top: var(--space-3); }
.exbox-commands { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2); background: var(--color-surface-alt); border-top: var(--border-1) solid var(--color-border-soft); }
.predict-ask { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-sm); }
.read-answer { min-height: var(--control-height); width: 100%; }
.command-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.options { display: grid; gap: var(--space-2); }
.option { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; width: 100%; padding: var(--space-3); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.option[data-state="selected"] { border-color: var(--color-accent); background: var(--color-surface-alt); }
.option[data-state="wrong"] { border-style: dashed; color: var(--color-text-muted); cursor: default; }
.option[data-state="dim"] { opacity: var(--opacity-dim); }
.option[data-state="right"] { border-color: var(--color-success); background: var(--color-success-bg); }
.option-why { font-size: var(--text-sm); color: var(--color-text-2); font-style: italic; padding: 0 var(--space-3); }
.option-status { font-size: var(--text-sm); }

.verdict { border: var(--border-1) solid var(--color-border-strong); border-left-width: var(--border-3); border-radius: var(--radius-md); padding: var(--space-3); display: grid; gap: var(--space-1); }
.verdict[data-state="empty"] { color: var(--color-text-muted); border-left-width: var(--border-1); }
.verdict[data-state="ok"] { border-color: var(--color-success); background: var(--color-success-bg); }
.verdict[data-state="ok"] .verdict-sentence { color: var(--color-success); }
.verdict[data-state="ko"], .verdict[data-state="retry"] { border-color: var(--color-error); background: var(--color-error-bg); }
.verdict[data-state="ko"] .verdict-sentence, .verdict[data-state="retry"] .verdict-sentence { color: var(--color-error); }
.verdict[data-state="solution"], .verdict[data-state="read"] { border-color: var(--color-warning); background: var(--color-warning-bg); }
.verdict[data-state="solution"] .verdict-sentence, .verdict[data-state="read"] .verdict-sentence { color: var(--color-warning); }
.verdict .btn-primary { color: var(--color-text-on-accent); }
.verdict-sentence { font-weight: var(--weight-semibold); display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.verdict-detail, .detail-line { font-size: var(--text-sm); color: var(--color-text-muted); }
.query-warning { border: var(--border-1) solid var(--color-warning); border-left-width: var(--border-3); border-radius: var(--radius-md); background: var(--color-warning-bg); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); margin-top: var(--space-2); }
.query-warning .label { color: var(--color-warning); margin-right: var(--space-1); }
.result { display: grid; gap: var(--space-2); }
.result-error { display: grid; gap: var(--space-1); font-size: var(--text-sm); border-left: var(--border-3) solid var(--color-error); padding-left: var(--space-3); }
.explain { font-size: var(--text-sm); border: var(--border-1) solid var(--color-border-soft); border-radius: var(--radius-md); padding: var(--space-3); }
.explain-title { font-weight: var(--weight-semibold); }
.explain-clause { font-weight: var(--weight-semibold); }

.end-screen { max-width: var(--measure-narrow); margin: 0 auto; display: grid; gap: var(--space-3); }
.end-title { font-size: var(--text-lg); line-height: var(--leading-lg); }
.end-next-title { font-weight: var(--weight-semibold); }
.end-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.test-head { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-4); background: var(--color-surface-alt); border-bottom: var(--border-1) solid var(--color-border); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.test-title { font-weight: var(--weight-semibold); }
.test-score { font-size: var(--text-xl); line-height: var(--leading-xl); }
.test-list { padding-left: 0; list-style: none; font-size: var(--text-sm); display: grid; gap: var(--space-1); }

/* Schema browser */
.schema { display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.schema-title { font-weight: var(--weight-semibold); }
.schema-table { border: var(--border-1) solid var(--color-border-soft); border-radius: var(--radius-md); overflow: hidden; }
.schema-name { width: 100%; display: flex; justify-content: space-between; padding: var(--space-1) var(--space-2); border: 0; background: var(--color-surface-alt); font: inherit; font-weight: var(--weight-semibold); color: var(--color-text); cursor: pointer; }
.schema-count { color: var(--color-text-muted); font-weight: var(--weight-regular); }
.schema-body { max-height: var(--schema-table-height); overflow: auto; padding: var(--space-1) var(--space-2); display: grid; gap: var(--space-1); }
.schema-col { color: var(--color-text-2); }
.schema-type { color: var(--color-text-muted); }   /* C.3b: column types are text, not signs */
.schema-note { font-size: var(--text-xs); color: var(--color-text-muted); }

/* Practice, Sandbox, Settings */
.check-list { display: grid; gap: var(--space-1); }
.check-row { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); }
.form-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; font-size: var(--text-sm); }
.set { display: grid; gap: var(--space-2); justify-items: start; padding-bottom: var(--space-4); border-bottom: var(--border-1) solid var(--color-border-soft); }
.set-title { font-size: var(--text-lg); line-height: var(--leading-lg); }
.query-item { display: flex; align-items: center; gap: var(--space-1); }
.query-load { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: var(--space-1) 0; font-size: var(--text-xs); color: var(--color-text-2); cursor: pointer; white-space: pre-wrap; word-break: break-word; }

/* D.3 point 6, layout mobile: under the breakpoint the columns stack, the work first (editor, verdict, result), then the
   lesson and the schema as folded panels; the hub boxes go in one column; the bar scrolls sideways instead of wrapping. */
.fold { display: grid; gap: var(--space-3); }
.fold-body { display: grid; gap: var(--space-3); min-width: 0; }
.fold-head { display: none; }
@media (max-width: 900px) {
  .three-col, .two-col { grid-template-columns: minmax(0, 1fr); }
  .three-col > .col-main { order: 1; }
  .three-col > .col-theory { order: 2; border-right: 0; border-top: var(--border-1) solid var(--color-border-strong); }
  .three-col > .col-schema { order: 3; border-left: 0; border-top: var(--border-1) solid var(--color-border-strong); }
  .fold-head { display: block; cursor: pointer; font-weight: var(--weight-semibold); font-size: var(--text-md); }
  .fold:not([open]) > .fold-body { display: none; }
  .view .hub { grid-template-columns: minmax(0, 1fr); }
  /* F.9 block 3 (session 63, design-system.md §10.17): two rows — the mark and the data state, then the five sections
     across the whole width; on one row that scrolled sideways, Sandbox and Profile were hidden on a phone. */
  .bar { flex-wrap: wrap; gap: 0 var(--space-3); padding: 0 var(--space-3); }
  .brand, .section-link, .data-state { white-space: nowrap; }
  .sections { order: 3; flex: 1 0 100%; flex-wrap: nowrap; justify-content: space-between; overflow-x: auto; min-width: 0; }
  .data-state { margin-left: auto; flex: none; }
  .para { scroll-margin-top: calc(var(--layout-bar-height) * 2 + var(--space-4)); }   /* the bar is two rows here */
  .view { padding-left: var(--space-3); padding-right: var(--space-3); }
  .three-col { border-left: 0; border-right: 0; border-radius: 0; margin-left: calc(var(--space-3) * -1); margin-right: calc(var(--space-3) * -1); }
}
@media (min-width: 900px) {
  .schema-toggle { position: absolute; right: 0; top: 0; }
  .schema-panel { position: absolute; right: 0; top: var(--control-height); z-index: var(--z-panel); width: var(--layout-col-schema); box-shadow: var(--shadow-md); }
}

/* Sandbox data (D.2 second part): source and import in the left column, the import preview in place of the editor. */
/* Session 30 (spec §16.8): the data in the row "Data", three groups side by side, one per row under the column minimum. */
.sb-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--strip-col-min), 100%), 1fr)); gap: var(--space-5); align-items: start; font-size: var(--text-sm); line-height: var(--leading-sm); }
.sb-group { display: grid; gap: var(--space-2); justify-items: start; align-content: start; min-width: 0; }
.sb-lists { display: grid; gap: var(--space-1); font-size: var(--text-sm); line-height: var(--leading-sm); }
.name-form { display: grid; gap: var(--space-2); }
.name-form .input { width: 100%; }
.check-group { display: grid; gap: var(--space-1); }
.check-group + .check-group { margin-top: var(--space-2); }
.notice { display: grid; gap: var(--space-1); font-size: var(--text-sm); border-left: var(--border-3) solid var(--color-border-strong); padding-left: var(--space-3); margin-bottom: var(--space-3); }
.import-preview { display: grid; gap: var(--space-4); }
.import-table { justify-items: stretch; }
.import-col .input { min-width: 0; }

/* Editor (§15.2 "Editor", D.2 second part): a textarea with transparent text over a highlighted mirror, same box and metrics,
   no soft wrap. Locked (predict, read): read-only on the subdued surface. */
.editor-wrap { position: relative; height: var(--editor-height); }
.editor-mirror, .editor-input { position: absolute; inset: 0; margin: 0; padding: var(--space-3); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: var(--text-sm); line-height: var(--leading-md); white-space: pre; overflow: auto; tab-size: 2; letter-spacing: normal; }
.editor-mirror { background: var(--color-surface); color: var(--color-text); pointer-events: none; overflow: hidden; }
.editor-input { background: transparent; color: transparent; caret-color: var(--color-text); resize: none; }
.editor-input::placeholder { color: var(--color-text-muted); }
.editor-input:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.editor-wrap.is-locked .editor-mirror { background: var(--color-surface-alt); }
.tok-keyword { color: var(--color-syntax-keyword); font-weight: var(--weight-semibold); }
.tok-function { color: var(--color-syntax-function); }
.tok-string { color: var(--color-syntax-string); font-style: italic; }
.tok-number { color: var(--color-syntax-number); }
.tok-table, .tok-column { color: var(--color-syntax-name); }
.tok-unknown { color: var(--color-syntax-unknown); text-decoration: underline wavy var(--color-syntax-unknown); }
.tok-comment { color: var(--color-syntax-comment); font-style: italic; }
.editor-ac { position: absolute; z-index: var(--z-panel); width: var(--editor-ac-width); max-height: calc(var(--editor-ac-rows) * var(--leading-md) * var(--text-sm)); overflow-y: auto;
  top: calc(var(--space-3) + var(--ac-line, 1) * var(--leading-md) * var(--text-sm)); left: min(calc(var(--space-3) + var(--ac-col, 0) * 1ch), calc(100% - var(--editor-ac-width)));
  font-family: var(--font-mono); font-size: var(--text-sm); line-height: var(--leading-md); background: var(--color-surface); border: var(--border-1) solid var(--color-border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.editor-ac-item { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0 var(--space-2); cursor: pointer; }
.editor-ac-item[aria-selected="true"] { background: var(--color-surface-alt); font-weight: var(--weight-semibold); }
.editor-ac-kind { color: var(--color-text-muted); font-family: var(--font-ui); }
.schema-name[data-ref="true"] { font-weight: var(--weight-semibold); text-decoration: underline; }
.data-status { font-size: var(--text-sm); border-left: var(--border-3) solid var(--color-border-strong); padding-left: var(--space-3); }
.sb-gen { display: grid; gap: var(--space-2); }
.sb-gen > summary { cursor: pointer; font-size: var(--text-sm); list-style: none; display: inline-flex; align-items: center; gap: var(--space-2); }
.sb-gen > summary::-webkit-details-marker { display: none; }
.sb-gen[open] > summary .strip-chev { transform: rotate(90deg); }
/* Session 43 (Andrea): the sign that opens «Genera nuovi dati» is in the text colour; it reads as part of the command. */
.sb-gen > summary .strip-chev { color: var(--color-text); }
.sb-intro { margin-bottom: var(--space-3); }

/* Home as hub (v1.18): the course box, then Review, Practice and Sandbox side by side. */
.hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.hub-box { display: grid; gap: var(--space-2); align-content: start; justify-items: start; padding: var(--space-4); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.hub-title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.set-sub { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-top: var(--space-3); }
.profile-stats { display: grid; gap: var(--space-1); padding-left: var(--space-4); }
/* Rows of a table from the schema browser, full width in the main column (v1.18). */
/* Session 30 (spec §16.8; Andrea 2026-10-03): open tables under the work, across the whole view; pairs in the order of the
   opening, always side by side (Andrea 2026-10-03, choice B: two very wide tables must stay together to be compared): the
   pair never wraps above the breakpoint; each table takes room in proportion to its natural width (flex basis = content,
   shrink weighted by it) and keeps at least --rows-col-min; a wide one scrolls in its box. An odd one takes what it needs
   up to the row. Under the breakpoint one per row. Folded: the head only, no minimum. */
.table-viewers { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.three-col > .table-viewers { padding: var(--space-4) var(--space-5); background: var(--color-surface); border-top: var(--border-1) solid var(--color-border-strong); }
.tv-row { display: flex; flex-wrap: nowrap; gap: var(--space-4); align-items: flex-start; }
.tv-row > .table-viewer { flex: 1 1 auto; min-width: min(var(--rows-col-min), 100%); max-width: 100%; }
.tv-row.is-single > .table-viewer { flex-grow: 0; }
.tv-row > .table-viewer.is-folded { flex: 0 0 auto; min-width: auto; }
.table-viewer.is-folded .table-viewer-head { white-space: nowrap; gap: var(--space-3); }
.table-viewer { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); min-width: 0; border-top: var(--border-1) solid var(--color-border-soft); padding-top: var(--space-3); }
.table-viewer .res th, .table-viewer .res td { white-space: nowrap; }
.table-viewer-body[hidden] { display: none; }
.table-fold { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2) var(--space-1) 0; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-md); }
.table-fold:hover { background: var(--color-surface-alt); }
.table-viewer:not(.is-folded) .table-fold .strip-chev { transform: rotate(90deg); }
.table-viewer .table-fold .schema-count { font-weight: var(--weight-regular); color: var(--color-text-muted); }
.res .col-name, .res .col-type { display: block; }
.res .col-type { font-family: var(--font-ui); font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.table-viewer-head { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-sm); font-weight: var(--weight-semibold); }

/* D.3 point 1 (design-system.md §5): reading type on the things that are read (titles, summaries, prompts, the theory card),
   the UI face on the things that are used; tabular figures wherever there are counts, times and numbers. */
.home-title, .lesson-title, .para-title, .resume-title, .end-title, .lesson-box-title, .theory-title, .end-next-title, .module-name { font-family: var(--font-reading); font-weight: var(--weight-semibold); }
.resume-summary, .lesson-box-summary { font-family: var(--font-reading); color: var(--color-text-2); line-height: var(--leading-reading); }
.exbox-prompt { font-family: var(--font-reading); line-height: var(--leading-reading); }
.theory { font-family: var(--font-reading); line-height: var(--leading-reading); color: var(--color-text-2); }
.theory .label, .theory-mark { font-family: var(--font-ui); }
.exbox-head, .test-head, .test-score, .test-list, .gate-line, .data-state, .table-cap, .table-viewer-head, .schema-count, .course, .lesson-box, .hub-box, .profile-stats { font-variant-numeric: tabular-nums; }
.gate-line, .lesson-prereq, .schema-toggle { font-family: var(--font-ui); }

/* D.3 Home (design-system.md §10.1, §10.2, §10.6, §10.7). */
.front { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; padding: var(--space-6) var(--space-6) var(--space-5); border-bottom: var(--border-1) solid var(--color-border); }
.front-text { display: grid; gap: var(--space-3); justify-items: start; }
.front-title { font-family: var(--font-reading); font-weight: var(--weight-semibold); font-size: var(--text-2xl); line-height: var(--leading-2xl); }
.front-sub { font-family: var(--font-reading); font-style: italic; color: var(--color-text-2); font-size: var(--text-lg); line-height: var(--leading-reading); max-width: var(--measure-reading); }
.label-front { color: var(--color-text-muted); }
.front-art { width: 100%; max-width: 30rem; justify-self: center; }
.lang-pick { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-2); font-size: var(--text-sm); }
/* Session 27 (design-system.md §10.1): no thin band; on Home the course box is the frontespizio of who returns. */
.course-hero { padding: var(--space-6); gap: var(--space-4); }
.course-hero-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.course-text { display: grid; gap: var(--space-3); justify-items: start; }
.course.course-hero .resume-title { font-family: var(--font-reading); font-weight: var(--weight-semibold); font-size: var(--text-2xl); line-height: var(--leading-2xl); }
.course-hero .front-art { max-width: 22rem; }
@media (max-width: 900px) {
  .course-hero-top, .front { grid-template-columns: minmax(0, 1fr); }
  .front .front-art { max-width: 16rem; justify-self: start; }
  .course-hero .front-art { display: none; }   /* on a phone the course box keeps the work first; the illustration stays in the frontespizio */
}
.course { background: var(--color-accent-soft); border: var(--border-1) solid var(--color-border-strong); border-radius: var(--radius-lg); padding: var(--space-5); display: grid; gap: var(--space-3); }
.label-accent { color: var(--color-accent); }
.course .resume-title { font-size: var(--text-xl); line-height: var(--leading-xl); }
.course .resume-summary { max-width: var(--measure-reading); }
.course-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.ticks { display: flex; gap: var(--space-1); margin-top: var(--space-2); }
.tick { flex: 1; height: var(--tick-height); border-radius: var(--radius-sm); border: var(--border-1) solid var(--color-border-strong); background: var(--color-surface); }
.tick.is-done { background: var(--color-accent); border-color: var(--color-accent); }
.tick.is-current { background: var(--color-accent-soft); border-color: var(--color-accent); }
.course-foot { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-xs); }
.hub-title { display: flex; align-items: center; gap: var(--space-2); }
.ico { width: var(--icon-size); height: var(--icon-size); color: var(--color-accent); flex: none; }

/* D.3 Learn, the course path (design-system.md §10.3) and the lesson dots in their states (§16.1 + "done with errors"). */
.dot { display: inline-block; width: var(--dot-size); height: var(--dot-size); border-radius: 50%; border: var(--border-1) solid var(--color-border-strong); background: var(--color-surface); vertical-align: middle; flex: none; }
.dot[data-state="done"] { background: var(--color-accent); border-color: var(--color-accent); }
.dot[data-state="erred"] { background: var(--color-accent); border-color: var(--color-error); box-shadow: 0 0 0 var(--dot-ring-in) var(--color-error-bg), 0 0 0 var(--dot-ring-out) var(--color-error); }
.dot[data-state="started"] { background: var(--color-accent-soft); border-color: var(--color-accent); }
.dot[data-state="locked"], .dot[data-state="prep"] { background: var(--color-neutral-bg); border-color: var(--color-neutral); border-style: dashed; }
/* Session 27: the introduction, before the path and off its line: a quiet box on the side paper, its lessons with the same
   dots, the way past it as a link. It is read before the course, not a stop of it. */
.intro-block { max-width: var(--path-max); background: var(--color-surface-side); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-2); }
.intro-block .path-lessons { margin: 0; padding-left: 0; border-left: 0; }
.intro-sub { font-size: var(--text-sm); line-height: var(--leading-sm); margin: 0; }
.intro-skip { font-size: var(--text-sm); justify-self: start; }
.front-start { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.tour-label { display: flex; align-items: center; gap: var(--space-2); }   /* F.9: the tour, in the frame of the frontespizio */
.path { position: relative; display: grid; max-width: var(--path-max); }
.stop { position: relative; }
.stop::before { content: ""; position: absolute; left: calc(var(--node-size) / 2 + var(--space-1)); top: 0; bottom: 0; border-left: var(--border-2) solid var(--color-border-strong); }
.stop[data-pos="past"]::before, .stop[data-pos="current"]::before { border-color: var(--color-accent); }
.stop[data-pos="current"]::before { bottom: auto; height: var(--space-6); }
/* Session 31: below the current node the line goes on in grey to the next module (it broke at the open module). */
.stop[data-pos="current"]::after { content: ""; position: absolute; left: calc(var(--node-size) / 2 + var(--space-1)); top: var(--space-6); bottom: 0; border-left: var(--border-2) solid var(--color-border-strong); }
.stop[data-pos="current"]:first-child::after { top: calc(var(--space-4) + var(--space-6)); }
.stop[data-pos="current"]:last-child::after { content: none; }
.stop:first-child::before { top: var(--space-4); }
.stop:last-child::before { bottom: auto; height: var(--space-4); }
.module-head { position: relative; width: 100%; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-1); border: 0; background: transparent; font: inherit; color: var(--color-text); text-align: left; cursor: pointer; border-radius: var(--radius-md); }
.module-head:hover { background: var(--color-surface-alt); }
.node { flex: none; width: var(--node-size); height: var(--node-size); border-radius: 50%; border: var(--border-2) solid var(--color-border-strong); background: var(--color-surface); margin-left: var(--space-1); box-sizing: border-box; }
.stop.is-done .node { background: var(--color-accent); border-color: var(--color-accent); }
.stop[data-pos="current"] .node { width: var(--node-size-current); height: var(--node-size-current); margin-left: calc(var(--space-1) - (var(--node-size-current) - var(--node-size)) / 2); border-color: var(--color-accent); background: var(--color-accent-soft); }
.module-name { font-family: var(--font-reading); font-weight: var(--weight-regular); font-size: var(--text-md); }
.stop[data-pos="current"] .module-name { font-weight: var(--weight-semibold); font-size: var(--text-lg); }
.stop[data-pos="future"] .module-name { color: var(--color-text-2); }
.module-count { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.path-lessons { list-style: none; margin: var(--space-1) 0 var(--space-2) calc(var(--node-size) + var(--space-5)); padding-left: var(--space-3); border-left: var(--border-1) solid var(--color-border); display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.path-lesson { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.lesson-link { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text); text-decoration: none; }
.lesson-link[data-state="locked"], .path-lesson.is-prep { color: var(--color-text-muted); }
.path-lesson.is-current .lesson-link { color: var(--color-accent); font-weight: var(--weight-semibold); }

/* D.3 Learn: tags and the paragraph window. */
.tag { background: var(--color-accent-soft); color: var(--color-accent); border-color: transparent; }
button.tag { font: inherit; font-size: var(--text-xs); line-height: var(--leading-xs); cursor: pointer; }
button.tag[aria-pressed="true"] { background: var(--color-accent); color: var(--color-text-on-accent); }
.para-window { border: var(--border-1) solid var(--color-accent); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--color-surface-alt); font-family: var(--font-reading); line-height: var(--leading-reading); }
.para-window .para { display: grid; gap: var(--space-2); }
.para-window .para-title { font-size: var(--text-md); }

/* D.3 punto 4: reference pages (glossary, symbols, what we left out), module subtitle, end-of-test rows, arrival on a paragraph. */
.module-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: 0; }
.module-head .node { grid-column: 1; grid-row: 1; }
.module-head .module-name { grid-column: 2; grid-row: 1; }
.module-head .module-count { grid-column: 3; grid-row: 1; margin-left: 0; }
.module-sub { grid-column: 2; grid-row: 2; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--color-text-muted); }
.ref-nav { font-size: var(--text-sm); }
.ref-nav a[aria-current="page"] { color: var(--color-text); font-weight: var(--weight-semibold); text-decoration: none; }
.home-body > .ref-nav { margin-top: calc(var(--space-2) * -1); }
.ref-page { max-width: var(--measure-reading); margin: 0 auto; display: grid; gap: var(--space-3); }
.gl-search .input { width: 100%; }
.gl-group { display: grid; gap: var(--space-1); margin-top: var(--space-4); }
.gl-lesson { font-family: var(--font-reading); font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-semibold); }
.gl-list { list-style: none; padding: 0; margin: 0; display: grid; }
.gl-item { display: grid; gap: var(--space-1); justify-items: start; padding: var(--space-3) 0; border-top: var(--border-1) solid var(--color-border-soft); }
.gl-title { font-family: var(--font-reading); font-weight: var(--weight-semibold); }
.gl-rule { font-family: var(--font-reading); line-height: var(--leading-reading); }
.gl-go { font-size: var(--text-sm); }
.gl-item[hidden], .gl-group[hidden], .gl-none[hidden] { display: none; }
.sym-item { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--space-4); }
.sym { display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.sym-tok code { font-size: var(--text-md); }
.sym-text { display: grid; gap: var(--space-1); justify-items: start; }
.test-list { gap: 0; }
.test-row { display: grid; grid-template-columns: var(--space-5) minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline; padding: var(--space-2) 0; border-top: var(--border-1) solid var(--color-border-soft); }
.test-what { display: grid; gap: var(--space-1); justify-items: start; }
.test-line { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.test-n { color: var(--color-text-muted); }
.test-out { font-weight: var(--weight-semibold); }
.test-row.is-wrong .test-out { color: var(--color-text-muted); }
.para { scroll-margin-top: calc(var(--layout-bar-height) + var(--space-4)); }
@media (max-width: 900px) { .sym-item { grid-template-columns: minmax(0, 1fr); } }

/* layout mobile: the editor wraps on a phone (after the editor rule above, which sets white-space: pre). */
@media (max-width: 900px) { .editor-mirror, .editor-input { white-space: pre-wrap; overflow-wrap: anywhere; } }

/* Session 30 (design-system.md §10.9): the closed row with its state visible, between the bar and the view. On the side
   paper, like the columns it replaces; the toggle is a button (aria-expanded), the chevron turns when it opens; "See" sits
   beside the toggle, never inside it. Open, the panel is part of the same box, under a soft rule. */
.strip { margin-bottom: var(--space-4); border: var(--border-1) solid var(--color-border-strong); border-radius: var(--radius-lg); background: var(--color-surface-side); }
.strip-head { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0; padding-right: var(--space-3); }
.strip-toggle { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); min-height: var(--control-height); padding: var(--space-1) var(--space-3); border: 0; border-radius: var(--radius-lg); background: transparent; font: inherit; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--color-text); text-align: left; cursor: pointer; }
.strip-toggle:hover { background: var(--color-surface-alt); }
.strip-toggle .label { margin: 0; }
.strip-chev { width: 1em; height: 1em; flex: none; color: var(--color-text-faint); transition: transform var(--dur-base) var(--ease-out); }
.strip.is-open > .strip-head .strip-chev { transform: rotate(90deg); }
.strip-state { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); }
.strip-title { font-weight: var(--weight-semibold); }
.strip-sep, .strip-count { color: var(--color-text-muted); }
.strip-count { font-variant-numeric: tabular-nums; }
.strip-after { display: inline-flex; align-items: baseline; gap: var(--space-2); margin-left: calc(var(--space-2) - var(--space-3)); font-size: var(--text-sm); line-height: var(--leading-sm); padding: var(--space-1) 0; }
.link-btn { padding: 0; border: 0; background: transparent; font: inherit; color: var(--color-link); text-decoration: underline; text-decoration-color: var(--color-link-underline); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration-color: currentColor; }
.strip-body { display: grid; gap: var(--space-4); padding: var(--space-4); border-top: var(--border-1) solid var(--color-border-soft); }
.strip-body[hidden] { display: none; }
.strip .lesson-box { padding-bottom: 0; border-bottom: 0; }
.theory-blocks { display: grid; gap: var(--space-3); }
.theory-row .theory-blocks { grid-template-columns: repeat(auto-fill, minmax(min(var(--strip-col-min), 100%), 1fr)); align-items: start; }
.para-window-lesson { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-2); }
/* Session 30: under the breakpoint "See" takes a line of its own, aligned with the label (chevron + gap in), without the
   separator that only worked on one line. */
@media (max-width: 900px) {
  .strip-after { flex-basis: 100%; margin-left: calc(var(--space-3) + 1em + var(--space-2)); padding: 0 0 var(--space-2); }
  .strip-after > .strip-sep { display: none; }
}
/* Session 30: under the breakpoint the open tables come right after the work, before the schema, one per row. */
@media (max-width: 900px) {
  .tv-row { flex-wrap: wrap; }
  .two-col > .col-main { order: 1; }
  .two-col > .table-viewers { order: 2; }
  .two-col > .col-schema { order: 3; }
}

/* Session 31 (spec §16.2, design-system.md §10.9): the head of the lesson. Left, "Lesson 6 · title" (in the exercises the
   button that opens the panel; in the reading plain text, the place of the chevron kept); right, the two ways in. */
.strip-toggle.is-static { cursor: default; }
.strip-toggle.is-static:hover { background: transparent; }
.strip-chev-slot { width: 1em; height: 1em; flex: none; }
/* The two ways in: the two halves of one control, the same in the head and in the path. Icon faint, word in the text
   colour, state last (the reading's dot, the exercises' n/m and their error dot). The half in view is filled with the
   paper and in semibold, as a switch. */
.entry { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); color: var(--color-text); text-decoration: none; border: var(--border-1) solid var(--color-border-strong); background: transparent; font-family: var(--font-ui); font-size: var(--text-sm); line-height: var(--leading-sm); white-space: nowrap; }
.entry + .entry { margin-left: calc(-1 * var(--border-1)); }
.entry:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.entry:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
a.entry:hover { background: var(--color-surface-alt); }
/* Session 43: the half in view has its own surface role: paper in the light theme, one step lighter in the dark one, where
   --color-surface was barely apart from the side paper of the head. */
.entry[aria-current="page"] { background: var(--color-surface-current); font-weight: var(--weight-semibold); }
.entry-ico { width: 1em; height: 1em; color: var(--color-text-faint); }
.entry-state { color: var(--color-text-2); font-variant-numeric: tabular-nums; }
.entry.is-none, .entry.is-none .entry-word { color: var(--color-text-muted); }
.lesson-nav { display: flex; align-items: center; margin-left: auto; }
/* Session 31 (design-system.md §10.3): the same control on every lesson of the path; above the breakpoint its two halves
   stand in two columns shared by every row of the list (subgrid), so that the states read down the list. */
.path-lessons:has(.path-entries) { grid-template-columns: minmax(0, 1fr) max-content max-content; column-gap: 0; }
.path-lessons:has(.path-entries) > .path-lesson { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: 0; align-items: center; }
.path-lesson-main { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; padding-right: var(--space-4); }
.path-entries { display: contents; }
.path-entries .entry { padding: 0 var(--space-2); }
/* Session 31 (design-system.md §10.10): the reading between its margins. Left the index of the paragraphs, held while the
   text scrolls, the current one marked by an accent bar and semibold, set off from the text by a rule; the right margin
   holds the Schema button. A lesson without paragraphs keeps the margin empty, without the rule. */
.reading-layout { display: grid; grid-template-columns: minmax(var(--reading-index-width), 1fr) minmax(0, auto) 1fr; column-gap: var(--space-6); align-items: start; }
.reading-layout > .reading { margin: 0; }
.reading-index { align-self: stretch; justify-self: end; width: var(--reading-index-width); border-right: var(--border-1) solid var(--color-border-strong); font-family: var(--font-ui); font-size: var(--text-sm); line-height: var(--leading-sm); }
.reading-index.is-empty { border-right: 0; }
.reading-index-in { position: sticky; top: calc(var(--layout-bar-height) + var(--space-4)); display: grid; gap: var(--space-1); padding-right: var(--space-4); }
.reading-index-in .label { margin-bottom: var(--space-2); }
.reading-index-link { color: var(--color-text-2); text-decoration: none; padding: var(--space-1) var(--space-2); border-left: var(--border-2) solid transparent; }
.reading-index-link:hover { color: var(--color-text); }
.reading-index-link[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-semibold); border-left-color: var(--color-accent); }
/* Under the breakpoint: the two ways in on a line of their own, two equal cells with their counts, then "See"; no index. */
@media (max-width: 900px) {
  .lesson-nav { order: 1; flex-basis: 100%; margin: 0 0 var(--space-2); display: grid; grid-template-columns: 1fr 1fr; }
  .lesson-nav .entry { justify-content: center; }
  .lesson-head .strip-after { order: 2; }
  .path-lessons:has(.path-entries) { grid-template-columns: minmax(0, 1fr); }
  .path-lessons:has(.path-entries) > .path-lesson { display: flex; flex-wrap: wrap; row-gap: var(--space-1); }
  .path-lesson-main { flex-basis: 100%; }
  /* session 43 (Andrea): the two halves stand in columns down the list here too: every row gets the same two equal
     cells, the width of the row less the indent of the dot, as the lesson head does on a phone */
  .path-entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 0 0 calc(100% - var(--dot-size) - var(--space-2)); margin-left: calc(var(--dot-size) + var(--space-2)); }
  .path-entries .entry { justify-content: center; }
  .reading-layout { display: block; }
  .reading-index { display: none; }
}

/* Session 32 (spec §8.2, design-system.md §10.11): the module test. The end lists the lessons known and the lessons to do,
   each to do with the paragraphs to look at; the start and the end are a narrow column like the old concept test. */
.mt-group { display: grid; gap: var(--space-2); }
.mt-list { list-style: none; margin: 0; padding: 0; display: grid; font-size: var(--text-sm); }
.mt-row { display: grid; gap: var(--space-1); justify-items: start; padding: var(--space-2) 0; border-top: var(--border-1) solid var(--color-border-soft); }
.mt-lesson { font-family: var(--font-reading); font-size: var(--text-md); }
.mt-look { color: var(--color-text-2); }
/* The line of the module test sits under the subtitle, aligned with the module's name (node, its margin and the gap). */
.module-test { margin: calc(var(--space-1) * -1) 0 var(--space-2) calc(var(--space-1) + var(--space-1) + var(--node-size) + var(--space-3)); font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--color-text-muted); }
.stop[data-pos="current"] .module-test { margin-left: calc(var(--space-1) + var(--space-1) + var(--node-size) + var(--space-3) + (var(--node-size-current) - var(--node-size)) / 2); }

/* F.3 (session 48): access pages, before the sign-in. The bar holds the mark and, at its end, the language; the page is
   the narrow column with the form (the fields of .name-form) and a foot of links. */
.bar-end { margin-left: auto; }
.access { padding-top: var(--space-6); }
.access .check-row { align-items: start; }
.access-foot { font-size: var(--text-sm); }
/* design-system.md §10.12 (session 48): «Continue with Google», then the divider «or». */
.btn-provider { justify-content: center; width: 100%; min-height: calc(var(--control-height) * 1.5); font-weight: var(--weight-semibold); }
.btn-provider:hover:not(:disabled) { background: var(--color-surface-alt); }
.btn-provider .ico-google { width: var(--icon-size); height: var(--icon-size); }
.access-or { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }
.access-or::before, .access-or::after { content: ""; flex: 1 1 auto; border-top: var(--border-1) solid var(--color-border-soft); }
.account-rows { display: grid; gap: var(--space-1); font-size: var(--text-sm); }

/* ---- F.4 (session 55): the final exam, #/exam (src/views/exam.js; design-system.md §10.13) ---- */
.exam-intro { max-width: var(--measure-reading); display: grid; gap: var(--space-3); }
.exam-title { font-family: var(--font-reading); font-weight: var(--weight-semibold); font-size: var(--text-2xl); line-height: var(--leading-2xl); }
.exam-lead { font-family: var(--font-reading); font-size: var(--text-lg); line-height: var(--leading-reading); }
.exam-rules { display: grid; gap: var(--space-2); padding-left: var(--space-5); line-height: var(--leading-reading); }
.exam-conds { list-style: none; display: grid; gap: var(--space-1); }
.exam-cond { display: flex; gap: var(--space-2); align-items: baseline; }
.exam-cond-mark { width: var(--icon-size); flex: 0 0 auto; text-align: center; color: var(--color-text-faint); }
.exam-cond[data-ok="true"] .exam-cond-mark { color: var(--color-success); font-weight: var(--weight-semibold); }
.exam-outcome { border: var(--border-1) solid var(--color-border-strong); border-left-width: var(--border-3); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-2); }
.exam-outcome[data-state="ok"] { border-color: var(--color-success); background: var(--color-success-bg); }
.exam-outcome[data-state="ko"] { border-color: var(--color-error); background: var(--color-error-bg); }
.exam-outcome-title { font-family: var(--font-reading); font-weight: var(--weight-semibold); font-size: var(--text-xl); line-height: var(--leading-xl); }
.exam-themes { display: grid; gap: var(--space-1); padding-left: var(--space-5); }
.exam-cert { font-size: var(--text-md); }
/* session 56 (design-system.md §10.13): what to do with the certificate, under the outcome */
.exam-cert-actions { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.exam-cert-link { font-size: var(--text-sm); overflow-wrap: anywhere; }
.exam-open { padding: var(--space-4) 0; display: grid; gap: var(--space-3); }
/* session 64 (design-system.md §10.13): the certificate's own page, #/certificate — the steps before, the data and the
   actions after; reading width, the data as label and value rows */
.certificate { max-width: var(--measure-reading); display: grid; gap: var(--space-3); }
.certificate .exam-cert-actions { margin-top: var(--space-2); }
.cert-data { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); align-items: baseline; border-top: var(--border-1) solid var(--color-border); border-bottom: var(--border-1) solid var(--color-border); padding: var(--space-3) 0; }
.cert-row { display: contents; }
.cert-row dd { margin: 0; overflow-wrap: anywhere; }
.cert-steps { padding-left: 0; }
.cert-note { font-size: var(--text-sm); }
@media (max-width: 900px) { .cert-data { grid-template-columns: 1fr; row-gap: 0; } .cert-row dd { margin-bottom: var(--space-2); } }
.exam-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.exam-time { font-size: var(--text-lg); line-height: var(--leading-lg); }
.exam-nav { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.exam-nav-item { min-width: var(--tap-min); min-height: var(--tap-min); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.exam-nav-item:hover { border-color: var(--color-border-strong); }
.exam-nav-item[data-state="written"], .exam-nav-item[data-state="tried"] { border-color: var(--color-border-strong); background: var(--color-surface-alt); }
.exam-nav-item[data-state="tried"] { border-bottom: var(--border-3) solid var(--color-warning); }
.exam-nav-item[data-state="right"] { border-color: var(--color-success); background: var(--color-success-bg); color: var(--color-success); font-weight: var(--weight-semibold); }
.exam-nav-item[data-state="wrong"] { border-color: var(--color-error); background: var(--color-error-bg); color: var(--color-error); text-decoration: line-through; }
.exam-nav-item[aria-current="step"] { outline: var(--border-2) solid var(--color-accent); outline-offset: var(--focus-offset); }
.exam-q { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.exam-prompt { font-family: var(--font-reading); font-size: var(--text-lg); line-height: var(--leading-reading); max-width: var(--measure-reading); }
.exam-cols { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.exam-col { font-size: var(--text-sm); border: var(--border-1) solid var(--color-border); border-radius: var(--radius-sm); padding: 0 var(--space-2); background: var(--color-surface-alt); }
.exam-cols-note { font-size: var(--text-sm); color: var(--color-text-muted); max-width: var(--measure-reading); }
.exam-move { justify-content: space-between; margin-top: var(--space-4); }
.exam-stop { display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; margin: var(--space-4) 0; padding-top: var(--space-3); border-top: var(--border-1) solid var(--color-border-soft); }
.exam-stop-link { font-family: var(--font-reading); font-weight: var(--weight-semibold); font-size: var(--text-lg); }
.exam-stop.is-ready .exam-stop-link { color: var(--color-accent); }
