/* EVFormations — shared styles
   Tokens first; components below. Light theme with basalt (dark) sections. */

:root {
  --limestone: #e3e4de;
  --paper: #f0f1ec;
  --plaster: #cfd1c8;
  --basalt: #171b1f;
  --basalt-2: #232930;
  --graphite: #4b5157;
  --line: rgba(23, 27, 31, 0.18);
  --line-dark: rgba(227, 228, 222, 0.22);
  --blue: #2438c8;
  --blue-deep: #1b2b9e;
  --blue-light: #9dabff;
  --danger: #a8231b;
  --ok: #1d6a47;
  --field-border: #737a81;

  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --header-h: 68px;
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --z-header: 40; --z-dialog: 100; --z-toast: 120;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--limestone);
  color: var(--basalt);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg, iframe { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-stretch: 108%; font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 var(--s4); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.4vw, 4.75rem); letter-spacing: -0.03em; font-weight: 650; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3.1rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.2; }
h4 { font-size: 1.0625rem; line-height: 1.3; }
p { margin: 0 0 var(--s4); max-width: 68ch; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--blue-light); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 200; background: var(--basalt); color: var(--limestone); padding: var(--s3) var(--s4); }
.skip:focus { top: var(--s4); }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px); }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section-tight { padding-block: clamp(40px, 6vw, 80px); }
.on-dark { background: var(--basalt); color: var(--limestone); }
.on-dark p { color: rgba(227, 228, 222, 0.82); }
.muted { color: var(--graphite); }
.on-dark .muted { color: rgba(227, 228, 222, 0.72); }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.5; max-width: 52ch; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  font: 600 1rem/1 var(--font-body);
  border: 1.5px solid transparent; border-radius: var(--radius);
  background: var(--blue); color: #fff; text-decoration: none; cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
  touch-action: manipulation;
}
.btn:hover { background: var(--blue-deep); text-decoration: none; }
.btn:active { background: #14206f; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; color: inherit; border-color: currentColor; }
.btn-outline:hover { background: var(--basalt); color: var(--limestone); border-color: var(--basalt); }
.on-dark .btn-outline:hover { background: var(--limestone); color: var(--basalt); border-color: var(--limestone); }
.btn-light { background: var(--limestone); color: var(--basalt); }
.btn-light:hover { background: #fff; }
.btn-sm { min-height: 44px; padding: 0 var(--s4); font-size: 0.95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; min-height: 24px; }
.on-dark .link-btn { color: var(--blue-light); }
.text-link { font-weight: 600; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: var(--limestone); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s5); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-stretch: 112%; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; }
.nav a.nav-link { text-decoration: none; font-weight: 500; padding: 10px 2px; border-bottom: 2px solid transparent; }
.nav a.nav-link:hover { border-bottom-color: var(--basalt); }
.nav a.nav-link[aria-current='page'] { border-bottom-color: var(--blue); font-weight: 650; }
.nav-actions { display: flex; align-items: center; gap: var(--s2); }
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: inherit; border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: rgba(23, 27, 31, 0.08); }
.icon-btn svg { width: 24px; height: 24px; }
.badge-dot { position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--blue); color: #fff; font: 700 0.75rem/20px var(--font-body); text-align: center; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-grid; margin-left: auto; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--limestone); border-bottom: 1px solid var(--line); padding: var(--s3) clamp(16px, 4vw, 48px) var(--s5); margin: 0; }
  .nav.open { display: flex; }
  .nav a.nav-link { padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .nav-actions { padding-top: var(--s4); }
}

/* ---------- Hero: the live wall ---------- */
.hero { position: relative; min-height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; justify-content: flex-end; background: var(--plaster); overflow: hidden; isolation: isolate; }
.hero canvas.wall { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding-block: 26vh var(--s5); }
.hero-plate { background: var(--basalt); color: var(--limestone); padding: clamp(24px, 3.4vw, 48px); max-width: 44rem; }
.hero-plate h1 { margin-bottom: var(--s4); }
.hero-plate p { color: rgba(227, 228, 222, 0.86); }
.hero-tune { background: var(--limestone); border: 1px solid var(--line); padding: var(--s4) var(--s5); }
.hero-tune h2 { font-size: 1rem; letter-spacing: 0; font-stretch: 100%; margin: 0 0 var(--s3); }
.hero-tune .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-bottom: var(--s3); }
.hero-tune .row:last-child { margin-bottom: 0; }
.hero-tune .row > .lbl { min-width: 5.5rem; font-weight: 600; font-size: 0.95rem; }
@media (min-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; gap: var(--s6); padding-block: var(--s6); }
  .hero-tune { max-width: 26rem; justify-self: end; }
}

/* ---------- Chips, fields ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 44px; padding: 0 var(--s4); border: 1.5px solid var(--field-border); border-radius: 999px; background: transparent; color: inherit; font: 500 0.95rem/1 var(--font-body); cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); touch-action: manipulation; }
.chip:hover { border-color: var(--basalt); }
.chip[aria-pressed='true'], .chip[aria-checked='true'] { background: var(--basalt); border-color: var(--basalt); color: var(--limestone); font-weight: 650; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, 0.25); }

.field { margin-bottom: var(--s4); }
.field label, .field .label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 0.875rem; color: var(--graphite); margin: 6px 0 0; }
.on-dark .field .help { color: rgba(227, 228, 222, 0.72); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: 400 1rem/1.4 var(--font-body);
  color: var(--basalt); background: #fff; border: 1.5px solid var(--field-border); border-radius: var(--radius);
}
textarea.input { min-height: 112px; resize: vertical; }
.input:hover { border-color: var(--basalt); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.9rem; font-weight: 600; margin: 6px 0 0; }
.field-error::before { content: '! '; font-weight: 800; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--graphite); pointer-events: none; font-size: 0.9rem; }
.input-group .input { padding-right: 3.2rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
legend { font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 6px; }
.check { display: flex; gap: var(--s3); align-items: flex-start; min-height: 44px; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.check label { font-weight: 400; margin: 0; }
input[type='range'] { width: 100%; accent-color: var(--blue); min-height: 32px; }
.seg { display: inline-flex; border: 1.5px solid var(--field-border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 12px 20px; min-height: 48px; font-weight: 500; cursor: pointer; }
.seg input:checked + span { background: var(--basalt); color: var(--limestone); font-weight: 650; }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: -3px; }
.error-summary { border: 2px solid var(--danger); background: #fbeceb; color: #5c110c; padding: var(--s4); margin-bottom: var(--s4); border-radius: var(--radius); }
.error-summary h3 { font-size: 1rem; margin-bottom: 6px; font-stretch: 100%; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: inherit; font-weight: 600; }

/* ---------- Sections: home ---------- */
.split { display: grid; gap: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 960px) { .split { grid-template-columns: 5fr 7fr; gap: var(--s8); align-items: start; } .split.rev { grid-template-columns: 7fr 5fr; } }
.statement { display: grid; gap: var(--s6); }
.statement h2 { max-width: 20ch; }
@media (min-width: 960px) { .statement { grid-template-columns: 5fr 6fr; gap: var(--s8); } }
.process { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process li { display: grid; grid-template-columns: 3.2rem 1fr; gap: var(--s4); padding: var(--s5) 0; border-top: 1px solid var(--line); counter-increment: step; }
.process li:last-child { border-bottom: 1px solid var(--line); }
.process li::before { content: counter(step); font-family: var(--font-display); font-stretch: 112%; font-weight: 300; font-size: 2.4rem; line-height: 1; color: var(--blue); }
.process h3 { margin-bottom: 6px; }
.process p { margin: 0; color: var(--graphite); }

.duo { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
@media (min-width: 860px) { .duo { grid-template-columns: 1.15fr 0.85fr; align-items: end; } }
.plate { position: relative; overflow: hidden; background: var(--plaster); }
.plate canvas { width: 100%; height: 100%; object-fit: cover; }
.plate-ratio-a { aspect-ratio: 4 / 3; }
.plate-ratio-b { aspect-ratio: 3 / 4; }
.duo-text { padding-top: var(--s4); }
.duo-text h3 { margin-bottom: 8px; }
.material-list { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); list-style: none; padding: 0; margin: 0 0 var(--s4); }
.material-list li { display: inline-flex; align-items: center; font-size: 0.95rem; }

.teaser { display: grid; gap: var(--s7); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .teaser { grid-template-columns: 5fr 6fr; gap: var(--s8); } }
.ticks { list-style: none; padding: 0; margin: 0 0 var(--s5); }
.ticks li { display: flex; gap: var(--s3); padding: 8px 0; }
.ticks svg { flex: none; width: 22px; height: 22px; margin-top: 3px; color: var(--blue-light); }
.viewer-mock { position: relative; aspect-ratio: 16 / 11; background: var(--basalt-2); overflow: hidden; }
.viewer-mock canvas { width: 100%; height: 100%; }
.viewer-mock .tag { position: absolute; left: var(--s3); bottom: var(--s3); background: var(--basalt); color: var(--limestone); padding: 6px 12px; font-size: 0.875rem; }

.mosaic { display: grid; gap: var(--s4); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .mosaic { grid-template-columns: repeat(12, 1fr); } .mosaic .m1 { grid-column: span 5; } .mosaic .m2 { grid-column: span 3; } .mosaic .m3 { grid-column: span 4; } }
.tile { display: block; text-align: left; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.tile .plate { transition: transform 0.35s var(--ease); }
.tile:hover .plate, .tile:focus-visible .plate { transform: translateY(-4px); }
.tile:hover { text-decoration: none; }
.tile h3 { margin: var(--s3) 0 2px; font-size: 1.125rem; }
.tile p { margin: 0; font-size: 0.95rem; color: var(--graphite); }
.cta-band { display: grid; gap: var(--s5); grid-template-columns: 1fr; align-items: end; }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { max-width: 22ch; margin: 0 0 var(--s3); }

/* ---------- Footer ---------- */
.site-footer { background: var(--basalt); color: var(--limestone); padding-block: var(--s8) var(--s6); }
.site-footer a { color: inherit; }
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; } }
.footer-grid h2 { font-size: 1rem; font-stretch: 100%; letter-spacing: 0; margin-bottom: var(--s3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-base { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line-dark); font-size: 0.9rem; color: rgba(227, 228, 222, 0.72); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; }

/* ---------- Page heads ---------- */
.page-head { padding-block: clamp(40px, 6vw, 88px) var(--s6); }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 4rem); max-width: 18ch; }
.crumb { display: flex; gap: var(--s2); font-size: 0.95rem; color: var(--graphite); margin-bottom: var(--s4); }

/* ---------- Configurator ---------- */
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: 0 0 var(--s5); padding: 0; counter-reset: st; }
.stepper li { display: flex; align-items: center; gap: var(--s2); color: var(--graphite); counter-increment: st; font-weight: 500; }
.stepper li::before { content: counter(st); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 0.875rem; font-weight: 700; }
.stepper li[aria-current='step'] { color: var(--basalt); font-weight: 700; }
.stepper li[aria-current='step']::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper li.done::before { background: var(--basalt); border-color: var(--basalt); color: var(--limestone); content: '✓'; }

.cfg { display: grid; gap: var(--s5); grid-template-columns: 1fr; padding-bottom: var(--s9); }
@media (min-width: 1100px) { .cfg { grid-template-columns: minmax(0, 1fr) 27rem; align-items: start; } .cfg-panel { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto; } }
.cfg > * { min-width: 0; }
.viewer { position: relative; background: var(--basalt); height: min(64vh, 520px); overflow: hidden; }
@media (min-width: 1100px) { .viewer { height: auto; min-height: 560px; aspect-ratio: 16 / 10; } }
.viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--basalt-2); }
.viewer canvas.preview { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; }
.viewer-bar p { margin: 0; font-size: 0.95rem; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--limestone); background: var(--basalt-2); }
.dev-note { background: #fff6d6; border: 1px solid #c9a227; color: #4d3b00; padding: var(--s3) var(--s4); font-size: 0.925rem; border-radius: var(--radius); }
.dev-note code { font-size: 0.875em; }
.cfg-panel { background: var(--paper); border: 1px solid var(--line); padding: var(--s5); }
.cfg-panel h2 { font-size: 1.5rem; }
.estimate { background: var(--basalt); color: var(--limestone); padding: var(--s5); margin: var(--s5) 0; }
.estimate .price { font-family: var(--font-display); font-stretch: 108%; font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -0.02em; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.estimate small { color: rgba(227, 228, 222, 0.75); }
.estimate dl { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s4); margin: var(--s4) 0 0; font-size: 0.925rem; font-variant-numeric: tabular-nums; }
.estimate dt { color: rgba(227, 228, 222, 0.8); }
.estimate dd { margin: 0; text-align: right; }
.thumb-row { display: flex; align-items: center; gap: var(--s3); }
.thumb-row img, .thumb-row canvas { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); }
.confirm { border: 2px solid var(--ok); background: #e6f2eb; padding: var(--s5); border-radius: var(--radius); }
.confirm h3 { color: var(--ok); }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); align-items: center; padding-bottom: var(--s5); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.filters .grp { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.filters .grp > span { font-weight: 600; font-size: 0.95rem; }
.gallery { columns: 1; column-gap: var(--s5); }
@media (min-width: 640px) { .gallery { columns: 2; } }
@media (min-width: 1000px) { .gallery { columns: 3; } }
.gallery .tile { break-inside: avoid; margin-bottom: var(--s6); width: 100%; }
.gallery .tile .plate { aspect-ratio: var(--ar, 4 / 5); }
.empty { padding: var(--s7) 0; }
.patterns { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pattern .plate { aspect-ratio: 1; }
.pattern h3 { margin: var(--s3) 0 4px; }
.pattern p { font-size: 0.95rem; color: var(--graphite); margin-bottom: var(--s2); }
.on-dark .pattern p { color: rgba(227, 228, 222, 0.78); }
dialog { border: 0; padding: 0; background: var(--paper); color: var(--basalt); max-width: min(560px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px); overflow: auto; z-index: var(--z-dialog); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35); }
dialog::backdrop { background: rgba(23, 27, 31, 0.68); }
dialog.wide { max-width: min(980px, calc(100vw - 32px)); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--s5) 0; }
.dlg-head h2 { font-size: 1.6rem; margin: 0; }
.dlg-body { padding: var(--s5); }
.dlg-project { display: grid; grid-template-columns: 1fr; }
@media (min-width: 800px) { .dlg-project { grid-template-columns: 1.1fr 1fr; } }
.dlg-project .plate { height: 36vh; }
@media (min-width: 800px) { .dlg-project .plate { height: 100%; min-height: 440px; } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s4); margin: var(--s4) 0 var(--s5); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.tabs-auth { display: flex; gap: var(--s2); margin-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.tabs-auth button { min-height: 44px; padding: 0 var(--s4); border: 0; border-bottom: 3px solid transparent; background: none; font: 600 1rem var(--font-body); color: var(--graphite); cursor: pointer; margin-bottom: -1px; }
.tabs-auth button[aria-selected='true'] { color: var(--basalt); border-bottom-color: var(--blue); }

/* ---------- Account ---------- */
.tabs { display: flex; flex-wrap: nowrap; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.tabs button { min-height: 52px; padding: 6px var(--s3); flex: 1 1 auto; text-align: center; border: 0; border-bottom: 3px solid transparent; background: none; font: 600 0.975rem/1.2 var(--font-body); color: var(--graphite); cursor: pointer; margin-bottom: -1px; }
@media (min-width: 640px) { .tabs button { flex: none; padding: 0 var(--s5); } }
.tabs button:hover { color: var(--basalt); }
.tabs button[aria-selected='true'] { color: var(--basalt); border-bottom-color: var(--blue); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 6px; border-radius: 11px; background: var(--blue); color: #fff; font-size: 0.8rem; line-height: 22px; text-align: center; }
.rec { border-top: 1px solid var(--line); padding: var(--s5) 0; }
.rec:last-child { border-bottom: 1px solid var(--line); }
.rec-head { display: grid; gap: var(--s3) var(--s5); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 800px) { .rec-head { grid-template-columns: 5rem 1fr auto auto; } }
.rec-id { font-family: var(--font-display); font-stretch: 112%; font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-title { font-weight: 600; margin: 0; }
.rec-sub { font-size: 0.925rem; color: var(--graphite); margin: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 0.9rem; font-weight: 650; background: #fff; border: 1.5px solid var(--basalt); white-space: nowrap; }
.status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.status.s-quoted { background: #fff3cf; border-color: #8a6a00; }
.status.s-quoted::before { background: #b58900; }
.status.s-complete { background: #e6f2eb; border-color: var(--ok); }
.status.s-complete::before { background: var(--ok); }
.status.s-declined { border-color: var(--graphite); color: var(--graphite); }
.status.s-declined::before { background: var(--graphite); }
.rec-detail { display: grid; gap: var(--s6); grid-template-columns: 1fr; padding-top: var(--s5); }
@media (min-width: 900px) { .rec-detail { grid-template-columns: 1fr 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--s4) 40px; color: var(--graphite); }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 24px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-border); background: var(--limestone); display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; }
.timeline li.done { color: var(--basalt); }
.timeline li.done .dot { background: var(--basalt); border-color: var(--basalt); color: var(--limestone); }
.timeline li.done::before { background: var(--basalt); }
.timeline li.now { color: var(--basalt); font-weight: 650; }
.timeline li.now .dot { border-color: var(--blue); background: var(--blue); color: #fff; }
.timeline .when { display: block; font-weight: 400; font-size: 0.875rem; color: var(--graphite); }
.timeline .desc { display: block; font-weight: 400; font-size: 0.925rem; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s5); margin: 0 0 var(--s4); font-size: 0.975rem; }
.spec dt { color: var(--graphite); }
.spec dd { margin: 0; font-variant-numeric: tabular-nums; }
.proto { margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px dashed var(--field-border); border-radius: var(--radius); font-size: 0.925rem; }
.proto summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.note { display: grid; grid-template-columns: 12px 1fr auto; gap: var(--s3); align-items: start; padding: var(--s4) 0; border-top: 1px solid var(--line); }
.note::before { content: ''; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: transparent; border: 2px solid var(--field-border); }
.note.unread::before { background: var(--blue); border-color: var(--blue); }
.note p { margin: 0; }
.note time { font-size: 0.875rem; color: var(--graphite); white-space: nowrap; }
.note.unread p { font-weight: 650; }
.panel-msg { max-width: 34rem; padding: var(--s7) 0; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: var(--s2); width: min(92vw, 30rem); }
.toast { background: var(--basalt); color: var(--limestone); padding: var(--s3) var(--s4); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); font-weight: 500; animation: toast-in 0.25s var(--ease); }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .tile:hover .plate, .tile:focus-visible .plate { transform: none; }
}
