/* CV Gold — page styles. Mobile first; tokens at the top. Light: navy on cream and white. Dark: cream on navy. */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #0f1c33;
  --muted: #4f5b6e;
  --line: #dde2ea;
  --line-strong: #b4bdcc;
  --accent: #15345e;
  --accent-text: #15345e;
  --accent-tint: #e7eef8;
  --on-accent: #ffffff;
  --selection: #d5e3f7;
  --good: #1f7a3f;
  --good-tint: #e3f3e8;
  --warn: #b63d0e;
  --warn-tint: #fdeadf;
  --bad: #b3261e;
  --bad-tint: #fbe6e4;
  --focus: #15345e;
  --paper-bg: #e2e7ef;
  --shadow: 0 1px 2px rgba(15, 28, 51, .05), 0 10px 30px rgba(15, 28, 51, .07);
  --r: 10px;
  --r-lg: 16px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}

/* Dark mode is the same design turned over: cream and white on navy. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1a30;
    --surface: #122444;
    --surface-2: #1a2f52;
    --ink: #f1ede3;
    --muted: #a9b3c6;
    --line: #24395e;
    --line-strong: #3f5a8a;
    --accent: #f1ede3;
    --accent-text: #9cc5ff;
    --accent-tint: rgba(241, 237, 227, .1);
    --on-accent: #0b1a30;
    --selection: #2c4a7a;
    --good: #7fd19a;
    --good-tint: rgba(127, 209, 154, .16);
    --warn: #ffb070;
    --warn-tint: rgba(255, 176, 112, .16);
    --bad: #f29b93;
    --bad-tint: rgba(242, 155, 147, .16);
    --focus: #9cc5ff;
    --paper-bg: #071225;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1a30;
  --surface: #122444;
  --surface-2: #1a2f52;
  --ink: #f1ede3;
  --muted: #a9b3c6;
  --line: #24395e;
  --line-strong: #3f5a8a;
  --accent: #f1ede3;
  --accent-text: #9cc5ff;
  --accent-tint: rgba(241, 237, 227, .1);
  --on-accent: #0b1a30;
  --selection: #2c4a7a;
  --good: #7fd19a;
  --good-tint: rgba(127, 209, 154, .16);
  --warn: #ffb070;
  --warn-tint: rgba(255, 176, 112, .16);
  --bad: #f29b93;
  --bad-tint: rgba(242, 155, 147, .16);
  --focus: #9cc5ff;
  --paper-bg: #071225;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  overflow-wrap: anywhere;
  /* Fill the viewport so the footer sits at the bottom on short screens instead of floating mid-page. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; display: flex; flex-direction: column; }
/* The two short screens sit in the middle of the space between header and footer on a tall window. */
#s-working, #s-error { margin-top: auto; margin-bottom: auto; }
[hidden] { display: none !important; }
svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-underline-offset: 3px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Headings receive focus only so screen readers announce a screen change; no ring on them. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--selection); }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 20; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line-strong); text-decoration: none; font-weight: 600; }
.skip:focus { top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- header and footer ---------- */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: 8px; }
.mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font: 700 12px/28px var(--serif); text-align: center; letter-spacing: .02em; }
.wordmark { font: 700 19px/1 var(--serif); letter-spacing: .005em; }
.top-price { margin: 0; color: var(--muted); font-size: 14px; display: none; }
@media (min-width: 720px) { .top-price { display: block; } }

.foot { margin-top: 56px; padding-top: 22px; padding-bottom: 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot .wordmark { font-size: 16px; color: var(--ink); }
.foot-note { flex-basis: 100%; }
@media (min-width: 720px) { .foot-note { flex-basis: auto; margin-left: auto; text-align: right; max-width: 48ch; } }

/* ---------- type helpers ---------- */

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--accent-text); margin: 0 0 8px; }
.lbl { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.fine { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.opt-tag { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 6px; }

/* ---------- hero and steps ---------- */

.hero { padding: 20px 0 6px; }
h1 { font: 700 clamp(30px, 6.4vw, 46px)/1.1 var(--serif); letter-spacing: -.012em; margin: 0 0 14px; max-width: 22ch; text-wrap: balance; }
.lede { font-size: 18px; line-height: 1.5; max-width: 58ch; margin: 0 0 14px; }
.price { font-size: 17px; margin: 0; color: var(--muted); }
.price strong { color: var(--ink); }

.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 16px 14px; }
.steps .n { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); font-weight: 700; font-size: 14px; align-items: center; justify-content: center; margin-bottom: 10px; }
.steps h2 { font: 600 17px/1.3 var(--sans); margin: 0 0 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- panels ---------- */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 16px; margin-top: 26px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .panel { padding: 26px 28px; } }
.panel-title { font: 700 22px/1.25 var(--serif); margin: 0 0 14px; }
.panel h3 { font: 700 19px/1.3 var(--sans); margin: 0 0 6px; }

/* ---------- form controls ---------- */

textarea, input[type="text"] {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
}
textarea { resize: vertical; min-height: 100px; display: block; }
textarea::placeholder, input::placeholder { color: var(--muted); opacity: .8; }
textarea:focus-visible, input[type="text"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field { margin-top: 22px; }
fieldset { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
legend { padding: 0; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 6px; border-radius: 12px; margin-bottom: 14px; }
.tabs [role="tab"] { border: 0; background: transparent; padding: 12px 10px; border-radius: 8px; font-weight: 600; font-size: 16px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
@media (max-width: 419px) { .tabs [role="tab"] { padding: 12px 6px; } .tabs [role="tab"] svg { display: none; } }

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: 28px 16px;
  cursor: pointer;
  background: var(--bg);
  min-height: 156px;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-tint); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.drop-icon { width: 38px; height: 38px; color: var(--accent-text); margin-bottom: 4px; }
.drop-text { font-size: 16px; }
.drop-text strong { display: block; }
.drop-text .u { text-decoration: underline; text-underline-offset: 3px; color: var(--accent-text); font-weight: 600; }
.drop-sub { font-size: 14px; color: var(--muted); }
.file-chosen { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 12px; background: var(--good-tint); color: var(--ink); border-radius: var(--r); font-size: 15px; }
.file-chosen svg { color: var(--good); flex: none; }
.file-chosen .fn { font-weight: 600; min-width: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; margin-left: auto; white-space: nowrap; }

.div-cards { display: grid; gap: 10px; margin-top: 8px; }
@media (min-width: 560px) { .div-cards { grid-template-columns: 1fr 1fr; } }
.div-card {
  position: relative;
  display: grid; grid-template-columns: 60px 1fr; gap: 4px 14px; align-items: start;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  cursor: pointer;
  background: var(--surface);
}
.div-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.div-card:hover { border-color: var(--line-strong); }
.div-card.selected, .div-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-tint); }
.div-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.div-card .thumb { grid-row: 1 / span 2; width: 60px; height: 78px; }
.div-name { font-weight: 700; font-size: 17px; padding-top: 2px; }
.div-when { color: var(--muted); font-size: 15px; line-height: 1.45; }
.thumb .pg { fill: #fff; stroke: #c3cad6; }
.thumb .ink { fill: #3b3b3b; }
.thumb .mid { fill: #8a8a8a; }
.thumb .light { fill: #cfcfcf; }
.thumb .tint { fill: #e8edf4; }
.thumb .prim { fill: #1c3a5e; }
.thumb .onprim { fill: #fff; }
.thumb .kpi { fill: #fff; stroke: #d5dce6; stroke-width: .6; }
.thumb .acc { fill: #3b6ea5; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(.94); border-color: var(--accent); }
.btn-lg { padding: 14px 26px; font-size: 17px; min-height: 52px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost:hover { border-color: transparent; background: var(--accent-tint); }
.btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
.btn-sub { font-weight: 500; opacity: .75; font-size: .88em; }
.actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 559px) { .actions .btn { width: 100%; } }
@media (min-width: 560px) { .actions { flex-direction: row; align-items: center; flex-wrap: wrap; } }
.form-err { color: var(--bad); margin: 0; font-size: 15px; font-weight: 500; }
.form-err:empty { display: none; }

/* ---------- before and after ---------- */

.sample { margin-top: 48px; }
.sec-head h2 { font: 700 clamp(24px, 4.4vw, 32px)/1.2 var(--serif); margin: 0 0 10px; text-wrap: balance; }
.sec-intro { color: var(--muted); max-width: 66ch; margin: 0; }
.ba { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 720px) { .ba { grid-template-columns: 1fr 1fr; gap: 18px; } }
.ba-col { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); padding: 16px; min-width: 0; }
.ba-tag { margin: 0 0 12px; font: 700 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); }
.ba-after .ba-tag { background: var(--accent-tint); color: var(--accent-text); }
.ba-doc { font-size: 14px; line-height: 1.5; }
.ba-doc p, .ba-doc ul { margin: 0 0 6px; }
.before-doc { font-family: Arial, Helvetica, sans-serif; color: var(--muted); }
.before-doc .bd-name { font-weight: 700; letter-spacing: .04em; margin: 0 0 8px; color: var(--ink); }
.before-doc .bd-h { font-weight: 700; margin: 10px 0 2px; font-size: 12px; letter-spacing: .06em; }
.before-doc .bd-role { font-weight: 700; }
.before-doc ul { padding-left: 18px; }
.after-doc .ad-name { font: 700 18px/1.1 var(--serif); letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.after-doc .ad-thesis { color: var(--accent-text); font-weight: 700; margin: 6px 0 8px; font-size: 15px; }
.after-doc .ad-proof { display: flex; flex-wrap: wrap; gap: 3px 0; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); padding: 5px 0; margin: 0 0 10px; font-weight: 600; font-size: 13px; }
.after-doc .ad-proof span + span::before { content: "▪"; color: var(--accent); margin: 0 7px; }
.after-doc .ad-h { font-weight: 700; margin: 0; font-size: 14px; }
.after-doc .ad-ctx { color: var(--muted); font-size: 13px; margin: 1px 0 6px; }
.after-doc .ad-win { font-style: italic; font-weight: 700; margin: 0 0 6px; }
.after-doc ul { margin: 0; padding-left: 16px; }
.after-doc li { margin: 0 0 5px; }
.after-doc li::marker { color: var(--accent); }
.ba-qs { margin-top: 14px; background: var(--surface-2); border-radius: var(--r-lg); padding: 16px; }
.ba-qs h3 { margin: 0 0 10px; font: 600 16px/1.3 var(--sans); }
.ba-qs dl { margin: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .ba-qs dl { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.ba-qs dt { font-weight: 600; font-size: 15px; }
.ba-qs dd { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.ba-qs .fine { margin-top: 12px; }

/* ---------- working ---------- */

.w-title { font: 700 clamp(26px, 5vw, 34px)/1.15 var(--serif); margin: 0 0 6px; }
.w-for { color: var(--muted); margin: 0; font-size: 15px; }
.w-for:empty { display: none; }
.stepper { list-style: none; margin: 22px 0 0; padding: 0; display: grid; }
.stepper li { display: grid; grid-template-columns: 28px 1fr; gap: 0 14px; align-items: start; position: relative; padding: 0 0 18px; }
.stepper li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px; background: var(--line); }
.stepper li.done:not(:last-child)::before { background: var(--good); }
/* The connector after the live step carries a slow sweep of the accent colour, so a step that lasts two minutes still looks alive. */
.stepper li.live:not(:last-child)::before {
  background: linear-gradient(180deg, var(--line) 0 35%, var(--accent) 50%, var(--line) 65% 100%);
  background-size: 100% 300%;
  animation: sweep-y 2.6s linear infinite;
}
.stepper .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.stepper li.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.stepper li.done .dot::after { content: "✓"; font-size: 14px; font-weight: 700; line-height: 1; }
.stepper li.live .dot { border-color: var(--accent); background: var(--accent-tint); }
.stepper li.live .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.3s ease-in-out infinite; }
.s-body { display: flex; flex-direction: column; padding-top: 3px; }
.s-name { font-weight: 600; }
.stepper li.todo .s-name { color: var(--muted); font-weight: 500; }
.s-time { color: var(--muted); font-size: 14px; }
.stepper li.live .s-time { color: var(--accent-text); font-weight: 600; }
.s-note { color: var(--muted); font-size: 13px; font-style: italic; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes sweep-y { from { background-position: 0 100%; } to { background-position: 0 0; } }
@keyframes sweep-x { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (min-width: 720px) {
  /* Five equal columns, each step centred in its column, so the row spans the whole card. */
  .stepper { grid-template-columns: repeat(5, 1fr); gap: 0; }
  .stepper li { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 0 6px; }
  .stepper li:not(:last-child)::before { left: calc(50% + 18px); right: calc(-50% + 18px); top: 13px; bottom: auto; width: auto; height: 2px; }
  .stepper li.live:not(:last-child)::before {
    background: linear-gradient(90deg, var(--line) 0 35%, var(--accent) 50%, var(--line) 65% 100%);
    background-size: 300% 100%;
    animation: sweep-x 2.6s linear infinite;
  }
  .s-body { padding-top: 8px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .stepper li.live:not(:last-child)::before { background: var(--line); animation: none; }
}
.w-now { display: grid; grid-template-columns: 12px 1fr; gap: 12px; align-items: start; margin-top: 8px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r); }
.w-now-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 6px; animation: pulse 1.3s ease-in-out infinite; }
.w-now-line { margin: 0; transition: opacity .4s ease, transform .4s ease; }
.w-now-line.enter { opacity: 0; transform: translateY(5px); transition: none; }
.w-estimate { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.w-estimate:empty { display: none; }
.keep-link { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.keep-link p { margin: 0 0 10px; }
.linkrow { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.linkrow input { font-size: 14px; color: var(--muted); }
@media (min-width: 560px) { .linkrow { flex-direction: row; } .linkrow input { flex: 1; } }

/* ---------- analysis ---------- */

.a-head { padding: 20px 0 0; }
.a-story { font: 500 clamp(19px, 2.4vw, 24px)/1.4 var(--serif); margin: 0 0 10px; max-width: 64ch; text-wrap: pretty; }
.a-meta { color: var(--muted); margin: 0; font-size: 15px; }

.thesis-cards { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 720px) { .thesis-cards { grid-template-columns: 1fr 1fr; } }
.thesis-card { position: relative; display: block; border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px 16px 14px 46px; cursor: pointer; font: 600 17px/1.35 var(--serif); background: var(--surface); }
.thesis-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.thesis-card::before { content: ""; position: absolute; left: 15px; top: 16px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.thesis-card:hover { border-color: var(--line-strong); }
.thesis-card.selected, .thesis-card:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px var(--accent); }
.thesis-card.selected::before, .thesis-card:has(input:checked)::before { border-color: var(--accent); background: radial-gradient(var(--accent) 46%, var(--surface) 52%); }
.thesis-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.thesis-card.neutral { font: 500 16px/1.35 var(--sans); color: var(--muted); }

.two-up { display: grid; gap: 14px; margin-top: 14px; }
.two-up .panel { margin-top: 0; }
@media (min-width: 720px) { .two-up { grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; } }
.strengths { border-left: 4px solid var(--good); }
.risks { border-left: 4px solid var(--warn); }
.plist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.plist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15.5px; line-height: 1.45; }
.plist li::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.strengths .plist li::before { background: var(--good-tint); color: var(--good); }
.risks .plist li::before { content: "!"; background: var(--warn-tint); color: var(--warn); }

.gaps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.count { margin: 0; font-weight: 600; color: var(--accent-text); font-size: 14px; background: var(--accent-tint); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.count:empty { display: none; }
.qs { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: q; display: grid; gap: 20px; }
.q { position: relative; padding-left: 40px; }
.q::before { counter-increment: q; content: counter(q); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.q.answered::before { content: "✓"; background: var(--good); color: #fff; }
.q-text { display: block; font-weight: 600; font-size: 17px; line-height: 1.35; margin: 2px 0 4px; }
.q-why { margin: 0 0 2px; font-size: 15px; }
.q-why b { color: var(--muted); font-weight: 600; }
.q-eg { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-style: italic; }
.q textarea { min-height: 76px; }

.cta-bar { margin-top: 22px; }
.cta-inner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.cta-copy p { margin: 0; }
.cta-text { color: var(--ink); font-size: 15px; }
.cta-note { color: var(--muted); font-size: 14px; }
.cta-note:empty { display: none; }
.cta-btns { display: flex; flex-direction: column-reverse; gap: 6px; }
@media (max-width: 719px) {
  .cta-bar {
    position: sticky; bottom: 0; z-index: 5;
    margin: 22px -16px 0; padding: 12px 16px 12px;
    background: linear-gradient(to top, var(--bg) 78%, transparent);
  }
  .cta-text { display: none; }
}
@media (min-width: 720px) {
  .cta-inner { grid-template-columns: 1fr auto; align-items: center; padding: 18px 22px; }
  .cta-btns { flex-direction: row; align-items: center; gap: 10px; }
  .cta-inner .form-err { grid-column: 1 / -1; }
}

/* ---------- result ---------- */

.r-head { padding: 20px 0 0; }
.r-head h2 { font: 700 clamp(24px, 4.5vw, 34px)/1.15 var(--serif); margin: 0 0 6px; }
.r-sub { margin: 0; color: var(--muted); }
.actionbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; position: sticky; top: 0; z-index: 4; padding: 10px 0; background: var(--bg); }
@media (max-width: 559px) { .actionbar .btn { flex: 1 1 auto; } }
.paper { margin-top: 10px; background: var(--paper-bg); border-radius: var(--r-lg); padding: 16px 10px 12px; }
@media (min-width: 720px) { .paper { padding: 28px 24px 16px; } }
.paper-stage { position: relative; width: 100%; overflow: hidden; min-height: 240px; }
.paper-stage iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; width: 100%; height: 100%; }
.paper-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

.scores { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.scores summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: 17px; list-style: none; display: flex; align-items: center; gap: 12px; border-radius: var(--r-lg); }
.scores summary::-webkit-details-marker { display: none; }
.scores summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; flex: none; }
.scores[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.score-sum { font-weight: 500; color: var(--muted); font-size: 15px; margin-left: auto; white-space: nowrap; }
.scores .hint { padding: 0 18px; }
.score-list { list-style: none; margin: 0; padding: 0 18px 8px; }
.score-list li { display: grid; grid-template-columns: 68px 1fr; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.badge { display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 4px 9px; margin-top: 1px; }
.badge.pass { background: var(--good-tint); color: var(--good); }
.badge.close { background: var(--warn-tint); color: var(--warn); }
.badge.miss { background: var(--bad-tint); color: var(--bad); }
.sc-crit { font-weight: 600; }
.sc-note { grid-column: 2; color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- error ---------- */

.error h2 { font: 700 clamp(24px, 4.5vw, 32px)/1.15 var(--serif); margin: 0 0 10px; }
.err-detail { background: var(--bad-tint); color: var(--ink); border-radius: var(--r); padding: 10px 12px; font-size: 15px; margin: 0 0 6px; }
.err-detail:empty { display: none; }
.error h3 { font: 600 17px/1.3 var(--sans); margin: 18px 0 8px; }
.error ul { margin: 0; padding-left: 20px; }
.error li { margin: 4px 0; }

/* Design panel */
.designer { margin-top: 18px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.d-head h3 { margin: 0 0 2px; font-family: var(--serif); font-size: 1.25rem; }
.d-head .hint { margin: 0; }
.d-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 10px; flex-wrap: wrap; }
.d-filters { display: flex; gap: 6px; }
.d-filter { min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.d-filter[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-text); font-weight: 600; }
.d-gallery { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 124px; gap: 12px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x proximity; }
.d-tpl { display: block; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .85rem; text-align: left; cursor: pointer; scroll-snap-align: start; }
.d-tpl img { display: block; width: 100%; aspect-ratio: 210 / 297; object-fit: cover; object-position: top; background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; }
.d-tpl span { display: block; margin-top: 4px; }
.d-tpl[aria-pressed="true"] img { outline: 3px solid var(--accent-text); outline-offset: 1px; }
.d-tpl[aria-pressed="true"] span { font-weight: 700; }
.d-sub { margin: 14px 0 8px; font-size: .95rem; }
.d-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.d-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.d-swatch { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; }
.d-swatch[aria-pressed="true"] { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.d-colour { display: inline-flex; align-items: center; gap: 6px; }
.d-colour input { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; cursor: pointer; }
.d-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.d-field { display: grid; gap: 3px; font-size: .9rem; }
.d-field select { min-height: 40px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.d-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.d-jump { margin: 0; }
/* Wide screens: the panel and the page side by side, so a click shows its result without scrolling. */
@media (min-width: 1180px) {
  .d-split { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 20px; align-items: start; width: min(1320px, calc(100vw - 48px)); margin-left: calc(50% - min(660px, 50vw - 24px)); }
  .d-split > .designer { position: sticky; top: 12px; margin-top: 10px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 16px; }
  .d-gallery { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; max-height: 330px; overflow: hidden auto; }
  .d-fields { grid-template-columns: 1fr 1fr; }
  .d-jump { display: none; }
}
.d-invite { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
