@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap; src: url(../fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: Bricolage; font-weight: 200 800; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-opsz-normal.woff2) format("woff2-variations"); }
/* each question has its own colour; the answer has its own side of the screen and changes colour with what it says */
.p-sofa { --hue: #bcd8ff; } .p-car { --hue: #ffd95e; } .p-caravan { --hue: #ffc3a3; } .p-chair { --hue: #d8ccff; }
:root {
  --fun: Bricolage, Inter, system-ui, sans-serif;
  --ink: #14161b; --text: #23272f; --muted: #3f4653; --line: #14161b22; --line2: #14161b66; --bg: #fff; --card: #fff;
  --accent: #2f5fd0; --accent-ink: #234aa6; --tint: #edf2fd;
  --good: #06371f; --good-bg: #8fe3b4; --bad: #4d0d05; --bad-bg: #ff9b87; --warn: #402800; --warn-bg: #ffe08a;
  --serif: "Source Serif 4", Charter, Georgia, serif; --sans: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #7ea2f0; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar: the four questions */
.top { background: var(--hue); }
.top > div { padding: 0 max(24px, calc(50vw - 720px)); display: flex; align-items: center; gap: 4px 28px; flex-wrap: wrap; }
.brand { font: 750 1.1875rem/1 var(--fun); color: var(--ink); text-decoration: none; padding: 18px 0; }
.top nav { display: flex; gap: 4px; overflow-x: auto; margin-left: -10px; }
.top nav a { padding: 9px 12px; color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 550; white-space: nowrap; border-radius: 99px; border: 1px solid transparent; }
.top nav a:hover { border-color: var(--ink); }
.top nav a[aria-current] { background: var(--ink); color: #fff; }

main { padding: 0 0 80px; }
h1 { font: 800 clamp(2.9rem, 6vw, 5.4rem)/.92 var(--fun); letter-spacing: -0.045em; color: var(--ink); margin: 0 0 22px; text-wrap: balance; }
.intro { margin: 0 0 24px; }
.dek { font-size: 1.125rem; line-height: 1.5; margin: 0 0 10px; max-width: 34rem; }
.byline { font-size: 0.875rem; margin: 0; } .byline a { color: inherit; }

.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: start; }
.left { background: var(--hue); padding: 34px 40px 48px max(24px, calc(50vw - 720px)); min-height: 100vh; min-width: 0; }
.left > .callout { background: #fff; color: var(--ink); margin: 0 0 18px; }
.left a { color: var(--ink); }
form.panel { display: grid; gap: 34px; }
.card { border-top: 4px solid var(--ink); padding: 14px 0 0; }
.card > h2 { font: 800 1.75rem/1.1 var(--fun); letter-spacing: -.02em; color: var(--ink); margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.card > h2 label { flex-wrap: wrap; max-width: 100%; font-size: 0.875rem; font-weight: 500; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(7.25rem, 50% - 7px)), 1fr)); gap: 16px 14px; align-items: end; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f + .fields, .fields + .f, .veh + .fields { margin-top: 16px; }
.name { font-weight: 550; font-size: 0.9375rem; line-height: 1.35; color: var(--ink); }
.hint { color: var(--text); font-size: 0.84375rem; line-height: 1.4; }
.tag { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font: 650 0.6875rem/1 var(--sans); margin-right: 7px; vertical-align: 1px; }
.inp { display: flex; align-items: baseline; border-bottom: 3px solid var(--ink); background: #ffffff73; overflow: hidden; border-radius: 6px 6px 0 0; }
.inp:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 3px 0 var(--accent); }
.inp input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: none; font: 800 1.875rem/1.1 var(--fun); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); padding: 6px 0 6px 10px; }
.inp:has([aria-invalid=true]) { border-color: var(--bad); box-shadow: 0 0 0 3px #f7dcd8; }
.suffix { font-style: normal; font-size: 0.9375rem; color: var(--ink); padding: 0 12px 0 6px; white-space: nowrap; }
select { font: 500 1rem/1.2 var(--sans); color: var(--ink); padding: 10px 34px 10px 12px; width: 100%; min-width: 0; border: 1.5px solid var(--ink); border-radius: 10px; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235b6474' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; text-overflow: ellipsis; }
h2 select { width: auto; max-width: 100%; padding: 6px 30px 6px 10px; font-size: 0.875rem; }
.veh { width: 100%; height: 150px; display: block; margin: 4px 0 0; background: #fff; border-radius: 12px; }
.plan { width: 100%; height: 230px; display: none; background: #fff; border-radius: 12px; margin-bottom: 16px; }
.note { color: var(--muted); font-size: 0.875rem; line-height: 1.5; margin: 14px 0 0; }
.note:empty { display: none; }
.callout { overflow-wrap: anywhere; background: var(--warn-bg); color: #4d3307; border-radius: 12px; padding: 14px 16px; font-size: 0.9375rem; line-height: 1.5; }
.callout strong { color: var(--warn); }
.card .callout { margin: 0 0 16px; font-size: 0.875rem; }
button { overflow-wrap: anywhere; font: 600 0.9375rem/1 var(--sans); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line2); background: #fff; color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: progress; }
#go { width: 100%; background: var(--ink); border-color: var(--ink); color: #fff; font: 800 1.75rem/1 var(--fun); padding: 20px; border-radius: 99px; }
#go:hover { background: #333a47; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; font: inherit; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(7.25rem, 50% - 4px)), 1fr)); gap: 8px; }
.kinds label { display: flex; flex-direction: column; gap: 6px; border-radius: 12px; padding: 12px 14px; font-size: 0.9375rem; font-weight: 600; line-height: 1.25; color: var(--ink); cursor: pointer; background: #ffffff66; border: 1.5px solid transparent; }
.kinds label:hover { background: #ffffffb0; }
.kinds svg { width: 64px; fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linejoin: round; stroke-linecap: round; }
.kinds input { position: absolute; opacity: 0; }
.kinds label:has(:checked) { background: var(--ink); color: #fff; }
.kinds label:has(:focus-visible) { outline: 3px solid #7ea2f0; outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 0.9375rem; color: var(--ink); cursor: pointer; margin-top: 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
#sofaFields { margin-top: 14px; }
.diagram { margin: 0 0 16px; }
.diagram svg { width: 100%; height: auto; display: block; border-radius: 12px; background: #fff; }

/* the answer */
.stage { position: sticky; top: 0; scroll-margin-top: 0; min-width: 0; }
.stage .card { --side: #fff; border: 0; padding: 0; background: var(--side); overflow: hidden auto; height: 100vh; }
.stage .card:has(> .verdict.good) { --side: var(--good-bg); } .stage .card:has(> .verdict.bad) { --side: var(--bad-bg); } .stage .card:has(> .verdict.warn) { --side: var(--warn-bg); }
/* the picture stays in sight while you read down the steps (on a screen tall enough for both) */
@media (min-height: 560px) { .stage .pic { position: sticky; top: 0; z-index: 1; } .stage .controls { border-top: 0; } #steps li, #steps button { scroll-margin-top: calc(var(--pic-h) + 8px); } }
.verdict { padding: 34px 40px 22px; min-height: 64px; font-size: 1.125rem; line-height: 1.45; color: var(--text); }
.verdict strong { display: block; font: 800 var(--vsize, clamp(2.6rem, 5vw, 4.6rem))/.95 var(--fun); letter-spacing: -0.04em; color: var(--ink); text-wrap: balance; }
.verdict.good { color: var(--good); } .verdict.good strong { color: var(--good); }
.verdict.bad { color: var(--bad); } .verdict.bad strong { color: var(--bad); }
.verdict.warn { color: var(--warn); } .verdict.warn strong { color: var(--warn); }
.verdict span { display: block; margin-top: 12px; max-width: 38rem; }
.p-chair h1, .p-caravan h1 { font-size: clamp(2.5rem, 4.4vw, 4rem); }
.p-chair { --vsize: clamp(1.9rem, 3vw, 2.5rem); }
.verdict button { margin-top: 12px; }
.stage { --pic-h: clamp(260px, 46vh, 560px); }
.pic { width: 100%; height: var(--pic-h); display: block; background: #fff; touch-action: pan-y; }
.controls { display: flex; gap: 14px; align-items: center; padding: 14px 40px; flex-wrap: wrap; }
.controls button { padding: 10px 14px; font-size: 0.875rem; min-width: 96px; }
#scrub { flex: 1 1 140px; accent-color: var(--accent); min-width: 0; height: 24px; }
.seg { display: inline-flex; }
.controls .seg button { border-radius: 0; min-width: 0; }
.controls .seg button:first-child { border-radius: 10px 0 0 10px; }
.controls .seg button:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
#steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
#steps:not(:empty) { padding: 4px 30px 8px; }
#steps li { counter-increment: s; }
#steps button, #steps li.plain { display: grid; grid-template-columns: 28px 1fr; width: 100%; text-align: left; border: 0; background: none; font: 400 0.96875rem/1.5 var(--sans); color: var(--text); padding: 8px 10px; border-radius: 10px; }
#steps button::before, #steps li.plain::before { content: counter(s); font-weight: 600; color: inherit; font-variant-numeric: tabular-nums; }
#steps button:hover { background: #ffffff8c; }
#steps li.now button { background: var(--ink); color: #fff; } #steps li.now button::before { color: #fff; }
.after { padding: 14px 40px 34px; font-size: 0.9375rem; color: var(--text); } .after button { color: var(--ink); } .after a { color: var(--ink); }
.after p { margin: 0 0 6px; } .after p:empty { display: none; } .after p:last-child { margin: 0; }
.longest { color: var(--ink); font-size: 0.96875rem; }

.prose { max-width: 720px; margin: 72px auto 0; padding: 0 24px; font: 400 1.125rem/1.62 var(--serif); }
.prose h2 { font: 800 1.875rem/1.15 var(--fun); letter-spacing: -0.02em; color: var(--ink); margin: 1.9em 0 .5em; scroll-margin-top: 16px; }
.prose li { margin: 0 0 .6em; }
.prose .src { font: 400 0.9375rem/1.55 var(--sans); }
footer { border-top: 1px solid var(--line); max-width: 672px; margin: 56px auto 0; padding: 20px 24px 0; font-size: 0.875rem; color: var(--muted); }

@media (max-width: 1000px) {
  .tool { grid-template-columns: minmax(0, 1fr); }
  .left { padding: 24px 24px 36px; min-height: 0; }
  .stage { position: static; } .stage .card { height: auto; overflow: clip; min-height: 60vh; }
  .plan { display: block; }
}
@media (max-width: 560px) {
  .top > div { padding: 0 16px; gap: 0; } .brand { padding: 14px 0 6px; width: 100%; } .top nav a { padding: 8px 10px; } .top nav .x { display: none; }
  .left { padding: 18px 16px 30px; } .verdict { padding: 26px 16px 18px; } .controls, .after { padding-left: 16px; padding-right: 16px; } #steps:not(:empty) { padding: 4px 6px 8px; }
  .stage { --pic-h: 320px; }
}
.printed { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  #correction, .top, form.panel, .stage .controls, main .prose, main footer, .byline, #share, .after p:has(#share) { display: none; }
  main, .left { padding: 0; min-height: 0; background: none; } .tool { display: block; } .intro { margin: 0 0 12px; } h1 { font-size: 22pt; margin: 0; } .verdict { padding: 0 0 8px; font-size: 11pt; } .verdict strong { font-size: 20pt; } .after, #steps:not(:empty) { padding-left: 0; padding-right: 0; } #steps li.now button, #steps li.now button::before { color: #000; } .dek { display: none; }
  .printed { display: block; font-size: 10pt; margin: 0 0 12px; } .printed h2 { font: 600 11pt/1.3 var(--sans); color: var(--ink); margin: 10px 0 4px; }
  .printed dl { columns: 2; column-gap: 28px; margin: 0; } .printed dl > div { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 2px 0; }
  .printed dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); }
  .stage { position: static; } .stage .card { height: auto; overflow: visible; background: none !important; }
  .stage .pic { position: static; height: 8.5cm; object-fit: contain; break-inside: avoid; border: 0; }
  .verdict { break-inside: avoid; break-after: avoid; } #steps li { break-inside: avoid; } #steps li.now button { background: none; }
}
/* Windows contrast themes drop background colours: say "this one" with outlines instead, and keep the drawings' own white paper. */
@media (forced-colors: active) {
  .pic, .veh, .plan, .diagram svg { forced-color-adjust: none; background: #fff; }
  .top nav a:not([aria-current]) { border-color: Canvas; } .top nav a[aria-current] { border-color: Highlight; }
  .kinds label:has(:checked) { outline: 3px solid Highlight; outline-offset: -3px; }
  .seg button[aria-pressed=true] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  #steps li.now button { outline: 2px solid Highlight; outline-offset: -2px; }
  .inp:focus-within { outline: 3px solid Highlight; }
  .inp:has([aria-invalid=true]) { outline: 2px dashed CanvasText; outline-offset: 2px; }
  .callout { border: 1px solid CanvasText; }
}
