/* Self-hosted webfonts — Verde redesign.
   Cormorant Garamond (serif, headings) + Manrope (geometric grotesque, UI).
   Manrope replaces the brief's Hanken Grotesk, which has no Cyrillic subset
   on Google Fonts (the UI is Ukrainian/Russian). OFL-licensed, sourced from
   Google Fonts, subset to latin + cyrillic (cyrillic-ext carries the hryvnia
   sign U+20B4). Served same-origin from /fonts/*.woff2 — CSP default-src
   'self' covers font-src, no Caddyfile change needed. Regenerate via the
   Verde font-fetch script. */

/* Cormorant Garamond 500 — cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Cormorant Garamond 500 — cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Cormorant Garamond 500 — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cormorant Garamond 500 — latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cormorant Garamond 600 — cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-600-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Cormorant Garamond 600 — cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Cormorant Garamond 600 — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cormorant Garamond 600 — latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cormorant Garamond 700 — cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cormorant-700-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Cormorant Garamond 700 — cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cormorant-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Cormorant Garamond 700 — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cormorant-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cormorant Garamond 700 — latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cormorant-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Manrope 400 — cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/manrope-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Manrope 400 — cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/manrope-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Manrope 400 — latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/manrope-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope 400 — latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/manrope-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Manrope 500 — cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/manrope-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Manrope 500 — cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/manrope-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Manrope 500 — latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/manrope-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope 500 — latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/manrope-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Manrope 600 — cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/manrope-600-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Manrope 600 — cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/manrope-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Manrope 600 — latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/manrope-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope 600 — latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/manrope-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Manrope 700 — cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/manrope-700-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Manrope 700 — cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/manrope-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Manrope 700 — latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/manrope-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope 700 — latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/manrope-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================================
   Verde design tokens — single source of truth is docs/redesign/README.md.
   Light theme is fixed for now; the token architecture is dark-ready (Noir),
   but Noir values land in a later stage. Components reference ONLY these
   tokens — no raw hex at call sites.
   ============================================================================ */
:root {
  /* ---- Palette (Verde, light) ---- */
  --bg-app:       #E8E5DC; /* canvas behind the screen (phone frame in proto) */
  --surface:      #FCFBF7; /* screen / primary card background                */
  --surface-2:    #F6F4EC; /* secondary card (cart item, menu row)            */
  --surface-3:    #F0EEE4; /* chips, inactive tabs, promo field               */
  --forest:       #22432E; /* primary brand / CTA / active tab                */
  --forest-deep:  #1D2B21; /* headings, strong text                           */
  --forest-grad:  linear-gradient(150deg, #22432E, #2E5A3B); /* hero, headers  */
  --leaf:         #7CA24B; /* accent labels (category on card)                */
  --leaf-soft:    #B7CE93; /* text on deep green                              */
  --text:         #5C6359; /* body paragraph                                  */
  --text-muted:   #9AA091; /* captions, metadata                              */
  --text-muted-2: #7C8378; /* secondary descriptions                         */
  --on-forest:    #F4F1E9; /* text on green buttons                           */
  --hairline:     rgba(34, 67, 46, .1); /* dividers                           */
  --leaf-glow:    rgba(124, 162, 75, .28); /* --leaf @28% — hero decor circle */
  --leaf-veil:    rgba(183, 206, 147, .3); /* --leaf-soft @30% — avatar disc on forest header */
  --leaf-tile:    #E7ECDD; /* soft-green icon tile behind profile menu glyphs   */

  /* ---- State colours (not in the Verde palette; kept semantic) ---- */
  --danger:       #C0392B;
  --danger-soft:  rgba(192, 57, 43, .18);
  --success:      #1F7A30;
  --success-soft: rgba(46, 160, 67, .18);
  --warn:         #B97200;
  --warn-soft:    rgba(255, 165, 0, .18);
  --scrim:        rgba(29, 43, 33, .92); /* toast / dark overlay              */

  /* ---- Type ---- */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ---- Radii ---- */
  --r-banner: 22px;
  --r-card:   16px;
  --r-tile:   14px;
  --r-thumb:  10px;
  --r-cta:    15px;
  --r-pill:   999px;

  /* ---- Shadows ---- */
  --shadow-cta:   0 10px 22px -8px rgba(34, 67, 46, .5);
  --shadow-float: 0 2px 10px rgba(31, 61, 43, .12);

  color-scheme: light;
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text);
}

/* ---- Noir (dark) theme — insertion point, intentionally empty. ------------
   Verde is fixed light for now. Both hooks are kept so components need no
   changes when Noir lands: the Telegram theme toggle stamps data-theme on the
   root, and a system dark preference is the fallback signal. */
:root[data-theme="noir"] {
  /* Noir token overrides go here. */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Noir token overrides go here. */
  }
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute must always win — several components (e.g.
   .card-clickable { display:block }) set an explicit display that would
   otherwise override the UA [hidden] rule and keep the element visible.
   The list-search filter relies on this to hide non-matching cards. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100vh;
  /* Never allow horizontal scroll at the page level. If an element wants to
     escape the viewport (intrinsic image width, long word, etc.) clip it
     rather than producing a body-level scrollbar. */
  overflow-x: hidden;
}
body { background: var(--surface); }

/* ---- Base typography ------------------------------------------------------
   Serif (Cormorant) for headings, sans (Manrope) for body/UI. Per-component
   serif assignments (product names, hero titles) land in their own stages. */
h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--forest-deep);
  font-weight: 600;
}

.container { padding: 16px; max-width: 640px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-header h1 { margin: 0; font-size: 22px; }

.error { color: var(--danger); }
.muted { color: var(--text-muted); }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.tab {
  background: none;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-muted);
  font: inherit;
  font-size: 15px;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--forest-deep);
  border-bottom-color: var(--forest);
  font-weight: 600;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card {
  background: var(--surface-2);
  border-radius: var(--r-card);
  padding: 14px;
}
.card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.card-desc { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.card-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--text-muted); }
.field input, .field textarea, .field select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--forest-deep);
}
.field textarea { resize: vertical; }

.btn-primary {
  background: var(--forest);
  color: var(--on-forest);
  border: none;
  padding: 12px 18px;
  border-radius: var(--r-cta);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
/* Applied by shell.ts only when the native Telegram MainButton takes over the
   fragment's CTA; without MainButton (browser/desktop) the drawn button stays
   visible. */
.cta-hidden-by-mainbutton { display: none; }

.btn-link {
  background: none;
  border: none;
  color: var(--forest);
  cursor: pointer;
  font: inherit;
}

.card-clickable {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.card-clickable:active { filter: brightness(.95); }

.actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-approve, .btn-reject {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--r-cta);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--on-forest);
}
.btn-approve { background: var(--success); }
.btn-reject { background: var(--danger); }
.btn-approve:disabled, .btn-reject:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Shop UI ---------------------------------------------------------- */

/* Catalog brand header (replaces the generic .page-header on the storefront). */
.shop-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.shop-brand-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  color: var(--forest-deep);
}
.shop-brand-tagline {
  font-weight: 400;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
}

/* Hero banner — static placeholder until a promo feature exists in the backend. */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-banner);
  background: var(--forest-grad);
  padding: 22px 20px;
  margin-bottom: 18px;
  color: var(--on-forest);
}
.hero-decor {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--leaf-glow);
}
.hero-label {
  position: relative;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--leaf-soft);
}
.hero-title {
  position: relative;
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--on-forest);
}
.hero-desc {
  position: relative;
  margin: 0;
  max-width: 200px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--leaf-soft);
}

/* Tab row: all shop sections as Verde pills (shared by cart/orders/profile/
   admin navs too — a single nav component). Adaptive:
   • ≤3 tabs → stretch full-width, no scroll, no bar;
   • >3 tabs → horizontal scroll strip. Desktop/fine-pointer clients get a
     visible slim Verde scrollbar as the scroll affordance; touch clients (whose
     native scrollbars auto-hide) fall back to a right-edge fade hinting "more".
   Labels are never shrunk or clipped in either mode. */
.shop-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 3px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--leaf) transparent;
}
/* Visible slim scrollbar (Chromium/WebKit) — only paints when the strip
   actually overflows, so ≤3 stretched tabs never show one. */
.shop-nav::-webkit-scrollbar { height: 6px; }
.shop-nav::-webkit-scrollbar-track { background: transparent; }
.shop-nav::-webkit-scrollbar-thumb {
  background: var(--leaf);
  border-radius: 999px;
}

/* Touch clients only: the native bar auto-hides, so keep the right-edge fade as
   the "more" hint when the row holds >3 tabs. The 14px scroll-runway keeps the
   last pill's text out of the fade when scrolled to the end (pill has 14px inner
   padding, so the 28px fade then covers only padding — no label is ever dimmed).
   :has() unsupported → rule is skipped → plain scroll strip (graceful).
   Excluded on fine pointers so the mask never dims the visible scrollbar. */
@media (pointer: coarse) {
  .shop-nav:has(.shop-nav-tab:nth-child(4)) {
    padding-right: 14px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
}

.shop-nav-tab {
  flex: 0 0 auto;
  background: var(--surface-3);
  border: none;
  padding: 9px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-muted-2);
  border-radius: 11px;
  cursor: pointer;
}
/* ≤3 tabs → each fills an equal share of the row (pure quantity-query, works
   without :has()). first-child that is also within the last 3 ⇒ total ≤3. */
.shop-nav-tab:first-child:nth-last-child(-n+3),
.shop-nav-tab:first-child:nth-last-child(-n+3) ~ .shop-nav-tab {
  flex: 1;
}
.shop-nav-tab.active {
  background: var(--forest);
  color: var(--on-forest);
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
/* Verde card: no surface — the bottle photo + labels sit on the canvas. */
.product-card {
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}
/* No-image placeholder: a neutral surface-3 tile carrying the product name's
   initial in muted Cormorant (mirrors the profile avatar). Never holds an
   image — product_thumb-img is the image variant. */
.product-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--surface-3);
  border-radius: var(--r-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 44px;
  color: var(--text-muted);
  margin-bottom: 9px;
}
.product-thumb-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r-tile);
  margin-bottom: 9px;
  background: var(--surface);
}

.product-gallery {
  position: relative;
  margin: 0 0 18px;
  border-radius: var(--r-tile);
  overflow: hidden;
  background: var(--surface-2);
}
.product-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.product-gallery-track::-webkit-scrollbar { display: none; }
.product-gallery-slide {
  flex: 0 0 100%;
  /* Without min-width: 0 the <img>'s intrinsic width becomes the flex item's
     minimum, forcing the track wider than the viewport and producing a
     horizontal scrollbar. Belt and suspenders: max-width caps it too. */
  min-width: 0;
  max-width: 100%;
  width: 100%;
  /* Fixed height keyed to viewport rather than aspect-ratio + max-height
     combo (which behaves inconsistently under different flex contexts).
     object-fit: contain shows the whole image centered. */
  height: 60vh;
  object-fit: contain;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--surface);
}
.product-gallery-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border-radius: var(--r-pill);
  pointer-events: none;
}
.product-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font: 600 22px / 1 var(--font-sans);
  cursor: pointer;
  padding: 0 0 2px;
  /* Stay above the snap track; the counter is non-interactive so order
     between them doesn't matter. */
  z-index: 1;
}
.product-gallery-nav:hover { background: rgba(0, 0, 0, .65); }
.product-gallery-nav:active { transform: translateY(-50%) scale(.95); }
.product-gallery-nav.prev { left: 8px; }
.product-gallery-nav.next { right: 8px; }
.product-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.15;
  color: var(--forest-deep);
}
.product-meta {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-muted);
  margin: 2px 0 5px;
}
.product-price {
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  color: var(--forest);
}
/* ---- Product detail page ---------------------------------------------- */

/* Leaf accent label above the name. No product-category model exists (category
   is client segmentation on users), so this carries the vintage. */
.product-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--leaf);
  margin-bottom: 10px;
}
.product-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.02;
  color: var(--forest-deep);
  margin: 0 0 14px;
}
/* Article — an identifier, not prose: mono digits so it reads as a code the
   client can quote to a manager. Sits between title and price. */
.product-sku {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--text-muted-2);
  margin: -8px 0 12px;
}
.product-price-big {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--forest);
  margin: 0 0 18px;
}
.product-description {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

/* Buy block: styled qty input (kept — quantity is chosen here, not stepped) +
   CTA. The CTA doubles as the native MainButton in Telegram; this drawn button
   is the browser/desktop fallback and carries the CTA shadow. */
.qty-field input {
  padding: 11px 12px;
  border-radius: var(--r-thumb);
  font-size: 15px;
}
.product-buy .btn-primary { box-shadow: var(--shadow-cta); }
.product-stock-out, .product-stock-low {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 4px;
}
.product-stock-out { color: var(--danger); }
.product-stock-low { color: var(--warn); }

/* Product tabs (Опис / Характеристики) — CSS-only via hidden radios. */
.product-tabs { margin-top: 24px; }
.product-tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.product-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.product-tab {
  padding: 10px 4px;
  margin-right: 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.product-tab-panel { display: none; }
/* Reveal the panel and highlight the label for the checked radio. */
#ptab-desc:checked ~ .product-tab-bar label[for="ptab-desc"],
#ptab-specs:checked ~ .product-tab-bar label[for="ptab-specs"] {
  color: var(--forest-deep);
  border-bottom-color: var(--forest);
}
#ptab-desc:checked ~ .product-tab-panel[data-panel="desc"],
#ptab-specs:checked ~ .product-tab-panel[data-panel="specs"] {
  display: block;
}

/* Characteristics — real product.attributes as hairline label/value rows
   (spec-sheet look from the Verde mock), not a striped table. */
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table tr { border-bottom: 1px solid var(--hairline); }
.spec-table th {
  text-align: left;
  font-weight: 400;
  color: var(--text-muted);
  padding: 12px 0;
  width: 42%;
  vertical-align: top;
}
.spec-table td {
  padding: 12px 0;
  color: var(--forest-deep);
  font-weight: 500;
  vertical-align: top;
}

/* Admin characteristics editor — paired label/value inputs per row. */
.attr-editor { gap: 8px; }
.attr-editor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.attr-editor-row input { min-width: 0; }

/* Live list search box (admin users, etc). */
.list-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-thumb);
  background: var(--surface);
  color: var(--forest-deep);
  font: inherit;
}
.list-search::placeholder { color: var(--text-muted); }

/* Support chat thread — inbound left, admin replies right. */
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.chat-msg { display: flex; flex-direction: column; max-width: 82%; }
.chat-in { align-self: flex-start; align-items: flex-start; }
.chat-out { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-in .chat-bubble {
  background: var(--surface-2);
  color: var(--forest-deep);
  border-bottom-left-radius: 4px;
}
.chat-out .chat-bubble {
  background: var(--forest);
  color: var(--on-forest);
  border-bottom-right-radius: 4px;
}
.chat-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.chat-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  text-decoration: none;
  word-break: break-word;
  background: var(--surface-2);
  color: var(--forest);
}
.chat-out .chat-attach {
  background: var(--forest);
  color: var(--on-forest);
}

/* ---- Cart / checkout (Stage 4) ---------------------------------------- */

/* Empty cart — centred Verde state with a catalog CTA (navigate hook kept). */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 48px 16px 32px;
}
.cart-empty-text { margin: 0; font-size: 15px; color: var(--text-muted); }
.cart-empty .btn-primary { box-shadow: var(--shadow-cta); }

/* Line item: thumbnail | (name / unit price / stepper — line total). The
   .card class supplies the surface-2 background + 16px radius; only the
   padding + flex layout are overridden here. */
.cart-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
}
.cart-item-thumb { flex: 0 0 auto; width: 52px; }
/* product_thumb() is a full-width catalog element by default — clamp it to the
   52×70 mini-thumb and drop the card margin/aspect the catalog needs. */
.cart-item-thumb .product-thumb-img,
.cart-item-thumb .product-thumb {
  width: 52px;
  height: 70px;
  aspect-ratio: auto;
  margin-bottom: 0;
  border-radius: var(--r-thumb);
}
.cart-item-thumb .product-thumb { font-size: 26px; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  color: var(--forest-deep);
  word-break: break-word;
}
.cart-item-unit {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

/* Stepper pill: − on --surface-3, editable qty (direct entry preserved), +
   on --forest. Hooks (data-action qty-inc/qty-dec, data-qty-submit) untouched. */
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 4px 6px;
}
.cart-qty-step {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.cart-qty-dec { background: var(--surface-3); color: var(--forest-deep); font-size: 15px; }
.cart-qty-inc { background: var(--forest); color: var(--on-forest); font-size: 14px; }
.cart-qty-input {
  width: 40px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--forest-deep);
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-qty-input { -moz-appearance: textfield; appearance: textfield; }
.cart-item-line-total {
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: var(--forest);
  white-space: nowrap;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  margin-top: 16px;
}
.cart-total span { font-size: 13px; color: var(--text-muted-2); }
.cart-total strong { font-size: 20px; font-weight: 700; color: var(--forest); }

/* Packing rule not met — checkout will refuse, so say it up front. */
.cart-qty-warning {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: var(--r-thumb);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  line-height: 1.45;
}

/* Checkout section — inline Verde B2B form (all six fields visible). */
.checkout-title { font-size: 20px; margin: 24px 0 12px; }
.checkout-form .field select,
.checkout-form .field textarea {
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: var(--r-thumb);
  padding: 12px 14px;
}
.checkout-form .field select:focus,
.checkout-form .field textarea:focus {
  outline: none;
  border-color: var(--hairline);
}
.checkout-hint { margin-top: 12px; }

/* CTA stack: primary "Оформити" (doubles as native MainButton) full-width,
   secondary "Очистити" as a centred muted link below. */
.cart-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.cart-actions .btn-primary { padding: 15px; box-shadow: var(--shadow-cta); }
.cart-actions .btn-link { align-self: center; padding: 6px; color: var(--text-muted-2); }

.order-row { text-decoration: none; }

.session-expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 48px 16px 32px;
}
.session-expired h2 { margin: 0; font-size: 20px; }
.session-expired p { margin: 0; line-height: 1.5; max-width: 32ch; }
.session-expired .btn-primary { margin-top: 12px; }

/* ---- Profile (Stage 5) ------------------------------------------------- */

/* Gradient header: avatar disc (initial) + name + client-category status. */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border-radius: var(--r-banner);
  background: var(--forest-grad);
  color: var(--on-forest);
  margin-bottom: 12px;
}
.profile-avatar {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--leaf-veil);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  color: var(--on-forest);
}
.profile-identity { min-width: 0; }
.profile-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.1;
  color: var(--on-forest);
  word-break: break-word;
}
.profile-status {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--leaf-soft);
  margin-top: 3px;
}

/* Telegram ID + copy row (kept from the old profile). */
.profile-idrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-card);
  background: var(--surface-2);
  margin-bottom: 18px;
  font-size: 13px;
}
.profile-idrow-label { color: var(--text-muted); }
.profile-idrow-value {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--forest-deep);
}
.profile-idrow .btn-link { margin-left: auto; padding: 0; font-size: 13px; }

/* Data-verification card: status badge + "request verification" button. */
.profile-verify {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-card);
  background: var(--surface-2);
  margin-bottom: 18px;
}
.profile-verify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.profile-verify-row .profile-verify-label { color: var(--text-muted); }
.profile-verify .profile-verify-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.profile-verify .btn-primary { width: 100%; }

/* Account menu: plain nav rows + CSS accordion sections. */
.profile-menu { display: flex; flex-direction: column; gap: 9px; }
.profile-menu-heading {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 6px 0 2px 4px;
}

/* Shared row shell for nav rows AND accordion heads (icon | label | chevron). */
.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 14px;
  border: none;
  border-radius: var(--r-card);
  background: var(--surface-2);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.profile-row:active { filter: brightness(.97); }
.profile-row-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--forest-deep);
}
.profile-row-chevron {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transition: transform .18s ease;
}

/* Accordion: a name-less hidden checkbox (never enters a form) toggles the
   panel; a <label for> is the head. Clicking the label flips the checkbox
   natively — no JS. The chevron rotates 90° when the section is open. */
.profile-section { display: flex; flex-direction: column; }
.profile-acc-toggle { position: absolute; opacity: 0; pointer-events: none; }
.profile-acc-head { margin: 0; }
.profile-acc-toggle:checked ~ .profile-acc-head .profile-row-chevron {
  transform: rotate(90deg);
}
.profile-acc-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 4px 12px;
}
.profile-acc-toggle:checked ~ .profile-acc-panel { display: flex; }

/* Entity card inside a panel (establishment / org / contact / address). */
.profile-entity {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--surface-2);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.profile-entity:active { filter: brightness(.97); }
.profile-entity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.profile-entity-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  color: var(--forest-deep);
  word-break: break-word;
}
.profile-entity-meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.profile-empty {
  margin: 2px 0;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--text-muted);
}
.profile-add {
  align-self: flex-start;
  padding: 8px 2px;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--forest);
  cursor: pointer;
}

/* ---- Admin ------------------------------------------------------------ */

/* Admin index lists (Stage 6) — shared Verde list pattern. Applied via an
   .admin-list class on the <ul>, so the global .card/.list used by customer
   screens are never touched. Rows keep the shared .card surface; only the
   rhythm, radius, hairline and the serif title are layered on to match the
   Verde admin mock (docs/redesign/verde.dc.html + docs/redesign/README §5). */
.admin-list { gap: 9px; }
.admin-list .card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
}

/* List-item name → Cormorant serif (mock's product/list rows). Scoped to
   admin so customer .card titles stay on Manrope. */
.admin-item-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  color: var(--forest-deep);
}
/* Money on an admin row (orders total) — forest, keeps the Manrope weight. */
.admin-amount { color: var(--forest); }

/* Header add-button pill ("+ Новий"), replacing the plain .btn-link look. */
.admin-add {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--forest);
  color: var(--on-forest);
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}
.admin-add:active { filter: brightness(.95); }

/* Settings panel (integrations) — a Verde surface wrapping a shared form so the
   page reads as a card, without restyling the .field inputs inside. */
.admin-panel {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 12px;
}
.admin-panel > :first-child { margin-top: 0; }
.admin-panel > :last-child { margin-bottom: 0; }

/* products.html — full Verde mock row: thumb | body | price + "Редагувати". */
.admin-product { display: flex; align-items: center; gap: 12px; padding: 11px; }
.admin-product-thumb { flex: 0 0 auto; width: 40px; }
/* product_thumb() defaults to a full-width catalog element — clamp to 40×52. */
.admin-product-thumb .product-thumb-img,
.admin-product-thumb .product-thumb {
  width: 40px;
  height: 52px;
  aspect-ratio: auto;
  margin-bottom: 0;
  border-radius: var(--r-thumb);
}
.admin-product-thumb .product-thumb { font-size: 20px; }
.admin-product-body { flex: 1; min-width: 0; }
.admin-product-meta {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-muted);
  margin-top: 2px;
}
.admin-product-aside { flex: 0 0 auto; text-align: right; }
.admin-product-price { font-weight: 700; font-size: 13px; line-height: 1; color: var(--forest); }
.admin-product-edit {
  font-weight: 500;
  font-size: 11px;
  line-height: 1;
  color: var(--leaf);
  margin-top: 5px;
}

.admin-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.admin-image-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}
.admin-image-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

/* ---- New states (Stage 7): skeleton · error · success · toast ---------- */

/* Skeleton: generic shimmer shell.ts drops into #content while a slow /view
   fetch is in flight. Hook-free and transient — replaced by the real fragment
   on arrival. Shimmer sweeps across the Verde surface tokens. */
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card {
  height: 76px;
  border-radius: var(--r-card);
  background: linear-gradient(
    100deg,
    var(--surface-2) 30%,
    var(--surface-3) 50%,
    var(--surface-2) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}
.skeleton-card:first-child { height: 132px; } /* hero-ish lead block */
@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-card { animation: none; }
}

/* Error state: centred Verde block with a retry button (data-action=navigate
   re-runs loadView on the same path). Replaces the old flat <p class="error">. */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 48px 16px 32px;
}
/* Danger disc with a pure-CSS "!" mark (stem + dot as pseudo-elements) — no
   emoji, no asset, CSP-clean. */
.error-state-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--danger-soft);
}
.error-state-icon::before,
.error-state-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
}
.error-state-icon::before {
  top: 15px;
  width: 4px;
  height: 20px;
  border-radius: 2px;
}
.error-state-icon::after {
  bottom: 13px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.error-state-text {
  margin: 0;
  max-width: 32ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
.error-state .btn-primary { margin-top: 4px; }

/* Diagnostic dump (init failure / unhandled rejection). Verde-tokened — no raw
   hex — monospace + pre-wrapped so a stack trace stays readable. */
.error-dump {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--danger);
}

/* Checkout success overlay. Scope a true centred-modal treatment to ONLY this
   overlay via :has() — the PIN and secret-reveal overlays carry no
   .success-dialog, so they keep their existing in-flow rendering untouched.
   Where :has() is unsupported the dialog simply renders in flow — still clear. */
#overlay:has(.success-dialog) {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--scrim);
}
.success-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  width: 100%;
  max-width: 340px;
  padding: 32px 24px 24px;
  border-radius: var(--r-banner);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
/* Success disc with a pure-CSS check mark (rotated L drawn from two borders) —
   no emoji, no asset, CSP-clean. */
.success-check {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-soft);
}
.success-check::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 15px;
  height: 26px;
  border: solid var(--success);
  border-width: 0 4px 4px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.success-title { margin: 6px 0 0; font-size: 22px; color: var(--forest-deep); }
.success-sub { margin: 0; font-size: 14px; color: var(--text-muted); }
/* Write-access priming copy. Rendered only when the bot may not message this
   client yet (needsWriteAccess in shell.ts), so the dialog keeps its current
   two-line shape for everyone who already allowed. */
.success-note {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}
.success-dialog .btn-primary {
  margin-top: 10px;
  width: 100%;
  box-shadow: var(--shadow-cta);
}
.success-dialog .btn-link { margin-top: 2px; font-size: 14px; }

/* Toast — Verde surface pill: dark scrim for contrast, CTA elevation, Manrope
   type, safe-area-aware. Logic (toast() in shell.ts) is unchanged. */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: 90%;
  padding: 12px 18px;
  border-radius: var(--r-cta);
  background: var(--scrim);
  color: var(--on-forest);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow-cta);
  z-index: 9999;
}

/* ==== Admin price editor (price_list_detail.html + priceEditor.ts) ======== */

/* Slim header: title + one meta line + a settings-accordion toggle. */
.pl-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.pl-head-main { flex: 1; min-width: 0; }
.pl-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--forest-deep);
}
.pl-head-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pl-head-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.pl-head-gear {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: var(--r-thumb);
  background: var(--surface-3);
  color: var(--forest-deep);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}
/* Publish toggle — the only one-tap way to flip draft ↔ published. */
.pl-head-publish {
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-thumb);
  background: var(--forest-deep);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pl-head-publish.is-published {
  background: var(--surface-3);
  color: var(--text-muted);
  font-weight: 500;
}
/* Settings collapse: a name-less checkbox toggles the panel (no JS).
   The checkbox is a sibling of .pl-settings (see price_list_detail.html). */
.pl-settings-toggle { position: absolute; opacity: 0; pointer-events: none; }
.pl-settings { display: none; margin-bottom: 8px; }
.pl-settings-toggle:checked ~ .pl-settings { display: flex; }

/* Rule editor card. */
.pl-rule {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-card);
  background: var(--surface-2);
  margin-bottom: 14px;
}
/* Segmented control (rule type + sheet mode): radios drawn as pills. */
.pl-rule-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-tile);
  background: var(--surface-3);
}
.pl-seg-opt { flex: 1; margin: 0; }
.pl-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pl-seg-opt span {
  display: block;
  text-align: center;
  padding: 8px 6px;
  border-radius: var(--r-thumb);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted-2);
  cursor: pointer;
}
.pl-seg-opt input:checked + span {
  background: var(--forest);
  color: var(--on-forest);
  font-weight: 600;
}
.pl-rule-value {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pl-rule-value input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  background: var(--surface);
  color: var(--forest-deep);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
}
.pl-rule-unit {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}
.pl-rule-presets { display: flex; gap: 8px; }
.pl-preset {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: var(--r-thumb);
  background: var(--leaf-tile);
  color: var(--forest);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pl-preset:active { filter: brightness(.97); }
.pl-rule-round { margin: 0; }

.pl-search { margin-bottom: 10px; }
.pl-chips { margin-bottom: 10px; }
.pl-select-all {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-tile);
  background: transparent;
  color: var(--forest);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Product rows. */
.pl-rows { display: flex; flex-direction: column; gap: 8px; }
.pl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.pl-row-off { opacity: .55; }
.pl-row-check { flex: 0 0 auto; margin: 0; display: flex; }
.pl-row-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--forest);
}
.pl-row-body { flex: 1; min-width: 0; }
.pl-row-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  color: var(--forest-deep);
}
.pl-row-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.pl-row-base {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.pl-row-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.pl-tag-rule { background: var(--success-soft); color: var(--success); }
.pl-tag-override { background: var(--warn-soft); color: var(--warn); }
.pl-tag-off { background: var(--surface-3); color: var(--text-muted); }
.pl-row-aside {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.pl-row-price {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--forest);
}
.pl-row-edit {
  border: none;
  background: none;
  padding: 0;
  color: var(--leaf);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pl-empty { text-align: center; padding: 24px 0; }

/* Pinned summary bar. */
.pl-summary {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px -16px 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}
.pl-summary-text { flex: 1; font-size: 12px; color: var(--text-muted); }
.pl-save-cta { flex: 0 0 auto; box-shadow: var(--shadow-cta); }

.pl-danger { color: var(--danger); }

/* Override bottom sheet. */
.pl-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.pl-sheet[hidden] { display: none; }
.pl-sheet-scrim { position: absolute; inset: 0; background: var(--scrim); }
.pl-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-radius: var(--r-banner) var(--r-banner) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.pl-sheet-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--forest-deep);
}
.pl-sheet-compare { font-size: 13px; color: var(--text-muted); }
.pl-sheet-compare strong { color: var(--forest); }
.pl-sheet-hint { font-size: 12px; }
.pl-sheet-valuewrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pl-sheet-value {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  background: var(--surface);
  color: var(--forest-deep);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
}
.pl-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.pl-sheet-actions .btn-primary { flex: 1; }
