/* ═══════════════════════════════════════════════════════════════
 *  iJewel3d — Wedding Band Builder (Custom UI)
 *  Design System–aligned stylesheet
 * ═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════ THEME ══════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:            #f7f5f2;
  --surface:       #ffffff;
  --surface-2:     #fbfaf7;
  --surface-3:     #f5f3ef;

  /* Foreground / Ink */
  --ink:           #1a1a1a;
  --ink-2:         #4a4a4a;
  --ink-3:         #6a6460;
  --muted:         #8a8a8a;
  --muted-2:       #a09a92;
  --muted-3:       #b0aaa2;

  /* Lines */
  --line:          #ececec;
  --line-2:        #e8e4de;
  --line-3:        #e4dfd8;
  --line-strong:   #d7d3cc;

  /* Accent — Warm Gold */
  --accent:        #8b6f3a;
  --accent-soft:   #d9c9a6;
  --accent-deep:   #6b542a;

  /* Semantic */
  --danger:        #b23b3b;
  --ok:            #3b7a5a;

  /* Shadows (warm-tinted) */
  --shadow-sm:     0 1px 2px rgba(20,18,14,.04), 0 1px 3px rgba(20,18,14,.05);
  --shadow-md:     0 4px 14px rgba(20,18,14,.08);
  --shadow-lg:     0 12px 40px rgba(20,18,14,.12);
  --shadow-active: 0 2px 8px rgba(20,18,14,.18);

  /* Radii */
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     12px;

  /* Layout */
  --panel-w:       440px;

  /* Animation */
  --ease:          cubic-bezier(.22,.61,.36,1);

  /* Typography */
  --serif:         'Cormorant Garamond', 'Times New Roman', serif;
  --sans:          'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }

/* ══════════════════════════════ LAYOUT ══════════════════════════════ */
#app { position: fixed; inset: 0; display: flex; }

#stage {
  position: relative;
  flex: 1 1 auto;
  background: radial-gradient(ellipse at 30% 20%, #fff 0%, #eee6d9 55%, #d9cdb7 100%);
  overflow: hidden;
}
#root { position: absolute; inset: 0; }

#panel {
  flex: 0 0 var(--panel-w);
  width: var(--panel-w);
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 5;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;   /* children scroll; panel itself doesn't */
  min-height: 0;
}

.panel-header, .tabs, .price-bar { flex: 0 0 auto; }

/* ══════════════════════════════ LOADING ══════════════════════════════ */
#loading {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
#loading.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.loader-ring {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin .85s linear infinite;
}
.loader-text { font-family: var(--serif); font-size: 20px; letter-spacing: .06em; color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }

.mini-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
  display: inline-block; vertical-align: -3px;
}

#build-badge {
  position: absolute; top: 16px; left: 50%;
  transform: translateX(-50%) translateY(-60px);
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(26,26,26,.88); color: #fff;
  border-radius: 999px; font-size: 12px; letter-spacing: .04em;
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: all .3s var(--ease);
  z-index: 20;
}
#build-badge.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════ HEADER ══════════════════════════════ */
.panel-header {
  padding: 16px 18px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

/* ── Band switch (Her / His) ── */
.band-switch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 5px;
  background: var(--surface-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-3);
}
.band-switch button {
  padding: 11px 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .025em;
  color: var(--muted-2);
  border-radius: 7px;
  text-align: center;
  line-height: 1;
  transition: all .2s var(--ease);
}
.band-switch button.active {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-active);
}

/* ── Diamond separator between Her & His ── */
.band-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  gap: 5px;
}
.sep-line {
  flex: 1;
  height: 1px;
  background: var(--accent-soft);
}
.sep-diamond {
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
  opacity: .75;
}

/* ── Title area ── */
.title-area {
  /* Break out of .panel-header's horizontal padding so the border-top
   * divider spans the full panel width; restore content inset internally. */
  margin: 14px -18px 0;
  padding: 16px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid #f0ece6;
}
.ring-label {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.title-row h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: .01em;
}
.title-row h1 em {
  font-style: italic;
  color: var(--accent);
}
.title-row .sku {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted-3);
  text-transform: uppercase;
  padding-bottom: 4px;
}

/* ══════════════════════════════ TABS ══════════════════════════════ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 1 0 auto;
  padding: 14px 10px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.tab.active { color: var(--ink); }
.tab.active::after {
  content: ""; position: absolute;
  left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.tab:hover:not(.active) { color: var(--ink-2); }

/* ══════════════════════════════ PANEL BODY ══════════════════════════════ */
.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 22px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.tab-pane { display: none; animation: fade .25s var(--ease); }
.tab-pane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ══════════════════════════════ FIELD ══════════════════════════════ */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.field-label {
  font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.field-value {
  font-size: 12px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.row-inline { display: flex; gap: 14px; }
.row-inline > .field { flex: 1; margin: 0; }

.dim-list { font-size: 12px; line-height: 1.8; color: var(--ink-2); }
.dim-list strong { color: var(--ink); font-weight: 500; }

/* ══════════════════════════════ OPTION GRID ══════════════════════════════ */
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
  width: 72px; padding: 10px 6px 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius-md);
  background: var(--surface);
  transition: all .15s var(--ease);
  position: relative;
}
.opt:hover:not(.active) { border-color: var(--line-strong); background: var(--surface-2); }
.opt.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.opt img { width: 70%; max-height: 60%; object-fit: contain; pointer-events: none; }
#profile-opts .opt img { transform: scaleY(-1); }
.opt.sq { aspect-ratio: 1; }
.opt .opt-lbl {
  font-size: 9px; letter-spacing: .04em;
  color: var(--ink-3); text-align: center;
  line-height: 1.2; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--sans);
}
.opt.active .opt-lbl { color: var(--ink); font-weight: 500; }
.opt .swatch-dot {
  width: 36px; height: 36px; border-radius: 50%;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.07);
}

/* ══════════════════════════════ SLOT TABS ══════════════════════════════ */
.slot-tabs {
  display: flex; gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 3px; background: var(--surface-2);
  margin-bottom: 16px;
}
.slot-tabs button {
  flex: 1;
  padding: 8px 4px;
  font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 7px;
  transition: all .2s var(--ease);
}
.slot-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.slot-tabs button:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════ SLIDER ══════════════════════════════ */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--line);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--ink); border-radius: 50%;
  cursor: pointer; border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--ink), 0 2px 4px rgba(0,0,0,.15);
  transition: transform .15s var(--ease);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--ink); border-radius: 50%;
  cursor: pointer; border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--ink), 0 2px 4px rgba(0,0,0,.15);
}
.slider:disabled { opacity: .35; cursor: not-allowed; }

/* ══════════════════════════════ TAPE RULER ══════════════════════════════ */
.tape-container {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.tape-wrap {
  position: relative;
  height: 56px;
  cursor: ew-resize;
  touch-action: none;
}
.tape-ruler {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .28;
  pointer-events: none;
  -webkit-user-drag: none;
}
.tape-clip {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 3%;
  background: linear-gradient(to right, rgba(139,111,58,.10), rgba(139,111,58,.28));
  border-right: 1.5px solid var(--accent);
  transition: width .05s linear;
}
.tape-wrap.dragging .tape-clip { transition: none; }
.tape-edge {
  position: absolute;
  right: -6px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff, var(--shadow-sm);
}

/* ── Size-system toggle (US / EU / UK) ── */
.size-system-toggle { display: flex; gap: 2px; }
.size-system-toggle button {
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  border-radius: 4px;
  transition: all .15s var(--ease);
}
.size-system-toggle button:hover:not(.active) { color: var(--ink-2); background: var(--surface-3); }
.size-system-toggle button.active { background: var(--ink); color: #fff; }

/* ══════════════════════════════ INPUTS ══════════════════════════════ */
.text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s var(--ease);
}
.text-input:focus { border-color: var(--ink); }

.select-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%238a8a8a' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  padding-right: 32px;
  transition: border-color .15s var(--ease);
}
.select-input:focus { border-color: var(--ink); }

/* ══════════════════════════════ TOGGLE ══════════════════════════════ */
.toggle-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; color: var(--ink-2); }
.toggle {
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background .2s var(--ease);
}
.toggle::after {
  content: "";
  position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.toggle.on { background: var(--ink); }
.toggle.on::after { transform: translateX(16px); }

/* ══════════════════════════════ POSES ══════════════════════════════ */
#poses-bar {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 4px;
  padding: 6px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  z-index: 12;
}
.pose {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s var(--ease);
  padding: 6px;
  -webkit-user-drag: none; user-select: none;
}
.pose img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.pose:hover { background: rgba(0,0,0,.04); }
.pose.active { background: rgba(26,26,26,.08); box-shadow: inset 0 0 0 1px var(--ink); }

/* ══════════════════════════════ LOGO ══════════════════════════════ */
#logo-overlay {
  position: absolute; top: 22px; left: 24px;
  display: flex; align-items: center; gap: 10px;
  z-index: 10;
}
#logo-overlay img { width: 28px; height: 28px; }
#logo-overlay .brand {
  font-family: var(--serif); font-size: 20px;
  color: var(--ink); letter-spacing: .03em;
}

/* ══════════════════════════════ PRICE BAR ══════════════════════════════ */
.price-bar {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 14px 20px 16px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 4;
}

/* Compact tap-bar shown only on mobile to keep panel-body roomy. */
.price-summary {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  background: none;
  cursor: pointer;
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: 4px;
}
.price-summary-label {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.price-summary-amount {
  margin-left: auto;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.price-chevron {
  width: 14px; height: 14px;
  color: var(--muted);
  transition: transform .2s var(--ease);
}
.price-bar.expanded .price-chevron { transform: rotate(180deg); }
.price-bar.expanded .price-summary-amount { display: none; }

.price-detail { display: flex; flex-direction: column; gap: 10px; }

/* ── Per-band lines ── */
.price-lines { display: flex; flex-direction: column; gap: 6px; }
.price-line {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: baseline;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.price-line-label {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: .04em;
}
.price-line-detail {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.price-line-amount {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

/* ── Total row (shown when > 1 band) ── */
.price-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 8px;
  border-top: 1px dashed var(--line-2);
}
.total-label {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.total-amount {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── Actions row ── */
.price-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.price-actions .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  font-size: 11px;
  white-space: nowrap;
}
.price-actions .btn-primary {
  margin-left: auto;
  padding: 10px 18px;
}

/* ── Buttons ── */
.btn-primary {
  padding: 10px 18px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 500;
  transition: background .2s var(--ease);
}
.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px; letter-spacing: .08em;
  color: var(--ink-2);
  text-transform: uppercase;
  transition: all .15s var(--ease);
}
.btn-ghost.full { flex: 1; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ══════════════════════════════ FIELD HINTS ══════════════════════════════ */
.field-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}
.field-hint-icon {
  width: 32px;
  height: 32px;
  opacity: .45;
}
.field-hint-text {
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1.5;
  max-width: 200px;
}

.field-disabled-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.field-disabled-hint-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .6;
}

/* ══════════════════════════════ SYMBOL GRID ══════════════════════════════ */
.symbol-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.symbol-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.symbol-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.symbol-btn:active {
  border-color: var(--ink);
  transform: scale(.95);
}

/* ══════════════════════════════ TEXT OPTION BUTTONS ══════════════════════════════ */
.opt.text-opt {
  width: auto;
  min-width: 52px;
  aspect-ratio: unset;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-2);
  text-align: center;
}
.opt.text-opt.active {
  color: var(--ink);
  font-weight: 500;
}

/* ══════════════════════════════ TOAST ══════════════════════════════ */
#toast {
  position: fixed;
  top: 18px; right: 18px;
  padding: 10px 14px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-12px);
  transition: all .25s var(--ease);
  z-index: 100; pointer-events: none;
  max-width: 320px;
}
#toast.show { opacity: 1; transform: none; }
#toast.warn { background: #8a6d1a; }
#toast.err  { background: var(--danger); }

/* ══════════════════════════════ RESPONSIVE ══════════════════════════════ */
@media (max-width: 900px) {
  :root { --panel-w: 100%; }
  #app { flex-direction: column; }
  #stage { height: 40dvh; flex: 0 0 40dvh; }
  #panel { flex: 1 1 auto; height: 60dvh; border-left: 0; border-top: 1px solid var(--line); }
  #poses-bar { bottom: 10px; }

  /* Slimmer header — drop the decorative title row to free vertical space. */
  .panel-header { padding: 8px 12px 10px; }
  .band-switch button { padding: 8px 0; font-size: 16px; }
  .title-area { display: none; }

  /* Tabs: tighter padding so they don't dominate. */
  .tabs { padding: 0 6px; }
  .tab { padding: 11px 8px; font-size: 10px; letter-spacing: .12em; }

  /* Body: smaller padding, tighter field rhythm. */
  .panel-body { padding: 14px 14px 14px; }
  .field { margin-bottom: 16px; }

  /* Collapsible price bar — by default only the summary tap-bar is visible. */
  .price-bar { padding: 8px 14px 12px; gap: 6px; }
  .price-summary { display: flex; }
  .price-detail { display: none; }
  .price-bar.expanded .price-detail { display: flex; }

  .price-line-amount { font-size: 13px; }
  .total-amount { font-size: 20px; }

  .price-actions { flex-wrap: nowrap; gap: 8px; }
  .price-actions .btn-ghost { padding: 9px 10px; }
  .price-actions .btn-primary { margin-left: auto; padding: 10px 14px; flex: 1 1 auto; }
}

/* Phones — extra compaction. */
@media (max-width: 480px) {
  #stage { height: 36dvh; flex: 0 0 36dvh; }
  #panel { height: 64dvh; }
  .opt { width: 64px; }
  .opt .swatch-dot { width: 32px; height: 32px; }
}
