/* Self-hosted variable fonts (Google Fonts, cyrillic + latin subsets); no third-party request at load. */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('/fonts/jetbrains-mono-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/manrope-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/manrope-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/fonts/unbounded-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/fonts/unbounded-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0a0b0d;
  --bg-2: #101215;
  --glass: rgba(18, 20, 24, .72);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --text: #eceae6;
  --muted: #8d9097;
  --dim: #80848b;
  --accent: #c8231e;
  --m1: #2c8dd9; --m2: #1f2f7a; --m3: #d4241e;
  --radius: 14px;
  --rail: 268px;
  --inspector: 340px;
  --top: 68px;
  font-family: Manrope, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: clip;
  -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

#app { position: relative; height: 100%; }
#stage { position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 42%, #2b2e34 0%, #15171b 45%, #08090b 100%); }
.vignette { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 75% 75% at 50% 48%, transparent 55%, rgba(0,0,0,.45) 100%); }
.photo-btn { gap: 6px; display: inline-flex !important; align-items: center; color: var(--text) !important; }
.photo-btn[aria-pressed="true"] { background: var(--text) !important; color: #111 !important; }
.photo-btn span { font-size: 12.5px; }
#photo-status { position: absolute; z-index: 4; left: 50%; bottom: 82px; transform: translateX(-50%); padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px);
  font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 12px; white-space: nowrap; }
#photo-status[hidden] { display: none; }
#photo-status .bar { width: 90px; margin: 0; }
#gl { display: block; width: 100%; height: 100%; outline: none; touch-action: none; cursor: grab; }
#gl.pointer { cursor: pointer; }
#gl:active { cursor: grabbing; }

/* top bar */
.topbar { position: absolute; z-index: 5; inset: 0 0 auto 0; height: var(--top); display: flex; align-items: center;
  gap: 24px; padding: 0 28px; background: linear-gradient(180deg, rgba(10,11,13,.92), rgba(10,11,13,0)); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-logo { display: block; width: clamp(32px, 3.2vw, 48px); height: auto; flex: none; }
.brand-text { font-weight: 300; letter-spacing: .32em; text-transform: uppercase; font-size: 12px; }
.brand-text em { font-style: normal; font-weight: 600; }
.brand-mark { display: inline-flex; gap: 2px; transform: skewX(-18deg); }
.brand-mark i { width: 5px; height: 16px; border-radius: 1px; }
.brand-mark i:nth-child(1) { background: var(--m1); } .brand-mark i:nth-child(2) { background: var(--m2); } .brand-mark i:nth-child(3) { background: var(--m3); }
.brand-mark.big i { width: 8px; height: 30px; }
.presets { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(16,18,21,.6); backdrop-filter: blur(14px); }
.presets button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
  cursor: pointer; letter-spacing: .02em; transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out; white-space: nowrap; }
.presets button:hover { color: var(--text); }
.presets button[aria-pressed="true"] { background: var(--text); color: #111; }
.actions { display: flex; gap: 8px; margin-left: auto; }
.ghost, .solid { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  font-size: 13px; cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out; white-space: nowrap; }
.ghost { border: 1px solid var(--line-2); background: rgba(16,18,21,.5); backdrop-filter: blur(14px); }
.ghost:hover { border-color: rgba(255,255,255,.35); }
.solid { border: 1px solid var(--text); background: var(--text); color: #0c0c0e; font-weight: 600; }
.solid:hover { background: #fff; }
.ghost.small { height: 32px; padding: 0 14px; font-size: 12px; }

.eyebrow { margin: 0 0 8px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.lead { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* views */
.views { position: absolute; z-index: 4; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px); }
.views button { border: 0; background: none; height: 34px; min-width: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.views button:hover, .views button[aria-pressed="true"] { color: var(--text); background: rgba(255,255,255,.08); }
.views #btn-lighting { border-left: 1px solid var(--line-2); }
.views #btn-lighting[aria-expanded="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.lighting-panel { position: absolute; z-index: 7; left: calc(50% + 180px); bottom: 26px; width: 280px;
  display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 8px;
  max-width: calc(100% - 24px); padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 18px;
  background: rgba(12,13,15,.97); box-shadow: 0 12px 40px #0006; backdrop-filter: blur(18px); }
.lighting-panel[hidden] { display: none; }
.lighting-panel header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lighting-panel h2 { margin: 0; font-size: 14px; }
.lighting-panel header button { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; width: 28px; height: 28px; }
.lighting-panel label { display: block; align-self: center; font-size: 11px; color: var(--muted); }
.lighting-panel input { display: block; width: 100%; min-width: 0; margin: 0; height: 30px; accent-color: var(--accent); cursor: pointer; touch-action: pan-y; }
.lighting-panel input:focus-visible { outline: none; background: rgba(255,255,255,.08); border-radius: 4px; }
.lighting-ends { grid-column: 2; display: flex; justify-content: space-between; color: var(--dim); font-size: 10px; margin: 0 0 8px; }
.lighting-panel > button { grid-column: 1 / -1; justify-self: start; }
body[data-step="3"] .lighting-panel { display: none; }
body[data-step="2"]:not(.pads-3d) .lighting-panel { display: none; }
@media (max-width: 760px) {
  #stage.lighting-mobile-open { margin-bottom: var(--lighting-gap, 220px); }
  .lighting-panel { left: 12px !important; top: calc(100% + 8px); bottom: auto; width: calc(100% - 24px) !important;
    max-width: none; grid-template-columns: 108px minmax(0, 1fr); padding: 10px 16px; }
}

/* tooltip */
#tooltip { position: absolute; z-index: 6; pointer-events: none; padding: 6px 10px; border-radius: 8px; font-size: 12px;
  background: rgba(236,234,230,.95); color: #111; opacity: 0; transform: translate(14px, 14px); transition: opacity .12s; white-space: nowrap; }
#tooltip.on { opacity: 1; }

/* left rail */
.rail { position: absolute; z-index: 4; left: 20px; top: calc(var(--top) + 8px); bottom: 20px; width: var(--rail);
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass);
  backdrop-filter: blur(18px); overflow: hidden; }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 18px 10px; font-size: 11px;
  letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.rail-head small { letter-spacing: 0; text-transform: none; color: var(--dim); }
.rim-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 12px 6px; }
.rim-tile { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; min-width: 0; }
.rim-tile:hover { border-color: rgba(255,255,255,.35); }
.rim-tile[aria-pressed="true"] { border-color: var(--text); background: rgba(255,255,255,.08); }
.rim-tile svg { width: 34px; height: 34px; stroke-width: 2.2; }
.rim-tile span { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.brands { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.brand-tile { aspect-ratio: 1; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #e9e8e4; cursor: pointer; display: grid; place-items: center; }
.brand-tile img { max-width: 100%; max-height: 100%; }
.brand-tile[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.rail-list { overflow-y: auto; padding: 0 8px 12px; scrollbar-width: thin; scrollbar-color: #2a2d33 transparent; }
.rail-group { margin: 12px 10px 4px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.part { width: 100%; display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center; text-align: left;
  border: 0; background: none; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.part:hover { background: rgba(255,255,255,.05); }
.part[aria-current="true"] { background: rgba(255,255,255,.09); box-shadow: inset 2px 0 0 var(--text); }
.part .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); background-size: 260%; background-position: center; }
.part b { display: block; font-weight: 500; font-size: 13px; }
.part small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }

/* inspector */
.inspector { position: absolute; z-index: 4; right: 20px; top: calc(var(--top) + 8px); width: var(--inspector);
  max-height: calc(100% - var(--top) - 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass);
  backdrop-filter: blur(18px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a2d33 transparent; }
.empty { padding: 26px 24px 22px; }
.empty h1 { margin: 0; font: 500 38px/1.02 'Cormorant Garamond', serif; letter-spacing: -.01em; }
.empty h1 em { font-style: italic; }
.hint-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 11.5px; }
.hint-row svg { width: 22px; height: 22px; stroke: var(--muted); stroke-width: 1.4; flex: none; }
.panel { padding: 22px 22px 18px; animation: rise 180ms cubic-bezier(.2, 0, 0, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.panel h2 { margin: 0 0 18px; font: 500 30px/1.05 'Cormorant Garamond', serif; }
.panel section { padding: 16px 0; border-top: 1px solid var(--line); }
.panel h3 { margin: 0 0 12px; font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; gap: 8px; }
.panel h3 span { letter-spacing: 0; text-transform: none; color: var(--text); font-size: 12px; }
.finishes, .shapes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 8px 13px; font-size: 12.5px; cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out; }
.chip:hover { border-color: rgba(255,255,255,.35); }
.chip[aria-pressed="true"] { background: var(--text); color: #111; border-color: var(--text); }
.shape { flex: 1 1 calc(50% - 6px); display: grid; gap: 2px; text-align: left; border: 1px solid var(--line-2); background: transparent;
  border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.shape small { color: var(--muted); font-size: 11px; }
.shape[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

.picker { display: grid; gap: 12px; }
.pk-sv { position: relative; height: 170px; border-radius: 10px; cursor: crosshair; touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.pk-sv::before, .pk-sv::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.pk-sv::before { background: linear-gradient(90deg, #fff, transparent); }
.pk-sv::after { background: linear-gradient(0deg, #000, transparent); }
.pk-dot { position: absolute; z-index: 1; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.5); pointer-events: none; }
.pk-hue { position: relative; height: 14px; border-radius: 7px; cursor: pointer; touch-action: none;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.pk-hue .pk-dot { top: 50%; }
.pk-row { display: flex; align-items: center; gap: 10px; }
.pk-swatch { width: 30px; height: 30px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.pk-hex { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: transparent;
  color: var(--text); font: 13px ui-monospace, monospace; text-transform: uppercase; }
.pk-eye { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.ins-note { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.ins-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

/* loader */
#loader { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--bg); transition: opacity 240ms cubic-bezier(.2, 0, 0, 1); }
#loader.done { opacity: 0; pointer-events: none; }
#loader-retry[hidden] { display: none; } /* .ghost задаёт display и иначе перебивает hidden: кнопка «Обновить страницу» висела при обычной загрузке */
.loader-inner { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .26em; text-transform: uppercase; }
.loader-inner p { margin: 18px 0 14px; }
.bar { width: 200px; height: 1px; background: var(--line-2); margin: 0 auto 10px; overflow: hidden; }
.bar i { display: block; width: 100%; height: 100%; background: var(--text); transform: scaleX(0); transform-origin: left; transition: transform 200ms ease-out; }
.loader-inner small { font-size: 11px; letter-spacing: .1em; color: var(--dim); }

/* spec dialog */
dialog#spec { border: 1px solid var(--line-2); border-radius: 18px; padding: 0; background: #111316; color: var(--text);
  width: min(560px, calc(100% - 32px)); max-height: min(720px, calc(100% - 48px)); }
dialog#spec::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.spec-inner { padding: 24px 26px; display: flex; flex-direction: column; max-height: inherit; }
.spec-inner header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.spec-inner header > div { min-width: 0; }
.spec-inner header > button { flex: none; }
.spec-inner h2 { margin: 0; font: 500 30px/1 'Cormorant Garamond', serif; }
#spec-list { overflow-y: auto; }
#spec-order { flex-shrink: 0; justify-content: center; margin-top: 16px; min-height: 44px; text-decoration: none; }
.spec-row { display: grid; grid-template-columns: 1fr auto 18px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.spec-row small { color: var(--muted); }
.spec-row i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.spec-group { margin: 16px 0 4px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.credit { margin: 16px 0 0; color: var(--dim); font-size: 11px; line-height: 1.5; }

#toast { position: fixed; z-index: 30; left: 50%; bottom: 84px; transform: translate(-50%, 10px); opacity: 0; padding: 10px 16px;
  border-radius: 999px; background: var(--text); color: #111; font-size: 13px; transition: opacity 180ms ease-out, transform 180ms cubic-bezier(.2, 0, 0, 1); pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* no focus ring anywhere (owner rule): keyboard focus is a quiet fill, one step denser than hover */
:focus { outline: none; }
:is(button, a, [role="radio"], label.drop):focus-visible { background-image: linear-gradient(rgba(255,255,255,.1), rgba(255,255,255,.1)); }
:is(.chip, .shape, .centre-option, .presets button, .views button, .pad-model, .history-item, .forged-tile, .brand-tile, .rim-tile, .part, .family):not([aria-pressed="true"], [aria-checked="true"], [aria-current="true"]):focus-visible {
  border-color: var(--line-2) !important; box-shadow: none !important; }
:is(.chip, .shape, .centre-option, .presets button, .views button, .pad-model, .history-item, .forged-tile, .brand-tile, .rim-tile, .part, .family)[aria-pressed="true"]:focus-visible,
:is(.chip, .shape, .centre-option, .presets button, .views button, .pad-model, .history-item, .forged-tile, .brand-tile, .rim-tile, .part, .family)[aria-checked="true"]:focus-visible,
:is(.chip, .shape, .centre-option, .presets button, .views button, .pad-model, .history-item, .forged-tile, .brand-tile, .rim-tile, .part, .family)[aria-current="true"]:focus-visible {
  background-color: rgba(226, 35, 26, .24) !important; }
.brand-tile[aria-pressed="true"] { outline: 0; background: #f5f4f0; border-color: var(--accent); }
#progress-text, #parts-count, #v-status { font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .spec-inner h2 { font-size: 20px; } }
@media (hover: none) { .presets button:hover, .ghost:hover, .solid:hover, .chip:hover, .rim-tile:hover, .part:hover, .family:hover, .drop:hover, .tach-video header button:hover, .tach-bar button:hover { border-color: inherit; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* tablet: hide intro copy, narrower panels */
@media (max-width: 1180px) {
  :root { --rail: 230px; --inspector: 300px; }
  .presets { display: none; }
}
/* tablet: brand, three steps and three labelled actions do not fit in one row, so the actions become icons */
@media (max-width: 1100px) {
  .actions span { display: none; }
  .actions .ghost, .actions .solid { width: 38px; padding: 0; justify-content: center; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  /* between the two side panels there is no room for one row of four labels; stack them in the free middle */
  .views { top: auto; bottom: 26px; right: auto; left: calc(var(--rail) + 20px + (100% - var(--rail) - var(--inspector) - 40px) / 2);
    flex-direction: column; align-items: stretch; padding: 6px; border-radius: 20px; }
  .views button { min-width: 0; padding: 0 12px; white-space: nowrap; }
  .views #btn-lighting { border-left: 0; border-top: 1px solid var(--line-2); }
}
/* narrow tablet: the steps carry the page title, the brand keeps only its mark */
@media (max-width: 900px) and (min-width: 761px) { .brand-text { display: none; } }
/* phone: stage on top, sheet below */
@media (max-width: 760px) {
  :root { --top: 56px; }
  html, body { overflow: auto; }
  #app { display: flex; flex-direction: column; min-height: 100%; height: auto; }
  .topbar { position: fixed; padding: 0 14px; gap: 10px; }
  .brand-text { font-size: 10.5px; letter-spacing: .24em; }
  .actions span { display: none; }
  .actions .ghost, .actions .solid { width: 38px; padding: 0; justify-content: center; }
  #stage { position: relative; height: 58vh; flex: none; }
  .views { bottom: 12px; }
  .rail { position: relative; inset: auto; width: auto; margin: 0 12px; border-radius: var(--radius) var(--radius) 0 0; max-height: none; }
  .rail-list { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 14px; }
  .rail-group { display: none; }
  .part { width: auto; flex: none; grid-template-columns: 18px auto; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; }
  .part .dot { width: 18px; height: 18px; }
  .part small { display: none; }
  .part[aria-current="true"] { box-shadow: none; border-color: var(--text); }
  .inspector { position: relative; inset: auto; width: auto; max-height: none; margin: 0 12px 24px; border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }

}

/* v2: three pages */
.steps button { display: inline-flex; align-items: center; gap: 8px; }
.steps button i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px;
  box-shadow: inset 0 0 0 1px currentColor; }
.paddle-toggle { padding: 0 18px 10px; }
.paddle-toggle p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.paddle-toggle[hidden] { display: none; }
.rail-list { flex: 1; }
.rail-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.rail-foot .solid { flex: 1; min-width: 0; justify-content: center; }
.rail-foot [hidden] { display: none; }
body[data-step="3"] .rail, body[data-step="3"] .inspector, body[data-step="3"] .views, body[data-step="3"] #photo-status { display: none; }

.visual { position: absolute; z-index: 6; inset: calc(var(--top) + 8px) 20px 20px; display: grid; grid-template-columns: minmax(340px, 460px) 1fr;
  gap: 16px; align-items: start; overflow-y: auto; }
.visual[hidden] { display: none; }
/* the empty part of the step-3 layer lets the mouse through: the rim and paddles behind it turn and zoom together */
.visual { pointer-events: none; }
.visual > * { pointer-events: auto; }
.visual-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); backdrop-filter: blur(18px); }
.visual-card { padding: 24px; }
.visual-card h2 { margin: 0; font: 500 32px/1.05 'Cormorant Garamond', serif; }
.visual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.drop, .ref { margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; }
.drop { grid-column: 1 / -1; aspect-ratio: 16 / 9; display: grid; place-items: center; border: 1px dashed var(--line-2); cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out; }
.ref[hidden] { display: none; }
.drop:hover { border-color: rgba(255,255,255,.4); }
.drop img, .ref img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ref img { object-fit: contain; background: #d6d6d4; }
.drop-hint { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 13px; color: var(--text); padding: 12px; }
.drop-hint svg { width: 28px; height: 28px; stroke: var(--muted); }
.drop-hint small { color: var(--muted); font-size: 11px; }
.drop-hint[hidden], .drop img[hidden] { display: none; }
.ref figcaption { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(10,11,13,.7); font-size: 11px; }
.visual-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.visual-actions .solid[disabled] { opacity: .4; cursor: not-allowed; }
.v-status { margin: 12px 0 0; min-height: 1.4em; color: var(--muted); font-size: 13px; line-height: 1.5; }
/* the centre section on the try-on */
.centre-pick { margin-top: 18px; }
.centre-pick h3 { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.centre-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.centre-option { display: grid; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: none; cursor: pointer; }
.centre-option b { font-weight: 500; font-size: 13px; }
.centre-option small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.centre-option[aria-checked="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.centre-match { margin-top: 10px; }
.centre-match[hidden] { display: none; }
.centre-sub { margin: 12px 0 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.centre-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.centre-note i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); vertical-align: -2px; }

/* the result: one window, the same size whatever the photo; the photo fits inside it, never stretched */
dialog.viewer { width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: #0d0e10; color: var(--text); overflow: hidden; }
dialog.viewer[open] { display: flex; flex-direction: column; }
dialog.viewer::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.viewer-frame { aspect-ratio: 16 / 10; max-height: calc(100dvh - 210px); width: 100%; background: #050506; display: grid; place-items: center; overflow: hidden; }
.viewer-frame { position: relative; }
.viewer-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.viewer-foot { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; padding: 14px 18px 16px; }
.viewer-text { display: grid; gap: 2px; min-width: 0; }
.viewer-text b { font-weight: 500; font-size: 14px; }
.viewer-text small { color: var(--muted); font-size: 12px; }
.viewer-save { justify-content: center; text-decoration: none; min-width: 160px; }
.viewer-more { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.history[hidden] { display: none; }
.history h3 { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.history h3 small { letter-spacing: 0; text-transform: none; color: var(--dim); margin-left: 6px; }
.history-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.history-item { position: relative; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: none; cursor: pointer; text-align: left; }
.history-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.history-item span { display: block; padding: 5px 7px; font-size: 11px; color: var(--muted); }
.history-item[aria-current="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.history-note { margin: 10px 0 0; font-size: 11.5px; color: var(--dim); }
@media (max-width: 1180px) { .steps { display: flex; } }
@media (max-width: 760px) {
  .steps { position: fixed; top: var(--top); left: 12px; right: 12px; margin: 0; justify-content: center; }
  .steps button { padding: 7px 10px; }
  #stage { margin-top: 44px; }
  .visual { position: relative; inset: auto; display: block; margin: 0 12px 24px; }
  body[data-step="3"] #stage { display: none; }
}

/* step 2: the paddle catalogue */
body[data-step="2"] #gl, body[data-step="2"] .views, body[data-step="2"] #photo-status { visibility: hidden; }
.catalog { position: absolute; z-index: 2; margin: 0; top: calc(var(--top) + 8px); bottom: 20px; left: calc(var(--rail) + 40px); right: calc(var(--inspector) + 40px);
  display: grid; grid-template-rows: 1fr auto; gap: 12px; place-items: center; }
.catalog[hidden] { display: none; }
.catalog img { max-width: 100%; max-height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.catalog img[hidden] { display: none; }
.catalog figcaption { color: var(--muted); font-size: 13px; text-align: center; }
.family { width: 100%; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; text-align: left; border: 0; background: none;
  padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.family:hover { background: rgba(255,255,255,.05); }
.family[aria-current="true"] { background: rgba(255,255,255,.09); box-shadow: inset 2px 0 0 var(--text); }
/* the form's cut-out photo on a dark tile, as the rest of the site (the cut-out is lifted when made, so black carbon reads on it) */
.family img { width: 52px; height: 52px; border-radius: 10px; object-fit: contain; padding: 4px; background: radial-gradient(circle at 50% 30%, #34373d, #121315); border: 1px solid var(--line-2); }
.family b { display: block; font-weight: 500; font-size: 13px; }
.family small { display: block; color: var(--muted); font-size: 11.5px; }
.pad-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pad-photos figure { margin: 0; border-radius: 10px; overflow: hidden; background: #fff; }
.pad-photos img { display: block; width: 100%; aspect-ratio: 810 / 971; object-fit: contain; }
.pad-photos figcaption { padding: 4px 8px; font-size: 11px; color: #555; background: #f2f2f2; }
.pad-models { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pad-model { padding: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: none; cursor: pointer; position: relative; }
.pad-model img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.pad-model span { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(10,11,13,.75); font-size: 11px; }
.pad-model[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.chip i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
@media (max-width: 760px) {
  .catalog { position: absolute; inset: 12px; }
}
body.pads-3d[data-step="2"] #gl, body.pads-3d[data-step="2"] .views { visibility: visible; }
body.pads-3d .catalog { pointer-events: none; grid-template-rows: 1fr; align-items: end; padding-bottom: 64px; }

/* phone: everything in one column, the step buttons always at hand at the bottom */
.st-short { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar { gap: 8px; }
  #btn-shot { display: none; }
  .steps { top: var(--top); left: 8px; right: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; }
  .steps button { justify-content: center; padding: 8px 4px; font-size: 12.5px; min-width: 0; }
  .st-long { display: none; } .st-short { display: inline; }
  #stage { height: 54vh; margin-top: 46px; }
  body[data-step="2"] #stage { height: 50vh; }
  .views { left: 10px; right: 10px; transform: none; justify-content: space-between; bottom: 10px; }
  .views button { padding: 0 9px; font-size: 12px; min-width: 30px; }
  .rail { backdrop-filter: none; background: #121418; z-index: auto; }     /* a blur or a layer here would pin the bottom bar to the panel */
  .rail-head { padding: 14px 14px 8px; }
  .rail-foot { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(10, 11, 13, .92); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .rail-foot .solid, .rail-foot .ghost { height: 46px; font-size: 14px; }
  body[data-step="3"] .rail-foot { display: none; }
  .inspector { margin-bottom: 16px; }
  /* step 2 */
  .catalog { inset: 10px; }
  .family { width: auto; flex: none; grid-template-columns: 40px auto; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; }
  .family img { width: 40px; height: 40px; padding: 3px; }
  .family[aria-current="true"] { box-shadow: none; border-color: var(--text); }
  .pad-models { grid-template-columns: repeat(3, 1fr); }
  .paddle-toggle { padding: 0 14px 10px; }
  /* step 3 */
  .visual { margin: calc(var(--top) + 54px) 10px 16px; z-index: 1; }
  .visual-card { padding: 18px 16px; }
  .visual-card h2 { font-size: 27px; }
  .centre-options { grid-template-columns: 1fr; }
  .visual-actions .solid { flex: 1; justify-content: center; height: 46px; }
  /* the result window */
  dialog.viewer { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .viewer-frame { aspect-ratio: 4 / 5; max-height: calc(100dvh - 250px); }
  .viewer-foot { grid-template-columns: 1fr; padding: 12px 14px 14px; }
  .viewer-save { height: 48px; font-size: 15px; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
#pad-photos[hidden] { display: none; }


/* ================================================================ MICKEY_Performance look
   the configurator lives inside mickeyperformance.ru/steering: its dark panels, red accent, Unbounded headings,
   Manrope text and monospace capitals for the small labels */
:root {
  --bg: #0a0b0d; --bg-2: #101216; --glass: rgba(10, 11, 13, .88);
  --line: rgba(236, 240, 245, .10); --line-2: rgba(236, 240, 245, .18);
  --text: #eceff3; --muted: #9aa3ae; --dim: #80848b;
  --accent: #e2231a; --accent-soft: rgba(226, 35, 26, .14);
  --radius: 14px;
  --display: Unbounded, system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
}
#stage { background: radial-gradient(ellipse 60% 70% at 50% 42%, #3a3d42 0%, #1b1d21 45%, #0a0b0d 100%); }
.topbar { background: rgba(10, 11, 13, .96); border-bottom: 1px solid var(--line); }
.brand-text { font: 700 15px/1 var(--display); letter-spacing: -.01em; text-transform: lowercase; }
.brand-text em { color: var(--accent); font-weight: 800; }
.loader-mark { display: block; width: 96px; height: auto; margin: 0 auto; }

/* labels: monospace capitals */
.eyebrow, .rail-head, .rail-group, .panel h3, .centre-pick h3, .history h3, .spec-group, .centre-sub, .loader-inner {
  font-family: var(--mono); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.rail-head small, .panel h3 span { font-family: Manrope, system-ui, sans-serif; letter-spacing: 0; text-transform: none; }

/* headings */
.empty h1, .panel h2, .visual-card h2, .spec-inner h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; text-transform: lowercase; }
.empty h1 { font-size: 30px; line-height: 1.08; }
.empty h1 em { font-style: normal; color: var(--accent); }
.panel h2 { font-size: 22px; line-height: 1.15; }
.visual-card h2 { font-size: 24px; }

/* panels */
.rail, .inspector, .visual-card, .views, .presets, #photo-status { background: var(--glass); border-color: var(--line-2); }
.rail, .inspector, .visual-card { border-radius: var(--radius); }

/* buttons: red pill for the main action, outlined pill otherwise */
.solid { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.solid:hover { background: #f0362d; border-color: #f0362d; }
.ghost { border-color: var(--line-2); background: transparent; font-weight: 600; }
.ghost:hover { border-color: rgba(236, 240, 245, .4); }

/* options: dark tiles, the chosen one outlined red on a red tint */
.chip { border-radius: 8px; background: var(--bg-2); border-color: var(--line-2); font-weight: 600; }
.chip[aria-pressed="true"], .shape[aria-pressed="true"], .centre-option[aria-checked="true"] {
  background: var(--accent-soft); color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.presets button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.steps button i { box-shadow: inset 0 0 0 1px currentColor; }
.steps button[aria-pressed="true"] i { background: var(--accent); box-shadow: none; color: #fff; }
.views button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.part[aria-current="true"], .family[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pad-model[aria-pressed="true"], .history-item[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.centre-option { background: var(--bg-2); border-radius: 12px; }
.drop { border-color: var(--line-2); background: var(--bg-2); }

/* forged carbon chart */
.forged-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.forged-tile { aspect-ratio: 1; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; }
.forged-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#ins-forged-wrap[hidden], #pad-forged[hidden] { display: none; }

@media (max-width: 760px) {
  .brand-text { font-size: 13px; }
  .forged-grid { grid-template-columns: repeat(8, 1fr); }
  .steps button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
  .part[aria-current="true"], .family[aria-current="true"] { box-shadow: none; border-color: var(--accent); }
}

/* the tachometer's demo video: a small card over the corner of the stage, closed with × or Esc; the rest stays usable */
.tach-video { position: fixed; z-index: 30; right: calc(var(--inspector) + 36px); bottom: 20px; width: 280px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--glass); backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(0,0,0,.55); overflow: hidden; }
.tach-video[hidden] { display: none; }
.tach-video header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px 8px 14px; font-size: 12px; color: var(--muted); }
.tach-video header { cursor: grab; touch-action: none; user-select: none; }
.tach-video.dragging { box-shadow: 0 24px 60px rgba(0,0,0,.7); }
.tach-video.dragging header { cursor: grabbing; }
.tach-video header::before { content: ''; width: 14px; height: 14px; flex: none; margin-right: -2px; opacity: .55;
  background: radial-gradient(circle, currentColor 1.3px, transparent 1.6px) 0 0 / 7px 7px; }
.tach-video header button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.07); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.tach-video header button:hover { background: var(--accent-soft); }
.tach-body { position: relative; }
.tach-video video { display: block; width: 100%; aspect-ratio: 1; background: #000; cursor: pointer; }
/* the sound control: a speaker button; its slider shows after a press and fades out when nobody touches it */
.tach-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.tach-bar button { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.tach-bar button:hover { background: rgba(226,35,26,.55); }
#tach-vol { width: 120px; opacity: 0; transform: scaleX(.96); transform-origin: left; pointer-events: none; transition: opacity 180ms ease-out, transform 180ms cubic-bezier(.2, 0, 0, 1); accent-color: var(--accent); height: 20px; }
.tach-bar.show-vol #tach-vol { opacity: 1; transform: none; pointer-events: auto; }
.tach-video[data-muted="false"] #tach-vol-off, .tach-video[data-muted="true"] #tach-vol-on { display: none; }
/* where the inspector overlaps the stage, the card moves to the stage's bottom-left, clear of the panel and the view buttons */
@media (max-width: 1180px) { .tach-video { right: auto; left: calc(var(--rail) + 16px); bottom: 84px; } }
@media (max-width: 760px) { .tach-video { left: auto; right: 12px; bottom: 12px; width: 200px; } .tach-video header { padding: 4px 4px 4px 10px; } }
