:root {
  /* Notchup look (notchup.fi): navy and gold. The site is dark only; the light scheme is derived. */
  --brand-navy: #0b1a2b;
  --brand-cream: #f3e5ab;

  /* Light scheme. Gold #8c6a2c is the logo's dark gold: 5.0:1 on white, so it works for text. */
  --paper: #f6f4ee;
  --surface: #ffffff;
  --ink: #0b1a2b;
  --muted: #4a5a66;
  --line: #d8d2c2;
  --gauge: #8c6a2c;          /* the measured things: outline, card, chips */
  --gauge-soft: #f3e5ab;
  --on-gauge: #ffffff;       /* text on a gauge-coloured fill */
  --focus: #1b4f8a;
  --error: #a3261b;          /* 6.9:1 on --paper */
  --dim: #0a1624;            /* the veil behind the outline: dark in both schemes */
  --on-dim: #e8eef5;
  --stage-gold: #d4af37;     /* the logo's gold, 8.7:1 on --dim; the outline and chip use it in both schemes */

  --radius: 6px;
  --font: system-ui, -apple-system, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1a2b;
    --surface: #12294a;
    --ink: #e8eef5;
    --muted: #9fb3c8;
    --line: #1d3a5c;
    --gauge: #d4af37;        /* the logo's gold: 8.3:1 on navy */
    --gauge-soft: rgb(212 175 55 / 0.18);
    --on-gauge: #0b1a2b;
    --focus: #64ffda;
    --error: #ff9c8f;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* The page is a grid: the view (start, or result with its toolbar) over one slim footer line. On a
   window at least 560 px tall the body is exactly the window high, so nothing scrolls and the footer
   stays in view; on shorter windows (phones in landscape) the page scrolls normally. */
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 var(--font);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a { color: var(--gauge); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

*[hidden] { display: none !important; }

@media (min-width: 768px) and (min-height: 560px) {
  body { height: 100dvh; }
  .start { overflow-y: auto; } /* only if the content cannot fit even squeezed: never push the footer out */
}
/* The result is dimmed: a navy veil behind the outline, in light and dark alike. */
body[data-view=result] { background: var(--dim); }
h1, h2, h3 { line-height: 1.2; }
h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
h3 { margin: 1.1rem 0 0.4rem; font-size: 1rem; }

/* Buttons and fields: the browser's own controls, lightly dressed */
button {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
button:hover { background: var(--gauge-soft); }
button:disabled { cursor: not-allowed; }
.primary { background: var(--gauge); border-color: var(--gauge); color: var(--on-gauge); font-weight: 700; padding: 0.65rem 1.4rem; }
.primary:hover:not(:disabled) { background: var(--gauge); filter: brightness(1.1); }
.primary:disabled { background: var(--line); border-color: var(--line); color: var(--muted); }
select, input[type=number], input[type=text] {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: 0.55rem 0.6rem;
  max-width: 100%;
}
select { width: 100%; }

/* Brand strip: the gold logo is drawn for navy, so it always sits on navy. */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.logo { display: block; line-height: 0; border-radius: 4px; }
/* The company site's soft golden glow (static, no script): on hover where a pointer really hovers, and on keyboard focus. */
.logo img { display: block; width: 28px; height: 28px; filter: drop-shadow(0 0 0 rgba(212, 175, 55, 0)); }
.logo:focus-visible img { filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.25)); }
@media (hover: hover) {
  .logo:hover img { filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.25)); }
}
.app-name { font-weight: 650; color: var(--brand-cream); }
.logo:focus-visible, .toolbar button:focus-visible, .toolbar input:focus-visible { outline-color: #64ffda; }
/* Preview label: a quiet gold outline. Remove it when the project reaches 1.0. */
.badge {
  padding: 0.05rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-cream);
  border: 1px solid #d4af37;
  border-radius: 999px;
}

/* 1. Start: one question, one button */
.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
}
.start .brand { padding: 0.55rem 1rem; background: var(--brand-navy); border-radius: 8px; }
.start .logo img { width: 44px; height: 44px; }
.start .app-name { font-size: 1.15rem; }
.start h1 { margin: 0.75rem 0 0; max-width: 16ch; font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.08; font-weight: 750; }
.lede { margin: 0; max-width: 32ch; font-size: 1.2rem; color: var(--muted); }
.start .primary { font-size: 1.15rem; padding: 0.8rem 1.9rem; }
.no-js { max-width: 36rem; color: var(--muted); }
@media (max-height: 760px) {
  .start { gap: 0.6rem; padding-block: 0.75rem; }
  .start h1 { margin-top: 0.25rem; }
}

/* The illustration: a screen, and a smaller gold outline that shrinks inside it */
.art { width: min(320px, 80vw, 30dvh); height: auto; margin: 0.5rem 0 0.75rem; }
.art-screen { fill: var(--surface); stroke: var(--muted); stroke-width: 3; }
.art-base { fill: var(--muted); }
.art-inner { transform-box: fill-box; transform-origin: center; transform: scale(0.875); } /* 14 / 16 */
.art-inner rect { fill: var(--gauge-soft); stroke: var(--gauge); stroke-width: 3; vector-effect: non-scaling-stroke; }
.art-label { fill: var(--ink); font: 700 22px/1 var(--font); }

/* 3. Result: toolbar on top, the stage fills the space between it and the footer */
.result { height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
@media (min-width: 768px) and (min-height: 560px) {
  .result { height: auto; }
}
.toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  padding: 0.3rem 0.75rem;
  background: var(--brand-navy);
  color: var(--brand-cream);
}
.toolbar button {
  color: var(--brand-cream);
  background: transparent;
  border: 1px solid rgb(243 229 171 / 0.55);
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.toolbar button:hover { background: rgb(243 229 171 / 0.14); }
.pair { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.9rem; }
/* The arrow is decoration: the second declaration gives it an empty text alternative where supported; the first is the fallback for browsers that do not know that syntax. */
.screen-btn::after { content: " ▾"; content: " ▾" / ""; }
.tools { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; margin-left: auto; }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; margin-left: 0.4rem; border-radius: 50%; background: var(--stage-gold); }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }
.switch input {
  appearance: none;
  position: relative;
  width: 2.3rem;
  height: 1.3rem;
  margin: 0;
  border: 1px solid rgb(243 229 171 / 0.7);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.switch input::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: calc(1.3rem - 6px);
  height: calc(1.3rem - 6px);
  border-radius: 50%;
  background: var(--brand-cream);
}
.switch input:checked { background: var(--stage-gold); border-color: var(--stage-gold); }
.switch input:checked::before { left: calc(100% - 1.3rem + 4px); background: var(--brand-navy); }

.stage-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--dim); color: var(--on-dim); }
.stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); /* keeps an oversized drawing centred */
  place-items: center;
  overflow: hidden;
}
.stage > * { grid-area: 1 / 1; }
.stage.is-edges { outline: 2px dashed var(--brand-cream); outline-offset: -2px; } /* your screen's edges, in full screen */

/* The outline is the hero: a crisp gold line at true size, nothing inside unless asked */
.frame { position: relative; }
.outline {
  position: relative;
  border: 2px solid var(--stage-gold);
  border-radius: 10px;
  overflow: hidden;
}
.frame .outline { width: 100%; height: 100%; }

/* Width and height in cm, as dimension lines outside the outline (inside when space is tight) */
.dim {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-cream);
  font-size: 0.85rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dim b { font-weight: 600; }
.dim i { flex: 1; position: relative; block-size: 9px; border-inline: 1px solid var(--brand-cream); }
.dim i:first-child { border-inline-end: 0; }
.dim i:last-child { border-inline-start: 0; }
.dim i::after { content: ""; position: absolute; inset-inline: 0; inset-block-start: 50%; border-block-start: 1px solid var(--brand-cream); }
.dim-w { left: 0; right: 0; top: -22px; }
.dim-h { top: 0; bottom: 0; left: -22px; writing-mode: vertical-rl; transform: rotate(180deg); }
.frame.tight .dim-w { top: 8px; left: 14px; right: 14px; }
.frame.tight .dim-h { left: 8px; top: 14px; bottom: 14px; }

.chip {
  margin: 0;
  padding: 0.3rem 0.85rem;
  max-width: calc(100% - 1.5rem);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-navy);
  background: var(--stage-gold);
  border-radius: 999px;
}
.chip-context { display: none; margin: 0; color: var(--brand-cream); font-size: 0.9rem; font-weight: 600; text-align: center; }
.is-fullscreen .chip-context, .is-drawing .chip-context { display: block; }
.chip-stack { z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; max-width: calc(100% - 1.5rem); }
.frame .chip-stack { position: absolute; left: 50%; bottom: 14px; width: max-content; transform: translateX(-50%); }
.accuracy { margin: 0; font-size: 0.8rem; text-align: center; color: var(--brand-cream); }
.acc-zoom, .acc-mismatch { font-weight: 700; }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand-cream); text-decoration: underline; font-size: inherit; }
.link-btn:hover { background: none; color: #fff; }
.link-btn:focus-visible { outline-color: #64ffda; }
.ov-title { margin: 0 0 0.4rem; font-size: 0.9rem; }

/* A bigger target, in full screen: how far it reaches past each edge of your screen */
.edge {
  position: absolute;
  z-index: 2;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  background: var(--stage-gold);
  color: var(--brand-navy);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.e-top { top: 14px; left: 50%; transform: translateX(-50%); }
.e-bottom { bottom: 14px; left: 50%; transform: translateX(-50%); }
.e-left { left: 14px; top: 50%; transform: translateY(-50%); }
.e-right { right: 14px; top: 50%; transform: translateY(-50%); }

/* Not enough room: say so, show both sizes to scale, offer Full screen */
.fit-card {
  max-width: 26rem;
  margin: 1rem;
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--stage-gold);
  border-radius: 12px;
}
.fit-card h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.fit-card p { margin: 0 0 0.75rem; }
.fit-card .overview svg { margin: 0 auto; }
.fit-card .primary { margin-top: 0.5rem; }
.note { margin: 0.35rem 0 0; font-size: 0.875rem; color: var(--muted); }
.note:empty { display: none; }

.exit-fs { position: absolute; z-index: 5; bottom: 0.75rem; right: 0.75rem; }
.is-fullscreen .toolbar, .is-fullscreen .site-footer, .is-drawing .toolbar, .is-drawing .site-footer { display: none; }
.is-fullscreen .result, .is-drawing .result { grid-template-rows: minmax(0, 1fr); }

/* Footer: one quiet line */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1rem;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
/* Items stay whole; they share one line when the window is wide enough and wrap as units when not. */
@media (min-width: 768px) {
  .site-footer > * { white-space: nowrap; }
}
.site-footer a { color: var(--muted); }
/* The source link and the version stay together as one item. */
.site-footer .meta { display: inline-flex; align-items: center; gap: 0.75rem; }
.site-footer .gh { display: inline-flex; align-items: center; }
.site-footer .gh:hover { color: var(--ink); }

/* 2. Setup: a native dialog with two questions. One heading, one main action and at most one link per step. */
.dialog {
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overscroll-behavior: contain; /* a long hint scrolls inside the dialog, never the page behind it */
}
.dialog::backdrop, .drawer::backdrop { background: rgb(5 12 20 / 0.6); }
.dialog-body { padding: 0.5rem 1.5rem 1.5rem; }
.dialog-top { display: flex; align-items: center; margin: 0 -0.75rem 0.25rem; }
.dialog-top button { min-height: 2.75rem; padding: 0 0.75rem; border: 0; background: none; }
.dialog-top .back { font-weight: 600; }
.dialog-top .close { min-width: 2.75rem; margin-left: auto; font-size: 1.6rem; line-height: 1; }
.dialog h2 { margin: 0 0 1.1rem; font-size: 1.3rem; }
.dialog h2:focus { outline: none; }
.dialog .primary { display: block; width: 100%; margin-top: 1rem; padding: 0.8rem 1.4rem; font-size: 1.1rem; }
.dialog .link-btn {
  display: block;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  padding: 0.6rem 0;
  color: var(--gauge);
  font-size: 1rem;
  text-align: left;
}
.dialog .link-btn:hover, .drawer .link-btn:hover { background: none; color: var(--ink); }
.dialog .link-btn:focus-visible, .drawer .link-btn:focus-visible { outline-color: var(--focus); }

/* Step 1: the number is the hero */
.size-row { display: flex; align-items: center; gap: 0.5rem; }
.dialog .size-row input { width: calc(5ch + 1.2rem + 2px); min-width: 0; padding: 0.3rem 0.6rem; font-size: 2.25rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
/* A quiet gold edge instead of the page-wide focus ring: the field is the hero of the step, so the ring was loud. Still a clear indicator (gold on navy / dark on light). */
.dialog .size-row input:focus-visible { outline: none; border-color: var(--gauge); box-shadow: 0 0 0 1px var(--gauge); }
.step-btn { flex: none; width: 2.75rem; min-width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.6rem; font-weight: 700; line-height: 1; }
.unit { color: var(--muted); font-size: 1.1rem; }
.hero { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.5rem; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.tick { flex: none; width: 1.6rem; height: 1.6rem; fill: none; stroke: var(--gauge); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.note.error { color: var(--error); font-weight: 600; }
/* The message under a field keeps its line when empty, so showing or hiding it never moves the dialog. */
.dialog .note.error, .dialog .note.error:empty, .dialog .note.error[hidden] { display: block !important; min-height: 1.5em; }
.dialog .note.error[hidden] { visibility: hidden; }
input[aria-invalid=true] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.model-wrap { margin-top: 0.9rem; }

/* Remembered screens: one unticked checkbox under the main button, a short line on step 2, a list in Details */
.remember { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; margin-top: 0.4rem; font-size: 0.95rem; cursor: pointer; }
.remember input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--gauge); }
#known-remembered { margin: -0.4rem 0 0.2rem; }
/* "Forgotten · Undo": floats at the bottom edge of the dialog for a few seconds, so nothing in it moves. */
.toast { position: absolute; left: 1rem; right: 1rem; bottom: 0.6rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0; padding: 0 0.5rem 0 1rem; color: var(--brand-cream); background: var(--brand-navy); border-radius: 8px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.35); font-weight: 600; }
.toast .inline-link { color: var(--brand-cream); }
.toast .inline-link:hover { color: #fff; }
.toast .inline-link:focus-visible { outline-color: #64ffda; }
.inline-link { min-height: 2.75rem; padding: 0 0.25rem; border: 0; background: none; color: var(--gauge); font: inherit; text-decoration: underline; cursor: pointer; }
.inline-link:hover { background: none; color: var(--ink); }
.remembered-list { margin: 0.4rem 0; padding: 0; list-style: none; }
.remembered-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 0.6rem; padding: 0.4rem 0; border-top: 1px solid var(--line); }
.remembered-row label { font-size: 0.85rem; color: var(--muted); }
.remembered-row input { min-width: 0; padding: 0.4rem 0.5rem; }
.remembered-row .here { grid-column: 2; font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.remembered-row button { grid-column: 3; grid-row: 1; min-height: 2.75rem; }
#remembered-status:focus { outline: none; }

/* Optional hints: a quiet native <details>, closed until asked for */
.hint { margin-top: 0.4rem; font-size: 0.9rem; color: var(--muted); }
.hint summary { display: flex; align-items: center; min-height: 2.75rem; cursor: pointer; }
.hint p { margin: 0 0 0.6rem; line-height: 1.45; }
.hint strong { color: var(--ink); }

/* The note keeps the room its open text needs (summary + about 6 lines), so opening it never moves the
   centred content above it. */
.start .about { width: min(26rem, 100%); min-height: 11.25rem; margin-top: 0; text-align: left; }
@media (min-width: 520px) {
  .start .about { min-height: 10rem; }
}
.start .about summary { justify-content: center; text-decoration: underline; text-underline-offset: 3px; }

/* Step 2: four big buttons, each outline drawn to the same scale */
.size-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.size-btn { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.35rem; min-height: 5rem; padding: 0.6rem 0.5rem; font-size: 1.15rem; font-weight: 700; }
.size-btn svg { display: block; width: 100%; max-width: 4.5rem; height: auto; }
.size-btn rect { fill: var(--gauge-soft); stroke: var(--gauge); stroke-width: 2; }
.size-btn[aria-current=true] { border-color: var(--gauge); box-shadow: inset 0 0 0 1px var(--gauge); }
.to-other { margin-top: 0.4rem; }
.dialog .to-other .size-row input { font-size: 1.4rem; }
.to-other select { margin-top: 0.8rem; }
/* The two alternatives: the one not used is dimmed, not disabled, so it stays reachable. */
.to-other .unused { opacity: 0.6; }
.to-other #to-show { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Details drawer: the resolution, the aspect-ratio choices and the card note */
.other { margin-top: 0.6rem; }
legend, .other label { display: block; padding: 0; margin-bottom: 0.35rem; font-weight: 600; }
.ratio-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.ratio-choices legend { flex-basis: 100%; }
.ratio-choice { position: relative; display: inline-block; }
.ratio-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ratio-choice span { display: inline-block; padding: 0.5rem 1rem; border: 1px solid var(--muted); border-radius: 999px; background: var(--paper); }
.ratio-choice input:checked + span { background: var(--gauge); border-color: var(--gauge); color: var(--on-gauge); font-weight: 700; }
.ratio-choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.res-line { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--muted); }
.res-inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.res-inputs label { margin: 0; }
.res-inputs input { width: 6.5rem; }
.adjust { margin-top: 1.1rem; }
.adjust h3 { margin-top: 0; }
.adjust .ratio-choices { margin-top: 0.9rem; }
.drawer .link-btn { color: var(--ink); }

/* Drawer: Details or Fine-tune, from the right edge */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(30rem, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 1rem 1.25rem 1.5rem;
  overflow-y: auto;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-left: 1px solid var(--line);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
#drawer-close { min-width: 2.4rem; font-size: 1.2rem; line-height: 1; }
.notes { margin-top: 1.1rem; font-size: 0.9rem; color: var(--muted); }
.notes p { margin: 0 0 0.5rem; }
.notes h3 { margin-top: 0; color: var(--ink); }
.facts { margin: 0.6rem 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Sample content at the screen's default scaling: a document and a window, clipped by the outline */
.desktop {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  color: var(--ink);
  font: 13px/1.45 var(--font);
  overflow: hidden;
  background: linear-gradient(135deg, var(--gauge-soft), var(--paper));
}
.d-menubar { display: flex; gap: 1rem; padding: 4px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.d-grow { flex: 1; }
.d-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
  overflow: hidden;
}
.d-title { padding: 6px 10px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.d-body { padding: 12px 16px; overflow: hidden; }
.d-body h3 { margin: 0 0 8px; font-size: 18px; }
.d-body p { margin: 0 0 10px; }
.d-doc { left: 3%; top: 44px; width: 50%; bottom: 5%; }
.d-web { left: 46%; top: 80px; width: 40%; height: 52%; }
.d-tabs { display: flex; gap: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.d-tabs span { padding-bottom: 4px; }
.d-tabs .on { border-bottom: 2px solid var(--gauge); font-weight: 600; }
.d-body .d-bar { height: 8px; margin: 0 0 8px; border-radius: 4px; background: var(--line); }
.d-chart { display: flex; align-items: flex-end; gap: 8px; height: 80px; margin-top: 12px; }
.d-chart i { flex: 1; border-radius: 3px 3px 0 0; background: var(--gauge); }

/* Overview */
.overview { margin: 0.75rem 0 0; }
.overview svg { display: block; width: 100%; max-width: 300px; height: auto; }
.ov-from { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.ov-to { fill: var(--gauge-soft); stroke: var(--gauge); stroke-width: 1.5; fill-opacity: 0.7; }
.legend { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--muted); }
.key { display: inline-block; width: 0.8rem; height: 0.55rem; margin: 0 0.35rem 0 0; border: 2px solid; border-radius: 2px; }
.key + .key, .legend .key:not(:first-child) { margin-left: 0.9rem; }
.key-from { border-color: var(--muted); }
.key-to { border-color: var(--gauge); background: var(--gauge-soft); }

/* Calibration: the bank card at true card size */
.card-stage { padding: 0.5rem 0; overflow-x: auto; }
.card {
  flex: none;
  border: 2px solid var(--gauge);
  background: var(--gauge-soft);
}
.cal-size { margin: 0.25rem 0 0.9rem; font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; min-height: 1.8rem; }
.cal-row { display: flex; align-items: flex-end; gap: 0.75rem; margin-bottom: 0.9rem; }
.cal-row .cal-slider { flex: 1; min-width: 0; margin-bottom: 0; }
.cal-slider { display: block; margin-bottom: 0.9rem; font-weight: 600; font-size: 0.9rem; }
.cal-slider input { display: block; width: 100%; margin: 0.4rem 0 0; accent-color: var(--gauge); }
.cal-note { font-size: 0.85rem; color: var(--muted); }
#cal-body p { margin: 0 0 0.6rem; }

/* All motion lives here. With reduced motion none of it applies and the end state shows at once. */
@media (prefers-reduced-motion: no-preference) {
  .art-inner { animation: shrink 4.5s ease-in-out infinite alternate; }
  .fade-in { animation: fade-in 0.3s both; }
  #step-you, #step-to { animation: fade-in 0.15s both; }
  .drawer[open] { animation: slide-in 0.22s ease-out; }
  button, .ratio-choice span, .switch input { transition: background-color 0.12s, border-color 0.12s; }
  .logo img { transition: filter 0.6s ease; }
  .to-other .size-row, .to-other select { transition: opacity 0.15s; }

  @keyframes shrink { from { transform: scale(0.96); } to { transform: scale(0.8); } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slide-in { from { transform: translateX(2rem); opacity: 0; } to { transform: none; opacity: 1; } }
}
