/* THREAD Mobile — app layer (loads after tokens.css)
   Styles mirror Web demo values: btn/badge/chips/fields/summary/toast. */

/* ---------- Safe areas ----------
   RULE for every app-style prototype: reserve BOTH safe areas.
   Real devices: env(safe-area-inset-*) (status bar / notch on top, home indicator below).
   Desktop phone frame: env() = 0, so the frame simulates them (override inside @media). */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; } /* mirrors Web demo main.css — keyboard focus must be visible */
body {
  font-family: var(--font); color: var(--ink); background: var(--surface);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }

/* ---------- Stage / phone frame (desktop) ---------- */
.stage { height: 100vh; height: 100dvh; }
.phone { height: 100%; }
.stage-note { display: none; }
#app {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); overflow: hidden;
}
@media (min-width: 560px) {
  body { overflow: auto; }
  .stage {
    height: auto; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 40px 24px;
    background: linear-gradient(165deg, #FBF6EF, #EFE6D8);
  }
  .phone {
    flex: 0 0 auto; width: 392px;
    height: min(846px, calc(100vh - 140px)); min-height: 600px;
    background: #141414; border-radius: 52px; padding: 12px;
    box-shadow: 0 40px 90px rgba(20, 15, 10, .30), 0 4px 16px rgba(20, 15, 10, .14);
  }
  #app { border-radius: 40px; --safe-top: 14px; --safe-bottom: 8px; /* simulated status bar / home indicator */ }
  .stage-note { display: block; font-size: 13px; color: #685C47; }
}

/* ---------- Screen & transitions ---------- */
.screen {
  flex: 1; min-height: 0; position: relative;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.view { display: flex; flex-direction: column; min-height: 100%; }
@keyframes pushIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes popIn  { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.view.anim-push { animation: pushIn var(--dur) var(--ease); }
.view.anim-pop  { animation: popIn var(--dur) var(--ease); }
.view.anim-fade { animation: fadeIn 160ms var(--ease); }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(56px + var(--safe-top)); flex: 0 0 auto;
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.appbar.top { display: flex; align-items: center; justify-content: space-between; padding: var(--safe-top) 16px 0; }
.appbar.sub { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; padding: var(--safe-top) 4px 0; }
.bar-title { font-size: 16px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-right { display: flex; justify-content: flex-end; align-items: center; }
.bar-lock { display: grid; place-items: center; width: 44px; color: var(--ink-secondary); }
.bar-lock svg { width: 18px; height: 18px; }
.logo { font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.logo .dot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 1.3px; background: var(--accent);
  margin-left: 3px; vertical-align: baseline;
}
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.saved svg path { fill: var(--accent); stroke: var(--accent); }

/* Search app bar */
.appbar.search-head { display: flex; align-items: center; gap: 4px; padding: calc(8px + var(--safe-top)) 12px 8px 16px; height: calc(60px + var(--safe-top)); }
.search-bar {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-pill);
}
.search-bar:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); } /* the input kills its own outline, so the bar carries the focus cue */
.search-bar svg { width: 17px; height: 17px; color: var(--ink-secondary); flex: 0 0 auto; }
.search-bar input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; outline: none; }
.search-bar input::placeholder { color: var(--ink-disabled); }
.bar-cancel { padding: 8px 10px; font-size: 14px; font-weight: 500; color: var(--ink-secondary); }

/* ---------- Tab bar ---------- */
.tabbar {
  display: flex; flex: 0 0 auto; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--surface-section);
  padding: 8px 4px calc(8px + var(--safe-bottom));
}
.tabbar.hidden { display: none; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-top: 2px; color: var(--ink-disabled); position: relative;
}
.tab .t-icon { position: relative; display: grid; place-items: center; }
.tab svg { width: 24px; height: 24px; }
.tab .t-label { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; }
.tab.active { color: var(--ink); }
.tab .ind { width: 4px; height: 4px; border-radius: 1px; background: transparent; }
.tab.active .ind { background: var(--accent); }
.badge {
  position: absolute; top: -5px; right: -9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent-btn); color: var(--ink);
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.badge:empty, .badge[data-count="0"] { display: none; }

/* ---------- Buttons (mirrors Web demo) ---------- */
.btn {
  height: 50px; padding: 0 28px;
  border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--dur), border-color var(--dur), color var(--dur), opacity var(--dur);
}
.btn-primary { background: var(--accent-btn); color: var(--ink); }
.btn-primary:active { background: #d96d31; }
.btn-primary:disabled { background: var(--surface-alt); color: var(--ink-disabled); cursor: not-allowed; }
.btn-secondary { border: 1px solid var(--ink); color: var(--ink); }
.btn-secondary:active { background: var(--surface-alt); }
.btn-block { width: 100%; }
.btn-sm { height: 40px; font-size: 14px; padding: 0 16px; }

/* Sticky CTA (bottom, thumb zone) */
.sticky-cta {
  position: sticky; bottom: 0; z-index: 15; margin-top: auto;
  padding: 10px 16px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 34%);
}
#app.no-tab .sticky-cta { padding-bottom: calc(12px + var(--safe-bottom)); }

/* ---------- Typography helpers ---------- */
.label-caps { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.page-title { display: flex; align-items: baseline; gap: 10px; padding: 20px 16px 12px; }
.page-title h1 { font-size: 26px; font-weight: 700; }
.pt-count { font-size: 13px; color: var(--ink-secondary); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 16px; margin: 28px 0 14px; }
.sec-head h2 { font-size: 20px; font-weight: 700; }
.view-all { font-size: 14px; font-weight: 500; color: var(--accent-text); }
.page-end { height: 28px; flex: 0 0 auto; }

/* ---------- Product cards ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 12px; padding: 0 16px; }
.card { position: relative; display: block; min-width: 0; }
.card-img {
  position: relative; display: block; aspect-ratio: 1;
  border-radius: var(--radius-card); overflow: hidden; background: #EFEFEF;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.sale-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--accent-btn); color: var(--ink);
  font-size: 11px; font-weight: 700;
  border-radius: var(--radius-mini); padding: 3px 7px;
}
.wish-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .92);
  display: grid; place-items: center;
}
.wish-btn svg { width: 18px; height: 18px; }
.wish-btn.saved svg path { fill: var(--accent); stroke: var(--accent); }
.wish-btn.unwish svg { width: 14px; height: 14px; }
.card-name { display: block; font-size: 14px; font-weight: 500; margin-top: 10px; }
.card-colour { font-size: 12px; color: var(--ink-secondary); margin-top: 2px; }
.card-price { font-size: 14px; font-weight: 700; color: var(--accent-text); margin-top: 6px; }
.card-price .struck, .pdp-price .struck, .rr-price .struck {
  color: var(--ink-disabled); text-decoration: line-through; font-weight: 500; margin-right: 6px;
}
.wish-card .btn { margin-top: 10px; }

/* Horizontal snap strip */
.strip {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 0 16px 4px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip .card { flex: 0 0 47%; scroll-snap-align: start; }

/* ---------- Home ---------- */
.m-hero {
  position: relative; height: 460px; flex: 0 0 auto;
  background: #2a2622 url("../img/hero.jpg") center / cover no-repeat;
  display: flex; align-items: flex-end;
}
.m-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0) 0%, rgba(5, 5, 5, .12) 55%, rgba(5, 5, 5, .62) 100%);
}
.m-hero .hero-inner { position: relative; padding: 0 20px 26px; color: #fff; }
.m-hero h1 { font-size: 40px; line-height: 1.1; font-weight: 700; margin: 10px 0 8px; }
.m-hero h1 .dot { display: inline-block; width: 7px; height: 7px; border-radius: 1.5px; background: var(--accent-btn); margin-left: 3px; }
.m-hero .sub { font-size: 14px; opacity: .88; margin-bottom: 18px; }

.benefit-strip { display: flex; gap: 8px; overflow-x: auto; padding: 16px; scrollbar-width: none; flex: 0 0 auto; }
.benefit-strip::-webkit-scrollbar { display: none; }
.benefit-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-alt); border-radius: var(--radius-pill);
  padding: 9px 14px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.benefit-chip svg { width: 16px; height: 16px; color: var(--accent); }

.tile {
  position: relative; display: flex; align-items: flex-end;
  height: 220px; border-radius: var(--radius-card); overflow: hidden;
  margin: 0 16px 12px; flex: 0 0 auto;
}
.tile::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0) 0%, rgba(5, 5, 5, .12) 55%, rgba(5, 5, 5, .62) 100%);
}
/* Portrait photos in a landscape tile show ~42% of image height —
   focal point set so the full head stays in frame (verified per aspect) */
.tile-women { background: #2a2622 url("../img/women-hero.jpg") center 6% / cover no-repeat; }
.tile-men { background: #2a2622 url("../img/men-hero.jpg") center 4% / cover no-repeat; }
.tile-foot { position: relative; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 16px 18px; color: #fff; }
.tile-label { font-size: 20px; font-weight: 700; }
.tile-go { font-size: 14px; font-weight: 500; }

/* ---------- Shop / PLP ---------- */
.pill-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; flex: 0 0 auto; }
.pill-row::-webkit-scrollbar { display: none; }
.pill-row.wrap { flex-wrap: wrap; overflow: visible; }
.pill {
  flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 16px; font-size: 13px; font-weight: 500; background: var(--surface);
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; padding: 2px 16px 14px; }
.toolbar .count { font-size: 13px; color: var(--ink-secondary); }
.filter-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 14px; font-size: 13px; font-weight: 500;
}
.filter-trigger svg { width: 14px; height: 14px; }
.f-count {
  min-width: 16px; height: 16px; border-radius: var(--radius-pill);
  background: var(--ink); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center; padding: 0 4px;
}

/* ---------- PDP ---------- */
.gallery { position: relative; flex: 0 0 auto; }
.g-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.g-track::-webkit-scrollbar { display: none; }
.g-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: start; background: #EFEFEF; }
.g-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.g-dots i { width: 5px; height: 5px; border-radius: 1px; background: rgba(20, 20, 20, .25); transition: background var(--dur); }
.g-dots i.on { background: var(--ink); }
.gallery .sale-badge { top: 14px; left: 16px; }

.pdp-info { padding: 20px 16px 4px; }
.pdp-info .eyebrow { color: var(--ink-secondary); }
.pdp-info h1 { font-size: 24px; font-weight: 700; margin-top: 6px; }
.pdp-colour { font-size: 13px; color: var(--ink-secondary); margin-top: 4px; }
.pdp-price { font-size: 20px; font-weight: 700; color: var(--accent-text); margin-top: 10px; }
.pdp-desc { font-size: 14px; line-height: 1.6; color: var(--ink-secondary); margin-top: 12px; }
.selector { margin-top: 22px; }
.sel-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 12px; }
.sel-label .muted { color: var(--ink-secondary); }
.sel-label strong { color: var(--ink); font-weight: 600; }

.swatches { display: flex; gap: 12px; }
.swatch {
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  display: grid; place-items: center; padding: 0; border: 1.5px solid transparent;
}
.swatch .dot { width: 26px; height: 26px; border-radius: var(--radius-pill); border: 1px solid rgba(0, 0, 0, .08); }
.swatch.active { border-color: var(--ink); }

.size-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.size-chip {
  min-width: 52px; height: 40px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; background: var(--surface);
  transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.size-chip.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.size-chip:disabled { color: var(--ink-disabled); cursor: not-allowed; text-decoration: line-through; }
.size-error { color: var(--error); font-size: 13px; margin-top: 10px; display: block; visibility: hidden; min-height: 17px; }
.size-error.show { visibility: visible; }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 30%, 70% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.size-chips.shake { animation: shake .4s; }

.accordion { border-top: 1px solid var(--border); margin-top: 26px; }
.accordion details { border-bottom: 1px solid var(--border); }
.accordion summary {
  list-style: none; cursor: pointer;
  padding: 17px 0; font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion .plus { font-size: 18px; font-weight: 400; color: var(--ink-secondary); transition: transform var(--dur); }
.accordion details[open] .plus { transform: rotate(45deg); }
.acc-body { font-size: 14px; line-height: 1.6; color: var(--ink-secondary); padding-bottom: 16px; }

/* ---------- Cart ---------- */
.ship-note {
  margin: 2px 16px 10px; padding: 12px 14px;
  background: var(--surface-alt); border-radius: var(--radius-input);
  font-size: 13px; flex: 0 0 auto;
}
.ship-bar { height: 4px; background: #E6E1DA; border-radius: 2px; margin-top: 9px; overflow: hidden; }
.ship-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width var(--dur); }

.cart-lines { flex: 0 0 auto; }
.cart-line { display: flex; gap: 12px; padding: 14px 16px; }
.cl-img { width: 92px; height: 92px; border-radius: var(--radius-input); overflow: hidden; background: #EFEFEF; flex: 0 0 auto; }
.cl-img img { width: 100%; height: 100%; object-fit: cover; }
.cl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-top { display: flex; justify-content: space-between; gap: 8px; }
.cl-name { font-size: 14px; font-weight: 500; }
.cl-remove { flex: 0 0 auto; width: 28px; height: 28px; margin: -4px -4px 0 0; display: grid; place-items: center; color: var(--ink-secondary); }
.cl-remove svg { width: 14px; height: 14px; }
.cl-meta { font-size: 12px; color: var(--ink-secondary); margin-top: 3px; }
.cl-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.cl-price { font-size: 14px; font-weight: 700; color: var(--accent-text); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-pill); height: 44px; }
.stepper button { width: 40px; height: 100%; font-size: 18px; color: var(--ink); }
.stepper button:disabled { color: var(--ink-disabled); cursor: not-allowed; }
.stepper .val { min-width: 28px; text-align: center; font-size: 15px; font-weight: 500; }
.stepper.sm { height: 34px; }
.stepper.sm button { width: 32px; font-size: 16px; }

.summary-m { margin: 8px 16px 4px; padding: 18px 18px 6px; background: var(--surface-alt); border-radius: var(--radius-card); flex: 0 0 auto; }
.summary-m .row { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; }
.summary-m .row .lbl { color: var(--ink-secondary); }
.summary-m .row .val { font-weight: 500; }
.summary-m .row.total { border-top: 1px solid var(--border); margin-top: 8px; padding: 14px 0; }
.summary-m .row.total .lbl { font-size: 16px; font-weight: 600; color: var(--ink); }
.summary-m .row.total .val { font-size: 16px; font-weight: 700; color: var(--accent-text); }

/* ---------- Checkout ---------- */
.co-sum {
  margin: 12px 16px 4px; background: var(--surface-alt);
  border-radius: var(--radius-input); flex: 0 0 auto; overflow: hidden;
}
.co-sum summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; font-size: 14px; font-weight: 500;
}
.co-sum summary::-webkit-details-marker { display: none; }
.co-sum .cs-total { font-weight: 700; color: var(--accent-text); }
.co-sum .cs-total::after { content: "▾"; color: var(--ink-secondary); font-weight: 400; margin-left: 8px; display: inline-block; transition: transform var(--dur); }
.co-sum[open] .cs-total::after { transform: rotate(180deg); }
.cs-body { padding: 0 16px 14px; }
.cs-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; color: var(--ink-secondary); }
.cs-line b { color: var(--ink); font-weight: 500; }
.cs-body .row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* Express checkout */
.express-block { padding: 16px 16px 4px; }
.wallet-btn {
  width: 100%; height: 50px; border-radius: var(--radius-pill);
  background: var(--ink); color: #fff;
  font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: opacity var(--dur);
}
.wallet-btn:active { opacity: .85; }
.wallet-btn svg { width: 17px; height: 17px; margin-top: -2px; }
.wallet-btn .g-mark { font-weight: 700; font-size: 18px; }
.pay-divider {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px; color: var(--ink-disabled); font-size: 12px;
}
.pay-divider::before, .pay-divider::after { content: ""; flex: 1; height: 1px; background: var(--surface-section); }
.wallet-body .w-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 14px; border-bottom: 1px solid var(--surface-section); }
.wallet-body .w-row .lbl { color: var(--ink-secondary); }
.wallet-body .w-row .val { font-weight: 500; text-align: right; }
.w-note { font-size: 12px; color: var(--ink-disabled); margin: 12px 0 4px; }

.co-form { display: flex; flex-direction: column; flex: 1; }
.co-form section { padding: 22px 16px 4px; }
.co-form h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; margin-bottom: 8px; }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 16px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-input); font: inherit; font-size: 16px; font-weight: 500;
  transition: border-color var(--dur);
}
.field input::placeholder { color: var(--ink-disabled); font-weight: 400; }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); } /* border + ring = 2px indicator, no layout shift */
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23141414' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field.error input { border-color: var(--error); }
.field .err { color: var(--error); font-size: 13px; margin-top: 6px; display: none; }
.field.error .err { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-hint { font-size: 12px; color: var(--ink-disabled); margin: 2px 0 6px; }
.pay-error {
  display: flex; gap: 10px; margin-bottom: 16px; padding: 14px;
  background: var(--error-bg); border-radius: var(--radius-input);
  font-size: 13px; line-height: 1.5;
}
.pay-error svg { width: 20px; height: 20px; color: var(--error); flex: 0 0 auto; margin-top: 1px; }

/* ---------- Confirmation ---------- */
.confirm { padding: 44px 24px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.confirm svg { width: 64px; height: 64px; color: var(--accent); }
.confirm h1 { font-size: 26px; font-weight: 700; margin-top: 18px; }
.confirm p { font-size: 14px; line-height: 1.6; color: var(--ink-secondary); margin-top: 10px; max-width: 300px; }
.details-card {
  width: 100%; background: var(--surface-alt); border-radius: var(--radius-card);
  padding: 8px 18px; text-align: left; margin-top: 22px;
}
.details-card .row { display: flex; justify-content: space-between; font-size: 14px; padding: 10px 0; }
.details-card .row .lbl { color: var(--ink-secondary); }
.details-card .row .val { font-weight: 500; }
.confirm .cta { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 22px; }

/* ---------- Tracking ---------- */
.track-head { padding: 20px 16px 24px; }
.track-head .th-num { font-size: 18px; font-weight: 600; }
.track-head .th-sub { font-size: 13px; color: var(--ink-secondary); margin-top: 4px; }
.tsteps { padding: 0 16px; }
.tstep { display: flex; gap: 14px; position: relative; padding-bottom: 30px; }
.tstep::before { content: ""; position: absolute; left: 11px; top: 27px; bottom: 3px; width: 2px; background: var(--surface-section); }
.tstep.done::before { background: var(--ink); }
.tstep:last-child { padding-bottom: 8px; }
.tstep:last-child::before { display: none; }
.t-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--border);
  font-size: 12px; position: relative; z-index: 1;
}
.tstep.done .t-dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.tstep.current .t-dot { border-color: var(--accent); }
.tstep.current .t-dot::after { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.t-info .t-title { font-size: 14px; font-weight: 600; color: var(--ink-secondary); }
.tstep.done .t-title, .tstep.current .t-title { color: var(--ink); }
.t-info .t-sub { font-size: 13px; color: var(--ink-secondary); margin-top: 2px; }
.t-info .t-date { font-size: 12px; color: var(--ink-disabled); margin-top: 2px; }

/* ---------- Wishlist ---------- */
.wish-sub { font-size: 13px; color: var(--ink-secondary); padding: 0 16px 16px; }

/* ---------- Account / support ---------- */
.signin-card {
  margin: 12px 16px 4px; padding: 20px 18px;
  background: var(--surface-alt); border-radius: var(--radius-card);
}
.signin-card h2 { font-size: 18px; font-weight: 700; }
.signin-card p { font-size: 13px; color: var(--ink-secondary); line-height: 1.5; margin: 6px 0 16px; }
.signin-card .field input { background: var(--surface); }
.user-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 14px; background: var(--surface-alt);
  border-radius: var(--radius-card); margin-bottom: 10px;
}
.avatar {
  width: 44px; height: 44px; border-radius: var(--radius-pill); flex: 0 0 auto;
  background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 16px; font-weight: 600;
}
.menu-list { padding: 12px 16px 0; }
.menu-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-secondary); padding: 14px 2px 10px;
}
.form-screen { padding: 20px 16px 8px; display: flex; flex-direction: column; }
.form-screen h1 { font-size: 24px; font-weight: 700; }
.form-screen p { font-size: 13px; color: var(--ink-secondary); line-height: 1.55; margin: 8px 0 20px; }
.doc-screen { padding: 20px 16px 8px; }
.doc-screen h1 { font-size: 24px; font-weight: 700; margin-bottom: 14px; }
.doc-screen p { font-size: 14px; color: var(--ink-secondary); line-height: 1.65; margin-bottom: 14px; }
.menu-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 14px; background: var(--surface-alt);
  border-radius: var(--radius-input); margin-bottom: 10px;
}
.menu-row .mr-icon { display: grid; place-items: center; }
.menu-row .mr-icon svg { width: 20px; height: 20px; color: var(--accent); }
.mr-body { flex: 1; min-width: 0; }
.mr-title { display: block; font-size: 14px; font-weight: 600; }
.mr-sub { display: block; font-size: 12px; color: var(--ink-secondary); margin-top: 2px; }
.mr-chev { font-size: 20px; color: var(--ink-disabled); line-height: 1; }
.accordion.pad-x { margin: 8px 16px 0; }
.contact-card { padding: 0 16px 8px; }
.contact-card p { font-size: 13px; color: var(--ink-secondary); line-height: 1.5; margin-bottom: 12px; }
.field textarea {
  width: 100%; min-height: 110px; padding: 12px 16px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-input); font: inherit; font-size: 16px; font-weight: 500;
  resize: vertical; transition: border-color var(--dur);
}
.field textarea::placeholder { color: var(--ink-disabled); font-weight: 400; }
.field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field.error textarea { border-color: var(--error); }

/* ---------- Search results ---------- */
.s-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-secondary); padding: 18px 16px 10px; }
.result-row { display: flex; gap: 12px; align-items: center; padding: 9px 16px; }
.rr-img { width: 56px; height: 56px; border-radius: var(--radius-mini); background: #EFEFEF; overflow: hidden; flex: 0 0 auto; }
.rr-img img { width: 100%; height: 100%; object-fit: cover; }
.rr-info { flex: 1; min-width: 0; }
.rr-name { display: block; font-size: 14px; font-weight: 500; }
.rr-meta { display: block; font-size: 12px; color: var(--ink-secondary); margin-top: 2px; }
.rr-price { font-size: 14px; font-weight: 700; color: var(--accent); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 56px 28px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty.tall { padding: 88px 28px; }
.empty svg { color: var(--accent); margin-bottom: 12px; }
.empty h2 { font-size: 24px; font-weight: 700; }
.empty p { font-size: 14px; color: var(--ink-secondary); line-height: 1.6; max-width: 300px; }
.empty .cta { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; width: 100%; max-width: 280px; }
.empty .pill-row { justify-content: center; padding-top: 12px; }

/* ---------- Bottom sheet ---------- */
#sheet-root { position: absolute; inset: 0; z-index: 40; visibility: hidden; pointer-events: none; }
#sheet-root.on { visibility: visible; }
#sheet-root .scrim {
  position: absolute; inset: 0; background: rgba(20, 20, 20, .44);
  opacity: 0; transition: opacity var(--dur); pointer-events: auto;
}
#sheet-root .sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-radius: 20px 20px 0 0;
  max-height: 84%; display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform var(--dur) var(--ease);
  pointer-events: auto;
}
#sheet-root.open .scrim { opacity: 1; }
#sheet-root.open .sheet { transform: none; }
.sheet::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 10px auto 0; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 4px; flex: 0 0 auto; }
.sheet-head h3 { font-size: 18px; font-weight: 600; }
.link-clear { font-size: 13px; font-weight: 500; color: var(--ink-secondary); text-decoration: underline; text-underline-offset: 3px; }
.sheet-body { overflow-y: auto; padding: 4px 20px 12px; }
.sheet-cta { padding: 12px 20px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--surface-section); flex: 0 0 auto; }

.f-group { padding: 15px 0; border-bottom: 1px solid var(--surface-section); }
.f-group.last { border-bottom: 0; }
.f-group h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 0; font-size: 14px; text-align: left; }
.opt .radio { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--border); transition: border var(--dur); }
.opt.on .radio { border: 6px solid var(--ink); }
.f-swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 62px; }
.f-swatch .fs-label { font-size: 10px; color: var(--ink-secondary); text-align: center; line-height: 1.25; }
.ss-prod { display: flex; gap: 14px; align-items: center; padding: 8px 0 16px; }
.ss-prod img { width: 64px; height: 64px; border-radius: var(--radius-input); background: #EFEFEF; object-fit: cover; }

/* ---------- Toast ---------- */
#toast-root { position: absolute; left: 0; right: 0; bottom: 0; z-index: 50; pointer-events: none; display: flex; justify-content: center; }
.toast {
  position: absolute; bottom: 84px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-pill); padding: 13px 22px;
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(20, 15, 10, .18);
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--dur), transform var(--dur);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast a { color: var(--accent-btn); text-decoration: underline; text-underline-offset: 2px; }

/* Fallback: environments without backdrop-filter get an opaque header
   (translucent-without-blur reads as a rendering bug). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .appbar { background: #fff; }
}

/* ---------- Reduced motion ---------- */
/* Vestibular-safe: screen slide-ins, sheets and the shake validation all
   collapse to instant state changes when the OS asks for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
