/* Desk Fit Finder — ink navy + vivid mint blueprint, off-white editorial content. */

:root {
  --ink: #0b1430;
  --ink-2: #111d42;
  --ink-3: #1b2a5c;
  --ink-line: #2a3b72;
  --mint: #3cf0b1;
  --mint-soft: rgba(60, 240, 177, 0.14);
  --mint-deep: #067a55;
  --lavender: #b9a8ff;
  --lavender-deep: #5b45c9;
  --coral: #ff7b67;
  --coral-deep: #c23b26;
  --amber: #f2b84b;
  --amber-deep: #8a5a00;

  --paper: #f5f7fb;
  --paper-2: #ebeff7;
  --card: #ffffff;
  --text: #121a33;
  --muted: #545c76;
  --rule: #d8dfec;

  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--mint-deep);
}

*, *::before, *::after { 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; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; line-height: 1.12; }
p { margin: 0; }
a { color: var(--mint-deep); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--mint); color: var(--ink); padding: 8px 14px; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 10px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink);
  border-bottom: 1px solid var(--ink-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand:focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--mint); }
.brand-name { font-weight: 650; letter-spacing: 0.01em; font-size: 16px; }

/* Technical mark: desk outline with two panels, keyboard and a dimension rail. */
.mark {
  position: relative; display: inline-block; width: 26px; height: 22px;
  border: 1.5px solid var(--mint); border-radius: 2px;
  background:
    linear-gradient(var(--mint), var(--mint)) 3px 3px / 8px 2px no-repeat,
    linear-gradient(var(--mint), var(--mint)) 12px 3px / 8px 2px no-repeat;
}
.mark::before {
  content: ""; position: absolute; left: 6px; bottom: 3px; width: 8px; height: 4px;
  border: 1px solid var(--lavender); border-radius: 1px;
  box-shadow: 9px 0 0 -1px var(--coral);
}
.mark::after {
  content: ""; position: absolute; right: -8px; top: -1.5px; bottom: -1.5px; width: 4px;
  border-top: 1px solid var(--mint); border-bottom: 1px solid var(--mint);
  background: linear-gradient(var(--mint), var(--mint)) center / 1px 100% no-repeat;
  opacity: 0.8;
}

.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 7px 12px; border-radius: 6px;
  color: #d4dcf5; text-decoration: none; font-size: 14px; font-weight: 500;
}
.site-nav a:hover { color: var(--ink); background: var(--mint); }
.site-nav a:focus-visible { box-shadow: 0 0 0 2px var(--mint); }

/* ---------- Intro ---------- */

.intro { padding: 44px 0 28px; }
.intro h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(34px, 5.2vw, 58px); color: var(--ink); max-width: 25ch;
}
.deck { margin-top: 14px; max-width: 62ch; font-size: 17px; color: var(--muted); }

.load-error {
  margin-bottom: 20px; padding: 14px 16px; border-radius: var(--radius);
  background: #fff1ee; border: 1px solid #f3b4a8; color: var(--coral-deep); font-weight: 500;
}

/* ---------- Planner grid ---------- */

.planner {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "quick work" "refine work"; gap: 14px 28px; align-items: start;
  padding-bottom: 12px;
}
.planner:focus { outline: none; }

/* Room choice and refinement */
.quick, .refine {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
}
.quick { grid-area: quick; min-width: 0; margin: 0; padding: 15px 14px; }
.quick legend {
  float: left; width: 100%; margin-bottom: 9px; padding: 0;
  color: var(--ink); font-size: 16px; font-weight: 700;
}
.quick .segmented { clear: both; }
.quick .hint { margin-top: 9px; font-size: 13px; max-width: 50ch; }
.refine { grid-area: refine; min-width: 0; }
.refine > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px; cursor: pointer; color: var(--ink); font-weight: 700;
}
.refine > summary::-webkit-details-marker { display: none; }
.refine > summary::after { content: "+"; color: var(--mint-deep); font-family: var(--mono); }
.refine[open] > summary { border-bottom: 1px solid var(--rule); }
.refine[open] > summary::after { content: "−"; }
.setup { padding: 0 15px 18px; }
.setup-head { display: none; }
.jump-setup { display: none; }
.use-measurements { display: inline-block; font-weight: 700; }
.measure-guide { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.jump-verdict { font-size: 14px; font-weight: 600; }

.group { border: 0; margin: 0; padding: 16px 0 0; min-width: 0; }
.group + .group { border-top: 1px solid var(--paper-2); margin-top: 16px; }
.group > legend {
  padding: 0; font-weight: 650; font-size: 14px; color: var(--ink); margin-bottom: 10px;
  float: left; width: 100%;
}
.group > legend + * { clear: both; }

.sub { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
.sub > legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.tag {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 99px;
  font: 600 10px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lavender-deep); background: #efeaff;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { min-width: 0; }
.field + .field { margin-top: 0; }
.group > .field + .field { margin-top: 12px; }
.field label { display: block; font-size: 14px; font-weight: 550; margin-bottom: 4px; color: var(--text); }

.input-unit { position: relative; }
.input-unit input {
  width: 100%; height: 40px; padding: 0 34px 0 11px;
  font: 500 15px/1 var(--mono); font-variant-numeric: tabular-nums;
  background: var(--paper); border: 1px solid #cfcabd; border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.input-unit input:hover { border-color: #a9a396; }
.input-unit input:focus-visible { border-color: var(--mint-deep); background: #fff; box-shadow: 0 0 0 3px rgba(6, 122, 85, 0.22); border-radius: var(--radius-sm); }
.input-unit input:disabled { color: #9a9a9a; background: var(--paper-2); border-style: dashed; cursor: not-allowed; }
.input-unit input[aria-invalid="true"] { border-color: var(--coral-deep); background: #fff6f4; }
.unit {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 500 12px/1 var(--mono); color: var(--muted); pointer-events: none;
}

.hint { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.field-error { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--coral-deep); line-height: 1.35; }

/* Segmented radios */
.segmented {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; gap: 3px;
  background: var(--paper-2); border-radius: 8px;
}
.seg { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid; place-content: center; min-height: 40px;
  text-align: center; padding: 6px 4px; border-radius: 6px; pointer-events: none;
  font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s;
}
.seg input:checked + span { background: var(--ink); color: #fff; box-shadow: inset 0 -2px 0 var(--mint); }
.seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px var(--mint-deep); }

/* Select */
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg);
  pointer-events: none;
}
.select-wrap select {
  width: 100%; min-height: 40px; padding: 8px 32px 8px 11px; appearance: none; -webkit-appearance: none;
  background: var(--paper); border: 1px solid #cfcabd; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
}
.select-wrap select:focus-visible { border-color: var(--mint-deep); box-shadow: 0 0 0 3px rgba(6, 122, 85, 0.22); }

/* Model notes */
.model-notes { margin-top: 12px; font-size: 12.5px; }
.spec { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text); }
.spec dd.text { font-family: var(--sans); font-size: 12.5px; }
.spec-note { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.spec-links { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; }

/* Switch */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 42px; height: 24px; margin: 0; cursor: pointer; }
.switch-track {
  pointer-events: none;
  flex: none; width: 42px; height: 24px; border-radius: 99px; background: #cfcabd; position: relative; transition: background .15s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--coral); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }
.switch-label { font-size: 14px; font-weight: 550; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: #fff; box-shadow: inset 0 -2px 0 var(--mint); }
.btn-primary:hover { background: var(--ink-3); color: #fff; }
.btn-quiet { background: transparent; border-color: #cfcabd; color: var(--ink); margin-top: 14px; }
.btn-quiet:hover { border-color: var(--ink); }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 13px; }

/* ---------- Work area ---------- */

.work { grid-area: work; display: grid; gap: 16px; min-width: 0; }

/* The studio shares the planner controls and loads its renderer on demand. */
.studio-launch .btn { margin: 0; }
.desk-studio {
  min-width: 0; padding: 16px; border: 1px solid #dacdbb;
  border-radius: var(--radius); background: #fcf7ef;
}
.studio-titlebar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 8px 16px;
  margin-bottom: 12px; color: var(--ink);
}
.studio-titlebar h2 { font: 700 24px/1.2 var(--serif); }
.studio-titlebar p, .studio-titlebar a { font-size: 13px; }
.studio-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 232px);
  grid-template-areas: "scene size" "scene gear"; grid-template-rows: max-content 1fr; align-items: start; gap: 12px;
}
.studio-scene { grid-area: scene; min-width: 0; }
.studio-measure { grid-area: size; min-width: 0; margin: 0; padding: 8px; border: 1px solid #dacdbb; border-radius: 7px; }
.studio-measure legend, .studio-gear label { font-size: 13px; font-weight: 650; color: var(--ink); }
.studio-size-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.studio-size-fields label { min-width: 0; font-size: 12px; }
.studio-gear { grid-area: gear; align-self: start; display: grid; gap: 7px; min-width: 0; }
.studio-size-fields input, .studio-gear select {
  width: 100%; min-width: 0; min-height: 38px; padding: 5px 7px; border: 1px solid #b9a894;
  border-radius: 5px; background: var(--card); color: var(--ink); font: inherit;
}
.studio-size-fields input { display: block; margin-top: 3px; }
.studio-size-fields input[aria-invalid="true"] { border-color: var(--coral-deep); }
.studio-switch { min-height: 32px; display: flex; align-items: center; gap: 7px; }
.studio-camera { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.studio-camera button { background: #f4e9d8; border-color: #b9a894; color: var(--ink); }
.studio-camera button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.studio-stage { min-width: 0; border: 1px solid #b9a894; border-radius: 7px; background: #e8d9c7; }
.studio-stage canvas { display: block; width: 100%; height: clamp(270px, 37vw, 445px); border-radius: inherit; cursor: grab; touch-action: pan-y; }
.studio-stage canvas:active { cursor: grabbing; }
.studio-stage canvas:focus-visible { outline: 2px solid var(--mint-deep); outline-offset: 2px; }
.studio-error { padding: 12px; }
.studio-hint { margin-top: 5px; color: #554c41; font-size: 12px; }
.studio-readout { margin-top: 8px; color: var(--ink); font-size: 13px; }
.studio-readout [data-studio-status] { margin: 4px 0; }
.studio-readout [data-studio-breakdown] { margin-top: 6px; }
.studio-grid[data-unavailable] { display: block; }
.studio-grid[data-unavailable] :is(.studio-measure, .studio-gear, .studio-camera, .studio-hint, .studio-readout) { display: none; }
@media (max-width: 700px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "size" "scene" "gear"; gap: 9px; }
  .desk-studio { padding: 10px; }
}
@media (pointer: coarse) {
  .studio-camera button, .studio-size-fields input, .studio-gear select, .studio-gear .btn { min-height: 44px; }
}

/* The sizing workspace keeps its equipment separate from the example. */
.sizing { margin-bottom: 20px; }
.sizing-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.intro .sizing-actions { margin-top: 12px; }
.sizing-actions .btn { margin: 0; }
.sizing-results, .sizing-fields, .sizing-metrics {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.sizing-option {
  display: grid; justify-items: start; align-content: start; gap: 5px;
  padding: 10px; border: 1px solid #dacdbb; border-radius: 7px; background: var(--card);
}
.sizing h3 { font-size: 15px; }
.sizing-option p { color: var(--ink); font-size: 13px; }
.sizing-option strong { display: block; font-size: clamp(15px, 2.7vw, 21px); font-variant-numeric: tabular-nums; }
.sizing-size-note { display: block; margin-top: 3px; color: #942f28; }
.sizing-edit-actions { margin-bottom: 8px; }
.sizing-controls details { scroll-margin-top: 26px; }
.sizing-work {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(270px, 2fr); gap: 14px; margin-top: 14px;
}
.sizing-preview, .sizing-controls, .sizing-group, .sizing label { min-width: 0; }
.sizing-controls { display: grid; align-content: start; gap: 8px; }
.sizing-group {
  margin: 0; padding: 9px; border: 1px solid #dacdbb; border-radius: 7px; background: var(--card);
}
.sizing-group > label { margin-top: 7px; }
.sizing-desk { margin-bottom: 8px; }
.sizing-desk-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.sizing-group legend, .sizing summary { font-weight: 700; }
.sizing summary { cursor: pointer; font-size: 14px; }
.sizing-group summary span { margin-left: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.sizing-group[open] > summary { margin-bottom: 8px; }
.sizing label, .sizing-field label { display: grid; gap: 3px; color: var(--ink); font-size: 13px; }
.sizing :is(input, select) {
  width: 100%; min-width: 0; min-height: 38px; padding: 5px 7px; border: 1px solid #b9a894;
  border-radius: 5px; background: var(--card); color: var(--ink); font: inherit;
}
.sizing input[aria-invalid="true"] { border-color: var(--coral-deep); }
.sizing-status { margin-bottom: 8px; color: var(--ink); font-size: 13px; }
.sizing-status p { margin-top: 3px; }
.sizing-status[data-fit="blocked"] [data-sizing-fit], .sizing [data-blocked="true"] { color: #942f28; }
.sizing-plan { display: block; width: 100%; height: clamp(270px, 37vw, 445px); }
.sizing-metrics { margin-top: 8px; font-size: 13px; }
.sizing-metrics > div { padding: 7px 8px; border: 1px solid #dacdbb; border-radius: 5px; }
.sizing-metrics dd { font-weight: 700; color: var(--ink); }
.sizing-checks { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.sizing-checks:empty, .sizing-list:empty { display: none; }
.sizing-notes { margin-top: 8px; }
.sizing-add-gear { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: end; }
.sizing-list { display: grid; list-style: none; padding: 0; gap: 6px; margin: 8px 0; }
.sizing-list fieldset {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  min-width: 0; margin: 0; padding: 6px; border: 1px solid #dacdbb; border-radius: 5px;
}
.sizing-stand-fields { grid-column: 1 / -1; }
.sizing-field-error { color: #942f28; font-size: 12px; }
@media (max-width: 720px) {
  .sizing-work { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 420px) {
  .sizing-desk-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sizing-desk-fields label:last-child { grid-column: 1 / -1; }
}
@media (pointer: coarse) {
  .sizing :is(input, select, button, summary), .sizing-actions button { min-height: 44px; }
}

/* Verdict */
.verdict {
  --tone: var(--muted); --tone-bg: var(--card);
  position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 20px 16px 24px; overflow: hidden;
}
.verdict::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--tone); }
.verdict:focus { outline: none; }
.verdict:focus-visible { box-shadow: var(--focus); }
.verdict[data-status="fit"] { --tone: var(--mint); }
.verdict[data-status="conditional"] { --tone: var(--amber); }
.verdict[data-status="blocked"] { --tone: var(--coral); }
.verdict[data-status="invalid"] { --tone: var(--coral-deep); }

.kicker { font: 600 12px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.setup-source { margin-bottom: 5px; color: var(--ink); font-size: 13px; font-weight: 700; }
.verdict-heading {
  margin-top: 6px; display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.015em; color: var(--ink);
}
.status-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--tone, var(--muted)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--muted)) 25%, transparent); }
.verdict-reason { margin-top: 8px; font-size: 15.5px; max-width: 72ch; }
.verdict-width {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px;
  margin-top: 9px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--paper); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums;
}
.width-label { font: 650 11px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.width-fact strong { color: var(--ink); font-size: 1.15em; font-weight: 700; }
.setup-context { margin-top: 8px; color: var(--muted); font-size: 14px; }
.verdict-next { margin-top: 12px; }
.verdict-next:empty { display: none; }
.fit-breakdown {
  display: grid; gap: 5px; padding-top: 7px; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 13px; line-height: 1.45;
}
.fit-breakdown strong { margin-right: 3px; color: var(--ink); }
#verdict-fit-breakdown { margin-top: 10px; }
.cmp-select[aria-pressed="true"] .fit-breakdown { border-color: var(--ink-line); color: #b9c4e6; }
.cmp-select[aria-pressed="true"] .fit-breakdown strong { color: #e9eefc; }
.guide-match .fit-breakdown { margin-top: 7px; }
.next-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between;
  padding: 12px 14px; border-radius: 8px; background: var(--paper); border: 1px dashed #cfc9bb;
}
.next-card p { flex: 1 1 320px; font-size: 14px; }
.next-card strong { color: var(--ink); }
.next-card + .next-card { margin-top: 8px; }
/* Status chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px;
  font: 650 12px/1.3 var(--sans); white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-fit { background: #dcfbef; color: var(--mint-deep); }
.chip-conditional { background: #fdf0d3; color: var(--amber-deep); }
.chip-blocked { background: #ffe5e0; color: var(--coral-deep); }

/* Drawing */
.drawing {
  margin: 0; background: var(--ink); color: #c9d3f0; border-radius: var(--radius);
  padding: 12px; border: 1px solid var(--ink); box-shadow: 0 18px 40px -28px rgba(11, 20, 48, 0.7);
}
.drawing-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.layout-switch { border: 0; margin: 0; padding: 0; min-width: 0; width: 100%; }
.layout-options { display: flex; flex-wrap: wrap; gap: 6px; }
.lo { position: relative; cursor: pointer; }
.lo input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lo span {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--ink-line); font-size: 13px; font-weight: 550; color: #c9d3f0; background: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.lo span:hover { border-color: #4a5fa3; }
.lo i { width: 8px; height: 8px; border-radius: 50%; background: #6b7699; flex: none; }
.lo i[data-status="fit"] { background: var(--mint); }
.lo i[data-status="conditional"] { background: var(--amber); }
.lo i[data-status="blocked"] { background: var(--coral); }
.lo input:checked + span { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.lo input:checked + span i { box-shadow: 0 0 0 2px var(--ink); }
.lo input:focus-visible + span { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lavender); }

.sheet {
  position: relative; border: 1px solid #3a4c86; outline: 1px solid #22325f; outline-offset: 3px;
  margin: 4px; background: #0d1838; border-radius: 2px;
}
.sheet.is-stale .plan { opacity: 0.35; filter: grayscale(0.6); }
.plan { display: block; width: 100%; height: auto; max-height: 72vh; }

.title-block {
  display: flex; flex-wrap: wrap; gap: 0;
  margin: 12px 4px 0; border: 1px solid #2c3d73; font: 500 11px/1.3 var(--mono); color: #aab6db;
}
.title-block span { padding: 6px 10px; border-right: 1px solid #2c3d73; }
.title-block span:last-child { border-right: 0; }

.legend { list-style: none; margin: 10px 4px 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: #c9d3f0; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend em { font-style: normal; color: var(--lavender); font-size: 11px; font-family: var(--mono); }
.sw { width: 16px; height: 11px; border-radius: 2px; border: 1.5px solid; flex: none; }
.sw-screen { border-color: var(--mint); background: rgba(60, 240, 177, 0.35); }
.sw-stand { border-color: #7fe7c3; border-style: dashed; background: rgba(60, 240, 177, 0.08); }
.sw-keyboard { border-color: var(--lavender); background: rgba(185, 168, 255, 0.28); }
.sw-pad { border-color: #8f7fe0; background: rgba(143, 127, 224, 0.18); }
.sw-tower { border-color: var(--coral); background: rgba(255, 123, 103, 0.25); }
.sw-over { border-color: var(--coral); background: repeating-linear-gradient(45deg, var(--coral) 0 2px, transparent 2px 4px); }
.sw-wall { border-color: #8796c7; background: repeating-linear-gradient(45deg, #8796c7 0 1.5px, transparent 1.5px 4px); }

/* SVG plan styling (user units are inches; strokes are non-scaling px). */
.plan line, .plan rect, .plan path { vector-effect: non-scaling-stroke; }
.plan .hatch-line, .plan .over-hatch-line { vector-effect: none; }
.plan text { font-family: var(--sans); fill: #e7ecfb; paint-order: stroke; stroke: #0d1838; stroke-linejoin: round; }
.plan .grid-minor { stroke: rgba(120, 150, 230, 0.13); stroke-width: 1; }
.plan .grid-major { stroke: rgba(60, 240, 177, 0.2); stroke-width: 1; }
/* Pattern fills are set as SVG attributes so url(#id) resolves within the document. */
.plan .wall { stroke: #8796c7; stroke-width: 1.25; }
.plan .wall-conflict { stroke: var(--coral); stroke-width: 2; }
.plan .hatch-line { stroke: #6676ad; }
.plan .wall-label { fill: #aebbe6; font-weight: 700; letter-spacing: 0.12em; }
.plan .open-side { stroke: #8796c7; stroke-width: 1.25; stroke-dasharray: 2 5; }
.plan .open-label { fill: #8796c7; font-weight: 700; letter-spacing: 0.12em; }
.plan .desk { fill: #16254f; stroke: none; }
.plan .desk-edge { fill: none; stroke: #e7ecfb; stroke-width: 1.75; }
.plan .front-label { fill: #8ea0d6; font-weight: 600; letter-spacing: 0.1em; }

.plan .item-body { stroke-width: 1.5; }
.plan .item-screen .item-body { fill: rgba(60, 240, 177, 0.42); stroke: var(--mint); stroke-width: 2; }
.plan .item-stand .item-body { fill: rgba(60, 240, 177, 0.07); stroke: #7fe7c3; stroke-dasharray: 4 3; }
.plan .item-keyboard .item-body { fill: rgba(185, 168, 255, 0.26); stroke: var(--lavender); }
.plan .item-pad .item-body { fill: rgba(143, 127, 224, 0.16); stroke: #8f7fe0; }
.plan .item-tower .item-body { fill: rgba(255, 123, 103, 0.24); stroke: var(--coral); }
.plan .mouse { fill: rgba(185, 168, 255, 0.45); stroke: var(--lavender); stroke-width: 1.25; }
.plan .mouse-split { stroke: var(--lavender); stroke-width: 1; }
.plan .over { stroke: var(--coral); stroke-width: 1.5; }
.plan .over-hatch-line { stroke: var(--coral); }

.plan .item-label { font-weight: 600; }
.plan .item-label.k-screen { fill: #b9ffe6; }
.plan .item-label.k-stand { fill: #9fe9cf; font-weight: 500; }
.plan .item-label.k-keyboard, .plan .item-label.k-pad { fill: #e4dcff; }
.plan .item-label.k-tower { fill: #ffd2c9; }

.plan .dim line, .plan .dim path { stroke: #c9d3f0; stroke-width: 1; fill: none; }
.plan .dim .ext { stroke: #6f7fb5; stroke-dasharray: 2 2; }
.plan .dim text { fill: #f1f4ff; font-family: var(--mono); font-weight: 600; }
.plan .dim-accent line, .plan .dim-accent path { stroke: var(--mint); }
.plan .dim-accent text { fill: var(--mint); }
.plan .dim-bad line, .plan .dim-bad path { stroke: var(--coral); }
.plan .dim-bad text { fill: #ffb3a6; }
.plan .dim-room line, .plan .dim-room path { stroke: #9aa8dc; }
.plan .dim-room text { fill: #c7d0f2; }

/* Tiles */
.tiles { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tiles.is-stale { opacity: 0.45; }
.tile {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 12px 11px;
  display: flex; flex-direction: column; min-width: 0;
}
.tile dt { order: 1; font: 600 11px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tile dd { margin: 0; }
.tile .tv { order: 2; margin-top: 6px; font: 650 21px/1.1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -0.02em; }
.tile .tv small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.tile .tc { order: 3; margin-top: 5px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.tile[data-tone="good"] { box-shadow: inset 0 3px 0 var(--mint); }
.tile[data-tone="warn"] { box-shadow: inset 0 3px 0 var(--amber); }
.tile[data-tone="bad"] { box-shadow: inset 0 3px 0 var(--coral); }
.tile[data-tone="bad"] .tv { color: var(--coral-deep); }
.tile[data-tone="warn"] .tv { color: var(--amber-deep); }

/* ---------- Sections ---------- */

.section { padding: 40px 0 8px; }
.section:focus { outline: none; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; justify-content: space-between; margin-bottom: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -0.01em; color: var(--ink); }
.section-deck { color: var(--muted); font-size: 14px; max-width: 70ch; }

/* Comparison */
.compare-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cmp { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cmp-select {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; flex: 1;
  padding: 14px 14px 12px; text-align: left; background: none; border: 0; cursor: pointer; border-radius: 0;
}
.cmp-select:hover { background: #fbfaf6; }
.cmp-select:focus-visible { box-shadow: inset 0 0 0 3px var(--mint-deep); border-radius: var(--radius) var(--radius) 0 0; }
.cmp-select[aria-pressed="true"] { background: var(--ink); color: #e9eefc; }
.cmp-select[aria-pressed="true"] .cmp-title { color: #fff; }
.cmp-select[aria-pressed="true"] .cmp-reason, .cmp-select[aria-pressed="true"] .cmp-metrics { color: #b9c4e6; }
.cmp-select[aria-pressed="true"] .cmp-metrics b { color: var(--mint); }
.cmp-select[aria-pressed="true"]:focus-visible { box-shadow: inset 0 0 0 3px var(--mint); }
.cmp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cmp-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.cmp-reason { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-metrics { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.cmp-metrics b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.cmp-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flag { font: 650 10.5px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; background: var(--mint); color: var(--ink); }
.flag-shown { background: transparent; border: 1px solid currentColor; color: inherit; opacity: 0.8; }
.cmp-off {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; justify-content: space-between;
  padding: 9px 14px; border-top: 1px dashed var(--rule); font-size: 12.5px; color: var(--muted); background: #fcfbf8;
}
.cmp-off .btn-quiet { margin-top: 0; }

/* Matches */
.matches-summary { font-size: 14.5px; margin-bottom: 12px; display: grid; gap: 6px; }
.matches-summary .basis-tag { display: inline-block; font: 650 11px/1.5 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; background: #efeaff; color: var(--lavender-deep); margin-right: 6px; }
.matches-summary .muted { color: var(--muted); font-size: 13.5px; }
.matches-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.match {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--radius); position: relative;
}
.match[data-tier="0"] { border-top: 3px solid var(--mint); }
.match[data-tier="1"] { border-top: 3px solid var(--amber); }
.match[data-tier="2"] { border-top: 3px solid var(--coral); }
.match[data-tier="3"] { border-top: 3px solid #c9c4b8; }
.match h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.match .variant { font-size: 13px; color: var(--muted); }
.match .why { font-size: 13px; color: var(--muted); }
.match-diagram { margin: 3px 0; }
.match-diagram .plan {
  height: auto; aspect-ratio: 52 / 34; max-height: 176px;
  border: 1px solid #3a4c86; border-radius: 6px 6px 0 0; background: #0d1838;
}
.match-diagram .mini-wall { fill: none; stroke: #8796c7; stroke-width: 1.25; stroke-dasharray: 2 3; }
.match-diagram figcaption { font-size: 12px; color: var(--muted); }
.diagram-dimensions {
  display: flex; flex-wrap: wrap; gap: 3px 16px; padding: 5px 9px;
  border: 1px solid #3a4c86; border-top: 0; border-radius: 0 0 6px 6px; background: var(--paper-2);
}
.diagram-dimensions strong { color: var(--ink); font: 650 13px/1.4 var(--mono); }
.diagram-note { display: block; margin-top: 5px; }
.guide-match { max-width: 370px; }
.match .actions { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.match .actions .btn-quiet { margin-top: 0; }
.match .match-source { color: var(--muted); font-size: 13px; }
.retailer-offer { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.retailer-offer .btn { min-height: 36px; }
.paid-label { color: var(--muted); font-size: 12px; }
.associate-disclosure { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.match.is-current { box-shadow: 0 0 0 2px var(--ink); }

/* Interaction outlines sit outside the existing fit and conflict colors. */
.sheet, .match { transition: outline-color 220ms ease-out; }
.match { outline: 1px solid transparent; outline-offset: 2px; }
.drawing:focus-within > .sheet:not(.is-stale) { outline-color: var(--lavender); }
.match:focus-within { outline-color: var(--lavender-deep); }

@media (hover: hover) and (pointer: fine) {
  .sheet:not(.is-stale):hover { outline-color: var(--lavender); }
  .match:hover { outline-color: var(--lavender-deep); }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet:not(.is-stale) #plan > .desk-edge { animation: desk-edge-highlight 240ms ease-out; }
  .match-diagram .plan { animation: desk-diagram-enter 240ms ease-out; }
}

@keyframes desk-edge-highlight {
  from { stroke: var(--lavender); }
}

@keyframes desk-diagram-enter {
  from { transform: translateY(4px); }
  to { transform: none; }
}

.rest { margin-top: 14px; }
.rest summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); padding: 6px 0; }
.rest .matches-list { margin-top: 10px; }
.fine { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.empty {
  padding: 16px; border: 1px dashed #c9c4b8; border-radius: var(--radius); background: #fcfbf8; font-size: 14px;
}

/* Notes */
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.note { padding: 14px 14px 16px; background: var(--paper-2); border-radius: var(--radius); }
.note h3 { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.note p { font-size: 13px; color: #3e465f; line-height: 1.5; }
.note:first-child { background: var(--ink); }
.note:first-child h3 { color: var(--mint); }
.note:first-child p { color: #c9d3f0; }

.site-footer { margin-top: 48px; padding: 22px 0 28px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }

.guide-links {
  list-style: none; padding: 0; margin: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px;
}
.guide-links a {
  display: block; height: 100%; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--radius); font-weight: 650;
}
.guide { max-width: 740px; padding-top: clamp(28px, 6vw, 72px); }
.guide h1 { font: 700 clamp(2.1rem, 5vw, 3.65rem)/1.05 var(--serif); color: var(--ink); }
.guide-answer { margin-top: 18px; font-size: 1.125rem; }
.guide .btn { margin-top: 20px; }
.guide [data-amazon-offer] { margin: 14px 0; }
.guide .retailer-offer .btn { margin-top: 0; }
.guide section { margin-top: 32px; }
.guide h2 { margin-bottom: 10px; font-family: var(--serif); color: var(--ink); }
.guide section p + p { margin-top: 12px; }
.guide dl { margin: 14px 0 0; }
.guide dt { margin-top: 14px; color: var(--ink); font-weight: 700; }
.guide dd { margin: 4px 0 0; }
.guide-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rule); }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .planner { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "quick" "work" "refine"; gap: 14px; }
  .jump-setup { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; }
  .setup-head { display: block; padding-top: 10px; }
  .compare-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .wrap { width: min(1200px, 100% - 24px); }
  .header-inner { height: auto; min-height: 52px; padding: 8px 0; flex-wrap: wrap; }
  .site-nav a { padding: 6px 8px; font-size: 13px; }
  .brand-name { font-size: 15px; }
  .intro { padding: 24px 0 16px; }
  .deck { margin-top: 9px; font-size: 15.5px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .tv { font-size: 18px; }
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
  .drawing { padding: 8px; }
  .sheet { margin: 2px; }
  .verdict { padding: 16px 14px 14px 18px; }
  .width-label { flex-basis: 100%; }
}
