/* ==========================================================================
   DIAL WORKS - builder page (build.html)
   Same look as the rest of the site: black on white, [ brackets ], // comments,
   chamfered corners, Orbitron headings + JetBrains Mono body.
   ========================================================================== */

.build-head > .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 40px; flex-wrap: wrap; padding-top: clamp(20px, 3vw, 34px); padding-bottom: clamp(16px, 2vw, 24px); }
.build-head h1 { font-size: clamp(22px, 4vw, 40px); }
.build-head p.eyebrow { margin-bottom: 12px; }
.build-head .build-lead { margin: 0 0 4px; max-width: 46ch; font-size: 13px; }

.build {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(24px, 4.4vw, 60px); align-items: start;
  padding: clamp(22px, 3vw, 36px) 0 clamp(48px, 7vw, 96px);
}
.build > * { min-width: 0; }
.build label, .build button, .build .opt, .build .gel { -webkit-tap-highlight-color: transparent; }

/* short laptop windows: lose the perks so the preview + price + button all fit without scrolling */
@media (min-width: 861px) and (max-height: 840px) {
  .perks { display: none; }
  .stage-art svg { max-height: calc(100vh - 340px); }
}

/* ---------- left: stage + buy bar ---------- */
.build-left { position: sticky; top: 82px; display: grid; gap: 14px; }

.stage { position: relative; background-color: var(--surface); border: 1px solid var(--ink); padding: 14px 16px 12px; }
/* night mode: a soft studio light behind the watch, so a black case on a black strap still reads */
html[data-theme="dark"] .stage {
  background-image:
    radial-gradient(ellipse 62% 56% at 50% 52%, rgba(214,218,226,.46) 0%, rgba(165,170,180,.27) 42%, rgba(0,0,0,0) 82%),
    radial-gradient(circle, var(--dot) 1px, transparent 1.4px);
  background-size: auto, 20px 20px;
}
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; position: relative; z-index: 3; }
.stage-fig { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stage-fig i { font-style: normal; }
.stage-tools { display: flex; gap: 8px; }
.chip-btn {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border: 1px solid var(--ink); background: var(--surface); cursor: pointer; line-height: 1;
  --cut: 6px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.chip-btn:hover { background: var(--lcd); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chip-btn:focus-visible { clip-path: none; }

.stage-art { display: grid; place-items: center; padding: 4px 0; }
.stage-art svg {
  display: block; width: auto; height: auto; max-width: 100%;
  max-height: calc(100vh - 400px); min-height: 240px; aspect-ratio: 560 / 800;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.stage-hint { margin: 2px 2px 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-height: 1.7em; }
.stage-hint::before { content: "> "; color: var(--ink); font-weight: 700; }
.stage-hint b { color: var(--ink); }

.buybar { background: var(--surface); border: 1px solid var(--ink); padding: 14px 16px 12px; display: grid; gap: 10px; }
.price-block { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.price-label::before { content: "// "; color: var(--ink); font-weight: 700; }
.price-total { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 4.2vw, 42px); line-height: 1; letter-spacing: .01em; display: inline-block; font-variant-numeric: tabular-nums; }
.price-total.bump { animation: bump .42s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.07); } 100% { transform: scale(1); } }
.price-delta { font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.price-delta.show { opacity: 1; transform: none; }
.price-delta.up { background: var(--lcd); }
.price-delta.down { background: var(--ink); color: var(--on-ink); }
.order-btn { padding: 17px 24px; font-size: 13px; }
.proc { margin: 0; font-size: 12.5px; color: var(--muted); }
.proc::before { content: "// "; color: var(--ink); font-weight: 700; }
.proc b { color: var(--ink); }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.perks li::before { content: "> "; color: var(--ink); font-weight: 700; }

/* ---------- right: includes + accordion ---------- */
.incl { border: 1px dashed var(--ink); background: var(--soft); padding: 14px 16px; margin-bottom: 14px; }
.incl .eyebrow { margin-bottom: 8px; }
.incl ul { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.incl li { padding-left: 2.2ch; position: relative; }
.incl li::before { content: "+"; position: absolute; left: 0; font-weight: 700; }
#link-notice { margin-bottom: 14px; }

.acc { border: 1px solid var(--ink); background: var(--surface); }
.acc-item + .acc-item { border-top: 1px solid var(--ink); }
.acc-h { margin: 0; font-size: inherit; letter-spacing: 0; text-transform: none; font-family: var(--mono); font-weight: 400; line-height: 1.2; }
.acc-head {
  width: 100%; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px 14px;
  text-align: left; padding: 16px 16px; background: var(--surface); border: 0; cursor: pointer; min-height: 60px;
}
.acc-head:hover { background: var(--soft); }
.acc-head:focus-visible { outline-offset: -4px; }
.acc-num { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.acc-title { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.acc-meta { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.acc-sum { font-size: 12px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.acc-price { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border: 1px solid var(--ink); display: none; }
.acc-price.on { display: inline-block; background: var(--lcd); }
.acc-chev { width: 11px; height: 11px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.is-open > .acc-h .acc-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.is-open > .acc-h .acc-head { background: var(--ink); color: var(--on-ink); }
.is-open > .acc-h .acc-num, .is-open > .acc-h .acc-sum { color: var(--on-ink-soft); }
.is-open > .acc-h .acc-chev { border-color: var(--on-ink); }
.is-open > .acc-h .acc-price { border-color: var(--on-ink); color: var(--ink); }
.is-open > .acc-h .acc-head:focus-visible { outline-color: var(--on-ink); }

.acc-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .26s ease, visibility 0s .26s; }
.is-open > .acc-panel { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .26s ease, visibility 0s; }
.acc-inner { overflow: hidden; min-height: 0; }
.acc-content { padding: 18px 16px 20px; display: grid; gap: 14px; }
.lead-s { margin: 0; font-size: 13px; color: var(--muted); }
.lead-s::before { content: "// "; color: var(--ink); font-weight: 700; }
.tip { margin: 0; font-size: 12px; color: var(--muted); }
.tip::before { content: "> "; color: var(--ink); font-weight: 700; }
.eyebrow--s { margin: 4px 0 0; font-size: 11px; }
.next-btn {
  justify-self: start; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: 10px 16px; background: var(--surface); border: 1px solid var(--ink); cursor: pointer;
}
.next-btn::after { content: " \2192"; }
.next-btn:hover { background: var(--lcd); }

/* ---------- option tiles ---------- */
.opt-grid { display: grid; gap: 10px; }
.opt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt-grid--1 { grid-template-columns: minmax(0, 1fr); }
.opt-grid--5 { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.opt-grid--decal { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }

.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.opt-box {
  position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px 8px 12px; height: 100%;
  border: 1px solid var(--ink); background: var(--surface); transition: background .12s;
}
.opt:hover .opt-box { background: var(--soft); }
.opt input:checked + .opt-box { background: var(--lcd); box-shadow: inset 0 0 0 2px var(--ink); }
.opt input:focus-visible + .opt-box { outline: 2px solid var(--ink); outline-offset: 3px; }
.opt-mark { position: absolute; top: 4px; right: 6px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.opt-mark::before { content: "[ ]"; }
.opt input:checked + .opt-box .opt-mark { color: var(--ink); }
.opt input:checked + .opt-box .opt-mark::before { content: "[x]"; }
.opt-media { display: grid; place-items: center; min-height: 44px; }
.opt-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.opt-sub { font-size: 11px; color: var(--muted); }
.opt--wide .opt-box { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; gap: 2px 14px; padding: 10px 14px; }
.opt--wide .opt-media { grid-row: 1 / span 2; }

.sw-case { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--ink); display: block; box-shadow: inset 0 0 0 4px rgba(255,255,255,.18), inset 0 -6px 8px rgba(0,0,0,.2); }
.sw-strap { width: 22px; height: 44px; border-radius: 3px; border: 1px solid var(--ink); display: block; }
.opt-media svg, .opt-media img { width: 52px; height: 52px; border-radius: 50%; display: block; }
.opt--decal .opt-box { padding: 10px 4px 8px; }
.opt--decal .opt-name { font-size: 11.5px; font-weight: 400; }
.opt--decal input:checked + .opt-box .opt-name { font-weight: 700; }

.grp { display: grid; gap: 10px; }
.grp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.grp-head b { font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.grp-price { font-size: 11px; font-weight: 700; padding: 2px 7px; border: 1px solid var(--ink); background: var(--lcd); }
.grp-blurb { font-size: 12px; color: var(--muted); }
.grp-blurb::before { content: "// "; }

.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chips-row .pill { padding: 8px 11px; font-size: 11px; }

/* custom upload row */
.custom-decal { display: grid; gap: 8px; }
.opt--custom .opt-box, .opt-box--btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; justify-items: start; text-align: left; gap: 14px; padding: 12px 14px; width: 100%; border: 1px dashed var(--ink); background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.opt--custom input:checked + .opt-box { border-style: solid; }
.opt-box--btn:hover { background: var(--soft); }
.opt-box--btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cd-thumb { width: 54px; height: 54px; border-radius: 50%; display: block; object-fit: cover; }
.cd-thumb--empty { display: grid; place-items: center; border: 1.5px dashed var(--ink); font-size: 22px; font-weight: 700; background: var(--soft); }
.cd-info { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.cd-info b { font-size: 13.5px; color: var(--ink); }
.cd-price { font-weight: 700; font-size: 12px; padding: 2px 7px; border: 1px solid var(--ink); background: var(--lcd); }
.opt--custom .opt-mark { top: 6px; right: 8px; }
.opt--custom input:checked + .opt-box .cd-price { margin-right: 26px; }
.custom-actions { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 4px 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { background: var(--lcd); }
.link-btn:disabled { opacity: .45; cursor: wait; }
.link-btn--danger { color: var(--sold); }

/* gel filters */
.gel-row { display: grid; grid-template-columns: 112px 1fr; gap: 8px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .12s, background .12s; }
.gel-row.is-active, .gel-row:hover { border-color: var(--ink); }
/* the window you're colouring gets a grey band so it's obvious which one it is */
.gel-row.is-active { background: var(--sel); box-shadow: inset 3px 0 0 var(--ink); }
.gel-row.is-off { opacity: .45; }
.gel-row.is-off .gel, .gel-row.is-off .gel input { cursor: not-allowed; }
.gel-row.is-off .gel:hover .gel-dot { transform: none; }
.gel-row--all { border-style: dashed; border-color: var(--ink); }
.gel-label { display: grid; gap: 0; line-height: 1.35; }
.gel-label b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; }
.gel-label span { font-size: 11px; color: var(--muted); }
.gel-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.gel { position: relative; display: block; cursor: pointer; }
.gel input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.gel-dot { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 1px solid var(--ink); box-shadow: inset 0 0 0 2px var(--surface); transition: transform .12s; }
.gel-dot--none { background: repeating-linear-gradient(135deg, var(--soft) 0 4px, var(--line) 4px 8px); }
.gel:hover .gel-dot { transform: scale(1.1); }
.gel input:checked + .gel-dot { box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--ink); transform: scale(1.04); }
.gel input:focus-visible + .gel-dot { outline: 2px solid var(--ink); outline-offset: 4px; }
.gel-name { margin: 0; font-size: 11.5px; color: var(--muted); }
.gel-name::before { content: "> "; color: var(--ink); font-weight: 700; }

/* text toggle */
.toggle { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--ink); cursor: pointer; position: relative; }
.toggle:hover { background: var(--soft); }
.toggle input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-track { width: 50px; height: 28px; border: 2px solid var(--ink); background: var(--surface); position: relative; display: block; transition: background .15s; }
.toggle-track i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--ink); transition: transform .18s; }
.toggle input:checked ~ .toggle-track { background: var(--lcd); }
.toggle input:checked ~ .toggle-track i { transform: translateX(22px); }
.toggle input:focus-visible ~ .toggle-track { outline: 2px solid var(--ink); outline-offset: 4px; }
.toggle-copy { display: grid; gap: 2px; }
.toggle-copy b { font-size: 13.5px; }
.toggle-copy span { font-size: 12px; color: var(--muted); }
.toggle-price { font-weight: 700; font-size: 12px; padding: 2px 7px; border: 1px solid var(--ink); background: var(--lcd); }


/* ---------- summary ---------- */
.summary { margin-top: 22px; border: 1px solid var(--ink); background: var(--surface); padding: 18px 16px 16px; }
.summary .eyebrow { margin-bottom: 10px; }
.sum { margin: 0; border-top: 1px solid var(--ink); }
.sum > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sum dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.sum dd { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.sum dd em { font-style: normal; font-weight: 700; white-space: nowrap; font-size: 12px; color: var(--muted); }
.sum .is-paid dd em { color: var(--ink); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 2px; }
.sum-total span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sum-total b { font-family: var(--display); font-size: 26px; font-weight: 900; }
.fine { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
#fine { margin-top: 16px; }

/* ---------- dialogs ---------- */
.dlg { border: 1px solid var(--ink); padding: 0; background: var(--surface); color: var(--ink); width: min(94vw, 460px); max-height: 92vh; overflow: auto; box-shadow: 10px 10px 0 var(--hard-shadow); }
.dlg--wide { width: min(94vw, 560px); }
.dlg::backdrop { background: var(--scrim); }
.dlg-body { padding: clamp(18px, 4vw, 26px); display: grid; gap: 12px; }
.dlg-body h2 { font-size: clamp(20px, 5vw, 28px); font-weight: 900; justify-self: start; padding: .1em .6em; margin: 4px 0 4px; }
.dlg-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.dlg-note--warn { color: var(--sold); }
.dlg-actions { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; }
.dlg-actions--col { display: grid; gap: 10px; }
.dlg-extras { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.steps { margin: 0; padding-left: 1.4em; font-size: 13px; display: grid; gap: 6px; }
.sum--dlg > div { grid-template-columns: 112px 1fr; padding: 6px 0; }
.dlg .fine { margin: 0; }
.crop-view { justify-self: center; width: min(100%, 300px); aspect-ratio: 1; border: 1px solid var(--ink); background: var(--lcd); touch-action: none; cursor: grab; position: relative; }
.crop-view.is-drag { cursor: grabbing; }
.crop-view canvas { display: block; width: 100%; height: 100%; }
.crop-view:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.crop-zoom { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.crop-zoom input { width: 100%; accent-color: var(--ink); min-height: 32px; }

/* ---------- tablet / phone ---------- */
@media (max-width: 1060px) {
  .build { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .acc-head { grid-template-columns: auto 1fr auto; }
  .acc-meta { grid-column: 2 / 3; grid-row: 2; justify-content: flex-start; }
  .acc-chev { grid-row: 1 / span 2; grid-column: 3; }
  .acc-sum { text-align: left; }
  .opt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .build-head .build-lead { display: none; }
  .build-head > .wrap { padding-top: 18px; padding-bottom: 14px; }
  .build { display: block; padding-top: 0; }
  .build-left { display: contents; }
  body[data-page="build"] .site-header { position: relative; }
  .stage { position: sticky; top: 0; z-index: 20; padding: 8px 12px 6px; margin: 0 calc(var(--gutter) * -1); border-left: 0; border-right: 0; border-top: 0; background-color: var(--surface); }
  .stage::after { display: none; }
  .stage-bar { position: absolute; top: 8px; left: 12px; right: 12px; margin: 0; pointer-events: none; }
  .stage-bar > * { pointer-events: auto; }
  .stage-fig { display: none; }
  .stage-tools { margin-left: auto; flex-direction: column; align-items: flex-end; gap: 6px; }
  .stage-art svg { max-height: 34vh; min-height: 200px; }
  .stage-hint { display: none; }
  .build-right { padding-top: 18px; }
  .buybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; border: 0; border-top: 1px solid var(--ink);
    grid-template-columns: 1fr auto; align-items: center; gap: 4px 14px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(5,5,5,.12);
  }
  .price-block { gap: 0 10px; align-items: center; }
  .price-label { width: 100%; font-size: 10px; }
  .price-total { font-size: 28px; }
  .order-btn { padding: 15px 18px; width: auto; }
  .proc { grid-column: 1 / -1; font-size: 11.5px; }
  .perks { display: none; }
  .build-right { padding-bottom: 150px; }
  .acc-head { padding: 14px; }
  .opt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .gel-row { grid-template-columns: 1fr; }
  .gel-label { display: flex; gap: 10px; align-items: baseline; }
  .sum > div { grid-template-columns: 1fr; gap: 2px; }
  .sum--dlg > div { grid-template-columns: 92px 1fr; gap: 8px; }
  .sum--dlg dt { font-size: 10px; letter-spacing: .08em; }
  .opt-grid--decal { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .opt-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toggle { grid-template-columns: auto 1fr; }
  .toggle-price { grid-column: 2; justify-self: start; }
  .opt--custom .opt-box, .opt-box--btn { grid-template-columns: auto 1fr; }
  .cd-price { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .acc-panel, .is-open > .acc-panel, .acc-chev, .toggle-track i, .gel-dot { transition: none; }
  .price-total.bump { animation: none; }
}
