/* Rigsmith design system: tokens, base, components.
   Bright and simple: light page, white cards, one electric-blue accent, deep navy only behind
   the 3D stage and in the footer. Page-specific styles live in their own files. */

/* ---------- Tokens ---------- */
:root {
  --bg: #E9EAEC;
  --panel: #F3F4F6;
  --panel-2: #E5E7EA;
  --line: #D9DBDF;
  --line-strong: #C6C9CF;
  --text: #1A1C20;
  --muted: #5A5F68;
  --accent: #2F6BFF;
  --accent-hover: #1F58E8;
  --accent-soft: #DCE4F5;
  --accent-ink: #FFFFFF;
  /* The accent for small text on light surfaces: same blue, deep enough for 4.5:1 contrast. */
  --accent-text: #1F58E8;
  --accent-strong: #2A64F5; /* primary button fill: white text at 4.95:1 */

  --navy: #0B1222;
  --navy-2: #121C33;
  --navy-line: #24304A;
  --navy-text: #E8EDF7;
  --navy-muted: #9AA6BD;

  /* RGB glow used only around the 3D PC */
  --glow-1: #4F86FF;
  --glow-2: #8A63FF;
  --glow-3: #FF6FC0;

  --ok: #12A66A;
  --warn: #C7860A;
  --error: #E5484D;

  --font-head: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 20px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(26 28 32 / .04);
  --shadow: 0 1px 2px rgb(26 28 32 / .03), 0 6px 20px -10px rgb(26 28 32 / .10);
  --shadow-lg: 0 2px 4px rgb(26 28 32 / .03), 0 18px 40px -18px rgb(26 28 32 / .16);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 56px;
  --s-8: 96px;

  --topbar-h: 64px;
  --container: 1240px;
  --gutter: 32px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 180ms;

  color-scheme: light;
}

@media (max-width: 600px) {
  :root { --gutter: 16px; --topbar-h: 56px; }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-feature-settings: 'cv11', 'ss01';
  /* Footer at the bottom of short pages. */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 var(--s-3);
  letter-spacing: -.025em;
}
h1 { font-size: clamp(40px, 5.6vw, 72px); letter-spacing: -.035em; }
h2 { font-size: clamp(28px, 3.2vw, 44px); }
h3 { font-size: 21px; font-weight: 700; letter-spacing: -.015em; }

p { margin: 0 0 var(--s-4); }

a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); }
a:hover { text-decoration-color: var(--accent); }

img, svg, canvas { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type helpers ---------- */
/* Small label above a value or a heading: sentence case, quiet. */
.label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted);
}
/* Small accent kicker above a big heading. */
.eyebrow {
  display: inline-block;
  margin: 0 0 var(--s-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
}
.mono { font-family: var(--font-mono); font-size: .9em; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.lead { font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 46ch; }

.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: var(--s-3);
  top: -60px;
  z-index: 100;
  padding: var(--s-2) var(--s-3);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }

/* ---------- Surfaces ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.panel--2 { background: var(--panel-2); box-shadow: none; }
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-3);
}
.panel__body { padding: var(--s-4) var(--s-5) var(--s-5); }

/* Legacy technical decorations, now invisible: kept so old markup does not break. */
.brackets { --bracket-color: transparent; }
.ticks { display: none; }

.divider { height: 1px; background: var(--line); border: 0; margin: var(--s-5) 0; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--panel);
  --btn-border: var(--line-strong);
  --btn-text: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 44px;
  padding: 0 var(--s-5);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { --btn-border: #B9C1CD; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  --btn-bg: var(--accent-strong);
  --btn-border: var(--accent-strong);
  --btn-text: var(--accent-ink);
  box-shadow: 0 1px 2px rgb(47 107 255 / .3), 0 8px 20px -8px rgb(47 107 255 / .6);
}
.btn--primary:hover { --btn-bg: var(--accent-hover); --btn-border: var(--accent-hover); box-shadow: 0 1px 2px rgb(47 107 255 / .3), 0 12px 28px -8px rgb(47 107 255 / .7); }

.btn--ghost { --btn-bg: transparent; --btn-border: transparent; --btn-text: var(--muted); box-shadow: none; }
.btn--ghost:hover { --btn-text: var(--text); --btn-border: transparent; --btn-bg: var(--panel-2); box-shadow: none; }

.btn--lg { height: 52px; padding: 0 var(--s-6); font-size: 16px; }
.btn--sm { height: 34px; padding: 0 var(--s-4); font-size: 14px; }
.btn--icon { width: 44px; padding: 0; }

.btn[aria-disabled="true"], .btn:disabled {
  --btn-text: #9AA3B2;
  --btn-border: var(--line);
  --btn-bg: var(--panel-2);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn__arrow { font-size: 15px; transition: transform var(--dur) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
}
.tag--dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tag--ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, white); }
.tag--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, white); }
.tag--error { color: var(--error); background: color-mix(in srgb, var(--error) 11%, white); }
.tag--accent { color: var(--accent-text); background: var(--accent-soft); }

/* ---------- Spec table ---------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec-table th,
.spec-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: baseline;
}
.spec-table th {
  width: 45%;
  padding-right: var(--s-3);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
}
.spec-table td {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table .null { color: var(--muted); }

/* ---------- Gauge bar ---------- */
.gauge { --value: 0; --gauge-color: var(--accent); }
.gauge__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.gauge__value { font-family: var(--font-mono); font-size: 13px; }
.gauge__track {
  position: relative;
  height: 8px;
  background: var(--panel-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.gauge__fill {
  height: 100%;
  width: calc(var(--value) * 1%);
  background: var(--gauge-color);
  border-radius: var(--r-pill);
  transition: width 400ms var(--ease);
}
.gauge--ok { --gauge-color: var(--ok); }
.gauge--warn { --gauge-color: var(--warn); }
.gauge--error { --gauge-color: var(--error); }
.gauge--accent { --gauge-color: var(--accent); }

/* ---------- Tooltip ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 50;
  width: max-content;
  max-width: 260px;
  padding: 7px 11px;
  background: var(--navy);
  border-radius: var(--r-sm);
  color: var(--navy-text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--shadow);
  transform: translate(-50%, -4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
[data-tooltip-pos="left"]::after { left: auto; right: 0; transform: translate(0, -4px); }
[data-tooltip-pos="left"]:hover::after,
[data-tooltip-pos="left"]:focus-visible::after { transform: translate(0, 0); }

/* ---------- Keyboard key ---------- */
kbd, .kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-6);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--text);
}
.wordmark__mark {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--glow-1), var(--glow-2) 60%, var(--glow-3));
  position: relative;
  box-shadow: 0 4px 12px -4px rgb(79 134 255 / .7);
}
.wordmark__mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid #fff;
  border-radius: 3px;
}

.nav { display: flex; align-items: center; gap: var(--s-5); flex: 1; }
.nav__list { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.nav__link[aria-current="page"] { color: var(--text); background: var(--panel); box-shadow: var(--shadow-sm); }
.nav__link[aria-disabled="true"] { cursor: default; color: #9AA3B2; }
.nav__link[aria-disabled="true"]:hover { background: none; color: #9AA3B2; }
.nav__soon { font-size: 10px; height: 18px; padding: 0 6px; }
.nav__end { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .topbar__inner { gap: var(--s-3); }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav {
    position: absolute;
    top: var(--topbar-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-2) var(--gutter) var(--s-4);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav__list { flex-direction: column; gap: 2px; }
  .nav__link { height: 46px; width: 100%; border-radius: var(--r-sm); }
  .nav__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
  .nav__end { margin: var(--s-3) 0 0; }
}

/* ---------- Mobile bottom navigation (js/ui/shell.js) ---------- */
.bottom-nav { display: none; }
@media (max-width: 720px) {
  body.has-bottom-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
  }
  .bottom-nav__link {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: 12px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
  }
  .bottom-nav__link svg { width: 22px; height: 22px; }
  .bottom-nav__link[aria-current="page"] { color: var(--accent-text); }
  /* The top bar's menu duplicates the bottom navigation on phones. */
  .nav-toggle, .nav { display: none !important; }
}

/* ---------- Footer (navy) ---------- */
.footer {
  margin-top: var(--s-8);
  padding: var(--s-7) 0 var(--s-6);
  background: var(--navy);
  color: var(--navy-muted);
  font-size: 14px;
}
.footer .wordmark { color: var(--navy-text); }
.footer .label { color: var(--navy-text); margin-bottom: var(--s-2); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: var(--s-6);
}
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--navy-muted); text-decoration: none; }
.footer a:hover { color: #fff; }
.footer__credits { font-size: 13px; line-height: 1.55; }
.footer__base {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--navy-line);
  font-size: 13px;
}
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Loading screen ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 320ms var(--ease), visibility 0s linear 320ms;
}
.loader[data-done="true"] { opacity: 0; visibility: hidden; }
.loader__box { width: min(320px, 80vw); }
.loader__row {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-4);
  font-size: 13px;
  color: var(--muted);
}
.loader__bar {
  margin-top: var(--s-2);
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}
.loader__fill {
  height: 100%;
  width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--glow-1), var(--glow-2), var(--glow-3));
  transition: width 240ms var(--ease);
}

/* ---------- Placeholder page block ---------- */
.page-head { padding: var(--s-7) 0 var(--s-5); }
.notice { padding: var(--s-5); max-width: 640px; }

/* ---------- Shared components (builder, compare) ---------- */
[hidden] { display: none !important; }

.btn--icon-sm { width: 34px; padding: 0; }
.btn--danger { --btn-bg: transparent; --btn-border: transparent; --btn-text: var(--error); box-shadow: none; }
.btn--danger:hover { --btn-bg: color-mix(in srgb, var(--error) 8%, white); --btn-border: transparent; box-shadow: none; }

.linkbtn {
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--accent-text); text-decoration-color: var(--accent); }
.linkbtn--danger:hover { color: var(--error); text-decoration-color: var(--error); }

.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field--grow { flex: 1; }
.field__label {
  padding: 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: #8C95A4; }
.input:hover { border-color: #B9C1CD; }
.input:focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.input { padding-right: 6px; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.input--lg { height: 50px; font-size: 20px; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars .gauge__head { font-size: 13px; }
.gauge--marked .gauge__track::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--mark) * 1%);
  width: 2px;
  z-index: 1;
  background: var(--text);
}

.callout {
  padding: var(--s-3) var(--s-4);
  background: var(--panel-2);
  border-radius: var(--r-sm);
  font-size: 14px;
}
.callout p:last-child { margin: 0; }
.callout .label { margin: 0 0 4px; }
.callout--warn { background: color-mix(in srgb, var(--warn) 10%, white); }
.callout--warn .label { color: var(--warn); }

/* ---------- Modals ---------- */
.modal {
  padding: 0;
  background: var(--panel);
  color: var(--text);
  border: 0;
  width: min(680px, calc(100vw - 32px));
  max-height: 90dvh;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}
.modal::backdrop { background: rgb(11 18 34 / .45); backdrop-filter: blur(4px); }
.modal--sm { width: min(440px, calc(100vw - 32px)); }
.modal__inner { padding: var(--s-6); }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); margin-bottom: var(--s-4); }
.modal__head h2 { font-size: 26px; margin: 0; }
.modal__head .label { margin: 0 0 4px; }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-5); }
.modal .field { margin-bottom: var(--s-4); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-5);
  z-index: 300;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px var(--s-4) 12px 40px;
  background: var(--navy);
  color: var(--navy-text);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast::before {
  content: '';
  position: absolute;
  left: 16px; top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--ok);
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }
.toast[data-level="error"]::before { background: var(--error); }
.toast[data-level="warn"]::before { background: var(--warn); }
@media (max-width: 720px) {
  .has-bottom-nav .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

.modal--wide { width: min(1120px, calc(100vw - 32px)); }

/* Disclosure menu: <details class="menu"><summary class="btn">…</summary><div class="menu__list">buttons</div></details> */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ''; width: 6px; height: 6px; margin: -3px 0 0 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.menu[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  display: grid;
  min-width: 220px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.menu__list button, .menu__list a {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu__list button:hover, .menu__list a:hover { background: var(--panel-2); }

/* 3D thumbnail of a whole build (js/ui/build-thumb.js): rendered once, cached as an image. */
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: radial-gradient(120% 90% at 50% 30%, #DEE0E3, #C9CCD1);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__msg { margin: 0; padding: 0 var(--s-3); font-size: 12px; color: var(--muted); text-align: center; }
.thumb[data-state="loading"] .thumb__msg::after { content: ''; display: block; width: 48px; height: 3px; border-radius: 3px; margin: 8px auto 0; background: var(--accent); animation: thumb-scan 1.2s var(--ease) infinite alternate; }
@keyframes thumb-scan { from { transform: translateX(-24px); } to { transform: translateX(24px); } }

@media (max-width: 640px) {
  .modal__inner { padding: var(--s-5) var(--s-4); }
  .modal__foot .btn { flex: 1; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
