/* THE WEB CONFIGURATOR. Object left, steps right, price bar pinned. On a phone the
   object sits on top and the steps scroll under it. Same dark studio tokens the Studio
   editor uses (skin/hoodie.css reads them), Nunito like the rest of the site. */
.cfg {
  --accent: #FEC710; --accent-ink: #17130a; --ink: #f2f2f2; --dim: #b8b5ad;
  --panel-2: #1a1b1f; --panel-3: #26282d; --ground: #101114;
  --warn: #ffb020;   /* caution text on --ground, measured 10.4:1 */
  --e-1: 0 6px 18px rgba(0,0,0,0.35); --e-2: 0 20px 50px rgba(0,0,0,0.45); --s-3: 12px; --s-4: 18px;
  color: var(--ink); background: var(--ground); font-family: var(--font, "Nunito", ui-rounded, system-ui, sans-serif);
  display: grid; grid-template-columns: minmax(0, 58fr) minmax(360px, 42fr); grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100dvh - var(--cfg-top, 64px)); min-height: 560px;
}
.cfg > * { min-width: 0; }
.cfg-stage-wrap { position: relative; grid-row: 1; grid-column: 1; overflow: hidden; background: radial-gradient(120% 90% at 50% 25%, rgba(255,255,255,0.07), transparent 60%), var(--panel-2); }
.cfg-view { position: absolute; inset: 0; }
.cfg-view canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.cfg-view.relief-view-flat::after { content: 'No 3D on this device. The emblem canvas in step 2 is exact.'; position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--dim); }
.cfg-overlay-tl { position: absolute; top: 14px; left: 14px; }
.cfg-overlay-tr { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.cfg-hint { position: absolute; left: 14px; bottom: 10px; margin: 0; font-size: 12px; color: #c3c0b8; pointer-events: none; }
.cfg-icon { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(38,40,45,0.9); color: var(--ink); cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
.cfg-icon svg { width: 22px; height: 22px; fill: currentColor; }
.cfg-icon[disabled] { opacity: .35; cursor: default; }
.cfg-icon:focus-visible, .cfg-tab:focus-visible, .cfg-frame:focus-visible, .cfg-chip:focus-visible, .cfg-swatch:focus-visible, .cfg-pair:focus-visible, .cfg-next:focus-visible, .cfg-ghost:focus-visible, .cfg-buy:focus-visible, .cfg input:focus-visible, .cfg select:focus-visible, .cfg .stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cfg-tier { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 12px; font-weight: 800; }
.cfg-tier[data-tone="good"], .cfg-verdict[data-tone="good"] strong { background: var(--accent); color: var(--accent-ink); }
.cfg-tier[data-tone="warn"], .cfg-verdict[data-tone="warn"] strong { background: #f0a234; color: #1b1203; }
.cfg-tier[data-tone="wait"], .cfg-verdict[data-tone="wait"] strong { background: var(--panel-3); color: var(--dim); }

.cfg-panel { grid-row: 1; grid-column: 2; overflow: auto; padding: 18px 22px 28px; background: var(--ground); display: flex; flex-direction: column; gap: 14px; }
.cfg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cfg-tab { min-width: 0; min-height: 44px; border: 0; border-radius: 12px; background: var(--panel-2); color: var(--dim); font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cfg-tab .n { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-3); color: var(--ink); display: grid; place-items: center; font-size: 12px; }
.cfg-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.cfg-tab[aria-selected="true"] .n { background: var(--accent-ink); color: var(--accent); }
.cfg-step { display: flex; flex-direction: column; gap: 12px; }
.cfg-step h3:focus { outline: none; }
.cfg-step h3:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .cfg-step { transition: opacity 140ms ease; }
  .cfg-step.is-leaving { opacity: 0; }
}
/* The canvas, and what to do with it when it is still empty. */
.cfg-canvas-wrap { position: relative; }
.cfg-empty[hidden] { display: none; }
.cfg-empty { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(92%, 420px); margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(16,17,20,0.82); color: var(--dim); font-size: 14px; text-align: center; pointer-events: none; }
/* The object on the Review step: the same view, held still. */
.cfg-shot { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--panel-2); }
.cfg-step h3 { margin: 6px 0 0; font-size: 1.35rem; }
.cfg-step h4 { margin: 8px 0 0; font-size: .95rem; color: var(--dim); }
.cfg-hint-text { margin: 0; color: var(--dim); }
.cfg-err { margin: 0; color: #ff8a8a; min-height: 1.2em; }

.cfg-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cfg-frame { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px; min-height: 64px; border: 0; border-radius: 14px; background: var(--panel-2); color: var(--ink); cursor: pointer; font: inherit; box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.cfg-frame svg { grid-row: 1 / 3; width: 30px; height: 30px; fill: currentColor; }
.cfg-frame strong { font-size: .98rem; }
.cfg-frame small { color: var(--dim); font-size: .78rem; line-height: 1.2; }
.cfg-frame[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.cfg-frame[aria-checked="true"] small { color: #4a3d0d; }

.cfg-canvas { width: 100%; aspect-ratio: 11 / 10; }
.cfg-add { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-chip { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--panel-3); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; position: relative; }
.cfg-chip:hover { background: #2f3138; }
.cfg-danger { color: #ff9a9a; }
.cfg-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cfg-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cfg-layer { display: flex; flex-direction: column; gap: 10px; }
.cfg-field { display: flex; flex-direction: column; gap: 6px; }
.cfg-field > span, .cfg-range > span { font-size: 13px; color: var(--dim); }
.cfg-field input, .cfg-field select { height: 44px; border-radius: 12px; border: 0; padding: 0 14px; background: var(--panel-3); color: var(--ink); font: inherit; font-size: 16px; }
.cfg-range { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.cfg-range input[type="range"] { width: 100%; height: 44px; accent-color: var(--accent); }

.cfg-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; border: 0; border-radius: 12px; background: var(--panel-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.cfg-swatch i { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.cfg-swatch[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.cfg-swatch[disabled] { opacity: .35; cursor: not-allowed; }
.cfg-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.cfg-pair { display: grid; grid-template-columns: 22px 22px 1fr; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--panel-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.cfg-pair i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.cfg-pair .a { background: var(--a); } .cfg-pair .b { background: var(--b); }

.cfg-verdict { padding: 14px 16px; border-radius: 14px; background: var(--panel-2); }
.cfg-verdict strong { display: inline-block; padding: 6px 12px; border-radius: 10px; margin-bottom: 8px; }
.cfg-verdict p { margin: 4px 0 0; color: var(--dim); }
.cfg-summary { margin: 0; padding-left: 18px; color: var(--ink); }
.cfg-summary li + li { margin-top: 4px; }
.cfg-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.cfg-next, .cfg-ghost, .cfg-buy { min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.cfg-next { background: var(--accent); color: var(--accent-ink); margin-left: auto; box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 6px 18px rgba(254,199,16,0.25); }
.cfg-ghost { background: var(--panel-3); color: var(--ink); }

.cfg-bar { grid-row: 2; grid-column: 1 / 3; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 12px 22px; background: var(--panel-2); box-shadow: 0 -10px 30px rgba(0,0,0,0.35); }
.cfg-price { display: flex; flex-direction: column; line-height: 1.1; }
.cfg-price strong { font-size: 1.35rem; }
.cfg-price span { font-size: 12px; color: var(--dim); }
.cfg-tier-line { font-size: 14px; color: var(--dim); }
.cfg-tier-line[data-tone="warn"] { color: #f6c37a; }
.cfg-buy { background: var(--accent); color: var(--accent-ink); padding: 0 26px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 6px 18px rgba(254,199,16,0.28); }
.cfg-buy[disabled] { cursor: wait; opacity: .85; }

@media (max-width: 900px) {
  .cfg { grid-template-columns: 1fr; grid-template-rows: 46vh minmax(0, 1fr) auto; height: auto; min-height: calc(100dvh - var(--cfg-top, 64px)); }
  .cfg-stage-wrap { grid-row: 1; grid-column: 1; position: sticky; top: var(--cfg-top, 64px); z-index: 2; height: 46vh; }
  .cfg-panel { grid-row: 2; grid-column: 1; overflow: visible; }
  .cfg-bar { grid-row: 3; grid-column: 1; position: sticky; bottom: 0; z-index: 3; grid-template-columns: auto 1fr auto; }
  .cfg-tier-line { display: none; }
  .cfg-tab span:not(.n) { font-size: 13px; }
  .cfg-bar { grid-template-columns: auto 1fr auto; padding: 10px 14px; }
  .cfg-panel { padding: 16px 14px 24px; }
}
@media (max-width: 460px) {
  /* Four tabs cannot hold a 44px target and a word on a phone: two rows of two. */
  .cfg-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* auto-fill with a ZERO minimum packs as many columns as will fit, which is all six:
     they collapsed to 24px wide and the labels spilled out of their own boxes. Two, like the tabs. */
  .cfg-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfg-buy { padding: 0 18px; }
  .cfg-price strong { font-size: 1.15rem; }
}

/* A character the subsetted fonts cannot draw. Stated where the typing happens, in the
   editor's own warning tone, and empty (so invisible) whenever the text is fine. */
.cfg-charwarn:empty { margin: 0; }   /* collapse, do NOT display:none: a live region that is
                                        not rendered may never announce when it fills */
.cfg-charwarn { margin: 6px 0 0; color: var(--warn); font-size: .84rem; line-height: 1.35; }

/* The pieces on the chest, so nothing is reachable only by hitting a 3D target. */
.cfg-pieces { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.cfg-pieces:empty { display: none; }
.cfg-piece { display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--panel-3); border-radius: 12px; background: var(--panel-2); color: var(--ink);
  font: inherit; cursor: pointer; }
.cfg-piece[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cfg-piece-kind { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.cfg-piece-name { font-weight: 800; }
