/* ─────────────────────────────────────────────────────────────────────
   panel.css — LobbyPanel dedicated builder page
   Big preview LEFT · stacked options rail RIGHT
   Reuses .seg / .seg-btn / .item-card / .upload-quality from lobby.css
   ───────────────────────────────────────────────────────────────────── */

/* ── Brand tokens (mirrors styles.css for safety on /panel.html) ── */
:root {
  --panel-bg:        #FAF7F2;   /* cream */
  --panel-surface:   #FFFFFF;
  --panel-ink:       #0A1226;   /* navy */
  --panel-ink-soft:  rgba(10, 18, 38, 0.66);
  --panel-ink-faint: rgba(10, 18, 38, 0.42);
  --panel-line:      rgba(10, 18, 38, 0.10);
  --panel-line-strong: rgba(10, 18, 38, 0.18);
  --panel-red:       #E81820;   /* signal red */
  --panel-red-deep:  #B8121A;
  --panel-shadow-sm: 0 1px 2px rgba(10,18,38,0.06), 0 1px 1px rgba(10,18,38,0.04);
  --panel-shadow-md: 0 4px 14px rgba(10,18,38,0.08), 0 1px 3px rgba(10,18,38,0.06);
  --panel-shadow-lg: 0 14px 44px rgba(10,18,38,0.14), 0 4px 10px rgba(10,18,38,0.06);
  --panel-radius:    14px;
  --panel-radius-sm: 10px;
  /* Global builder UI scale — matches the approved Beacon/Lobby Logo builder.
     Bumps typography, control/card spacing, the right rail, and the estimate
     card by ~16% without a transform/zoom hack (those break sticky cards). */
  --ui-scale: 1.16;
}

/* ── Page chrome ─────────────────────────────────────────────────── */
body.panel-page {
  margin: 0;
  background: var(--panel-bg);
  color: var(--panel-ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: 'ss01', 'cv02', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.panel-shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: calc(18px * var(--ui-scale)) calc(28px * var(--ui-scale)) 40px;
  display: flex;
  flex-direction: column;
  gap: calc(18px * var(--ui-scale));
  min-height: 100vh;
  box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────────────── */
.panel-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--panel-line);
}

/* .panel-header--slim: chrome (logo + cart + account) has been moved to
   the sitewide Gallery header (fixed-position, in the top corners). The
   in-page header now just carries the product name + tagline. The top
   padding creates clearance so the sitewide chrome doesn't overlap this
   block. Selector uses .panel-header.panel-header--slim so it wins the
   specificity fight with .panel-header.is-lg (both 0-2-0). */
.panel-header.panel-header--slim,
.panel-header.is-lg.panel-header--slim {
  grid-template-columns: 1fr;
  padding: 96px 0 20px; /* top clearance for the 72px fixed .legal-logo */
}
@media (max-width: 600px) {
  /* On phones the fixed chrome is smaller (42px hamburger at top:10),
     so less clearance is needed. */
  .panel-header.panel-header--slim,
  .panel-header.is-lg.panel-header--slim {
    padding: 64px 0 16px;
  }
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--panel-ink);
}

.brand-logo {
  width: 44px;
  height: 14px;
  display: block;
}

.brand-logo-v2 {
  width: auto;
  height: 36px;
  display: block;
  object-fit: contain;
}
@media (max-width: 720px) {
  .brand-logo-v2 { height: 30px; }
}

/* ── Larger header — CrispSign brand treatment ───────────────────────
   Display type = Space Grotesk (brand --font-display), product name in
   brand navy, descriptor muted, with a thin brand divider between the
   logo lockup and the title. Mirrors the approved LobbyLogo direction. */
.panel-header.is-lg {
  gap: 20px;
  padding: 10px 0 20px;
}
.panel-header.is-lg .brand-logo-v2 { height: calc(58px * var(--ui-scale)); }
@media (max-width: 900px) {
  .panel-header.is-lg .brand-logo-v2 { height: 42px; }
}

.panel-header-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--panel-line);
}
.panel-header.is-lg .panel-header-eyebrow {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: calc(25px * var(--ui-scale));
  letter-spacing: -0.015em;
  color: var(--panel-ink-faint);
  line-height: 1.1;
  font-weight: 500;
}
.panel-header.is-lg .panel-header-eyebrow strong {
  color: var(--panel-ink);
  font-size: calc(26px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel-header.is-lg .panel-header-eyebrow .muted {
  font-weight: 500;
  color: var(--panel-ink-faint);
}
.panel-header-tagline {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: calc(13px * var(--ui-scale));
  color: var(--panel-ink-faint);
  letter-spacing: 0.005em;
}
@media (max-width: 900px) {
  .panel-header-title { padding-left: 14px; }
  .panel-header.is-lg .panel-header-eyebrow { font-size: 18px; }
  .panel-header.is-lg .panel-header-eyebrow strong { font-size: 19px; }
  .panel-header-tagline { display: none; }
}

.brand-wordmark {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 18px;
  color: var(--panel-ink);
}

.panel-header-eyebrow {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--panel-ink-soft);
}
.panel-header-eyebrow strong {
  color: var(--panel-ink);
  font-weight: 700;
  letter-spacing: -0.005em;
}
.panel-header-eyebrow .muted { color: var(--panel-ink-faint); }

.panel-header-right { display: flex; gap: 14px; align-items: center; }

.panel-header-link {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 600;
  color: var(--panel-ink);
  text-decoration: none;
  padding: calc(8px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border-radius: 999px;
  border: 1px solid var(--panel-line-strong);
  background: var(--panel-surface);
  transition: background 120ms ease, border-color 120ms ease;
}
.panel-header-link:hover { background: #F1ECE3; border-color: var(--panel-ink); }

/* ── Header account / sign-in control (right side) ───────────────── */
.panel-header-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: calc(14px * var(--ui-scale));
  font-weight: 600;
  color: var(--panel-ink);
  text-decoration: none;
  padding: calc(9px * var(--ui-scale)) calc(16px * var(--ui-scale));
  border-radius: 999px;
  border: 1px solid var(--panel-line-strong);
  background: var(--panel-surface);
  max-width: 220px;
  transition: background 120ms ease, border-color 120ms ease;
}
.panel-header-account:hover { background: #F1ECE3; border-color: var(--panel-ink); }
.panel-header-account.is-signed-in {
  background: var(--panel-ink);
  color: #fff;
  border-color: var(--panel-ink);
}
.panel-header-account.is-signed-in:hover { background: #0c1730; }
.panel-header-account-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.panel-header-account-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .panel-header-account { padding: 8px 12px; font-size: 13px; max-width: 150px; }
}

/* ── Header cart control (right side) — icon + live item count ───── */
.panel-header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(44px * var(--ui-scale));
  height: calc(44px * var(--ui-scale));
  color: var(--panel-ink);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--panel-line-strong);
  background: var(--panel-surface);
  transition: background 120ms ease, border-color 120ms ease;
}
.panel-header-cart:hover { background: #F1ECE3; border-color: var(--panel-ink); }
.panel-header-cart-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.panel-header-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--panel-red);
  border-radius: 999px;
  box-sizing: border-box;
}
.panel-header-cart.has-items .panel-header-cart-count { display: inline-flex; }
@media (max-width: 900px) {
  .panel-header-cart { width: 40px; height: 40px; }
}

/* ── Two-column grid ─────────────────────────────────────────────── */
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(420px * var(--ui-scale));
  gap: calc(24px * var(--ui-scale));
  align-items: start;
  flex: 1;
}

/* ── LEFT: big clean preview canvas ──────────────────────────────── */
.panel-canvas {
  position: sticky;
  top: 16px;
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: var(--panel-radius);
  padding: 18px 18px 14px;
  box-shadow: var(--panel-shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(560px * var(--ui-scale));
}

.panel-canvas-pill {
  align-self: flex-start;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--panel-ink-soft);
  background: #F1ECE3;
  padding: 5px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.panel-canvas-stage {
  position: relative;
  flex: 1;
  min-height: calc(520px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  /* Neutral canvas frame; the SVG paints its own subtle measuring grid on top. */
  background: #fbfcfe;
  border-radius: var(--panel-radius-sm);
  border: 1px solid var(--panel-line);
  overflow: hidden;
}
.panel-canvas-svg {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.panel-canvas-stage svg { max-width: 100%; max-height: calc(560px * var(--ui-scale)); height: auto; }

/* ── In-canvas upload button — floats bottom-right over the live design area.
   Proxies to the same #panelArtwork input as the rail CTA (shared handler). ── */
.panel-stage-upload {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--panel-red);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(232,24,32,0.30), 0 1px 2px rgba(10,18,38,0.12);
  transition: background 140ms ease, transform 80ms ease;
}
.panel-stage-upload:hover { background: var(--panel-red-deep); }
.panel-stage-upload:active { transform: translateY(1px); }
.panel-stage-upload svg { width: 16px; height: 16px; flex-shrink: 0; }

.panel-canvas-help {
  font-size: 12px;
  color: var(--panel-ink-soft);
  text-align: center;
  padding: 4px 8px 2px;
  line-height: 1.45;
}
.panel-canvas-help strong { color: var(--panel-ink); font-weight: 600; }

/* ── Primary upload CTA — lives in the rail "Your artwork" section ── */
.panel-canvas-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: calc(12px * var(--ui-scale)) calc(18px * var(--ui-scale));
  font-family: inherit;
  font-size: calc(15px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--panel-red);
  border: 0;
  border-radius: var(--panel-radius-sm);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(232,24,32,0.28);
  transition: background 140ms ease, transform 80ms ease;
}
.panel-canvas-upload:hover { background: var(--panel-red-deep); }
.panel-canvas-upload:active { transform: translateY(1px); }
.panel-canvas-upload svg { width: 18px; height: 18px; flex-shrink: 0; }
/* In-rail placement: prominent button directly under the section sub-text,
   above the file-requirements details + dropzone. */
.rail-upload-cta { margin: 0 0 12px; }

/* Sample note sits inside the preview help block (text only — not a banner). */
.panel-canvas-sample-note {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--panel-ink-soft);
}
.panel-canvas-sample-note strong { color: var(--panel-ink); font-weight: 700; }
.panel-canvas-sample-note em { font-style: normal; font-weight: 700; color: var(--panel-ink); }

/* ── RIGHT: stacked option rail ──────────────────────────────────── */
.panel-rail {
  display: flex;
  flex-direction: column;
  gap: calc(14px * var(--ui-scale));
  min-width: 0;
}

.rail-section {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: var(--panel-radius);
  padding: calc(16px * var(--ui-scale)) calc(16px * var(--ui-scale)) calc(18px * var(--ui-scale));
  box-shadow: var(--panel-shadow-sm);
}

.rail-label {
  margin: 0 0 4px;
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--panel-ink);
}

.rail-sub {
  margin: 0 0 12px;
  font-size: calc(13px * var(--ui-scale));
  line-height: 1.45;
  color: var(--panel-ink-soft);
}

/* Locked-spec line for material/thickness (v1 ships 3/16″ only) */
.rail-spec-line {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--panel-ink-soft);
  background: rgba(232, 24, 32, 0.04);
  border: 1px solid rgba(232, 24, 32, 0.18);
  border-radius: 6px;
}
.rail-spec-line strong { color: var(--panel-ink); font-weight: 700; }

/* Sub-step (e.g. standoff position appears after standoff color) */
.rail-substep {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--panel-line);
}

.rail-cap {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--panel-ink-faint);
  margin-bottom: 8px;
}

/* ── Size inputs (W × H) ─────────────────────────────────────────── */
.size-inputs {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.size-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.size-cap {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--panel-ink-faint);
}

.size-input input[type="number"] {
  width: 100%;
  padding: 10px 36px 10px 12px;
  font-size: calc(17px * var(--ui-scale));
  font-weight: 600;
  color: var(--panel-ink);
  background: var(--panel-bg);
  border: 1px solid var(--panel-line-strong);
  border-radius: var(--panel-radius-sm);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}
.size-input input[type="number"]:focus {
  outline: none;
  border-color: var(--panel-ink);
  background: var(--panel-surface);
}
/* hide number spinners for a cleaner look */
.size-input input[type="number"]::-webkit-outer-spin-button,
.size-input input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.size-input input[type="number"] { -moz-appearance: textfield; }

.size-unit {
  position: absolute;
  right: 12px;
  bottom: 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--panel-ink-faint);
  pointer-events: none;
  letter-spacing: 0.02em;
}

.size-x {
  display: block;
  font-size: 22px;
  font-weight: 400;
  color: var(--panel-ink-faint);
  padding-bottom: 12px;
  user-select: none;
}

/* Size presets grid */
.size-presets {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
.size-presets .seg-btn { padding: 9px 6px !important; font-size: 13px !important; }

/* ── Details (collapsible specs) ─────────────────────────────────── */
.rail-details {
  margin: 6px 0 12px;
  padding: 0;
  border: 1px dashed var(--panel-line-strong);
  border-radius: var(--panel-radius-sm);
  background: var(--panel-bg);
}
.rail-details summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--panel-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rail-details summary::-webkit-details-marker { display: none; }
.rail-details summary::before {
  content: '+';
  display: inline-block;
  width: 14px;
  font-weight: 700;
  color: var(--panel-red);
  font-size: 14px;
  line-height: 1;
}
.rail-details[open] summary::before { content: '−'; }
.rail-details[open] summary { border-bottom: 1px dashed var(--panel-line-strong); }

.rail-spec-list {
  margin: 0;
  padding: 10px 14px 12px 28px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--panel-ink-soft);
}
.rail-spec-list li { margin: 2px 0; }
.rail-spec-list strong { color: var(--panel-ink); font-weight: 700; }

/* ── Upload drop zone ────────────────────────────────────────────── */
.upload-drop {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--panel-bg);
  border: 1.5px dashed var(--panel-line-strong);
  border-radius: var(--panel-radius-sm);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.upload-drop:hover,
.upload-drop:focus-within {
  border-color: var(--panel-ink);
  background: #F8F5EF;
}
.upload-drop.is-dragover {
  border-color: var(--panel-red);
  background: #FFF6F6;
}
.upload-drop.has-file {
  border-style: solid;
  border-color: var(--panel-ink);
  background: var(--panel-surface);
}

.upload-drop .upload-icon {
  width: 28px;
  height: 28px;
  color: var(--panel-ink-soft);
  flex-shrink: 0;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--panel-ink-soft);
  line-height: 1.4;
  min-width: 0;
}
.upload-text strong {
  color: var(--panel-ink);
  font-weight: 600;
  font-size: 13px;
}
.upload-text #panelArtworkMeta {
  font-size: 11px;
  color: var(--panel-ink-faint);
  letter-spacing: 0.01em;
}

.upload-clear {
  background: rgba(10,18,38,0.06);
  color: var(--panel-ink);
  border: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 120ms ease;
}
.upload-clear:hover { background: rgba(10,18,38,0.14); }

/* ── Buy section ─────────────────────────────────────────────────── */
.rail-buy {
  background: var(--panel-ink);
  color: #fff;
  border-radius: var(--panel-radius);
  padding: calc(18px * var(--ui-scale));
  box-shadow: var(--panel-shadow-lg);
  /* Rest in normal flow so the opaque card never floats over the artwork/config
     controls above it. Static at all breakpoints — this is the only price/CTA on
     the page (no dedicated .auto-sticky-bar), so pinning it caused the overlap. */
  position: relative;
  z-index: 1;
}

.rail-buy-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.rail-buy-price { display: flex; flex-direction: column; gap: 2px; }

.rail-buy-cap {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  font-weight: 700;
}

.rail-buy-amount {
  font-size: calc(32px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.rail-buy-meta {
  margin-top: 6px;
  font-size: calc(12px * var(--ui-scale));
  line-height: 1.5;
  color: rgba(255,255,255,0.70);
  min-height: 18px;
}

.rail-buy-cta {
  margin-top: 14px;
  width: 100%;
  padding: calc(14px * var(--ui-scale)) calc(16px * var(--ui-scale));
  background: var(--panel-red);
  color: #fff;
  font-family: inherit;
  font-size: calc(16px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 0;
  border-radius: var(--panel-radius-sm);
  cursor: pointer;
  transition: background 140ms ease, transform 80ms ease;
  box-shadow: 0 6px 18px rgba(232,24,32,0.32);
}
.rail-buy-cta:hover { background: var(--panel-red-deep); }
.rail-buy-cta:active { transform: translateY(1px); }
.rail-buy-cta:disabled {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.55);
  box-shadow: none;
  cursor: not-allowed;
}

.rail-buy-fineprint {
  margin: 10px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.4;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.panel-footer {
  margin-top: 8px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--panel-line);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--panel-ink-faint);
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────────
   Tablet (≤1180px) — slightly narrower rail
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  /* Tablet: ease the scale a touch and keep the rail proportional so the
     preview column can't be squeezed into overflow at this width. */
  body.panel-page { --ui-scale: 1.08; }
  .panel-grid { grid-template-columns: minmax(0, 1fr) calc(380px * var(--ui-scale)); gap: calc(18px * var(--ui-scale)); }
  .panel-shell { padding: calc(16px * var(--ui-scale)) 20px 32px; }
}

/* ─────────────────────────────────────────────────────────────────
   Mobile (≤900px) — preview on top, rail below
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* On phones the layout is single-column and space is tight — drop back to
     the hand-tuned 1× sizes so the scaled desktop rail can't cause overflow. */
  body.panel-page { --ui-scale: 1; }

  .panel-shell { padding: 12px 14px 28px; gap: 14px; }

  .panel-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 6px;
    column-gap: 10px;
    align-items: center;
  }
  .panel-header .brand-mark { min-width: 0; }
  .panel-header .brand-logo-v2 { height: 28px; max-width: 150px; }
  .panel-header.is-lg {
    gap: 8px 10px;
    padding: 8px 0 14px;
  }
  .panel-header.is-lg .brand-logo-v2 { height: 34px; max-width: 160px; }
  .panel-header-title {
    grid-column: 1 / -1;
    order: 3;
    padding-left: 0;
    border-left: 0;
    gap: 3px;
    min-width: 0;
  }
  .panel-header.is-lg .panel-header-eyebrow,
  .panel-header.is-lg .panel-header-eyebrow strong {
    font-size: 16px;
  }
  .panel-header-eyebrow { grid-column: 1 / -1; order: 3; font-size: 12px; }
  .panel-header-right {
    justify-self: end;
    gap: 8px;
    min-width: 0;
  }
  .panel-header-account {
    max-width: 112px;
    height: 38px;
    padding: 7px 10px;
  }
  .panel-header-account-icon { width: 16px; height: 16px; }
  .panel-header-cart { width: 38px; height: 38px; }

  .panel-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel-canvas {
    position: static;
    display: block;
    min-height: 320px;
    padding: 12px 12px 10px;
    overflow: visible;
  }
  .panel-canvas-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: 360px;
    padding: 6px;
    overflow: hidden;
  }
  .panel-canvas-stage svg {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 330px;
  }
  .panel-canvas-svg,
  .lobby-generic-preview,
  .lobby-panel-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 260px;
  }
  .panel-canvas-help { font-size: 11px; }

  .rail-section { padding: 14px 14px 16px; }
  .rail-label { font-size: 12px; }
  .rail-sub { font-size: 12px; }

  .size-input input[type="number"] { font-size: 16px; padding: 9px 32px 9px 11px; }
  .size-presets { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

  .rail-buy {
    /* Rest in normal flow on mobile too. This card is the ONLY price/CTA on
       LobbyPanel (no dedicated .auto-sticky-bar like the auto-pages have), so
       pinning it with position:sticky;bottom:0 floated the opaque dark card
       over the artwork/config controls whenever its natural spot was below the
       fold — i.e. on initial load / top scroll. Keeping it static means it
       never overlays controls at any scroll position. Inherits position:relative. */
    border-radius: var(--panel-radius);
    margin: 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .rail-buy-amount { font-size: 26px; }
  .rail-buy-cta { padding: 13px 14px; font-size: 15px; }
}

/* Tiny screens (≤380px) */
@media (max-width: 380px) {
  .panel-shell { padding-left: 10px; padding-right: 10px; }
  .panel-header .brand-logo-v2 { height: 26px; max-width: 132px; }
  .panel-header.is-lg .brand-logo-v2 { height: 30px; max-width: 140px; }
  .panel-header-right { gap: 6px; }
  .panel-header-account {
    max-width: 92px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .panel-canvas { min-height: 300px; }
  .panel-canvas-stage { min-height: 300px; }
  .size-inputs { gap: 6px; }
  .size-x { font-size: 18px; }
  .rail-buy-amount { font-size: 24px; }
}

/* ─────────────────────────────────────────────────────────────────
   Art Setup add-on (shared across all builders)
   ───────────────────────────────────────────────────────────────── */
.art-setup-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed #C9C3B3;
  border-radius: 10px;
  background: #FBF8F1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.art-setup-toggle:hover { background: #F4EFE2; border-color: var(--panel-ink, #0A1226); }
.art-setup-toggle input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #E81820;
  width: 16px; height: 16px;
  flex: 0 0 auto;
  cursor: pointer;
}
.art-setup-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45; color: #2A2A2A; }
.art-setup-title { font-weight: 600; color: #0A1226; }
.art-setup-title strong { color: #E81820; }
.art-setup-copy { color: #555; }

/* ─────────────────────────────────────────────────────────────────
   Cart drawer (shared multi-item cart — cart-ui.js)
   ───────────────────────────────────────────────────────────────── */
.cart-drawer { position: fixed; inset: 0; z-index: 1000; }
.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 38, 0.42);
  opacity: 0;
  transition: opacity 220ms ease;
}
.cart-drawer.is-open .cart-backdrop { opacity: 1; }
.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--panel-surface, #fff);
  box-shadow: -16px 0 48px rgba(16, 22, 38, 0.22);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(.22,.61,.36,1);
}
.cart-drawer.is-open .cart-panel { transform: translateX(0); }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--panel-line, #e7e1d6);
}
.cart-title { margin: 0; font-size: 19px; font-weight: 800; color: var(--panel-ink); }
.cart-close {
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: var(--panel-ink);
  cursor: pointer;
  padding: 0 4px;
}
.cart-empty { padding: 28px 22px; color: #5a5448; font-size: 14px; line-height: 1.55; }
.cart-items { list-style: none; margin: 0; padding: 8px 0; overflow-y: auto; flex: 1; }
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--panel-line, #efeae0);
}
.cart-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3efe6;
  border: 1px solid var(--panel-line, #e7e1d6);
  flex-shrink: 0;
}
.cart-item-thumb.is-empty { display: block; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--panel-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-spec { margin: 0; font-size: 12.5px; color: #6a6356; }
.cart-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--panel-ink); }
.cart-item-remove {
  border: none;
  background: none;
  font-size: 12px;
  color: #9a4a3f;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.cart-foot { padding: 18px 22px 24px; border-top: 1px solid var(--panel-line, #e7e1d6); }
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--panel-ink);
}
.cart-subtotal { font-size: 19px; font-weight: 800; }
.cart-checkout {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--panel-ink, #101626);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}
.cart-checkout:hover { background: #0c1730; }
.cart-checkout:disabled { opacity: .6; cursor: default; }
.cart-foot-note { margin: 12px 0 0; font-size: 11.5px; color: #7c7466; line-height: 1.5; }
body.cart-open { overflow: hidden; }

/* ─────────────────────────────────────────────────────────────────
   Shared controls — scaled inside the builder shell only
   (.seg/.seg-btn live in lobby.css and are reused on non-builder pages,
   so we bump them here scoped to .panel-page rather than globally.)
   ───────────────────────────────────────────────────────────────── */
body.panel-page .seg-btn {
  font-size: calc(13px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale)) calc(14px * var(--ui-scale));
}
body.panel-page .item-card-title { font-size: calc(13px * var(--ui-scale)); }
body.panel-page .item-card-tip,
body.panel-page .item-card-status { font-size: calc(12px * var(--ui-scale)); }

/* ─────────────────────────────────────────────────────────────────
   Reduced motion / accessibility
   ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
