/* ==========================================================================
   Cookie Countess — styles.css
   "Royal icing": lavender-white ground, indigo ink, violet action, gold highlight.
   Token system + light/dark + always-dark band overrides + 320px fixes.
   Bug list references are to research/design-language.md section 2.
   ========================================================================== */

/* ---------- Tokens (light, default) ---------------------------------------
   Two roles kept on SEPARATE tokens from the start (steering rule):
   - --on-brand / --cream : text sitting on saturated/always-dark bands (stays light in BOTH themes)
   - --surface            : card/panel surface fill (legitimately flips dark)
   Never reuse a "white" token for both jobs.
--------------------------------------------------------------------------- */
:root {
  --ground:      #F6F3FA;
  --surface:     #FFFFFF;
  --ink:         #26214A;
  --muted:       #524C78;
  --brand:       #5B3FB5; /* CTA fill; white text on it measures >=4.5:1 */
  --brand-text:  #5B3FB5; /* accent text / ticks / links on NORMAL surfaces */
  --accent-dark: #DCD0FF; /* accent text on ALWAYS-DARK bands (fixed, never --brand-text) */
  --gold:        #F2C14E; /* highlight fill; dark text on it, never white */
  --ink-fixed:   #26214A; /* dark text on gold (fixed in both themes) */
  --on-brand:    #FFFFFF; /* text on brand fills (fixed in both themes) */
  --cream:       #F1EEFA; /* text on always-dark bands (fixed in both themes) */
  --band:        #26214A; /* always-dark header/hero/footer/CTA/designer panel */

  --border:      #E2DAF2;
  --border-strong: #CBBEEC;
  --note-bg:     #EDE7FA;  /* small note chip tint (light) */
  --note-ink:    #39306B;  /* >=4.5:1 on --note-bg (bug 17) */

  --radius:      14px;
  --radius-lg:   22px;
  --maxw:        1120px;
  --shadow:      0 1px 2px rgba(38,33,74,.06), 0 8px 24px rgba(38,33,74,.07);

  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

/* ---------- Tokens (dark override) --------------------------------------- */
[data-theme="dark"] {
  --ground:      #16132B;
  --surface:     #221E3F; /* >=1.2:1 against --ground */
  --ink:         #F1EEFA;
  --muted:       #C9C3E4; /* >=4.5:1 on dark ground */
  --brand:       #5B3FB5; /* identical; white on it still >=4.5:1 (bug 7) */
  --brand-text:  #C2B3F5; /* links/accents on dark NORMAL surfaces */
  --accent-dark: #DCD0FF;
  --gold:        #F2C14E;
  --ink-fixed:   #26214A;
  --on-brand:    #FFFFFF;
  --cream:       #F1EEFA;
  --band:        #0D0B1D;

  --border:      #38325E;
  --border-strong: #4A4376;
  --note-bg:     #2C2650;
  --note-ink:    #E5DEFA;
}

/* ---------- Reset / base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere; /* bug 3: no overflow at 320 */
}
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw + 1rem, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.5vw + .8rem, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout -------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
/* bug 4: never put vertical padding on an element that is ALSO .container.
   Section spacing lives on .section, which is a wrapper, not a .container. */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 4vw, 2.75rem); }
.eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-text);
  margin: 0 0 .5rem;
}
.lead { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }

/* icing divider motif (crown dots) */
.divider { display: flex; align-items: center; gap: .4rem; color: var(--brand-text); margin: 1.25rem 0; }
.divider span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.divider span:nth-child(2) { width: 9px; height: 9px; }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  padding: .72rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s ease, border-color .15s ease, color .15s ease;
  line-height: 1.1; min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: #4b3399; border-color: #4b3399; color: var(--on-brand); }
.btn--ghost { background: transparent; color: var(--brand-text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--gold { background: var(--gold); color: var(--ink-fixed); border-color: var(--gold); } /* bug 8 */
.btn--gold:hover { background: #e4ad33; border-color: #e4ad33; color: var(--ink-fixed); }
.btn--block { width: 100%; }

/* ---------- Header -------------------------------------------------------- */
.site-header { background: var(--band); color: var(--cream); position: sticky; top: 0; z-index: 50; }
.site-header .header-inner { display: flex; align-items: center; gap: 1rem; padding-block: .75rem; flex-wrap: wrap; }
.brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--cream);
  text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; margin-right: auto;
  overflow-wrap: anywhere; /* bug 3: brand name wraps */
}
.brand .crown { color: var(--gold); font-size: 1.1em; }
.site-nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--cream); text-decoration: none; font-weight: 500; font-family: var(--font-head);
  padding: .4rem .6rem; border-radius: 8px; font-size: .98rem;
}
.site-nav a:hover { background: rgba(255,255,255,.1); color: var(--cream); }
.site-nav a[aria-current="page"] { color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: .5rem; }

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--cream);
  border: 1px solid rgba(255,255,255,.22); cursor: pointer; padding: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,.16); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero ---------------------------------------------------------- */
.hero { background: var(--band); color: var(--cream); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero h1 { color: var(--cream); }
.hero p { color: var(--cream); }
.hero .lead { color: var(--accent-dark); }
.hero .eyebrow { color: var(--accent-dark); } /* bug 1: eyebrow on dark uses accent-dark, not brand-text */
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.hero-figure { position: relative; }
.hero-figure img { border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgba(0,0,0,.35); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.img-note { font-size: .78rem; margin-top: .5rem; }

/* ---------- Proof strip --------------------------------------------------- */
.proof { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.proof-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: center; padding-block: 1.25rem; text-align: center; }
.proof-item { display: flex; flex-direction: column; min-width: 0; }
.proof-item strong { font-family: var(--font-head); font-size: 1.4rem; color: var(--ink); }
.proof-item span { font-size: .85rem; color: var(--muted); }
.proof-note { width: 100%; text-align: center; font-size: .78rem; color: var(--muted); }

/* ---------- Cards --------------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid > * { min-width: 0; } /* bug 3 */

.card {
  background: var(--surface);
  border: 1px solid var(--border); /* bug 16: light cards rely on visible border */
  border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; color: var(--muted); }
.card .img-note { color: var(--muted); padding: 0 1.2rem 1rem; margin: 0; }

/* note chip (bug 17) */
.note-chip {
  display: inline-block; background: var(--note-bg); color: var(--note-ink);
  font-size: .8rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px;
  border: 1px solid var(--border);
}

/* ---------- Always-dark band (generic) -----------------------------------
   bug 1 + 2: explicit light-on-dark for everything inside; no light cards.
--------------------------------------------------------------------------- */
.band { background: var(--band); color: var(--cream); }
.band h1, .band h2, .band h3, .band h4 { color: var(--cream); }
.band p, .band li { color: var(--cream); }
.band .muted { color: var(--accent-dark); }
.band a:not(.btn) { color: var(--accent-dark); }
.band a:not(.btn):hover { color: #fff; }
.band .eyebrow { color: var(--accent-dark); }
.band .img-note { color: var(--accent-dark); }
.band .lead { color: var(--accent-dark); }

/* designer teaser band with image */
.teaser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.teaser-grid img { border-radius: var(--radius-lg); aspect-ratio: 4/3; object-fit: cover; box-shadow: 0 18px 50px rgba(0,0,0,.35); }

/* ---------- How to order -------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; counter-reset: step; }
.steps > * { min-width: 0; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.step .num {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; background: var(--brand); color: var(--on-brand);
  font-family: var(--font-head); font-weight: 700; margin-bottom: .6rem;
}
.step h3 { margin: 0 0 .3rem; }
.step p { margin: 0; color: var(--muted); }

/* ---------- NAP / find us ------------------------------------------------- */
.findus { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.25rem, 4vw, 2.5rem); }
.findus > * { min-width: 0; } /* bug 3 */
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; }
dl.nap dt { font-family: var(--font-head); font-weight: 700; color: var(--ink); }
dl.nap dd { margin: 0; color: var(--muted); min-width: 0; overflow-wrap: anywhere; } /* bug 3 */

/* on a dark band, nap dt/dd must be light (bug 1) */
.band dl.nap dt { color: var(--cream); }
.band dl.nap dd { color: var(--accent-dark); }

.social-links { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }

/* ---------- CTA band ------------------------------------------------------ */
.cta-band { background: var(--band); color: var(--cream); text-align: center; }
.cta-band h2 { color: var(--cream); }
.cta-band p { color: var(--accent-dark); }
.cta-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* gold band variant (bug 8): ghost buttons inside gold use ink-fixed */
.band--gold { background: var(--gold); color: var(--ink-fixed); }
.band--gold h2, .band--gold h3, .band--gold p { color: var(--ink-fixed); }
.band--gold .btn--ghost { color: var(--ink-fixed); border-color: var(--ink-fixed); }
.band--gold .btn--ghost:hover { background: var(--ink-fixed); color: var(--gold); border-color: var(--ink-fixed); }

/* ---------- Footer -------------------------------------------------------- */
.site-footer { background: var(--band); color: var(--cream); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-block: 2.5rem; }
.footer-grid > * { min-width: 0; } /* bug 3 */
.site-footer h4 { color: var(--cream); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; }
.site-footer p, .site-footer li { color: var(--accent-dark); }
.site-footer a:not(.btn) { color: var(--accent-dark); text-decoration: none; }
.site-footer a:not(.btn):hover { color: #fff; text-decoration: underline; }
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; color: var(--cream); }
.footer-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-block: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom, .footer-bottom p { color: var(--accent-dark); font-size: .85rem; }

/* demo-note: solid dark background, light text incl. strong (bug 1) */
.demo-note { background: rgba(0,0,0,.28); color: var(--cream); border-radius: 10px; padding: .6rem .85rem; font-size: .82rem; }
.demo-note strong { color: #fff; }
.footer-bottom .demo-note { background: rgba(0,0,0,.35); }

/* =========================================================================
   Cookie designer (signature feature)
   ========================================================================= */
.designer-wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start; }
.designer-form { display: grid; gap: 1.5rem; }

fieldset.q { border: 1px solid var(--border); border-radius: var(--radius); margin: 0; padding: 1.1rem 1.2rem 1.3rem; background: var(--surface); }
fieldset.q legend { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; padding: 0 .4rem; color: var(--ink); }
.q-hint { color: var(--muted); font-size: .9rem; margin: .1rem 0 .9rem; }

/* radio / checkbox option rows */
.opt-list { display: grid; gap: .55rem; }
.opt-list.cols { grid-template-columns: repeat(2, 1fr); }
.opt-list.cols > * { min-width: 0; }
.opt {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem;
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer;
  background: var(--ground); transition: border-color .12s ease, background .12s ease;
}
.opt:hover { border-color: var(--border-strong); }
.opt input { accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.opt span { min-width: 0; overflow-wrap: anywhere; }
/* selected tile: outline + tick, not colour alone (bug 13) */
.opt:has(input:checked) { border-color: var(--brand); background: var(--note-bg); }
.opt:has(input:checked)::after { content: "✓"; margin-left: auto; color: var(--brand-text); font-weight: 700; }

/* colour swatches */
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: .3rem;
  border: 2px solid var(--border); border-radius: 12px; padding: .5rem .55rem .4rem; cursor: pointer;
  background: var(--surface); min-width: 68px; font: inherit; color: var(--ink);
}
.swatch:hover { border-color: var(--border-strong); }
.swatch .dot { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); }
.swatch .name { font-size: .78rem; font-weight: 600; }
.swatch .tick { position: absolute; top: 4px; right: 6px; font-weight: 700; color: var(--brand-text); opacity: 0; }
.swatch[aria-pressed="true"] { border-color: var(--brand); background: var(--note-bg); } /* bug 13 */
.swatch[aria-pressed="true"] .tick { opacity: 1; }
.swatch-msg { font-size: .85rem; margin-top: .65rem; min-height: 1.2em; color: var(--note-ink); }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: .9rem; }
.stepper button {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-size: 1.4rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.stepper button:hover { border-color: var(--brand); color: var(--brand-text); }
.stepper .count { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; min-width: 7.5ch; text-align: center; }

input[type="text"], input[type="date"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--border); border-radius: 10px; padding: .6rem .7rem;
}
input[type="text"]:focus, input[type="date"]:focus, textarea:focus { border-color: var(--brand); outline: none; }
textarea { resize: vertical; min-height: 84px; }
.field-label { display: block; font-weight: 600; margin-bottom: .35rem; }
.dependent[hidden] { display: none; }
.char-count { font-size: .78rem; color: var(--muted); margin-top: .25rem; }

/* ----- Live preview panel (always-dark, bug 1) ----- */
.preview-panel, .message-panel {
  background: var(--band); color: var(--cream);
  border-radius: var(--radius-lg); padding: 1.3rem 1.4rem;
}
.preview-panel { position: sticky; top: 84px; }
.preview-panel h2, .message-panel h2 { color: var(--cream); font-size: 1.15rem; }
.preview-panel p, .message-panel p { color: var(--accent-dark); }

/* plate + cookies */
.plate {
  display: flex; gap: 1rem; justify-content: center; align-items: center;
  background: radial-gradient(circle at 50% 42%, #f3eefb 0%, #e7ddf7 62%, #d8ccf0 100%);
  border-radius: 999px / 40%; padding: 1.6rem 1rem; margin: .5rem 0 1rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.12);
}
[data-theme="dark"] .plate {
  background: radial-gradient(circle at 50% 42%, #cfc4ea 0%, #b6a8da 62%, #9f8fcb 100%);
}
.cookie {
  width: clamp(48px, 18vw, 74px); aspect-ratio: 1; border-radius: 50%;
  background: #cbbdeb; /* neutral placeholder when no colour (bug: >=3:1 vs plate) */
  border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 3px 8px rgba(38,33,74,.25);
}
.preview-colours { color: var(--accent-dark); font-size: .9rem; text-align: center; margin: 0; }

/* ----- Message panel (always-dark, aria-live) ----- */
.message-box {
  background: rgba(0,0,0,.28); color: var(--cream);
  border-radius: 12px; padding: 1rem 1.1rem; margin: .5rem 0 1rem;
  white-space: pre-wrap; min-height: 6rem; font-size: .98rem; line-height: 1.55;
  overflow-wrap: anywhere;
}
.message-box.is-empty { color: var(--accent-dark); font-style: italic; }
.message-actions { display: grid; gap: .6rem; }
.message-actions .row { display: flex; gap: .6rem; flex-wrap: wrap; }
.message-actions .row > * { flex: 1 1 auto; }
/* bug 6: buttons inside always-dark panels keep their own text colour on hover */
.message-panel .btn--primary, .preview-panel .btn--primary { color: var(--on-brand); }
.message-panel .btn--ghost {
  color: var(--cream); border-color: rgba(255,255,255,.5);
}
.message-panel .btn--ghost:hover { background: #fff; color: var(--ink-fixed); border-color: #fff; }
.copy-status { font-size: .85rem; color: var(--accent-dark); min-height: 1.2em; }

/* =========================================================================
   bug 6: link-colour rules in dark sections must NOT override button text.
   Explicit exceptions for header/hero/band/footer, including :hover.
   ========================================================================= */
.site-header a.btn--primary, .hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary,
.cta-band a.btn--primary { color: var(--on-brand); }
.site-header a.btn--primary:hover, .hero a.btn--primary:hover, .band a.btn--primary:hover,
.site-footer a.btn--primary:hover, .cta-band a.btn--primary:hover { color: var(--on-brand); }

.site-header a.btn--gold, .hero a.btn--gold, .band a.btn--gold, .site-footer a.btn--gold,
.cta-band a.btn--gold { color: var(--ink-fixed); }
.site-header a.btn--gold:hover, .hero a.btn--gold:hover, .band a.btn--gold:hover,
.site-footer a.btn--gold:hover, .cta-band a.btn--gold:hover { color: var(--ink-fixed); }

/* ghost buttons on dark bands: light border/text, keep readable on hover (bug 1, 6) */
.site-header a.btn--ghost, .hero a.btn--ghost, .band a.btn--ghost, .site-footer a.btn--ghost,
.cta-band a.btn--ghost,
.site-header button.btn--ghost, .hero button.btn--ghost, .band button.btn--ghost,
.site-footer button.btn--ghost, .cta-band button.btn--ghost {
  color: var(--cream); border-color: rgba(255,255,255,.55); background: transparent;
}
.site-header a.btn--ghost:hover, .hero a.btn--ghost:hover, .band a.btn--ghost:hover,
.site-footer a.btn--ghost:hover, .cta-band a.btn--ghost:hover,
.site-header button.btn--ghost:hover, .hero button.btn--ghost:hover, .band button.btn--ghost:hover,
.site-footer button.btn--ghost:hover, .cta-band button.btn--ghost:hover {
  background: #fff; color: var(--ink-fixed); border-color: #fff;
}
/* gold band overrides the above ghost rule (bug 8) */
.band--gold a.btn--ghost, .band--gold button.btn--ghost { color: var(--ink-fixed); border-color: var(--ink-fixed); background: transparent; }
.band--gold a.btn--ghost:hover, .band--gold button.btn--ghost:hover { background: var(--ink-fixed); color: var(--gold); border-color: var(--ink-fixed); }

/* =========================================================================
   Responsive — bug 3
   ========================================================================= */
@media (max-width: 960px) {
  .hero-grid, .teaser-grid, .designer-wrap, .findus { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .preview-panel { position: static; }
}
@media (max-width: 700px) {
  /* nav gets its own row */
  .site-header .header-inner { flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .opt-list.cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  /* bug 3: hide header CTA on very small screens */
  .header-cta { display: none; }
}
@media (max-width: 360px) {
  .plate { gap: .5rem; padding: 1.2rem .5rem; }
  .message-actions .row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}
