/* Closed Complete — site styles
   VOICE: formal, calm, plain language. No bold text in body copy.
   COLOUR: white ground, ink text, bright green brand (#6CAC4D) with yellow-green buttons.
   TYPE: Inter throughout; Space Grotesk only inside the logo. Mono only for code.
   LAYOUT: one readable column for text, wide grids for overviews. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --ink: #1B232B;
  --ink-2: #34404B;
  --muted: #56626D;
  --line: #E1E5E8;
  --bg: #FFFFFF;
  --bg-2: #F5F8F2;
  --card: #FFFFFF;
  --green: #5C992A;        /* brand, middle of the button gradient */
  --green-mark: #4E8D2A;   /* checkmarks and dots */
  --green-text: #3D7524;   /* links and small green text, 4.5:1 on white */
  --green-soft: #EEF5E6;
  --btn-top: #46872B;      /* primary button gradient (KeePassXC-style) */
  --btn-bottom: #7BB12A;
  --btn-top-hover: #3D7825;
  --btn-bottom-hover: #6DA224;
  --red: #B3261E;
  --red-soft: #FBEAE8;
  --note: #F7F9EC;
  --note-line: #DDE7B5;
  --radius: 10px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.65; font-size: 17px; overflow-x: clip; }
a { color: var(--green-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4, h5 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.4vw, 42px); }
h2 { font-size: clamp(23px, 3vw, 28px); }
h3 { font-size: 19px; margin-top: 1.6em; }
p { margin: 0 0 1em; }
strong, b { font-weight: inherit; }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { background: #EEF1F3; padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow > * { max-width: 760px; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }

/* Header + footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 16px; flex-wrap: wrap; }
.site-header img { height: 28px; width: auto; display: block; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { background: var(--bg-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--green-text); background: var(--green-soft); }
.site-footer { margin-top: 72px; padding: 32px 0 44px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0 0 .5em; max-width: 80ch; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border-radius: 6px; border: 1px solid #3F7A27; background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); color: #fff; font: 500 16px var(--sans); text-decoration: none; cursor: pointer; text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn:hover { background: linear-gradient(180deg, var(--btn-top-hover), var(--btn-bottom-hover)); color: #fff; }
.btn.green { }
.btn.ghost { background: #fff; color: var(--ink); border-color: #C9D0D6; text-shadow: none; }
.btn.ghost:hover { border-color: var(--ink); background: #fff; color: var(--ink); }
.btn.plain { background: var(--ink); color: #fff; }
.btn.plain:hover { background: var(--ink-2); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.eyebrow { font-size: 14px; color: var(--green-text); margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--green); background: var(--green-soft); color: var(--ink); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green-mark); }

/* Home */
.hero { background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 64px 0 56px; }
.hero h1 { max-width: 20ch; }
.hero p.lead { font-size: 19px; color: var(--ink-2); max-width: 62ch; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
section.block { padding: 52px 0 8px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.steps .card h3 { margin-top: 0; }
.steps .num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green-text); font-size: 14px; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.fact { border-left: 3px solid var(--green); padding: 4px 0 4px 16px; }
.fact .v { font-size: 26px; font-weight: 500; }
.fact .k { font-size: 14px; color: var(--muted); }
.weights { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 16px; }
.weights th, .weights td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.weights th { font-weight: 500; color: var(--muted); font-size: 14px; }
.weights td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.weights .bar { height: 6px; background: #EEF1F3; border-radius: 3px; overflow: hidden; min-width: 80px; }
.weights .bar span { display: block; height: 100%; background: var(--green); }

/* Lessons overview */
.domain-block { margin-top: 36px; }
.domain-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--green); padding-bottom: 8px; margin-bottom: 4px; }
.domain-head h2 { margin: 0; font-size: 22px; }
.domain-head .w { color: var(--muted); font-size: 15px; white-space: nowrap; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { border-bottom: 1px solid var(--line); }
.lesson-list a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 4px; text-decoration: none; color: var(--ink); }
.lesson-list a:hover { background: var(--bg-2); }
.lesson-list .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-list .t { color: var(--ink); }
.tag { font-size: 13px; padding: 3px 10px; border-radius: 6px; background: #EEF1F3; color: var(--ink-2); white-space: nowrap; }
.tag.has-sim { background: var(--green-soft); color: var(--green-text); }

/* Documentation */
.doc-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 8px; }
.doc-index a { display: inline-flex; min-width: 38px; min-height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.doc-index a:hover { border-color: var(--green); color: var(--green-text); }
.doc-letter { font-size: 22px; color: var(--green-text); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 40px; scroll-margin-top: 20px; }
.doc-list { margin: 0; }
.doc-list dt { font-weight: 500; font-size: 18px; margin-top: 22px; scroll-margin-top: 20px; }
.doc-list dd { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }
.doc-list dd .see { display: block; font-size: 14px; margin-top: 4px; }
.doc-search { width: 100%; max-width: 420px; font: 16px var(--sans); padding: 11px 14px; border: 1px solid #B8C0C8; border-radius: 8px; margin-top: 8px; }
.doc-search:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* Lesson */
.crumbs { font-size: 14px; color: var(--muted); margin: 28px 0 8px; }
.crumbs a { color: var(--muted); }
.stepper { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.stepper .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper ol { list-style: none; display: flex; gap: 8px; margin: 0; padding: 10px 0; flex-wrap: wrap; }
.stepper a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-size: 15px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.stepper a .dot { width: 8px; height: 8px; border-radius: 50%; background: #C5CBD1; }
.stepper a.done .dot { background: var(--green-mark); }
.stepper .pos { font-size: 14px; color: var(--muted); }
.lesson-section { padding: 44px 0 12px; scroll-margin-top: 64px; }
.lesson-section + .lesson-section { border-top: 1px solid var(--line); }
.learn p, .learn li { max-width: 70ch; }
.learn ul, .learn ol { padding-left: 22px; }
.learn li { margin-bottom: .45em; }
.callout { border-radius: 8px; padding: 14px 18px; margin: 22px 0; background: var(--note); border: 1px solid var(--note-line); border-left: 4px solid var(--green); max-width: 70ch; }
.callout .ct { display: block; color: var(--green-text); margin-bottom: 4px; }
.shortcuts { border-collapse: collapse; margin: 12px 0 20px; font-size: 15px; background: var(--card); border: 1px solid var(--line); }
.shortcuts th, .shortcuts td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shortcuts th { background: var(--bg-2); font-weight: 500; }
.shortcuts tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.next { margin-top: 24px; }
.soon { display: flex; gap: 14px; align-items: flex-start; }
.soon .ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green-text); display: inline-flex; align-items: center; justify-content: center; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.pager a { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--green); background: var(--bg-2); }
.pager .dir { display: block; font-size: 13px; color: var(--muted); }
.pager .next-link { grid-column: 2; }
.pager .next-link:first-child { grid-column: 1; }
.pager .next-link.primary { background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); border-color: #3F7A27; color: #fff; }
.pager .next-link.primary:hover { background: linear-gradient(180deg, var(--btn-top-hover), var(--btn-bottom-hover)); }
.pager .next-link.primary .dir { color: #E6F2D8; }

/* Simulator */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.sim { border: 1px solid #C9CFD5; border-radius: 10px; overflow: hidden; background: #fff; min-height: 460px; display: flex; flex-direction: column; }
.sim-bar { background: #1F2A33; color: #fff; display: flex; align-items: center; gap: 4px; padding: 6px 10px; position: relative; flex-wrap: wrap; }
.sim-brand { font-family: var(--mono); font-size: 13px; color: #A9B6C1; margin-right: 10px; padding: 0 6px; }
.sim-menu-btn { background: transparent; color: #fff; border: 0; font: 500 14px var(--sans); padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.sim-menu-btn:hover, .sim-menu-btn[aria-expanded="true"] { background: #33424F; }
.sim-spacer { flex-grow: 1; }
.sim-user { width: 30px; height: 30px; border-radius: 50%; background: var(--green-mark); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.sim-panel { position: absolute; top: 100%; left: 10px; width: min(340px, calc(100% - 20px)); background: #fff; color: var(--ink); border: 1px solid #C9CFD5; border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,32,.16); z-index: 4; max-height: 400px; display: flex; flex-direction: column; }
.sim-panel[hidden] { display: none; }
.sim-filter { padding: 10px; border-bottom: 1px solid var(--line); }
.sim-filter input { width: 100%; font: 16px var(--sans); padding: 9px 12px; border: 1px solid #B8C0C8; border-radius: 8px; }
.sim-filter input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.sim-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.sim-tree { overflow-y: auto; padding: 6px 0; }
.sim-app { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px 4px; }
.sim-mod { display: flex; align-items: center; }
.sim-mod button.open { flex-grow: 1; text-align: left; background: none; border: 0; font: 15px var(--sans); color: var(--ink); padding: 8px 14px 8px 24px; cursor: pointer; min-height: 38px; }
.sim-mod button.open:hover { background: var(--bg-2); }
.sim-mod button.star { background: none; border: 0; cursor: pointer; padding: 6px 12px; color: #7C8894; min-height: 38px; }
.sim-mod button.star:hover { color: var(--ink); }
.sim-mod button.star[aria-pressed="true"] { color: #B98500; }
.sim-empty { padding: 14px; font-size: 14px; color: var(--muted); }
.sim-main { padding: 22px; flex-grow: 1; }
.sim-main h4 { font-size: 19px; margin: 0 0 12px; }
.sim-note { font-size: 13px; background: var(--note); border: 1px solid var(--note-line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.sim-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.sim-list th, .sim-list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sim-list th { color: var(--muted); font-weight: 500; font-size: 13px; }
.sim-home p { color: var(--muted); }
.tasks { position: sticky; top: 72px; }
.tasks h3 { font-size: 18px; margin-top: 0; }
.tasks ol { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.tasks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.45; }
.tasks .box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B8C0C8; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.tasks li.done .box { background: var(--green-mark); border-color: var(--green-mark); }
.tasks li.done .box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.tasks li.done span.text { color: var(--muted); text-decoration: line-through; }
.tasks .feedback { font-size: 14px; color: var(--ink-2); margin: 0 0 16px; }
.tasks .feedback:empty { display: none; }
.complete { display: none; }
.complete.show { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 4px; }
.complete p { margin: 0; }
.complete .btn { width: 100%; }
.tasks-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.reset-link { background: none; border: 0; padding: 6px 0; min-height: 36px; font: 400 14px var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.reset-link:hover { color: var(--ink); }

/* Lesson: instance console */
.inst-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; align-items: start; }
.inst { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #FAFBFC; display: flex; flex-direction: column; gap: 10px; }
.inst.marked { border-color: var(--green); background: var(--green-soft); }
.inst-host { margin: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.inst-btn { align-self: flex-start; background: #fff; border: 1px solid #B8C0C8; border-radius: 8px; padding: 7px 12px; min-height: 38px; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; }
.inst-btn:hover { border-color: var(--ink); }
.inst-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 14px; }
.inst-dl dt { color: var(--muted); }
.inst-dl dd { margin: 0; }
.inst-note { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.sim-block { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.sim-block h5 { font-size: 17px; margin: 0 0 4px; }
.sim-sub { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.path-slots { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot { display: flex; align-items: center; gap: 10px; border: 1px dashed #B8C0C8; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--muted); min-height: 48px; }
.slot.filled { border-style: solid; border-color: #8C97A2; color: var(--ink); background: #fff; }
.slot-n { font-size: 12px; width: 22px; height: 22px; border-radius: 50%; background: #EEF1F3; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.path-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip { background: #fff; border: 1px solid #B8C0C8; border-radius: 999px; padding: 8px 14px; min-height: 40px; font: 400 14px var(--mono); cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.clone-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.clone-form .btn { grid-column: 1 / -1; justify-self: start; }
.field label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--ink-2); }
.field select { width: 100%; font: 16px var(--sans); padding: 9px 10px; border: 1px solid #B8C0C8; border-radius: 8px; background: #fff; min-height: 44px; }
.clone-msg { font-size: 14px; margin: 12px 0 0; }
.clone-msg:empty { display: none; }
.clone-msg.ok { background: var(--green-soft); border-radius: 8px; padding: 10px 12px; }
.clone-msg.no { background: var(--red-soft); border-radius: 8px; padding: 10px 12px; }

/* Quiz */
.q { margin-bottom: 18px; }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { font-weight: 500; font-size: 18px; margin-bottom: 4px; padding: 0; }
.q .qmeta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.q label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.q label:hover { border-color: #B8C0C8; }
.q input { margin-top: 5px; accent-color: var(--green-mark); width: 16px; height: 16px; flex: none; }
.q label.right { border-color: var(--green-mark); background: var(--green-soft); }
.q label.wrong { border-color: var(--red); background: var(--red-soft); }
.q .btn { margin-top: 4px; }
.q .explain { display: none; border-radius: 8px; padding: 12px 16px; margin-top: 10px; font-size: 15px; }
.q .explain.show { display: block; }
.q .explain.ok { background: var(--green-soft); }
.q .explain.no { background: var(--red-soft); }
.score { font-size: 22px; font-weight: 500; }

@media (max-width: 860px) {
  .steps, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .tasks { position: static; order: -1; }
  .inst-grid, .path-slots, .clone-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .steps, .facts { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next-link { grid-column: 1; }
  .lesson-list a { grid-template-columns: 36px minmax(0, 1fr); }
  .lesson-list .tag { grid-column: 2; justify-self: start; }
  .stepper .pos { display: none; }
}

/* Simulator engine */
.sim-block.first { border-top: 0; margin-top: 4px; padding-top: 0; }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.sim-msg { font-size: 14px; margin: 12px 0 0; }
.sim-msg:empty { display: none; }
.sim-msg.ok { background: var(--green-soft); border-radius: 8px; padding: 10px 12px; }
.sim-msg.no { background: var(--red-soft); border-radius: 8px; padding: 10px 12px; }
.sw { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sw-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.sw-row.good { border-color: var(--green-mark); background: var(--green-soft); }
.sw-row.bad { border-color: var(--red); background: var(--red-soft); }
.sw-label { font-size: 15px; }
.segs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.seg { background: #fff; border: 1px solid #B8C0C8; border-radius: 6px; padding: 6px 10px; min-height: 36px; font: 400 14px var(--sans); color: var(--ink); cursor: pointer; }
.seg:hover { border-color: var(--ink); }
.seg[aria-pressed="true"] { background: var(--green-text); border-color: var(--green-text); color: #fff; }
.seq-slots { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.cf { border: 1px solid #C9CFD5; border-radius: 8px; overflow: hidden; }
.cf-head { background: #EEF1F3; padding: 10px 14px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid #C9CFD5; }
.cf-grid { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 10px 14px; padding: 16px 14px; align-items: center; }
.cf-label { font-size: 14px; color: var(--ink-2); text-align: right; }
.cf-grid select, .cf-grid input[type="text"], .fm-journal select, .fm-journal textarea, .fl-builder select { width: 100%; font: 16px var(--sans); padding: 8px 10px; border: 1px solid #B8C0C8; border-radius: 6px; background: #fff; min-height: 42px; color: var(--ink); }
.cf-grid .bad { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.cf-check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.cf-check input { width: 18px; height: 18px; accent-color: var(--green-mark); }
.cf-check input.bad { outline: 2px solid var(--red); }
.cf-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 14px; }
.cf .sim-msg { margin: 0 14px 14px; }
.fm-journal { padding: 0 14px 14px; display: grid; gap: 8px; }
.fm-journal .inst-btn { justify-self: start; }
.fm-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fm-activity li { font-size: 14px; display: flex; gap: 8px; align-items: baseline; border-left: 3px solid var(--line); padding-left: 10px; }
.fm-tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.fm-tag.work_notes { background: #FFF4D6; }
.fm-tag.comments { background: #E3EEFB; }
.sim-list tr.cur td { background: var(--green-soft); }
.fl-builder { border: 1px solid #C9CFD5; border-radius: 8px; padding: 12px; margin-bottom: 10px; display: grid; gap: 10px; }
.fl-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fl-top .sim-sub { margin: 0; }
.fl-top select { width: auto; }
.fl-cond { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.fl-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fl-crumb { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
@media (max-width: 600px) {
  .sw-row { grid-template-columns: minmax(0, 1fr); }
  .segs { justify-content: flex-start; }
  .cf-grid { grid-template-columns: minmax(0, 1fr); }
  .cf-label { text-align: left; }
  .fl-cond { grid-template-columns: minmax(0, 1fr); }
}

/* Exams */
.small { font-size: 14px; }
.exam-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.exam-cards .card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.exam-cards h2 { font-size: 21px; }
.exam-cards .btn { margin-top: auto; }
.exam-select { width: 100%; font: 16px var(--sans); padding: 9px 10px; border: 1px solid #B8C0C8; border-radius: 6px; margin: 4px 0 8px; min-height: 44px; background: #fff; }
.ready-score { margin: 0 0 12px; }
.ready-score .big { font-size: 40px; font-weight: 500; color: var(--green-text); }
.key-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.key-row input { flex: 1 1 220px; font: 16px var(--mono); padding: 10px 12px; border: 1px solid #B8C0C8; border-radius: 6px; text-transform: uppercase; min-height: 46px; }
.exam-bar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.exam-bar .wrap { display: flex; gap: 16px; align-items: center; min-height: 54px; flex-wrap: wrap; }
.exam-title { font-weight: 500; }
.exam-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 15px; padding: 4px 10px; border-radius: 6px; background: var(--bg-2); }
.exam-timer:empty { display: none; }
.exam-timer.low { background: var(--red-soft); color: var(--red); }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.exam-q { min-height: 320px; }
.exam-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.exam-side { position: sticky; top: 70px; }
.exam-side h3 { margin-top: 0; font-size: 17px; }
.palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pal { min-height: 36px; border: 1px solid #C9D0D6; border-radius: 6px; background: #fff; font: 400 14px var(--sans); cursor: pointer; color: var(--ink); position: relative; }
.pal.answered { background: var(--green-soft); border-color: var(--green-mark); }
.pal.flagged { outline: 2px solid #D99A00; outline-offset: -2px; }
.pal.current { box-shadow: 0 0 0 2px var(--ink); }
.pal.good { background: var(--green-soft); border-color: var(--green-mark); }
.pal.bad { background: var(--red-soft); border-color: var(--red); }
.flag { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 15px; cursor: pointer; }
.flag input { width: 18px; height: 18px; accent-color: #B98500; }
.dlg { border: 1px solid var(--line); border-radius: 10px; padding: 24px; max-width: 440px; width: calc(100% - 32px); }
.dlg::backdrop { background: rgba(15, 23, 32, .45); }
.dlg h2 { font-size: 21px; }
.result-card .actions { margin-top: 16px; }
.review { display: flex; flex-direction: column; gap: 10px; }
.rv { padding: 16px 20px; border-left: 4px solid var(--line); }
.rv.rv-ok { border-left-color: var(--green-mark); }
.rv.rv-no { border-left-color: var(--red); }
.rv p { margin: 0 0 6px; }
.rv-q { font-weight: 500; }
@media (max-width: 860px) {
  .exam-cards { grid-template-columns: minmax(0, 1fr); }
  .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-side { position: static; }
  .palette { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (max-width: 600px) { .palette { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Modules */
.module-bar { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.module-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; flex-wrap: wrap; }
.module-name { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
.module-code { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 5px; background: var(--green-soft); color: var(--green-text); border: 1px solid #CFE3BF; }
.module-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.module-nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 7px 12px; border-radius: 6px; }
.module-nav a:hover { background: #fff; color: var(--ink); }
.module-nav a[aria-current="page"] { background: #fff; color: var(--green-text); box-shadow: inset 0 -2px 0 var(--green); }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.module-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.module-card h3 { margin: 4px 0 0; font-size: 19px; }
.module-card p { margin: 0; }
.module-card .module-action { margin-top: auto; padding-top: 12px; }
.module-card.planned { background: #FBFCFA; }
.module-card.planned h3, .module-card.planned p { color: var(--muted); }
.steps.steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .module-grid, .steps.steps-4 { grid-template-columns: minmax(0, 1fr); } }
