/* ==========================================================================
   PrintPortal — app.css
   Shared application stylesheet (loaded after tokens.css on every screen).
   Owns: base styles, global chrome (promo bar, header, mega-nav, footer),
   components (buttons, cards, badges, fields, price, ratings, stepper,
   swatches, modals, timeline, toasts) and page-level helpers.
   Visual source of truth: DESIGN.md. Behavior source: EXPERIENCE.md.
   ========================================================================== */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 { margin: 0; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

[hidden] { display: none !important; }

/* ---- typography helpers (DESIGN.md scale) ---- */
.t-display { font-size: var(--fs-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
.t-h1 { font-size: var(--fs-h1); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.t-h2 { font-size: var(--fs-h2); font-weight: 600; line-height: 1.15; }
.t-h3 { font-size: var(--fs-h3); font-weight: 500; line-height: 1.3; }
.t-subhead { font-size: var(--fs-subhead); font-weight: 500; line-height: 1.4; }
.t-body-strong { font-size: var(--fs-body); font-weight: 500; line-height: 1.6; }
.t-label { font-size: var(--fs-label); font-weight: 500; line-height: 1.3; }
.t-caption { font-size: var(--fs-caption); line-height: 1.5; }
.t-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.t-price { font-size: var(--fs-price); font-weight: 600; line-height: 1.3; }
.t-mono, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.t-caption, .t-eyebrow, .t-price, .t-mono, .tnum, .price, .unit, .chip,
[data-js="cart-count"], .metric, td, .timeline time {
  font-variant-numeric: tabular-nums;
}
.muted { color: var(--ink-muted); }
.ink-soft { color: var(--ink-soft); }

/* ---- layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-5); }
main { display: block; }
.section { padding: var(--space-6) 0; }
.section-lg { padding: var(--space-9) 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--primary);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* footer/utility link-styled buttons */
.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linklike:hover { color: var(--primary-hover); }

/* header icon slots */
.icon-slot { display: inline-flex; }
.icon-slot .icon { width: 20px; height: 20px; }

.glyph { display: inline-flex; }
.glyph .icon { width: 28px; height: 28px; color: var(--primary); }

/* ---- promo bar internals ---- */
.promo-dots { display: inline-flex; gap: var(--space-1); }
.promo-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line-hover);
  background: transparent;
  padding: 0;
}
.promo-dot[aria-selected="true"] { background: var(--ink); border-color: var(--ink); }
.promo-arrow {
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-soft);
  min-height: 32px;
  min-width: 24px;
}
.promo-arrow:hover { color: var(--ink); }

/* ==========================================================================
   Buttons — DESIGN.md components.button-primary / -secondary / -tertiary
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--fs-label);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease,
    color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--line-hover); transform: translateY(-1px); }

.btn-tertiary { background: transparent; color: var(--primary); }
.btn-tertiary .label { transition: transform 120ms ease; }
.btn-tertiary:hover { background: var(--primary-tint); }
.btn-tertiary:hover .label { transform: translateX(2px); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); }

.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { border-color: var(--line); }

.btn-sm { min-height: 32px; padding: var(--space-1) var(--space-3); font-size: var(--fs-caption); }
.btn-block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; pointer-events: none; }

/* ==========================================================================
   Badges & chips — badge-sale (danger tint), badge-new (success tint),
   info chips on primary tint. Eyebrow case, radius-sm.
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.badge-sale { background: var(--danger-tint); color: var(--danger); }
.badge-new { background: var(--success-tint); color: var(--success); }
.badge-info { background: var(--primary-tint); color: var(--primary); }
.badge-accent { background: var(--accent-tint); color: var(--accent); }
.badge-warn { background: var(--warning-tint); color: var(--warning); }
.badge-line { background: var(--paper-shade); color: var(--ink-soft); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: var(--fs-caption);
}
.chip-link { cursor: pointer; }
.chip-link:hover { border-color: var(--line-hover); }

/* promo-code reveal chip (accent, per DESIGN.md) */
.chip-success { background: var(--accent-tint); color: var(--accent); border-color: transparent; }

/* quick-link chips (home hero) */
.chip-cta {
  padding: var(--space-2) var(--space-4);
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 500;
  border-color: transparent;
}
.chip-cta:hover { background: rgba(20, 110, 245, 0.14); }

/* ==========================================================================
   Cards — components.card: 1px line, radius-md, hover lifts border + shadow
   ========================================================================== */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.card-hover {
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
a.card-hover:hover, .card-hover:hover { border-color: var(--line-hover); box-shadow: var(--shadow-card); }

/* generic info card padding */
.card-pad { padding: var(--space-5); }

/* ==========================================================================
   Product / template tiles
   Tile anatomy (top→bottom): swatch row → media → eyebrow/badge row →
   title → price block. Whole tile is one link; favourite is a nested control.
   ========================================================================== */
.tile { position: relative; display: flex; flex-direction: column; }
.tile-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper-shade);
  border: 1px solid var(--line);
}
.tile-media .art { position: absolute; inset: 0; width: 100%; height: 100%; }
a.tile-link { color: inherit; display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
a.tile-link:hover { text-decoration: none; }
.tile:hover .tile-media-inner, a.tile-link:hover .tile-media-inner { transform: translateY(-2px); }
.tile-media-inner { transition: transform 120ms ease; }

.tile-fav {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
}

.tile-name { margin-top: auto; }
.tile-name a { color: var(--ink); font-weight: 500; }
.tile-name a:hover { color: var(--primary); }

/* quantity-price chip ("Buy 100 @ ₹180") */
.qty-chip {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: 12px;
  font-weight: 500;
}

/* ==========================================================================
   Rating row — warning-gold stars, count in caption
   ========================================================================== */
.rating { display: inline-flex; align-items: center; gap: var(--space-1); }
.rating .stars { color: var(--warning); letter-spacing: 1px; font-size: var(--fs-caption); }
.rating .count { color: var(--ink-muted); font-size: var(--fs-caption); }
a.rating:hover .count { text-decoration: underline; }

/* ==========================================================================
   Price block — current + compare-at + unit line, tabular numerals
   ========================================================================== */
.price-block { display: flex; flex-direction: column; gap: 2px; }
.price-row { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.price { font-size: var(--fs-price); font-weight: 600; }
.price-compare { color: var(--ink-muted); text-decoration: line-through; font-size: var(--fs-caption); }
.unit { color: var(--ink-muted); font-size: var(--fs-caption); }
.unit strong { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Fields — label above input; focus ring per components.field; error below
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field > label { font-size: var(--fs-label); font-weight: 500; }
.field .hint { color: var(--ink-muted); font-size: var(--fs-caption); }
.field-input,
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-body);
}
textarea { min-height: 88px; resize: vertical; }
.field-input:hover, input:hover, select:hover, textarea:hover { border-color: var(--line-hover); }
.field-input:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-tint), 0 0 0 1px var(--primary);
  border-color: var(--primary);
}
.field-input[aria-invalid="true"], input[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--danger);
}
.field-error { color: var(--danger); font-size: var(--fs-caption); }
.field-valid-ok { color: var(--success); font-size: var(--fs-caption); }

/* checkbox / radio rows */
.check, .radio-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  min-height: 44px;
}
.check input, .radio-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check label, .radio-row label, .radio-row .label { font-size: var(--fs-label); }
.radio-row .hint, .check .hint { display: block; color: var(--ink-muted); font-size: var(--fs-caption); }

/* option cards (configurator radios rendered as selectable cards) */
.option-card {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.option-card:hover { border-color: var(--line-hover); }
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.option-card:has(input:disabled) {
  opacity: 0.75;
  cursor: not-allowed;
  background: var(--paper-shade);
}
.option-card.disabled { opacity: 0.75; cursor: not-allowed; background: var(--paper-shade); }
.option-card input { margin-top: 2px; flex: none; }

/* ==========================================================================
   Swatches — circle, 20px, line ring; selected gets 2px primary ring
   ========================================================================== */
.swatches { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.swatch {
  width: 20px; height: 20px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  padding: 0;
  position: relative;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--primary); }
.swatch-more { border-radius: var(--radius-sm); font-size: 12px; padding: 0 var(--space-1); }

/* ==========================================================================
   Mega-nav — hover/focus opens panel; Esc closes; focus returns to trigger
   ========================================================================== */
.promo-bar {
  background: var(--paper-shade);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-caption);
  position: relative;
  z-index: 60;
}
.promo-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 36px;
  position: relative;
}
.promo-slide[hidden] { display: none; }
.promo-close {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

/* utility header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand .brandmark {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
}
.header-search { flex: 1; max-width: 560px; }
.search-wrap { position: relative; }
.search-wrap input { padding-left: var(--space-3); }
.search-icon { position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--ink-muted); }
.header-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.header-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-size: var(--fs-label);
}
.header-link:hover { background: var(--paper-shade); text-decoration: none; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.header-cart strong { font-variant-numeric: tabular-nums; }

/* mega-nav */
.mega-nav { border-top: 1px solid var(--line); background: var(--paper); }
.mega-list { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; }
.mega-item { position: relative; }
.mega-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-1) var(--space-3);
  color: var(--ink);
  background: none;
  border: none;
  font-size: var(--fs-label);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.mega-trigger:hover, .mega-trigger[aria-expanded="true"] {
  border-bottom-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
.mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  min-width: 620px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.mega-panel[hidden] { display: none; }
.mega-col h3 { font-size: var(--fs-caption); }
.mega-col ul { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-1); }
.mega-col a { color: var(--ink-soft); font-size: var(--fs-caption); }
.mega-col a:hover { color: var(--primary); }
.mega-promo {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--accent-tint);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs { padding: var(--space-4) 0 var(--space-2); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--ink-muted); margin-right: var(--space-2); }
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-9);
  background: var(--paper);
}
.footer-guarantee {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  padding: var(--space-6) 0;
}
.footer-col h3 { font-size: var(--fs-caption); }
.footer-col ul { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.footer-col a, .footer-col button.linklike { color: var(--ink-soft); font-size: var(--fs-caption); }
.footer-col a:hover { color: var(--primary); }
.footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) 0 var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: var(--fs-caption);
}
.payment-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.payment-scheme {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: 12px;
  color: var(--ink-soft);
}

/* ==========================================================================
   Hero bands & editorial bands
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-7);
  align-items: center;
  padding: var(--space-8) 0 var(--space-7);
}
.hero .offer-line { color: var(--ink-soft); }
.hero-cta-row { display: flex; gap: var(--space-3); margin-top: var(--space-5); flex-wrap: wrap; }
.hero-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(closest-side at 30% 30%, rgba(20,110,245,0.14), transparent),
    radial-gradient(closest-side at 75% 60%, rgba(122,61,255,0.12), transparent),
    var(--paper-shade);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-art svg { width: 72%; height: 72%; }

.band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
  background: var(--paper-shade);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}
.band .band-art {
  aspect-ratio: 16 / 7;
  border-radius: var(--radius-md);
  background:
    radial-gradient(closest-side at 65% 40%, rgba(20,110,245,0.12), transparent),
    var(--paper);
  border: 1px solid var(--line);
}
.band .links { display: flex; gap: var(--space-4); margin-top: var(--space-4); flex-wrap: wrap; }

/* value-prop trio */
.value-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.value-prop { display: flex; gap: var(--space-3); align-items: flex-start; }
.value-prop .glyph {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.value-prop h3 { font-size: var(--fs-body-strong); }
.value-prop p { color: var(--ink-soft); font-size: var(--fs-caption); margin: 0; }

/* ==========================================================================
   Carousels — horizontal paged tile rows
   ========================================================================== */
.carousel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.carousel {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 232px;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--space-2) 2px var(--space-3);
  scrollbar-width: thin;
}
.carousel > * { scroll-snap-align: start; }
.carousel-btns { display: flex; gap: var(--space-2); }
.circle-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 96px;
  gap: var(--space-4);
  overflow-x: auto;
  padding: var(--space-2) 2px;
  scrollbar-width: thin;
}
.circle-item { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
.circle-item .disc {
  width: 72px; height: 72px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-shade);
  transition: border-color 120ms ease, transform 120ms ease;
}
.circle-item:hover .disc { border-color: var(--primary); transform: translateY(-2px); }
.circle-item .disc svg { width: 34px; height: 34px; }
.circle-item span { font-size: var(--fs-caption); color: var(--ink-soft); }

/* ==========================================================================
   Grids
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }

/* ==========================================================================
   PDP — 2-col, sticky buy column
   ========================================================================== */
.pdp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--space-7); align-items: start; }
.pdp-media { display: grid; gap: var(--space-3); }
.pdp-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-shade);
  overflow: hidden;
}
.pdp-thumbs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.pdp-thumb {
  width: 64px; height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
  background: var(--paper);
  position: relative;
}
.pdp-thumb[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pdp-thumb svg { width: 100%; height: 100%; }

.buy-box { position: sticky; top: 84px; display: grid; gap: var(--space-4); }
.buy-box .rating-row { display: flex; align-items: center; gap: var(--space-3); }
.benefit-list { margin: 0; padding-left: var(--space-5); color: var(--ink-soft); font-size: var(--fs-caption); display: grid; gap: var(--space-1); }

.configurator { display: grid; gap: var(--space-4); }
.config-group { display: grid; gap: var(--space-2); }
.config-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.config-head label, .config-head .group-label { font-size: var(--fs-label); font-weight: 500; }
.config-options { display: grid; gap: var(--space-2); }
.option-reason {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
}
.option-hint { font-size: var(--fs-caption); color: var(--ink-muted); }
.dual-cta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-2); }

.pricing-guide {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-shade);
  padding: var(--space-4);
}
.pricing-guide table { width: 100%; border-collapse: collapse; font-size: var(--fs-caption); }
.pricing-guide th, .pricing-guide td { text-align: left; padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--line); }
.pricing-guide tr.current td { font-weight: 600; }
.pricing-guide th:last-child, .pricing-guide td:last-child { text-align: right; }

/* collapsible drawers / accordion */
.drawer { border: 1px solid var(--line); border-radius: var(--radius-md); }
.drawer + .drawer { margin-top: var(--space-3); }
.drawer-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: none;
  border: none;
  padding: var(--space-4);
  font-size: var(--fs-body-strong);
  text-align: left;
}
.drawer-body { padding: 0 var(--space-4) var(--space-4); }
.drawer-body[hidden] { display: none; }

/* reviews */
.review-item { border-top: 1px solid var(--line); padding: var(--space-4) 0; display: grid; gap: var(--space-2); }
.review-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.merchant-reply {
  border-left: 3px solid var(--primary);
  background: var(--primary-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-caption);
}
.histogram { display: grid; gap: var(--space-2); }
.hist-row { display: grid; grid-template-columns: 48px 1fr 56px; align-items: center; gap: var(--space-2); font-size: var(--fs-caption); }
.hist-bar { height: 8px; border-radius: var(--radius-sm); background: var(--paper-shade); overflow: hidden; }
.hist-bar span { display: block; height: 100%; background: var(--warning); }

/* sticky bottom action bar (mobile) */
.sticky-buy-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 6px rgba(8, 8, 8, 0.06);
  padding: var(--space-2) var(--space-4);
  display: none;
  gap: var(--space-3);
}
.sticky-buy-bar .btn { flex: 1; }

/* ==========================================================================
   Gallery (templates.html) — rail + filter sidebar + grid
   ========================================================================== */
.gallery-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.rail { display: grid; gap: var(--space-4); position: sticky; top: 84px; }
.rail-panel { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-3); }
.rail-panel h3 { font-size: var(--fs-caption); }
.facet-list { display: grid; gap: 0; max-height: 220px; overflow: auto; }
.facet-list .check { min-height: 36px; padding: var(--space-1) 0; }
.facet-list .check label { font-size: var(--fs-caption); }
.applied-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.master-switch { display: flex; align-items: center; gap: var(--space-3); }
.switch {
  position: relative;
  width: 44px; height: 24px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-shade);
  transition: background-color 120ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: var(--radius-circle);
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform 120ms ease;
}
.switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(20px); border-color: var(--primary); }
.filter-drawer-btn { display: none; }

.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.result-count { color: var(--ink-muted); font-size: var(--fs-caption); }
.template-card .swatches { padding: 0 var(--space-2); margin-top: calc(-1 * var(--space-1)); }

/* ==========================================================================
   Modals — quick view, auth modal. radius-lg, shadow-card, 24px padding,
   focus trap, Esc close, focus restore.
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 960px;
  width: 100%;
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: var(--space-5);
  position: relative;
}
.modal-sm { max-width: 440px; }
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { border-color: var(--line-hover); }
.quickview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.quickview-side { display: grid; gap: var(--space-3); align-content: start; }
.sideswitch { display: flex; gap: var(--space-3); }
.sideswitch label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
.sideswitch label:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.similar-rail { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--line); }

/* auth modal variant */
.auth-card { display: grid; gap: var(--space-3); }
.divider-row { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-muted); font-size: var(--fs-caption); }
.divider-row::before, .divider-row::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ==========================================================================
   Editor — focused shell (no site chrome). Hairline border + paper-shade
   well, no shadow: a workbench, not a brochure.
   ========================================================================== */
.editor-body { background: var(--paper-shade); }
.editor-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  background: var(--paper);
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-wrap: wrap;
}
.editor-toolbar .spacer { flex: 1; }
.editor-price-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  background: var(--paper);
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
}
.editor-canvas-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 0;
}
.editor-stage-col { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.editor-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.editor-controls .ctl {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-caption);
  color: var(--ink-soft);
}
.editor-controls .ctl .swatch { width: 16px; height: 16px; }
.editor-workbench {
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.editor-canvas {
  background: var(--paper);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  width: 460px;
  height: 300px;
  max-width: 90%;
}
.editor-canvas.landscape { width: 300px; height: 460px; }
.editor-canvas .design-layer { position: absolute; inset: 0; }
.editor-canvas .design-layer.background { z-index: 0; }
.editor-canvas .design-layer.elements { z-index: 1; }
.editor-canvas .bleed {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(212, 23, 54, 0.55);
  margin: -14px;
  display: none;
  pointer-events: none;
}
.editor-canvas .safety {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(20, 110, 245, 0.55);
  margin: 14px;
  display: none;
  pointer-events: none;
}
.editor-canvas.show-bleed .bleed { display: block; }
.editor-canvas.show-safety .safety .lbl,
.editor-canvas.show-bleed .bleed .lbl { display: block; font-size: 10px; position: absolute; top: -16px; left: 0; color: inherit; }
.editor-canvas.show-safety .safety { display: block; }
.editor-canvas .safety .lbl { color: var(--primary); }
.editor-canvas .bleed .lbl { color: var(--danger); }
.editor-canvas .dropzone {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 110, 245, 0.06);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  z-index: 5;
  color: var(--primary);
  font-size: var(--fs-label);
  font-weight: 500;
}
.editor-canvas.drag-over .dropzone { display: flex; }

/* ============================================================================
   STUDIO CORE (TICKET-004/005 additions)
   View strip · print-zone overlay · rulers · placement presets · review &
   approval gate · share placeholders. Workbench rule holds: hairline
   borders, no shadows on canvas/guides/rulers.
   ============================================================================ */

/* -- type chip in the toolbar -- */
.studio-type-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  color: var(--ink-soft);
  white-space: nowrap;
}

/* -- view strip: radio-group of view chips with live minis (§3, §11) -- */
.view-strip {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  background: var(--paper);
}
.view-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 84px;
  min-height: 44px;
  padding: var(--space-2);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  scroll-snap-align: start;
}
.view-chip.active {
  border-color: var(--primary);
  background: var(--primary-tint);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.view-chip .studio-mini {
  width: 48px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-shade);
  display: grid;
  place-items: center;
}
.view-chip .studio-mini svg { width: 100%; height: 100%; }
.view-chip .mini-flat {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 7px; font-weight: 600;
  overflow: hidden; padding: 2px; text-align: center;
}
.view-chip-label { font-size: var(--fs-caption); font-weight: 500; color: var(--ink-soft); }
.view-chip.active .view-chip-label { color: var(--primary); }
.view-strip-stub { padding: var(--space-2); color: var(--ink-muted); }

/* -- labelled studio stub: planned types (apparel/drinkware) get a clear
   placeholder canvas instead of silent no-op tools (§1 IA, honesty) -- */
.studio-stub {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2); text-align: center;
  padding: var(--space-4); color: var(--ink-soft);
}
.studio-stub .studio-stub-icon { color: var(--ink-muted); opacity: 0.6; }
.studio-stub strong { font-size: var(--fs-body); color: var(--ink); }
.studio-stub .t-caption { max-width: 34ch; }
[data-js="layer-bg"] .studio-stub { position: absolute; }

/* -- print-zone overlay: lit window with a dimming wash outside (§5.2) -- */
.studio-zone-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.studio-zone-overlay .zone-dim {
  position: absolute;
  box-shadow: 0 0 0 9999px var(--guide-dim);
  border-radius: var(--radius-sm);
}
.studio-zone-overlay .zone-label {
  position: absolute;
  transform: translateY(-130%);
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
}
.studio-zone-clip { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.studio-zone-clip .design-layer { position: absolute; inset: 0; }
.studio-zone-frame {
  position: absolute;
  border: 1.5px dashed var(--guide-wrap);
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 2;
  display: none;
}

/* -- dimension rulers (numerals in tabular numerals, §11) -- */
.studio-ruler { position: absolute; pointer-events: none; z-index: 2; }
.studio-ruler svg { width: 100%; height: 16px; }
.studio-ruler-top { top: 0; left: 0; right: 0; }
.studio-ruler-left { top: 0; bottom: 0; left: 0; width: 16px; }
.studio-ruler-left svg { width: 16px; height: 100%; }
.studio-ruler text { font-variant-numeric: tabular-nums; }

/* -- placement presets (§4.1): 44px icon tile over a text label, 2×2 grid -- */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: var(--space-2);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.preset-btn:hover { border-color: var(--line-hover); }
.preset-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.preset-icon { display: grid; place-items: center; width: 44px; height: 44px; }
.preset-label { font-size: var(--fs-caption); font-weight: 500; }

/* -- print specs card (§4.4) -- */
.print-specs-card {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
}

/* -- review & approve modal (§6.2) -- */
.review-modal { max-width: 640px; }
.review-thumbs {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding: var(--space-2) 0;
}
.review-thumb { margin: 0; min-width: 120px; display: grid; gap: 4px; }
.review-thumb-art {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 150px;
  display: grid;
  place-items: center;
  background: var(--paper-shade);
}
.review-thumb-art svg { width: 100%; height: 100%; }
.review-config { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); display: grid; gap: 4px; }
.review-config-row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-caption); }
.review-config-row span:last-child { text-align: right; }
.review-total-row { border-top: 1px solid var(--line); padding-top: var(--space-2); align-items: baseline; }

/* -- approval checkbox + gate error (§6.2, §11) -- */
.approval-gate {
  margin-top: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.approval-gate.has-error { border-color: var(--danger); }
.approval-check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-weight: 600;
}
.approval-check input {
  width: 24px;
  height: 24px;
  min-width: 24px;
  accent-color: var(--primary);
  border-radius: var(--radius-sm);
  margin-top: 1px;
}
.approval-gate .field-error { margin-top: var(--space-2); }
.approval-gate.has-error .approval-check input { outline: 2px solid var(--danger); outline-offset: 1px; }

/* -- share-link placeholder (§9: labelled placeholder, never silent) -- */
.canvas-el.placeholder-el { min-width: 90px; }
.placeholder-box {
  display: block;
  border: 1.5px dashed var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  padding: 14px 10px;
  text-align: center;
}

/* -- reduced motion: no transitions on studio chrome -- */
@media (prefers-reduced-motion: reduce) {
  .view-strip, .review-thumbs { scroll-behavior: auto; }
}

/* ============================================================================
   FLAT PRINT UPGRADES (TICKET-006, spec §5.4, §4.2–§4.4)
   Type-driven guides (CSS custom properties written by editor.js from
   PP.guideInsets — no hard-coded mm values), repeat-strip canvas + cadence
   ruler, recent uploads, image adjustment controls.
   Workbench rule holds: hairline borders only, no shadows on canvas/guides.
   ============================================================================ */

/* -- per-type guide insets: geometry arrives as canvas-scoped custom
      properties (--guide-bleed-inset[-y] / --guide-safety-inset[-y]) set
      from the type's guides declaration; the fallback matches the default
      3mm/5mm declaration for 85×52mm cards. The canvas IS the full-bleed
      artwork: the red dashed trim line sits bleed-mm inside the edge
      (artwork extends past it), the green safety line another safety-mm
      in (§5.4, DESIGN.md guide-line component specs: 1.5px dashed). -- */
.editor-canvas .bleed {
  border: 1.5px dashed var(--guide-bleed);
  margin: var(--guide-bleed-inset-y, 3.488%) var(--guide-bleed-inset-x, 3.488%);
}
.editor-canvas .safety {
  border: 1.5px dashed var(--guide-safety);
  margin: var(--guide-safety-inset-y, 9.302%) var(--guide-safety-inset-x, 9.302%);
}
/* label chips carry the semantic guide hues (colour + text, never colour
   alone — §11); overrides the core section's blue/red label colours */
.editor-canvas .safety .lbl { color: var(--guide-safety); }
.editor-canvas .bleed .lbl { color: var(--guide-bleed); }

/* -- repeat-strip tile canvas (§5.4): seam markers on the tile edges (the
      seams where the design meets itself), the edge-to-edge badge, and the
      cadence ruler row under the workbench -- */
.strip-seam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1.5px dashed var(--guide-wrap);
  z-index: 3;
  pointer-events: none;
}
.strip-seam-left { left: 0; }
.strip-seam-right { right: 0; }
.strip-badge {
  position: absolute;
  top: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  z-index: 3;
  pointer-events: none;
}
.cadence-ruler {
  padding: var(--space-2) var(--space-4) 0;
}
.cadence-ruler svg text { font-variant-numeric: tabular-nums; }
.cadence-ruler[hidden] { display: none; }

/* -- Recently Uploaded (§4.3) -- */
.recent-upload-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}
.recent-upload-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-shade);
}
.recent-upload-row .recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-upload-row .recent-actions { display: flex; gap: var(--space-1); }

/* -- Image adjustments (§4.2): labelled controls, visible focus, 44px
      touch targets inherited from the button specs -- */
.image-tools { display: grid; gap: var(--space-3); }
.adjust-row { display: grid; gap: var(--space-1); }
.adjust-row input[type="range"] { width: 100%; min-height: 44px; }
.adjust-toggle {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--fs-caption);
  min-height: 44px;
}
.adjust-toggle input[type="checkbox"],
.adjust-toggle input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); }
.print-specs-card .specs-advisory {
  border-top: 1px dashed var(--line);
  padding-top: var(--space-1);
  margin-top: var(--space-1);
}
.print-specs-card .specs-low {
  color: var(--warning);
}
.print-specs-card .specs-ok {
  color: var(--success);
}
.print-specs-card .specs-unknown {
  color: var(--ink-soft);
}
.crop-window { display: block; width: 100%; height: 100%; }
.canvas-el .crop-window img { max-width: none; max-height: none; }

.canvas-el {
  position: absolute;
  padding: 4px 6px;
  cursor: move;
  line-height: 1.3;
  max-width: 90%;
  outline: none;
}
.canvas-el.selected { outline: 2px dashed var(--primary); outline-offset: 2px; }
.canvas-el img { max-width: 160px; max-height: 120px; }
.canvas-el .delete-x {
  position: absolute;
  top: -12px; right: -12px;
  width: 22px; height: 22px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--danger);
  font-size: 12px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}
.canvas-el.selected .delete-x { display: inline-flex; }

/* -- Studio: approved chip (Review & Approve gate carries approval into
   the commerce flow); same badge family as badge-info, success green -- */
.badge-approved {
  background: var(--success-tint);
  color: var(--success);
  border-color: transparent;
}

/* editor side rail */
.editor-rail { border-left: 1px solid var(--line); background: var(--paper); display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.rail-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.rail-tab {
  border: none;
  background: none;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  min-height: 44px;
}
.rail-tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.rail-panels { overflow: auto; padding: var(--space-4); display: grid; gap: var(--space-4); align-content: start; }
.rail-panel-editor { display: grid; gap: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.rail-panel-editor h3 { font-size: var(--fs-caption); }
.text-el-row { display: grid; gap: var(--space-2); border-bottom: 1px solid var(--line); padding-bottom: var(--space-3); }
.mini-preview { width: 64px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.sidesel { display: flex; gap: var(--space-2); align-items: center; }
.sidesel label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  cursor: pointer;
  font-size: var(--fs-caption);
}
.sidesel label:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.editor-skeleton { width: 460px; height: 300px; max-width: 90%; }
.skeleton { position: relative; overflow: hidden; background: var(--paper-shade); border: 1px solid var(--line); border-radius: var(--radius-md); }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(8,8,8,0.04), transparent);
  animation: shimmer 1.1s infinite;
}
@keyframes shimmer { to { transform: translateX(0); } }
.saved-confirm { color: var(--success); font-size: var(--fs-caption); min-width: 56px; display: inline-block; }

/* ==========================================================================
   Cart
   ========================================================================== */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-6); align-items: start; }
.cart-items { display: grid; gap: var(--space-4); }
.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: var(--space-4);
  padding: var(--space-4);
  align-items: center;
}
.cart-line .thumb {
  width: 96px; height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper-shade);
}
.cart-line .thumb svg { width: 100%; height: 100%; }
.cart-line .meta { display: grid; gap: var(--space-1); }
.cart-line .config-summary { color: var(--ink-muted); font-size: var(--fs-caption); }
.cart-line-actions { display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-2); flex-wrap: wrap; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.qty-stepper button { width: 36px; height: 36px; border: none; background: var(--paper); }
.qty-stepper button:hover { background: var(--paper-shade); }
.qty-stepper output { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.line-total { font-size: var(--fs-h3); font-weight: 600; }
.totals-card { position: sticky; top: 84px; display: grid; gap: var(--space-3); }
.totals-rows { display: grid; gap: var(--space-2); }
.totals-row { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--fs-label); }
.totals-row.grand { border-top: 1px solid var(--line); padding-top: var(--space-2); font-size: var(--fs-h3); font-weight: 600; }
.totals-row .discount { color: var(--accent); font-weight: 500; }
.promo-row { display: flex; gap: var(--space-2); }
.promo-row input { flex: 1; }
.sticky-checkout-bar { display: none; }

/* empty states */
.empty-state { display: grid; gap: var(--space-4); justify-items: start; }
.empty-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }

/* undo toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translateX(-50%);
  z-index: 120;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: center;
  box-shadow: var(--shadow-card);
}
.toast .btn-tertiary { color: #fff; }

/* ==========================================================================
   Checkout — single page, five collapsible sections + summary rail
   ========================================================================== */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-6); align-items: start; }
.stepper { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-4) 0; }
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-caption);
  color: var(--ink-muted);
}
.step-pill .dot {
  width: 22px; height: 22px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.step-pill.current { color: var(--primary); border-color: var(--primary); }
.step-pill.current .dot { border-color: var(--primary); color: var(--primary); }
.step-pill.complete { color: var(--success); border-color: var(--success); }
.step-pill.complete .dot { background: var(--primary); border-color: var(--primary); color: #fff; }

.co-section { margin-bottom: var(--space-4); }
.co-section-body { padding: var(--space-4); display: grid; gap: var(--space-3); }
.co-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
}
.co-summary-row .content { color: var(--ink-soft); font-size: var(--fs-caption); }
.section-head-2 { display: flex; align-items: center; gap: var(--space-3); }
.section-head-2 .num {
  width: 26px; height: 26px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-caption);
  flex: none;
}
.co-section[data-complete="true"] .num { background: var(--primary); border-color: var(--primary); color: #fff; }

.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.address-grid .full { grid-column: 1 / -1; }
.error-summary {
  border: 1px solid var(--danger);
  background: var(--danger-tint);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.error-summary a { color: var(--danger); }

.pay-grid { display: grid; gap: var(--space-2); }
.card-fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-3); }
.cod-note { font-size: var(--fs-caption); color: var(--ink-muted); }
.review-lines { display: grid; gap: var(--space-2); }
.review-line { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--fs-caption); border-bottom: 1px dashed var(--line); padding-bottom: var(--space-2); }
.sticky-summary-bar { display: none; }

/* ==========================================================================
   Confirmation
   ========================================================================== */
.confirm-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border: 1px solid var(--success);
  background: var(--success-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-6) 0;
}
.confirm-banner .check-circle {
  width: 48px; height: 48px;
  flex: none;
  border-radius: var(--radius-circle);
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.artwork-line {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper-shade);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-caption);
}
.account-nudge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--accent-tint);
}

/* ==========================================================================
   Sign in — split layout: brand panel (accent tint) + auth card
   ========================================================================== */
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.auth-brand {
  background: var(--accent-tint);
  padding: var(--space-7);
  display: grid;
  gap: var(--space-4);
  align-content: center;
}
.auth-brand ul { margin: 0; padding-left: var(--space-5); color: var(--ink-soft); display: grid; gap: var(--space-2); font-size: var(--fs-label); }
.auth-panel { padding: var(--space-7); display: grid; gap: var(--space-4); }
.auth-demo { border: 1px dashed var(--line-hover); border-radius: var(--radius-md); padding: var(--space-3); }

/* ==========================================================================
   Account / orders
   ========================================================================== */
.account-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.account-nav { display: grid; gap: var(--space-2); position: sticky; top: 84px; }
.account-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--fs-label);
}
.account-nav a:hover, .account-nav a[aria-current="page"] { background: var(--primary-tint); color: var(--primary); text-decoration: none; }
.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 1fr 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
}
.order-row:hover { border-color: var(--line-hover); box-shadow: var(--shadow-card); }
.status-chip { white-space: nowrap; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 var(--space-5) var(--space-6); }
.timeline li::before {
  content: "";
  position: absolute;
  left: 9px; top: 22px; bottom: -2px;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline .stage-dot {
  position: absolute;
  left: 0; top: 2px;
  width: 20px; height: 20px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline li.current .stage-dot { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-tint); }
.timeline li.current .stage-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li.done .stage-dot { background: var(--primary); border-color: var(--primary); }
.timeline li.done .stage-dot::after { content: "✓"; color: #fff; font-size: 11px; }
.timeline li.future .stage-dot::after { content: ""; }
.timeline time { color: var(--ink-muted); font-size: var(--fs-caption); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }

/* ==========================================================================
   Offers
   ========================================================================== */
.offers-hero {
  background: var(--accent-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6);
  margin: var(--space-5) 0 var(--space-6);
}
.offers-hero .pct-line { color: var(--ink-soft); }
.quick-links { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }

/* ==========================================================================
   Favourites
   ========================================================================== */
.tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.tab {
  border: none;
  background: none;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  min-height: 44px;
}
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

/* favourite heart (bordered checkbox-style heart, 44px target) */
.fav-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}
.fav-btn .icon { width: 20px; height: 20px; }
.fav-btn:hover { border-color: var(--line-hover); }
.fav-btn.on { color: var(--danger); border-color: var(--danger); background: var(--danger-tint); }
.fav-btn.on .icon { fill: var(--danger); }

/* quick-view mini cards */
.qv-mini-art { border-radius: var(--radius-sm); overflow: hidden; }

/* toast root */
[data-js="toast-root"] { position: fixed; left: 0; right: 0; bottom: var(--space-5); z-index: 120; display: flex; justify-content: center; pointer-events: none; }
[data-js="toast-root"] .toast { pointer-events: auto; }

/* ==========================================================================
   Dead-stub surfaces — every Stub-scope feature resolves to one of these.
   Must be VISIBLE and LABELLED per the wiring contract.
   ========================================================================== */
.stub-note {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  border: 1px dashed var(--line-hover);
  background: var(--warning-tint);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--ink-soft);
  font-size: var(--fs-caption);
}
.stub-note strong { color: var(--ink); }

/* ==========================================================================
   Offline banner (simulated) + aria-live region
   ========================================================================== */
.offline-banner {
  background: var(--warning-tint);
  border-bottom: 1px solid var(--line);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-caption);
  color: var(--ink-soft);
  text-align: center;
}

/* ==========================================================================
   Responsive — breakpoints 479 / 768 / 992
   ========================================================================== */
@media (max-width: 991px) {
  .hero { grid-template-columns: 1fr; padding: var(--space-6) 0; }
  .pdp-grid { grid-template-columns: 1fr; }
  .buy-box { position: static; }
  .gallery-layout { grid-template-columns: 1fr; }
  .rail { position: static; }
  .filters-panel { display: none; }
  .filters-panel.open { display: grid; }
  .filter-drawer-btn { display: inline-flex; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .totals-card, .checkout-summary-rail { position: static; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-nav { position: static; display: flex; flex-wrap: wrap; }
  .auth-split { grid-template-columns: 1fr; }
  .editor-canvas-area { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .editor-rail { border-left: none; border-top: 1px solid var(--line); }
  .value-trio { grid-template-columns: 1fr; }
  .mega-panel { position: static; box-shadow: none; border: none; padding: var(--space-4) var(--space-4) var(--space-4) var(--space-6); grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .container { padding: 0 var(--space-4); }
  .grid-2, .grid-3, .grid-4, .empty-panels, .value-trio { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .header-row { gap: var(--space-2); flex-wrap: wrap; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .header-link .text-label { display: none; }
  .quickview-grid { grid-template-columns: 1fr; }
  .sticky-buy-bar.on { display: flex; }
  .sticky-buy-bar.on .btn { flex: 1; }
  .sticky-checkout-bar.on {
    display: grid;
    gap: var(--space-2);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 -2px 6px rgba(8, 8, 8, 0.06);
  }
  .address-grid, .card-fields { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; }
  .t-display { font-size: 40px; }
  .t-h1 { font-size: 28px; }
  .t-h2 { font-size: 22px; }
}
