/* Behavior Tech Quiz: "Exam Map". Swiss information design built on the exam's own structure: the blueprint drawn
   to scale, one colour per domain (A–F), condensed uppercase headings, square corners, a hard left-aligned grid.
   Type: Archivo (condensed via its width axis) for display, Instrument Sans for text, JetBrains Mono for data.
   Deliberately unlike the owner's other exam sites (rounded cards, colour heroes, navy/teal, indigo/magenta, cream/tomato). */
:root {
  --page: #ffffff;
  --surface: #ffffff;
  --bg: #f4f4f2;
  --ink: #0e0e10;
  --muted: #5c5f66;
  --line: #e2e2e0;
  --brand: #0e0e10;
  --brand-2: #2e62ff;
  --brand-soft: #f1f1ef;
  --link: #1f4fe0;
  --accent: #ff8a00;
  --accent-ink: #8a4700;
  --accent-soft: #fff1df;
  --good: #0b8457;
  --good-soft: #e6f5ee;
  --bad: #cf2e2e;
  --bad-soft: #fdeaea;
  --dA: #2e62ff; --dB: #00936b; --dC: #ff8a00; --dD: #e2363c; --dE: #7c4dff; --dF: #0aa5c2;
  --onA: #ffffff; --onB: #ffffff; --onC: #111111; --onD: #ffffff; --onE: #ffffff; --onF: #0b1a1e;
  --disp: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0f12; --surface: #15171b; --bg: #1c1f24; --ink: #ececee; --muted: #a2a6ad; --line: #2c3037;
    --brand: #ececee; --brand-2: #7c9dff; --brand-soft: #1f2228; --link: #8fb0ff;
    --accent: #ffa340; --accent-ink: #ffc98a; --accent-soft: #3a2a14;
    --good: #4cd6a0; --good-soft: #133126; --bad: #ff7272; --bad-soft: #3a1919;
    --dA: #4f7dff; --dB: #14b386; --dC: #ff9a2e; --dD: #f0484e; --dE: #9172ff; --dF: #22bcd8;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
h1 { font-family: var(--disp); font-weight: 850; font-stretch: 72%; text-transform: uppercase; line-height: .96; letter-spacing: -.005em;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: .1em 0 .4em; text-wrap: balance; }
h2 { font-family: var(--disp); font-weight: 800; font-stretch: 85%; text-transform: uppercase; font-size: 1.3rem; letter-spacing: .005em;
  margin: 2.2em 0 .8em; padding-bottom: 6px; border-bottom: 2px solid var(--ink); text-wrap: balance; }
h3 { font-size: 1.06rem; margin: 1.4em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
img, svg { max-width: 100%; }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .55em .6em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; }
.lead { font-size: 1.12rem; color: var(--ink); }
.meta { color: var(--muted); font-size: .9rem; }
.tag { color: var(--muted); font-size: .88rem; }
.kicker { font: 600 .76rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.note { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: .7em 1em; }
ul.plain { padding-left: 1.2em; }
ul.sources { font-size: .92rem; }
.soon { color: var(--muted); }

/* header */
.masthead { border-bottom: 2px solid var(--ink); background: var(--page); }
.masthead-in { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-block: 14px; }
.logo { font-family: var(--disp); font-weight: 850; font-stretch: 85%; font-size: 1.2rem; text-transform: uppercase; letter-spacing: -.005em; color: var(--ink); text-decoration: none; }
.logo b { color: var(--dA); }
.topnav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.topnav a { font: 600 .78rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.topnav a:hover { border-bottom-color: var(--line); }
.topnav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* page body: left-aligned to the header, reading column 860px, wide elements may span */
.page { padding-block: 26px 64px; }
.page > * { max-width: 860px; }
.page > .map, .page > .legend { max-width: none; }
.crumbs { font: 500 .76rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.dstripe { width: 132px; height: 10px; margin: 0 0 14px; }
.dstripe.d-A { background: var(--dA); } .dstripe.d-B { background: var(--dB); } .dstripe.d-C { background: var(--dC); }
.dstripe.d-D { background: var(--dD); } .dstripe.d-E { background: var(--dE); } .dstripe.d-F { background: var(--dF); }

/* home hero */
.hero { border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 20px; padding-block: 40px 30px; }
.hero .kicker { grid-column: 1 / -1; }
.hero h1 { grid-column: 1 / 9; font-size: clamp(2.6rem, 7.2vw, 5.6rem); line-height: .9; margin: 0 0 22px; }
.hero-side { grid-column: 9 / 13; align-self: end; margin-bottom: 22px; }
.hero-side .lead { font-size: 1rem; color: var(--muted); }
.hero .map, .hero .legend { grid-column: 1 / -1; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.btn, a.cta { display: inline-block; background: var(--brand); color: var(--page); font-weight: 700; text-decoration: none; padding: 11px 18px; font-size: .95rem; border: 2px solid var(--brand); }
.btn:hover, a.cta:hover { background: var(--dA); border-color: var(--dA); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--page); border-color: var(--ink); }

/* the exam map */
.map { display: flex; gap: 4px; margin: 6px 0 0; }
.blk { flex-basis: 0; min-width: 0; min-height: 168px; padding: 10px 10px 12px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; }
a.blk:hover { filter: brightness(1.08) saturate(1.05); }
.blk .k { font: 700 .76rem var(--mono); }
.blk .n { font-family: var(--disp); font-weight: 850; font-stretch: 70%; font-size: clamp(2rem, 5.8vw, 4.4rem); line-height: .9; }
.blk .n small { font-size: .36em; font-stretch: 100%; font-weight: 700; margin-left: 2px; }
.blk .t { font-size: .78rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.blk.d-A { background: var(--dA); color: var(--onA); } .blk.d-B { background: var(--dB); color: var(--onB); } .blk.d-C { background: var(--dC); color: var(--onC); }
.blk.d-D { background: var(--dD); color: var(--onD); } .blk.d-E { background: var(--dE); color: var(--onE); } .blk.d-F { background: var(--dF); color: var(--onF); }
.legend { display: flex; justify-content: space-between; gap: 10px; font: 500 .72rem var(--mono); color: var(--muted); margin: 8px 0 18px; }

/* domain table */
.dtable { border-top: 2px solid var(--ink); margin: 0 0 1.4em; }
.tr { display: grid; grid-template-columns: 10px minmax(0, 1fr) 96px 96px; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tr i { width: 10px; height: 34px; display: block; }
.tr.d-A i { background: var(--dA); } .tr.d-B i { background: var(--dB); } .tr.d-C i { background: var(--dC); }
.tr.d-D i { background: var(--dD); } .tr.d-E i { background: var(--dE); } .tr.d-F i { background: var(--dF); }
.tr-main a { font-weight: 700; text-decoration: none; color: var(--ink); }
.tr-main a:hover { color: var(--link); text-decoration: underline; }
.tr-main .tag { display: block; }
.tr .num { font: 600 .9rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.tr.head { padding: 8px 0; font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tr.head .num { font: inherit; }

/* link lists (tools, guides) */
.card-list { list-style: none; padding: 0; margin: 0 0 1.2em; border-top: 2px solid var(--ink); }
.card-list li { position: relative; padding: 11px 32px 11px 0; border-bottom: 1px solid var(--line); }
.card-list li::after { content: "\2192"; position: absolute; right: 2px; top: 11px; font-family: var(--mono); color: var(--muted); }
.card-list li a { font-weight: 700; color: var(--ink); text-decoration: none; }
.card-list li a:hover { color: var(--link); text-decoration: underline; }
.card-list br { display: none; }
.card-list .tag { display: block; }
.mybest { display: inline-block; margin-left: 8px; font: 700 .7rem var(--mono); text-transform: uppercase; background: var(--accent-soft); color: var(--accent-ink); padding: 1px 6px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.split h2 { margin-top: 1.6em; }

/* buttons inside the quiz, exam and drill apps */
button { font: 700 .92rem var(--sans); cursor: pointer; background: var(--brand); color: var(--page); border: 2px solid var(--brand); padding: 8px 16px; margin: 4px 6px 4px 0; }
button:hover { background: var(--dA); border-color: var(--dA); color: #fff; }
button.secondary { background: transparent; color: var(--ink); }
button.secondary:hover { background: var(--ink); color: var(--page); border-color: var(--ink); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--dA); outline-offset: 2px; }

/* topic page bits */
details.tasks { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin-bottom: 1em; }
details.tasks summary { cursor: pointer; font-weight: 650; }
details.tasks ul { padding-left: 1.1em; margin-top: .6em; }
.set-jump { font-weight: 600; }

/* quiz */
ol.quiz { padding-left: 0; list-style-position: inside; }
ol.quiz > li.q { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
li.q.correct { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good); }
li.q.wrong { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.q-meta { margin: 0 0 6px; }
.qnum { font-weight: 800; color: var(--muted); margin-right: 4px; }
.task-chip { display: inline-block; font-size: .76rem; font-weight: 750; letter-spacing: .03em; color: var(--brand); background: var(--brand-soft); padding: 2px 9px; border-radius: 999px; cursor: help; }
.stem { font-weight: 600; margin-bottom: .6em; }
ol.opts { list-style: none; padding: 0; margin: 0 0 .6em; }
ol.opts li { margin: 6px 0; }
ol.opts label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); }
ol.opts label:hover { border-color: var(--brand-2); }
ol.opts input { margin-top: .35em; accent-color: var(--brand); flex: none; }
.letter { font-weight: 700; color: var(--muted); flex: none; }
:where(ol.opts label:has(input:checked)) { border-color: var(--brand); background: var(--brand-soft); }
ol.opts label.is-answer { border-color: var(--good); background: var(--good-soft); }
ol.opts label.is-answer::after { content: "✓"; margin-left: auto; color: var(--good); font-weight: 800; }
ol.opts label.is-picked-wrong { border-color: var(--bad); background: var(--bad-soft); }
ol.opts label.is-picked-wrong::after { content: "✗"; margin-left: auto; color: var(--bad); font-weight: 800; }
details.exp { margin-top: 4px; }
details.exp summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: .95rem; }
details.exp p { margin: .5em 0; }
.src { font-size: .88rem; color: var(--muted); }
.quiz-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; z-index: 2; }
.quiz-bar .score { font-weight: 700; }
.quiz-bar .best { flex-basis: 100%; margin: 0; }

/* graphs */
figure.graph { margin: 4px 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
figure.graph figcaption { font-weight: 650; font-size: .95rem; margin: 0 4px 2px; }
.graph-svg { display: block; width: 100%; height: auto; }
.g-grid { stroke: var(--line); stroke-width: 1; }
.g-axis { stroke: var(--muted); stroke-width: 2; }
.g-tick { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.g-label { fill: var(--ink); font-size: 13px; font-weight: 600; font-family: var(--sans); }
.g-phase { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; }
.g-phase-label { fill: var(--ink); font-size: 12.5px; font-weight: 700; font-family: var(--sans); }
.g-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.g-dot { fill: var(--brand); stroke: var(--surface); stroke-width: 1.5; }
.g-data { font-size: .85rem; margin: 4px; }
.g-data summary { cursor: pointer; color: var(--muted); }
.g-data table { font-size: .85rem; max-width: 420px; }

/* timed exam */
.exam-app { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 1.4em; }
.exam-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 10px; position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 2; }
.exam-timer { font-variant-numeric: tabular-nums; background: var(--brand-soft); color: var(--brand); padding: 3px 10px; border-radius: 999px; }
.exam-timer.low { background: var(--bad-soft); color: var(--bad); }
.exam-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.exam-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-bottom: 1em; }
.exam-palette button { margin: 0; padding: 6px 0; border-radius: 8px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.exam-palette button.answered { background: var(--brand-soft); border-color: var(--brand-2); }
.exam-palette button.flagged { box-shadow: inset 0 -3px 0 var(--accent); }
.exam-palette button.flagged::after { content: " ⚑"; color: var(--accent-ink); font-size: .8em; }
.exam-palette button.current { outline: 2px solid var(--brand); }
.exam-result { border-radius: 12px; padding: 14px 16px; margin-bottom: 1em; background: var(--brand-soft); }
.exam-score { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; margin: 0 0 .3em; }
.bar { display: inline-block; height: 10px; border-radius: 6px; background: var(--brand-2); vertical-align: middle; min-width: 2px; }
.bar-wrap { display: inline-block; width: 120px; height: 10px; border-radius: 6px; background: var(--line); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.exam-topics tr.weak td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.exam-review { padding-left: 1.2em; }
.exam-review li { margin-bottom: 1.2em; }
.yours { color: var(--bad); font-weight: 600; }
.right { color: var(--good); font-weight: 600; }
.unscored-tag { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }

/* review page */
.review-count { font-weight: 700; }
.review-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 1em; }
.review-tools select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.review-list { padding-left: 0; }

/* calculation drill */
.drill-app { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 1.4em; }
.drill-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.drill-types button { background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 600; padding: 6px 12px; margin: 0; }
.drill-types button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .drill-types button[aria-pressed="true"] { color: #0f1712; } }
.drill-problem { font-size: 1.05rem; font-weight: 600; }
.drill-answer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drill-answer input { font: inherit; width: 9em; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.drill-feedback.ok { color: var(--good); font-weight: 700; }
.drill-feedback.no { color: var(--bad); font-weight: 700; }
.drill-work { background: var(--bg); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.drill-grid { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.drill-grid span { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: 800; border: 1px solid var(--line); }
.drill-grid .on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-2); }
.drill-grid .off { color: var(--muted); }
.drill-score { color: var(--muted); font-size: .92rem; }

/* sortable table */
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; }
table.sortable th[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; }

/* Exam Map overrides for the shared components: square corners, domain-coloured task tags, hard rules */
li.q, ol.opts label, details.tasks, figure.graph, .exam-app, .drill-app, .exam-result, .drill-work, .drill-grid span,
.review-tools select, .exam-palette button, .drill-answer input, .exam-timer, .unscored-tag, .bar-wrap, .bar { border-radius: 2px; }
ol.quiz > li.q { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; }
li.q.correct { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good); }
li.q.wrong { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.qnum { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.task-chip { font: 700 .7rem var(--mono); text-transform: uppercase; letter-spacing: .05em; border-radius: 0; padding: 2px 7px; background: var(--ink); color: var(--page); }
.task-chip.d-A { background: var(--dA); color: var(--onA); } .task-chip.d-B { background: var(--dB); color: var(--onB); } .task-chip.d-C { background: var(--dC); color: var(--onC); }
.task-chip.d-D { background: var(--dD); color: var(--onD); } .task-chip.d-E { background: var(--dE); color: var(--onE); } .task-chip.d-F { background: var(--dF); color: var(--onF); }
ol.opts label { background: var(--surface); border: 1px solid var(--line); }
ol.opts label:hover { border-color: var(--ink); }
.letter { font-family: var(--mono); }
:where(ol.opts label:has(input:checked)) { border-color: var(--ink); background: var(--bg); box-shadow: inset 0 0 0 1px var(--ink); }
.quiz-bar { background: var(--page); border-top: 2px solid var(--ink); }
details.tasks { background: var(--bg); border: 0; border-left: 4px solid var(--ink); }
.exam-app, .drill-app { background: var(--bg); border: 0; border-top: 2px solid var(--ink); }
.exam-bar { background: var(--bg); }
.exam-timer { font-family: var(--mono); background: var(--ink); color: var(--page); }
.exam-result { background: var(--surface); border: 2px solid var(--ink); }
.exam-score { font-family: var(--disp); font-stretch: 80%; text-transform: uppercase; }
.bar { background: var(--dA); }
.g-line { stroke: var(--dA); }
.g-dot { fill: var(--dA); }
.g-phase { stroke: var(--dC); }

/* footer */
footer.site { border-top: 2px solid var(--ink); padding-block: 18px 30px; font-size: .86rem; color: var(--muted); }
footer.site .affil { color: var(--ink); font-weight: 600; max-width: 860px; }
footer.site .links a { margin-right: 18px; display: inline-block; color: var(--muted); font: 600 .74rem var(--mono); text-transform: uppercase; letter-spacing: .05em; text-decoration: none; }
footer.site .links a:hover { color: var(--ink); }

/* ---------- tablets and phones ---------- */
@media (max-width: 860px) {
  .hero h1, .hero-side { grid-column: 1 / -1; }
  .hero-side { margin-bottom: 18px; }
  .map { flex-wrap: wrap; }
  .blk { flex: 1 1 30% !important; min-height: 104px; }
  .legend { display: none; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .masthead-in { padding-block: 12px; }
  .topnav { gap: 2px 14px; }
  .topnav a { font-size: .72rem; }
  .hero-in { padding-block: 26px 20px; }
  .hero h1 { font-size: 2.6rem; }
  .blk { min-height: 92px; padding: 8px; }
  .blk .t { font-size: .7rem; }
  .tr { grid-template-columns: 8px minmax(0, 1fr) 54px; gap: 10px; }
  .tr > .num:nth-of-type(3) { display: none; }
  .tr.head > span:nth-child(3) { display: none; }
  th, td { padding: .45em .4em; }
  .page table { display: block; overflow-x: auto; }
}
