/* ==========================================================================
   FaceMetrics Payment Gateway
   "Liquid glass" design system — frosted translucent surfaces, layered depth,
   hairline light edges, red brand accent on neutral glass.

   LAYERING RULE (important): only top-level surfaces get backdrop-filter
   (.appbar, .rail, .side, .card, .stat, .sel-menu, .sheet). Elements nested
   INSIDE those use flat translucent tints — stacking blur on blur turns to mud.
   ========================================================================== */
:root {
  /* brand */
  --red: #e4141b;
  --red-dark: #b60d13;
  --red-soft: rgba(228, 20, 27, .12);
  --red-tint: rgba(228, 20, 27, .07);
  --red-ring: rgba(228, 20, 27, .22);

  /* ink — these are tuned for the WORST-case composite: a .28-alpha tint on a
     .58-alpha card over the dark ambient orb. Lightening them breaks WCAG AA.
     Measured: --muted 5.0:1 on the darkest card, 9.4:1 on the brightest. */
  --ink: #0a0a0b;
  --ink-2: #2b2b32;
  --muted: #45454e;
  --placeholder: #4f4f58;
  --on-dark: #f4f4f5;
  --on-dark-muted: #a1a1aa;

  /* glass surfaces */
  --glass: rgba(255, 255, 255, .58);
  --glass-hi: rgba(255, 255, 255, .72);
  --glass-strong: rgba(252, 252, 253, .88);
  --glass-inset: rgba(255, 255, 255, .42);
  --glass-sunken: rgba(255, 255, 255, .28);
  --glass-dark: rgba(14, 14, 16, .82);
  --glass-dark-hi: rgba(255, 255, 255, .1);

  /* edges + hairlines */
  --edge: rgba(255, 255, 255, .72);
  --edge-2: rgba(255, 255, 255, .45);
  --hairline: rgba(10, 10, 11, .09);
  --hairline-2: rgba(10, 10, 11, .055);

  /* legacy aliases (kept so every old selector keeps resolving) */
  --line: var(--edge-2);
  --line-2: var(--hairline-2);
  --bg: #adadb2;
  --surface: var(--glass);
  --surface-2: var(--glass-inset);

  /* Status tints are OPAQUE on purpose. As translucent tints their composite
     changed with whichever ambient orb sat behind the card, dropping .pill.paid
     to 2.14:1. Opaque pins them at ~6.8:1 everywhere, including in print. */
  --ok: #0a5c31;
  --ok-soft: #dcf0e4;
  --warn: #6b4207;
  --warn-soft: #fbeacd;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --blur: 22px;
  --blur-lg: 34px;

  --shadow-sm:
    inset 0 1px 0 var(--edge),
    0 1px 2px rgba(10, 10, 11, .05),
    0 6px 18px -8px rgba(10, 10, 11, .16);
  --shadow:
    inset 0 1px 0 var(--edge),
    0 2px 6px rgba(10, 10, 11, .06),
    0 22px 52px -14px rgba(10, 10, 11, .28);
  --shadow-lg:
    inset 0 1px 0 var(--edge),
    0 3px 10px rgba(10, 10, 11, .07),
    0 36px 80px -20px rgba(10, 10, 11, .34);
  --shadow-red: 0 10px 26px -8px rgba(228, 20, 27, .55), inset 0 1px 0 rgba(255, 255, 255, .28);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* `clip`, not `hidden`: hidden would make <html> a scroll container and break
     position:sticky on .appbar / .rail / .side. clip contains the ambient
     backdrop layers without creating one. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: #adadb2;
}

/* Ambient backdrop. Glass needs TEXTURE behind it to read as glass — a flat
   colour blurs to nothing — so these soft orbs sit in a fixed layer and get
   refracted at every panel edge. */
body::before {
  content: "";
  position: fixed;
  inset: 0; /* must not exceed the viewport, or it widens the document */
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 12% 8%,  rgba(255, 255, 255, .95), transparent 70%),
    radial-gradient(32% 38% at 88% 12%, rgba(228, 20, 27, .30),   transparent 70%),
    radial-gradient(44% 46% at 78% 88%, rgba(20, 20, 26, .40),    transparent 72%),
    radial-gradient(36% 40% at 26% 92%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(148deg, #c2c2c7 0%, #a5a5ab 46%, #8e8e95 100%);
}

/* Faint brand wash — the logo, heavily blurred, as ambient depth. */
body::after {
  content: "";
  position: fixed;
  top: 50%; left: 50%;
  width: min(78vmin, 760px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  background: url("/logo.png") center/cover no-repeat;
  filter: blur(64px) saturate(130%);
  opacity: .2;
}

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

::selection { background: rgba(228, 20, 27, .22); }

/* ==========================================================================
   Glass primitives
   ========================================================================== */
.glass, .card, .stat, .sheet {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid var(--edge-2);
  box-shadow: var(--shadow);
}

/* ---- App bar --------------------------------------------------------------*/
.appbar {
  position: sticky; top: 0; z-index: 50;
  color: var(--on-dark);
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 34px -16px rgba(0, 0, 0, .55);
}
.appbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red) 22%, var(--red) 78%, transparent);
  opacity: .85;
}
.appbar-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 13px 22px;
  display: flex; align-items: center; gap: 13px;
}
.logo-mark {
  width: 40px; height: 40px; border-radius: 13px;
  object-fit: cover;
  background: rgba(255, 255, 255, .08);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -6px rgba(0, 0, 0, .6);
  overflow: hidden; flex: 0 0 auto;
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-mark .fallback { font-weight: 800; font-size: 16px; letter-spacing: -.5px; color: #fff; }
.logo-mark .fallback b { color: var(--red); }
.appbar .brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.3px; }
.appbar .brand-name span { color: #ff5a5f; }
.appbar .brand-tag {
  margin-left: auto; font-size: 12px; color: var(--on-dark-muted);
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}
.appbar .brand-tag .lock { opacity: .8; }
.appbar a { color: var(--on-dark); }

/* ---- Layout ---------------------------------------------------------------*/
.wrap { max-width: 1120px; margin: 0 auto; padding: 34px 22px 84px; }
.wrap.narrow { max-width: 500px; }
.wrap.mid { max-width: 800px; }

.page-head { margin-bottom: 24px; }
.page-head h1 {
  font-size: clamp(24px, 3.2vw, 34px); margin: 0 0 6px;
  letter-spacing: -.9px; font-weight: 800;
}
.page-head p { margin: 0; color: var(--ink-2); font-size: 15px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  color: var(--red-dark); margin-bottom: 12px;
}
.eyebrow::before {
  content: ""; width: 20px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--red), rgba(228, 20, 27, .2));
}

/* ==========================================================================
   App shell — floating icon rail + glass sidebar (admin & analytics)
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: 74px 262px minmax(0, 1fr);
  gap: 18px;
  max-width: 1420px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  align-items: start;
}

/* icon rail */
.rail {
  position: sticky; top: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 12px;
  border-radius: var(--radius-lg);
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 26px 60px -18px rgba(0, 0, 0, .6);
}
.rail-logo {
  width: 42px; height: 42px; border-radius: 13px; overflow: hidden; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08);
}
.rail-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-sep { width: 26px; height: 1px; background: rgba(255, 255, 255, .16); margin: 4px 0; }
.rail-btn {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .62);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer; font-family: inherit;
  transition: background .18s, color .18s, border-color .18s, transform .12s;
}
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rail-btn:active { transform: scale(.94); }
.rail-btn.on {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.rail-btn.accent.on { background: var(--red); border-color: rgba(255, 255, 255, .3); }
.rail-spacer { flex: 1 1 auto; min-height: 8px; }
.rail-label {
  writing-mode: vertical-rl; text-orientation: mixed;
  font-size: 9px; letter-spacing: .34em; text-transform: uppercase;
  color: rgba(255, 255, 255, .32); margin: 6px 0;
  font-family: var(--mono);
}

/* sidebar */
.side {
  position: sticky; top: 18px;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(180%);
  backdrop-filter: blur(var(--blur-lg)) saturate(180%);
  border: 1px solid var(--edge-2);
  box-shadow: var(--shadow);
}
.side-user { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; }
.side-user .av {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .8);
  box-shadow: 0 4px 12px -4px rgba(10, 10, 11, .4);
  background: #16161a;
}
.side-user .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-user .who { min-width: 0; }
.side-user .who .n { font-weight: 700; font-size: 14.5px; letter-spacing: -.2px; display: flex; align-items: center; gap: 5px; }
.side-user .who .e { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sec {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em; padding: 14px 8px 7px;
}
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; margin-bottom: 2px;
  border-radius: 13px; font-size: 14.5px; font-weight: 550;
  color: var(--ink-2); cursor: pointer;
  border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.side-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .75; }
.side-item .lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .num {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.side-item:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.side-item.on {
  background: var(--glass-hi);
  border-color: var(--edge);
  color: var(--ink); font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 4px 12px -6px rgba(10, 10, 11, .22);
}
.side-item.on svg { opacity: 1; color: var(--red); }
.side-divide { height: 1px; background: var(--hairline); margin: 12px 6px; }

.shell-main { min-width: 0; padding-bottom: 40px; }

/* Sign-in screen — vertically centred floating glass card. */
.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 0; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.auth-brand .logo-mark { box-shadow: inset 0 1px 0 var(--edge), 0 8px 20px -8px rgba(10, 10, 11, .4); }
.auth-brand .brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.4px; color: var(--ink); }
.auth-brand .brand-name span { color: var(--red); }

@media (max-width: 1060px) {
  .shell { grid-template-columns: 74px minmax(0, 1fr); }
  .side { display: none; }
}
@media (max-width: 700px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 32px; gap: 14px; }
  .rail {
    position: sticky; top: 10px; z-index: 40;
    flex-direction: row; justify-content: flex-start;
    border-radius: 20px; padding: 9px 11px; gap: 7px;
  }
  .rail-sep, .rail-label, .rail-spacer { display: none; }
  .rail-btn { width: 42px; height: 42px; }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card { padding: 26px; border-radius: var(--radius); }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -.35px; font-weight: 750; }
.card .card-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.card code {
  font-family: var(--mono); font-size: .92em;
  background: var(--glass-sunken); border: 1px solid var(--hairline);
  padding: 1px 6px; border-radius: 6px;
}

/* ==========================================================================
   Forms
   ========================================================================== */
label { display: block; font-size: 13px; font-weight: 650; margin: 18px 0 7px; color: var(--ink); }
.card > label:first-of-type, form > label:first-of-type { margin-top: 0; }
.hint { font-weight: 400; color: var(--muted); }

input, select, textarea {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  color: var(--ink);
  background: var(--glass-hi);
  border: 1px solid var(--edge-2);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(10, 10, 11, .05);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, textarea:hover { background: rgba(255, 255, 255, .8); }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, .92);
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-ring), inset 0 1px 2px rgba(10, 10, 11, .04);
}
textarea { resize: vertical; min-height: 66px; }
.field-money { position: relative; }
.field-money .cur {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; font-weight: 700; pointer-events: none; z-index: 1;
}
.field-money input { padding-left: 46px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
/* min-width:0 lets a flex item shrink below its content width. Without it, a
   long <select> label (e.g. "FM-1013 · Surgery Planning Program · $2,000.00")
   forces the item wider than the card and the row overflows on mobile. */
.row > * { flex: 1 1 160px; min-width: 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 20px; font-size: 15px; font-weight: 700; font-family: inherit;
  letter-spacing: -.15px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .16s, box-shadow .16s, border-color .16s, opacity .16s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn-block { width: 100%; }

.btn-red {
  background: linear-gradient(180deg, #f0272e, var(--red) 55%, var(--red-dark));
  color: #fff; border-color: rgba(255, 255, 255, .22);
  box-shadow: var(--shadow-red);
}
.btn-red:hover { background: linear-gradient(180deg, var(--red), var(--red-dark)); }
.btn-red:disabled {
  background: rgba(255, 255, 255, .38); color: #78787f;
  border-color: var(--edge-2); box-shadow: inset 0 1px 0 var(--edge);
  cursor: not-allowed;
}
.btn-dark {
  background: var(--glass-dark); color: var(--on-dark);
  border-color: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 24px -10px rgba(0, 0, 0, .5);
}
.btn-dark:hover { background: rgba(28, 28, 32, .9); color: #fff; }
.btn-outline {
  background: var(--glass-hi); color: var(--ink);
  border-color: var(--edge-2);
  box-shadow: inset 0 1px 0 var(--edge), 0 2px 8px -4px rgba(10, 10, 11, .16);
}
.btn-outline:hover { background: rgba(255, 255, 255, .9); border-color: rgba(10, 10, 11, .18); }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 12px; border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 16px 22px; font-size: 16px; border-radius: 14px; }

/* ==========================================================================
   Notices  (flat tints — nested inside glass, so no blur)
   ========================================================================== */
.notice {
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 14px;
  margin-bottom: 16px; border: 1px solid transparent;
}
.notice.error { background: var(--red-soft); color: var(--red-dark); border-color: rgba(228, 20, 27, .28); }
.notice.info  { background: var(--glass-sunken); color: var(--ink-2); border-color: var(--hairline); }
.notice.warn  { background: var(--warn-soft); color: var(--warn); border-color: rgba(217, 138, 15, .3); }
.hidden { display: none !important; }

/* ==========================================================================
   Pills / tags / chips
   ========================================================================== */
.pill {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 3px 11px; border-radius: 999px; letter-spacing: .01em;
  border: 1px solid transparent;
}
.pill.paid { background: var(--ok-soft); color: var(--ok); border-color: rgba(18, 161, 80, .28); }
.pill.pending { background: var(--warn-soft); color: var(--warn); border-color: rgba(217, 138, 15, .3); }
.pill.expired { background: rgba(10, 10, 11, .07); color: var(--muted); border-color: var(--hairline); }
.modal-expiry {
  font-size: 12.5px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid rgba(217, 138, 15, .3); border-radius: 10px;
  padding: 8px 12px; margin: 0 0 16px;
}

.tag {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 3px 8px; border-radius: 7px; border: 1px solid transparent;
}
.tag.included { background: rgba(14, 14, 16, .82); color: #fff; }
.tag.optional { background: var(--red-soft); color: var(--red-dark); border-color: rgba(228, 20, 27, .28); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 7px;
  background: var(--glass-sunken); color: var(--ink-2);
  border: 1px solid var(--hairline);
  text-transform: uppercase; letter-spacing: .05em;
}
.chip.yt { background: rgba(228, 20, 27, .13); color: #a5121a; border-color: rgba(228, 20, 27, .26); }
.chip.ig { background: rgba(193, 53, 132, .14); color: #91215c; border-color: rgba(193, 53, 132, .26); }
.chip.tt { background: rgba(20, 20, 24, .12); color: #1c1c22; border-color: rgba(20, 20, 24, .22); }
.chip.direct { background: var(--glass-sunken); color: var(--muted); }

/* ==========================================================================
   Copy-link box
   ========================================================================== */
.linkbox { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.linkbox input {
  flex: 1 1 220px; min-width: 0;
  font-size: 13px; font-family: var(--mono);
  background: var(--glass-sunken);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--hairline-2); vertical-align: middle; }
th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 800;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
tbody tr { transition: background .14s; }
tbody tr:hover { background: rgba(255, 255, 255, .34); }
tbody tr:last-child td { border-bottom: none; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { color: var(--muted); text-align: center; padding: 36px 0; font-size: 14px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Add-on ("topping") components — shared admin + checkout
   ========================================================================== */
.addon-grid { display: grid; gap: 12px; }

.topping {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1px solid var(--edge-2); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer;
  background: var(--glass-inset);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: border-color .16s, box-shadow .16s, background .16s, transform .1s;
}
.topping:hover { background: rgba(255, 255, 255, .58); transform: translateY(-1px); }
.topping.selected {
  border-color: var(--red); background: var(--red-tint);
  box-shadow: 0 0 0 3px var(--red-ring), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.topping.locked {
  cursor: default; background: var(--glass-sunken);
  border-style: dashed; transform: none;
}
.topping .check {
  width: 24px; height: 24px; border-radius: 8px; flex: 0 0 auto; margin-top: 1px;
  border: 1.5px solid rgba(10, 10, 11, .18); background: rgba(255, 255, 255, .7);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .16s, border-color .16s;
}
.topping.selected .check { background: var(--red); border-color: var(--red); }
.topping.locked .check { background: rgba(14, 14, 16, .84); border-color: transparent; }
.topping .check svg { width: 14px; height: 14px; opacity: 0; }
.topping.selected .check svg, .topping.locked .check svg { opacity: 1; }
.topping .body { flex: 1; min-width: 0; }
.topping .body .t-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.topping .body .t-name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.topping .body .t-price { font-weight: 800; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.topping .body .t-price .plus { color: var(--red); }
.topping .body .t-desc { color: var(--muted); font-size: 13px; margin-top: 3px; }

.addon-cfg {
  border: 1px solid var(--edge-2); border-radius: var(--radius); padding: 14px 16px;
  background: var(--glass-inset);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: border-color .16s, background .16s;
}
.addon-cfg.on { border-color: var(--red); background: var(--red-tint); }
.addon-cfg-head { display: flex; align-items: center; gap: 12px; }
.addon-cfg-head .switch-name { flex: 1; min-width: 0; }
.addon-cfg-head .switch-name .n { font-weight: 700; font-size: 14.5px; letter-spacing: -.2px; }
.addon-cfg-head .switch-name .d { color: var(--muted); font-size: 12.5px; }
.addon-cfg-body { display: none; margin-top: 14px; gap: 12px; align-items: end; }
.addon-cfg.on .addon-cfg-body { display: flex; flex-wrap: wrap; }
.addon-cfg-body label { margin: 0 0 6px; }
.addon-cfg-body .fld { flex: 1 1 140px; min-width: 0; }
/* .cfg-price inherits the global input styling; .cfg-switch is the hidden
   checkbox inside .switch — both intentionally need no rules of their own. */

/* toggle switch */
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: rgba(10, 10, 11, .16);
  box-shadow: inset 0 1px 3px rgba(10, 10, 11, .18);
  transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(10, 10, 11, .3);
  transition: transform .2s cubic-bezier(.32, .72, 0, 1);
}
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--red-ring); }

/* segmented control */
.seg {
  display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px;
  background: var(--glass-sunken); border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 2px rgba(10, 10, 11, .07);
}
.seg button {
  border: none; background: transparent; padding: 7px 13px;
  font-size: 12.5px; font-weight: 700; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-family: inherit;
  transition: background .16s, color .16s;
}
.seg button:hover { color: var(--ink); }
.seg button.active {
  background: rgba(255, 255, 255, .92); color: var(--ink);
  box-shadow: 0 1px 3px rgba(10, 10, 11, .16), inset 0 1px 0 #fff;
}

/* ==========================================================================
   CHECKOUT page
   ========================================================================== */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
/* min-width:0 is load-bearing: without it, long product names / monospace URLs
   force these grid children wider than the column and the layout overflows. */
.col-main { min-width: 0; }
.col-aside { min-width: 0; }
.aside-sticky { position: sticky; top: 92px; }

.product-hero { display: flex; gap: 16px; align-items: center; }
.product-hero .thumb {
  width: 76px; height: 76px; border-radius: 18px; flex: 0 0 auto; overflow: hidden;
  background: rgba(14, 14, 16, .86);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--edge-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 20px -8px rgba(10, 10, 11, .4);
}
.product-hero .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-hero .thumb .fallback { color: #fff; font-weight: 800; font-size: 19px; }
.product-hero .thumb .fallback b { color: var(--red); }
.product-hero h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.6px; font-weight: 800; }
.product-hero .p-desc { color: var(--ink-2); font-size: 14px; margin: 0; }

.base-price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 18px; padding-top: 18px;
  border-top: 1px dashed var(--hairline);
}
.base-price-row .lab { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.base-price-row .val { font-size: 21px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.section-title h2 { font-size: 17px; margin: 0; letter-spacing: -.35px; font-weight: 750; }
.section-title .count {
  font-size: 11.5px; color: var(--muted); font-weight: 700;
  background: var(--glass-sunken); border: 1px solid var(--hairline);
  padding: 2px 10px; border-radius: 999px;
}

/* "What's included" program spec — nested in a glass card, so flat tints only. */
.spec { display: grid; gap: 14px; }
.spec-group {
  background: var(--glass-sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.spec-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--red-dark); margin-bottom: 7px;
}
.spec-list { margin: 0; padding-left: 18px; }
.spec-list li { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.spec-list li:last-child { margin-bottom: 0; }
.spec-list li::marker { color: var(--red); }
.spec-foot { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

/* Order summary */
.summary .s-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; letter-spacing: -.3px; }
.summary-lines { display: flex; flex-direction: column; gap: 10px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.summary-line .sl-name { color: var(--ink-2); }
.summary-line .sl-name small { display: block; color: var(--muted); font-size: 11.5px; }
.summary-line .sl-val { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-line.muted .sl-name, .summary-line.muted .sl-val { color: var(--muted); font-weight: 400; }
.summary-divider { height: 1px; background: var(--hairline); margin: 15px 0; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; }
.summary-total .lab { font-size: 15px; font-weight: 800; }
.summary-total .amt { font-size: 27px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.summary-total .amt small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.tax-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

.terms-box {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--glass-sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 13px 14px; margin: 18px 0 16px;
  font-size: 13.5px; color: var(--ink-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.terms-box input[type="checkbox"] {
  width: 19px; height: 19px; margin: 1px 0 0; flex: 0 0 auto;
  accent-color: var(--red); cursor: pointer; box-shadow: none;
}
.terms-box label { margin: 0; font-weight: 400; cursor: pointer; line-height: 1.5; }
.terms-box strong { color: var(--ink); }

/* Trust copy on a payment page — kept at --ink-2, never faded. `opacity` on
   text composites against live glass, making the effective colour
   unpredictable, so it is deliberately not used here. */
.secure-note {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--ink-2); font-size: 12px; margin-top: 14px; text-align: center;
}
.pay-methods {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 12px; font-size: 11.5px; color: var(--ink-2);
}

/* Sticky mobile action bar — on a phone the summary is ~2 screens below the
   fold, so the total and CTA are pinned to the bottom instead. Desktop hides
   it entirely (the sticky summary column already does this job). */
.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 -12px 34px -14px rgba(0, 0, 0, .6);
  /* clear the iPhone home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(0);
  transition: transform .22s cubic-bezier(.32, .72, 0, 1), opacity .22s;
}
.paybar.tucked { transform: translateY(110%); opacity: 0; pointer-events: none; }
.paybar-inner {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 15px; max-width: 640px; margin: 0 auto;
}
.paybar-total { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.paybar-total .pb-lab {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--on-dark-muted);
}
.paybar-total .pb-amt {
  font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.paybar .btn { flex: 1 1 auto; min-height: 48px; }
.paybar .btn:disabled {
  background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .6);
  border-color: rgba(255, 255, 255, .16); box-shadow: none;
}
/* Draw attention to the consent box when someone taps Pay without ticking it. */
@keyframes fm-nudge {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
  35%      { box-shadow: 0 0 0 4px var(--red-ring); }
}
.terms-box.nudge { animation: fm-nudge .55s ease 2; border-color: var(--red); }

/* status cards (paid / not found) */
.state-card { text-align: center; padding: 44px 26px; }
.state-icon {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 16px;
  border: 1px solid var(--edge-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
/* Solid discs, white glyph — a tinted disc's contrast drifted with the
   backdrop (down to 3.1:1). The inset highlight keeps the glass reading. */
.state-icon.ok { background: var(--ok); color: #fff; border-color: rgba(255, 255, 255, .35); }
.state-icon.red { background: var(--red-dark); color: #fff; border-color: rgba(255, 255, 255, .35); }
.state-card h1 { font-size: 23px; margin: 0 0 6px; letter-spacing: -.6px; }
.state-card p { color: var(--muted); margin: 0; }

.foot { text-align: center; color: var(--ink-2); font-size: 12px; margin-top: 26px; }
.foot a { color: var(--ink-2); text-decoration: underline; }

/* ==========================================================================
   Legal page
   ========================================================================== */
.legal h1 { font-size: 27px; letter-spacing: -.8px; margin: 0 0 6px; font-weight: 800; }
.legal h2 { font-size: 16px; margin-top: 26px; letter-spacing: -.3px; font-weight: 750; }
.legal .sub-head {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--red-dark); margin: 24px 0 10px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.legal p { color: var(--ink-2); font-size: 15px; }
.legal .highlight {
  background: var(--red-soft); border: 1px solid rgba(228, 20, 27, .26);
  border-left: 4px solid var(--red);
  padding: 14px 16px; border-radius: 10px; color: var(--red-dark); margin: 18px 0;
}
.legal .highlight strong { color: var(--red-dark); }
.legal ul, .legal ol { color: var(--ink-2); font-size: 15px; padding-left: 22px; margin: 10px 0; }
.legal li { margin-bottom: 8px; }
.legal .clause { margin: 0 0 11px; }
.legal .clause > strong:first-child { color: var(--ink); }
.legal .defn {
  background: var(--glass-sunken); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 16px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.legal .defn p { margin: 7px 0; font-size: 14.5px; }
.legal .note { font-size: 13px; color: var(--muted); font-style: italic; }

/* ==========================================================================
   Styled dropdown
   ========================================================================== */
.sel { position: relative; }
.sel > select { position: absolute; opacity: 0; pointer-events: none; width: 100%; height: 0; padding: 0; border: 0; }
.sel-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; font-weight: 550; text-align: left;
  color: var(--ink);
  background: var(--glass-hi);
  border: 1px solid var(--edge-2); border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 var(--edge), inset 0 -1px 2px rgba(10, 10, 11, .04);
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.sel-btn:hover { background: rgba(255, 255, 255, .86); }
.sel-btn.placeholder .sel-label { color: var(--muted); font-weight: 400; }
.sel-btn:focus-visible, .sel.open .sel-btn {
  outline: none; border-color: var(--red);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 4px var(--red-ring);
}
/* min-width:0 is what actually enables the ellipsis inside the flex button. */
.sel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sel-caret { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); transition: transform .2s cubic-bezier(.32,.72,0,1), color .18s; }
.sel.open .sel-caret { transform: rotate(180deg); color: var(--red); }

/* Menus stay HIGH opacity on purpose — option text must never fight the
   backdrop for legibility. */
.sel-menu {
  position: absolute; z-index: 70; top: calc(100% + 7px); left: 0; right: 0;
  padding: 7px; max-height: 300px; overflow-y: auto;
  border-radius: 15px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(180%);
  backdrop-filter: blur(var(--blur-lg)) saturate(180%);
  border: 1px solid var(--edge-2);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.985);
  transition: opacity .18s ease, transform .18s cubic-bezier(.32,.72,0,1), visibility .18s;
}
.sel.open .sel-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* A surface with backdrop-filter is its own stacking context, so an open
   menu's z-index can never beat a LATER sibling surface — the dropdown would
   paint *under* the next card. Lift the host surface while a menu is open.
   20 stays below .rail (40) and .appbar (50). Adds no blur, so the
   no-nested-blur rule and select.js's .sel contract are both untouched. */
.card:has(.sel.open),
.glass:has(.sel.open),
.sheet:has(.sel.open),
.stat:has(.sel.open) { position: relative; z-index: 20; }
.sel-opt {
  padding: 10px 12px; border-radius: 10px; font-size: 14.5px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background .12s, color .12s;
}
.sel-opt:hover { background: rgba(10, 10, 11, .06); }
.sel-opt.active {
  background: linear-gradient(180deg, #f0272e, var(--red));
  color: #fff; font-weight: 650;
  box-shadow: 0 4px 12px -4px rgba(228, 20, 27, .5);
}
.sel-opt.disabled { color: var(--muted); cursor: not-allowed; background: none; }

/* ==========================================================================
   Analytics
   ========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 22px; }

/* ---- Link-created modal ---------------------------------------------------*/
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(14, 14, 16, .45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: fm-fade .18s ease;
}
@keyframes fm-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes fm-pop { from { opacity: 0; transform: translateY(12px) scale(.97) } to { opacity: 1; transform: none } }
.modal {
  width: 100%; max-width: 460px; padding: 28px 26px; text-align: center;
  border-radius: var(--radius-lg);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(180%);
  backdrop-filter: blur(var(--blur-lg)) saturate(180%);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-lg);
  animation: fm-pop .22s cubic-bezier(.32,.72,0,1);
}
.modal-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; background: var(--ok);
  box-shadow: 0 8px 22px -8px rgba(10, 92, 49, .7), inset 0 1px 0 rgba(255,255,255,.35);
}
.modal h2 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.5px; }
.modal-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 20px; }
.modal label {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: 6px;
}
.modal input { font-family: var(--mono); font-size: 13px; text-align: center; background: var(--glass-sunken); }
.modal-actions { margin-top: 16px; display: grid; gap: 10px; }
.modal-row { display: flex; gap: 10px; }
.modal-row .btn { flex: 1; }
.modal .btn.is-copied { background: var(--ok); box-shadow: 0 8px 22px -8px rgba(10, 92, 49, .6); }
.modal-note { font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.stat { padding: 17px 19px; border-radius: var(--radius); }
.stat .k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.stat .v { font-size: 29px; font-weight: 800; letter-spacing: -1.2px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.stat.accent {
  background: var(--glass-dark);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 24px 54px -18px rgba(0, 0, 0, .55);
}
.stat.accent .k { color: var(--on-dark-muted); }
.stat.accent .v { color: #fff; }
.stat.accent .v small { color: #ff5a5f; }

.bar-track {
  height: 6px; border-radius: 99px; overflow: hidden; margin-top: 7px; min-width: 90px;
  background: rgba(10, 10, 11, .1);
  box-shadow: inset 0 1px 2px rgba(10, 10, 11, .12);
}
.bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  box-shadow: 0 0 10px rgba(228, 20, 27, .45);
}
.bar-fill.dim { background: rgba(10, 10, 11, .22); box-shadow: none; }

.src-cell { display: flex; align-items: center; gap: 9px; }

.tabs {
  display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap;
  padding: 4px; border-radius: 14px;
  background: var(--glass-sunken); border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 2px rgba(10, 10, 11, .06);
}
.tab {
  padding: 9px 15px; font-size: 13.5px; font-weight: 700; color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; font-family: inherit;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .45); }
.tab.on {
  color: var(--ink); background: rgba(255, 255, 255, .92);
  border-color: var(--edge);
  box-shadow: 0 2px 8px -3px rgba(10, 10, 11, .22), inset 0 1px 0 #fff;
}

/* ==========================================================================
   Accessibility / capability fallbacks
   ========================================================================== */

/* No backdrop-filter (older Firefox, some Android): make surfaces opaque so
   text never sits on a busy backdrop. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass, .card, .stat, .sheet, .side, .sel-menu { background: rgba(252, 252, 253, .97); }
  .appbar, .rail, .stat.accent, .btn-dark { background: #101014; }
  body::before { filter: saturate(.85); }
}

/* Respect the OS "reduce transparency" setting. */
@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .stat, .sheet, .side, .sel-menu {
    background: #fbfbfc;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .appbar, .rail, .stat.accent { background: #101014; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Visible focus for keyboard users on every interactive surface. */
.btn:focus-visible, .tab:focus-visible, .rail-btn:focus-visible,
.side-item:focus-visible, .topping:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  .aside-sticky { position: static; }
  /* room for the fixed action bar so it never covers the last card */
  body.has-paybar .wrap { padding-bottom: 108px; }
}
/* Above the collapse point the summary column is already sticky and visible,
   so the bar would be a redundant second CTA. */
@media (min-width: 901px) {
  .paybar { display: none !important; }
}
/* ---- Phones ---------------------------------------------------------------*/
@media (max-width: 620px) {
  .wrap { padding: 20px 14px 64px; }
  .card { padding: 18px 16px; border-radius: 18px; }
  .card + .card { margin-top: 14px; }
  .cell-actions { flex-direction: column; }
  .page-head h1 { letter-spacing: -.6px; }
  .stat .v { font-size: 24px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
  body::after { display: none; } /* keep paint cost down on phones */

  /* Checkout: tighten the hero so the price is reachable sooner */
  .product-hero { gap: 13px; }
  .product-hero .thumb { width: 58px; height: 58px; border-radius: 15px; }
  .product-hero h1 { font-size: 19px; }
  .state-card { padding: 32px 18px; }
  .summary-total .amt { font-size: 24px; }
  .spec-group { padding: 12px 14px; }
  .spec-list { padding-left: 17px; }
  .spec-list li { font-size: 13.5px; }

  /* section headers stack instead of squashing their pill */
  .section-title { flex-wrap: wrap; gap: 6px 10px; }
  .appbar-inner { padding: 11px 14px; gap: 10px; }
  .appbar .brand-tag { padding: 4px 9px; font-size: 11px; }

  /* comfortable tap targets */
  .btn-sm { padding: 10px 14px; }
  .terms-box { padding: 14px; }
  .terms-box input[type="checkbox"] { width: 22px; height: 22px; }
}

/* Very narrow phones (iPhone SE / 320px) */
@media (max-width: 380px) {
  .appbar .brand-tag .lock { display: none; }
  .appbar .brand-name { font-size: 15.5px; }
  .base-price-row .val { font-size: 18px; }
  .summary-total .amt { font-size: 22px; }
  .paybar-inner { gap: 10px; padding: 10px 12px; }
  .paybar-total .pb-amt { font-size: 17px; }
  .btn-lg { padding: 15px 18px; font-size: 15px; }
}

/* Print — glass makes no sense on paper (users print the T&Cs). */
@media print {
  body { background: #fff; }
  body::before, body::after, .appbar, .rail, .side { display: none !important; }
  /* .rail/.side are hidden above, but the grid tracks remain — without this
     the page prints into the 74px rail column. */
  .shell { display: block; max-width: none; padding: 0; gap: 0; }
  .shell-main { padding-bottom: 0; }
  .card, .glass, .stat {
    background: #fff !important; box-shadow: none !important;
    border: 1px solid #ddd !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .wrap { max-width: none; padding: 0; }
}

/* ---- List controls: search + filter chips on one row ---------------------- */
.list-controls {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 14px;
}
.list-controls input[type="search"] { flex: 1 1 220px; max-width: 340px; margin: 0; }
.list-controls .tabs { margin: 0; }
@media (max-width: 640px) {
  .list-controls { flex-direction: column; align-items: stretch; }
  .list-controls input[type="search"] { max-width: none; }
}
