/* ============================================================================
 * WhatWood — Design System v2 (Stripe / Linear vocabulary)
 * Aligned to current markup in web/index.html. No HTML changes required.
 * ============================================================================
 *   1. Tokens                  9. Tables
 *   2. Reset + base           10. Dialogs
 *   3. Typography             11. Nav + tabs
 *   4. Layout primitives      12. Footer
 *   5. Animations             13. Page: Home (hero, features, example, how, showcase, testimonial, CTA)
 *   6. Buttons                14. Page: Detect · Price · List
 *   7. Forms + dropzone       15. Page: Marketplace
 *   8. Cards + KPIs           16. Feedback FAB + utilities
 *                             17. Responsive
 * ============================================================================ */

/* ─── 1. Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Surface palette — editorial paper cream */
  --bg:           #fbf6e6;
  --bg-soft:      #ffffff;
  --bg-warm:      #efe4c9;
  --bg-dark:      #131a13;
  --bg-overlay:   rgba(20, 24, 20, 0.55);
  --bg-input:     #ffffff;
  --surface-1:    #ffffff;
  --surface-2:    #faf6ec;
  --surface-3:    #f0e9d5;

  /* Ink */
  --text:           #1b1410;
  --text-strong:    #0a0604;
  --text-mute:      #6e655a;
  --text-soft:      #968b7d;
  --text-onbrand:   #ffffff;

  /* Borders — Stripe-style hairlines */
  --border:        rgba(20, 14, 10, 0.10);
  --border-strong: rgba(20, 14, 10, 0.16);
  --border-soft:   rgba(20, 14, 10, 0.06);
  --hairline:      rgba(20, 14, 10, 0.04);

  /* Brand — Tailwind green-700 family */
  --green:        #15803d;
  --green-deep:   #14532d;
  --green-soft:   #22c55e;
  --green-pale:   #dcfce7;
  --green-faint:  #f0fdf4;
  --green-ink:    #052e16;
  --money:        #15803d;
  --money-strong: #14532d;

  /* Status */
  --info:    #2563eb;  --info-bg: #dbeafe;
  --warn:    #b45309;  --warn-bg: #fef3c7;
  --danger:  #b91c1c;  --danger-bg:#fee2e2;
  --gold:    #b08400;  --gold-bg: #fdf4d2;

  /* Typography — Editorial Field Journal stack
     Fraunces: display serif w/ variable opsz/SOFT/WONK axes — hero, headings, oversized prices
     Source Serif 4: editorial body — lede, testimonial, longer reading
     IBM Plex Sans: UI chrome — buttons, forms, nav, dialog body text
     IBM Plex Mono: every numeral — prices, KPIs, tables, tabular data */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Editorial palette aliases — sit alongside the existing tokens so all
     legacy var(--green), var(--bg), var(--text) callers keep working. */
  --paper:        #fbf6e6;
  --paper-deep:   #eee2c4;
  --ink:          #1a1410;
  --ink-strong:   #0a0604;
  --ink-mute:     #6e655a;
  --sap:          #15803d;
  --sap-deep:     #14532d;
  --amber:        #b8860b;
  --hairline:     rgba(26, 20, 16, 0.10);

  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  28px;
  --text-4xl:  34px;
  --text-5xl:  44px;
  --text-6xl:  56px;
  --text-7xl:  72px;
  --text-8xl:  88px;

  /* Space (4px base) */
  --s-1:   4px;  --s-2:   8px;  --s-3:  12px;  --s-4:  16px;
  --s-5:  20px;  --s-6:  24px;  --s-7:  32px;  --s-8:  40px;
  --s-9:  48px; --s-10:  64px; --s-11:  80px; --s-12:  96px;
  --s-13: 128px; --s-14: 160px;

  /* Radius */
  --r-xs:  4px; --r-sm:  6px; --r-md:  8px; --r-lg:  10px;
  --r-xl:  12px; --r-2xl: 16px; --r-3xl: 20px; --r-full: 9999px;
  --radius-sm: var(--r-md);  /* legacy alias used inline */

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(20, 14, 10, 0.05);
  --shadow-2: 0 1px 2px rgba(20, 14, 10, 0.04), 0 2px 6px rgba(20, 14, 10, 0.06);
  --shadow-3: 0 1px 2px rgba(20, 14, 10, 0.04), 0 4px 12px rgba(20, 14, 10, 0.08);
  --shadow-4: 0 2px 4px rgba(20, 14, 10, 0.04), 0 12px 28px rgba(20, 14, 10, 0.10);
  --shadow-5: 0 4px 8px rgba(20, 14, 10, 0.06), 0 24px 48px rgba(20, 14, 10, 0.14);
  --shadow-focus:    0 0 0 3px rgba(21, 128, 61, 0.22);
  --shadow-focus-bg: 0 0 0 4px rgba(21, 128, 61, 0.12);

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 300ms;
  --t-slower: 500ms;

  /* Layout */
  --container:        1180px;
  --container-wide:   1320px;
  --container-narrow: 880px;
  --container-text:   680px;
  --nav-h: 64px;

  --safe-l: env(safe-area-inset-left,  0);
  --safe-r: env(safe-area-inset-right, 0);
  --safe-b: env(safe-area-inset-bottom,0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── 2. Reset + base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}

/* Paper grain — quiet atmospheric overlay using inline fractal noise SVG.
   Sits above body via a fixed pseudo-element so it never affects layout
   and never blocks pointer events. opacity tuned low; just enough to
   give the cream paper feel without distraction. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}
img, svg, video, canvas { max-width: 100%; display: block; }
button, input, select, textarea {
  font: inherit; color: inherit;
  background: transparent; border: none; outline: none;
  margin: 0; padding: 0;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--green-deep); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--green); }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--r-sm);
}

::selection { background: var(--green-pale); color: var(--green-ink); }

/* ─── 3. Typography (Editorial Field Journal) ───────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--text-strong);
  letter-spacing: -0.022em;
  line-height: 1.1;
  font-weight: 600;
  font-feature-settings: "kern", "liga", "calt", "ss01";
}
h1 { font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0; letter-spacing: -0.030em; font-weight: 600; line-height: 1.02; }
h2 { font-variation-settings: "opsz" 96,  "SOFT" 30, "WONK" 0; letter-spacing: -0.022em; line-height: 1.08; }
h3 { font-variation-settings: "opsz" 36,  "SOFT" 20; letter-spacing: -0.016em; }
h4 { font-variation-settings: "opsz" 24,  "SOFT" 14; letter-spacing: -0.010em; }

.muted     { color: var(--text-mute); }
.muted-tiny{ color: var(--text-mute); font-size: var(--text-xs); line-height: 1.5; }
.center    { text-align: center; }

.gold      { color: var(--sap, var(--green)); }

/* Eyebrow — Source Serif italic with ornament prefix (editorial vibe) */
.eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--sap-deep);
  margin: 0 0 var(--s-2);
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.eyebrow::before {
  content: "▷";
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  color: var(--amber);
  transform: translateY(-1px);
}

/* Lede — Source Serif, generous line-height for reading */
.lede {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  max-width: 560px;
  margin: 0;
}
.lede em { color: var(--sap-deep); font-style: italic; }

.link {
  color: var(--sap-deep, var(--green-deep));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

/* Drop-cap — applied to .has-dropcap p:first-of-type::first-letter */
.has-dropcap p:first-of-type::first-letter,
.dropcap::first-letter {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  float: left;
  font-size: 5.4em;
  line-height: 0.85;
  padding: 6px 12px 0 0;
  margin: 4px 6px -4px 0;
  color: var(--sap-deep);
}

/* Pull-quote — used in testimonial. Big Fraunces italic with hanging quote */
.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 72, "SOFT" 30;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink-strong, var(--text-strong));
  position: relative;
  padding-left: 0;
  margin: 0;
}
.pull-quote::before {
  content: "“";
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.6em;
  line-height: 0.5;
  color: var(--sap, var(--green));
  position: absolute;
  top: 0.18em;
  left: -0.65em;
}

/* Section ornament rule — hairline + amber florette between major sections */
.section-rule {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-4);
  margin: 0 auto;
  padding: var(--s-6) 0;
  max-width: var(--container-text);
  color: var(--amber, var(--gold));
  font-size: 18px;
}
.section-rule::before,
.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.section-rule::before { max-width: 220px; }
.section-rule::after  { max-width: 220px; }

/* Numerical helper class — use for inline numbers anywhere */
.num, .tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.005em;
}

/* ─── 4. Layout primitives ──────────────────────────────────────────────── */
main.tab-panel { display: block; }
main.tab-panel[hidden] { display: none; }

/* ─── 5. Animations ─────────────────────────────────────────────────────── */
@keyframes ww-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ww-fade-in     { from { opacity: 0; } to { opacity: 1; } }
@keyframes ww-scale-in    { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes ww-shimmer     { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes ww-pulse-ring {
  0%, 100% { box-shadow: 0 1px 2px rgba(0,0,0,0.10), 0 0 0 0 rgba(21,128,61,0.35); }
  50%      { box-shadow: 0 1px 2px rgba(0,0,0,0.10), 0 0 0 10px rgba(21,128,61,0); }
}
@keyframes ww-spin { to { transform: rotate(360deg); } }

/* Stage scan beam — sweeps every 7s, with annotated layer reveal */
@keyframes ww-stage-sweep {
  0%          { transform: translateX(-110%); opacity: 0.0; }
  8%          { opacity: 0.85; }
  60%         { transform: translateX(700%);  opacity: 0.85; }
  72%, 100%   { transform: translateX(700%);  opacity: 0.0; }
}
@keyframes ww-stage-reveal {
  0%, 8%      { clip-path: inset(0 100% 0 0); }
  60%         { clip-path: inset(0 0 0 0); }
  92%         { clip-path: inset(0 0 0 0); }
  100%        { clip-path: inset(0 100% 0 0); }
}
@keyframes ww-badge-blink {
  0%, 40%   { opacity: 1; }
  50%       { opacity: 0.35; }
  60%, 100% { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }

/* ─── 6. Buttons ────────────────────────────────────────────────────────── */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  height: 40px; padding: 0 var(--s-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--surface-1);
  color: var(--text-strong);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition:
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
  text-decoration: none;
}
.btn:focus-visible { box-shadow: var(--shadow-focus); }
.btn:disabled, .btn[disabled] { opacity: 0.55; pointer-events: none; }

.btn.small { height: 32px; padding: 0 var(--s-4); font-size: var(--text-xs); border-radius: var(--r-sm); }
.btn.sm    { height: 32px; padding: 0 var(--s-4); font-size: var(--text-xs); border-radius: var(--r-sm); }
.btn.big   { height: 52px; padding: 0 var(--s-8); font-size: var(--text-md); width: 100%; border-radius: var(--r-lg); }
.btn.lg    { height: 48px; padding: 0 var(--s-7); font-size: var(--text-base); border-radius: var(--r-lg); }
.btn.full  { width: 100%; }

/* ─── Editorial Field Journal buttons ───────────────────────────────────
   Solid color blocks (no tech-gradient slop), Fraunces italic labels,
   an inner amber hairline that breathes on hover, paper-press on click.
   Scoped so .small / .sm UI buttons stay in Plex Sans for clarity. */

/* Primary — letterpress sap-green card */
.btn.primary {
  background: var(--sap-deep);
  background-image: none;
  color: var(--paper, #fbf6e6);
  border: 1px solid var(--sap-deep);
  position: relative;
  isolation: isolate;
  padding: 0 var(--s-6);
  letter-spacing: 0.005em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 1px 2px rgba(5, 46, 22, 0.25),
    0 2px 8px rgba(5, 46, 22, 0.14);
  transition:
    background-color var(--t-base) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    letter-spacing var(--t-base) var(--ease-out);
}
/* Inner amber hairline — the "luxury edition" detail. Sits 4px in from
   every edge; breathes inward 1px on hover, snaps back on press. */
.btn.primary::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 134, 11, 0.32);
  border-radius: calc(var(--r-md) - 3px);
  pointer-events: none;
  transition:
    inset var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    opacity var(--t-base) var(--ease-out);
}
.btn.primary:hover {
  background: #0e5d2b;
  transform: translateY(-1px);
  letter-spacing: 0.012em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.26),
    0 4px 12px rgba(5, 46, 22, 0.32),
    0 10px 22px rgba(5, 46, 22, 0.16);
}
.btn.primary:hover::before {
  inset: 3px;
  border-color: rgba(217, 165, 32, 0.62);
}
.btn.primary:active {
  transform: translateY(0);
  letter-spacing: 0.005em;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.32),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 1px 1px rgba(5, 46, 22, 0.10);
}
.btn.primary:active::before {
  inset: 4px;
  border-color: rgba(184, 134, 11, 0.28);
}
.btn.primary:disabled {
  background: var(--surface-3);
  background-image: none;
  color: var(--text-soft);
  border-color: var(--border-strong);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.primary:disabled::before { opacity: 0; }

/* Ghost — hairline with cream-fill rise on hover (ink-on-paper feel) */
.btn.ghost, .btn.secondary {
  background: transparent;
  color: var(--sap-deep);
  border: 1.5px solid var(--sap);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0 var(--s-6);
  letter-spacing: 0.005em;
  box-shadow: none;
  transition:
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    letter-spacing var(--t-base) var(--ease-out);
}
/* Cream rises from the bottom — like ink soaking into paper.
   Sits behind the label via z-index: -1. */
.btn.ghost::before, .btn.secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--green-pale);
  transform: translateY(101%);
  transition: transform var(--t-slow) var(--ease-out);
  z-index: -1;
}
.btn.ghost:hover, .btn.secondary:hover {
  border-color: var(--sap-deep);
  color: var(--sap-deep);
  transform: translateY(-1px);
  letter-spacing: 0.012em;
}
.btn.ghost:hover::before, .btn.secondary:hover::before {
  transform: translateY(0);
}
.btn.ghost:active, .btn.secondary:active {
  transform: translateY(0);
  letter-spacing: 0.005em;
}
.btn.ghost:active::before, .btn.secondary:active::before {
  transform: translateY(20%);
}

/* Typographic upgrade — Fraunces italic on prominent buttons only.
   Small / sm modifiers stay in Plex Sans so dense UI rows don't go
   ornamental. */
.btn.primary:not(.small):not(.sm),
.btn.ghost:not(.small):not(.sm),
.btn.secondary:not(.small):not(.sm) {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 50, "WONK" 0;
}

/* Slightly more vertical breathing on the lg variant — serifs need air. */
.btn.lg.primary,
.btn.lg.ghost,
.btn.lg.secondary {
  letter-spacing: 0.010em;
  padding: 0 var(--s-8);
  font-size: var(--text-md);
}
.btn.lg.primary:hover,
.btn.lg.ghost:hover,
.btn.lg.secondary:hover {
  letter-spacing: 0.020em;
}

/* Danger */
.btn.danger {
  background: var(--surface-1);
  color: var(--danger);
  border-color: var(--border-strong);
}
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }

.btn-spinner { display: none; width: 16px; height: 16px; }
.btn-spinner svg { width: 16px; height: 16px; }
.btn-spinner svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-dasharray: 60 200;
  stroke-linecap: round;
  animation: ww-spin 0.9s linear infinite;
  transform-origin: 25px 25px;
}
.btn.is-loading .btn-label { opacity: 0.4; }
.btn.is-loading .btn-spinner { display: inline-flex; }

/* ─── 7. Forms + dropzone ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="search"],
.field select,
.field textarea,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="url"], input[type="search"],
select, textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-strong);
  transition:
    border-color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out);
}
textarea {
  height: auto;
  padding: var(--s-3) var(--s-4);
  line-height: 1.55;
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
}
select {
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-mute) 50%),
    linear-gradient(135deg, var(--text-mute) 50%, transparent 50%);
  background-position: right 14px top 17px, right 8px top 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: var(--shadow-focus-bg);
}
input::placeholder, textarea::placeholder { color: var(--text-soft); }

.form-error {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-top: var(--s-2);
  padding: 8px var(--s-3);
  background: var(--danger-bg);
  border-radius: var(--r-sm);
}
.form-success {
  color: var(--green-deep);
  font-size: var(--text-sm);
  margin-top: var(--s-2);
  padding: 8px var(--s-3);
  background: var(--green-pale);
  border-radius: var(--r-sm);
}
/* Larger / iconified banner variant — used by the inquiry dialog so the
   buyer gets an unmistakeable "your message went through" confirmation.

   Animations live on `.is-shown` (added by JS after the banner is
   un-hidden) so the keyframes don't silently fire once on initial
   page paint while the form is still collapsed. */
.form-success-banner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px var(--s-3);
  border: 1px solid rgba(21, 128, 61, 0.28);
  font-weight: 500;
  font-size: 14.5px;
}
.form-success-banner.is-shown {
  animation: success-banner-in 320ms var(--ease-out) both;
}
.form-success-banner .form-success-icon {
  flex: 0 0 18px;
  color: #15803d;
  transform: scale(0.6);
  opacity: 0;
}
.form-success-banner.is-shown .form-success-icon {
  animation: success-check-pop 480ms 80ms var(--ease-out) both;
}
@keyframes success-banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Detect form controls grid */
.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-top: var(--s-5);
}
@media (max-width: 900px) { .controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .controls { grid-template-columns: 1fr; } }

/* Publish-pair form layout */
.publish-pair {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 480px) { .publish-pair { grid-template-columns: 1fr; } }

/* ─── Post-publish success view (inside #publish-dialog) ───
   Shown in place of #publish-form after a successful POST. Centered
   layout, big green check, a key/value summary, and two CTAs.

   Animations are gated on `.is-shown`, which JS adds *after* the
   element becomes visible (force-reflow trick in showPublishSuccess).
   Without that gate the keyframes fire once on initial page paint
   while the section is still `hidden`, and never replay when we
   un-hide it. */
.publish-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--s-4) var(--s-1) var(--s-2);
  gap: var(--s-3);
}
.publish-success.is-shown {
  animation: success-fade-in 360ms var(--ease-out) both;
}
@keyframes success-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.publish-success .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-1);
}
/* Idle state — kept invisible & small so the pop is visible.
   .is-shown removes the gate and applies the keyframes. */
.publish-success .success-icon svg {
  transform: scale(0.6);
  opacity: 0;
}
.publish-success.is-shown .success-icon svg {
  animation: success-check-pop 520ms var(--ease-out) both;
}
@keyframes success-check-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  55%  { transform: scale(1.18); opacity: 1; }
  80%  { transform: scale(0.96); }
  100% { transform: scale(1); opacity: 1; }
}
/* Draw the check path. stroke-dasharray + stroke-dashoffset =
   classic SVG line-draw trick: starts fully retracted, eases out. */
.publish-success .success-icon svg path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
}
.publish-success.is-shown .success-icon svg path {
  animation: success-check-draw 520ms 180ms var(--ease-out) both;
}
@keyframes success-check-draw {
  to { stroke-dashoffset: 0; }
}
.publish-success .success-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.020em;
  color: var(--text);
  margin: 0;
}
.publish-success .success-sub {
  font-family: var(--font-serif, Georgia, serif);
  color: var(--text-mute);
  font-size: 15px;
  line-height: 1.55;
  max-width: 36ch;
  margin: 0;
}
.publish-success .success-summary {
  width: 100%;
  margin: var(--s-3) 0 var(--s-2);
  padding: var(--s-3) var(--s-4);
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s-2) var(--s-4);
  background: var(--surface-2, rgba(0,0,0,0.02));
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: var(--r-lg, 12px);
  text-align: left;
}
.publish-success .success-summary dt {
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.publish-success .success-summary dd {
  margin: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--text);
}
.publish-success .success-summary .total dd {
  font-weight: 600;
  color: #15803d;
  font-size: 15px;
}
.publish-success .success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  width: 100%;
  margin-top: var(--s-2);
}
.publish-success .success-actions .btn { flex: 1 1 160px; }
@media (max-width: 600px) {
  .publish-success {
    padding: var(--s-3) 0 var(--s-1);
    gap: var(--s-2);
  }
  .publish-success .success-icon svg { width: 56px; height: 56px; }
  .publish-success .success-title { font-size: 22px; }
  .publish-success .success-sub { font-size: 14px; max-width: 32ch; }
  .publish-success .success-summary {
    padding: var(--s-3);
    gap: 6px var(--s-3);
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .publish-success .success-summary dt { font-size: 12px; }
  .publish-success .success-summary dd { font-size: 13px; word-break: break-word; }
  .publish-success .success-summary .total dd { font-size: 14px; }
}
@media (max-width: 480px) {
  .publish-success .success-actions {
    flex-direction: column;
    gap: var(--s-2);
  }
  .publish-success .success-actions .btn { min-height: 48px; }
  /* Stack the summary into a single column so the longest value
     ("RM 12,400") never gets crowded against a long key. */
  .publish-success .success-summary {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .publish-success .success-summary dt { margin-top: 6px; }
  .publish-success .success-summary dt:first-child { margin-top: 0; }
  .publish-success .success-summary .total { margin-top: 8px; }
}

/* Highlight pulse for the marketplace card the seller just created.
   Triggered by the "View in Marketplace" CTA on the publish success view —
   adds .is-just-listed for ~2.4s then removes it. */
.market-card.is-just-listed {
  animation: card-just-listed 2.2s var(--ease-out);
  box-shadow: 0 0 0 2px #15803d, var(--shadow-lg, 0 12px 28px rgba(0,0,0,0.10));
}
@keyframes card-just-listed {
  0%   { box-shadow: 0 0 0 0   rgba(21,128,61,0.55); }
  35%  { box-shadow: 0 0 0 8px rgba(21,128,61,0.18); }
  100% { box-shadow: 0 0 0 0   rgba(21,128,61,0.00); }
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-2xl);
  padding: var(--s-9) var(--s-6);
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
}
.dropzone:hover { border-color: var(--green); background: var(--green-faint); }
.dropzone.is-drag, .dropzone.dragover {
  border-color: var(--green);
  background: var(--green-pale);
  transform: scale(1.005);
}
.dropzone .dz-icon {
  margin: 0 auto var(--s-3);
  color: var(--green-deep);
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-faint);
  border-radius: var(--r-2xl);
}
.dropzone .dz-headline {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 6px;
}
.dropzone .dz-headline .link { color: var(--green-deep); }
.dropzone .dz-sub {
  font-size: var(--text-sm);
  color: var(--text-mute);
  margin: 0;
}

/* Single-photo dropzone variant (smaller) */
.dropzone.dropzone-single { padding: var(--s-7) var(--s-5); }

/* Queue chip list */
.upload-queue {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: flex; flex-wrap: wrap;
  gap: var(--s-2);
}
.upload-queue li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 8px 4px 4px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
}
.upload-queue .queue-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
}
.upload-queue .remove-btn {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-mute);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  border: 0;
}
.upload-queue .remove-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* Batch progress */
.batch-progress {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  margin-top: var(--s-4);
}
.batch-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.batch-progress .progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--r-full);
  width: 0;
  transition: width 280ms var(--ease-out);
}
.batch-progress p { margin: 0; font-size: var(--text-sm); }

/* Manual list divider */
.manual-list-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--s-9) 0 var(--s-7);
  color: var(--text-soft);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.manual-list-divider::before,
.manual-list-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.manual-list-divider span { padding: 0 var(--s-4); }

.manual-list-section { }
.manual-list-head { margin-bottom: var(--s-4); }
.manual-list-head h3 {
  font-size: var(--text-2xl);
  letter-spacing: -0.018em;
  margin-bottom: 6px;
}
.manual-list-head p { color: var(--text-mute); margin: 0; line-height: 1.55; }

/* ─── 8. Cards + KPIs ───────────────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .kpi-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-strong, var(--text-strong));
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  line-height: 1.05;
}
.kpi .kpi-value.gold { color: var(--sap-deep, var(--money-strong)); }
.kpi .kpi-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink-mute, var(--text-mute));
  font-weight: 400;
}

/* Status pills */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}
.status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.open      { background: var(--green-pale); color: var(--green-deep); }
.status-pill.sold      { background: var(--gold-bg);    color: var(--gold); }
.status-pill.withdrawn { background: var(--danger-bg);  color: var(--danger); }

/* Admin pill */
.admin-pill {
  display: inline-flex; align-items: center;
  padding: 1px 6px;
  background: #ede9fe; color: #5b21b6;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  border-radius: var(--r-full);
  text-transform: uppercase;
}

/* ─── 9. Tables ─────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-1);
}
.logs-table, .market-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
.logs-table th, .logs-table td,
.market-table th, .market-table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.logs-table tr:last-child td,
.market-table tr:last-child td { border-bottom: 0; }
.logs-table th, .market-table th {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
  background: var(--surface-2);
}
.logs-table tbody tr, .market-table tbody tr {
  transition: background var(--t-fast) var(--ease-out);
}
.logs-table tbody tr:hover, .market-table tbody tr:hover {
  background: var(--surface-2);
}
.logs-table td.num, .logs-table th.num,
.market-table td.num, .market-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.logs-table td.num, .market-table td.num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.005em;
  color: var(--ink-strong, var(--text-strong));
}
.muted.center { text-align: center; padding: var(--s-7) !important; }

/* ─── 10. Dialogs ───────────────────────────────────────────────────────── */
dialog:not([open]) { display: none !important; }

dialog {
  border: 0;
  padding: 0;
  background: var(--surface-1);
  color: var(--text);
  outline: none;
  margin: auto;
  max-width: min(640px, 92vw);
  max-height: 92vh;
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
dialog[open] {
  animation: ww-scale-in 240ms var(--ease-out);
}

/* Dialog header (children of <dialog>) */
dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
dialog > header h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  font-variation-settings: "opsz" 36, "SOFT" 30;
  margin: 0;
  letter-spacing: -0.016em;
  color: var(--ink-strong, var(--text-strong));
}
dialog > header .close {
  height: 32px; width: 32px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  border: 1px solid transparent;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
dialog > header .close:hover {
  background: var(--hairline);
  color: var(--text-strong);
}

/* Auth dialog */
.auth-dialog    { max-width: 460px; }
.paywall-dialog { max-width: 520px; }
.listing-dialog { max-width: 820px; }
.inbox-dialog   { max-width: 780px; }

/* ─── Mobile polish for every dialog ──────────────
   Tightens the header + form padding on phones so the dialog
   isn't a wall of edge whitespace. Form inputs use 16px font so
   iOS Safari doesn't zoom the viewport when they're focused. */
@media (max-width: 600px) {
  dialog {
    max-width: min(640px, 96vw);
    max-height: 94vh;
    border-radius: var(--r-2xl, 16px);
  }
  dialog > header {
    padding: var(--s-3) var(--s-4);
  }
  dialog > header h2 {
    font-size: 18px;
    letter-spacing: -0.015em;
  }
  .auth-form { padding: var(--s-4); gap: var(--s-3); }
  .auth-form input,
  .auth-form select,
  .auth-form textarea { font-size: 16px; }
  .auth-form .btn.big { min-height: 48px; font-size: 15px; }
}

.auth-form {
  display: flex; flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-6);
  overflow-y: auto;
}
.auth-form .field { gap: 6px; }

.auth-tabs {
  display: flex;
  margin: var(--s-5) var(--s-6) 0;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  gap: 2px;
}
.auth-tab {
  flex: 1;
  height: 32px;
  padding: 0 var(--s-3);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--r-sm);
  color: var(--text-mute);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.auth-tab.is-active {
  background: var(--surface-1);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
}

/* Paywall body */
.paywall-body {
  padding: var(--s-6);
  display: flex; flex-direction: column;
  gap: var(--s-4);
  overflow-y: auto;
}
.paywall-price {
  display: flex; align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}
.paywall-currency {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--ink-mute, var(--text-mute));
}
.paywall-amount {
  font-family: var(--font-mono);
  font-size: 84px;
  font-weight: 500;
  letter-spacing: -0.026em;
  line-height: 1;
  color: var(--ink-strong, var(--text-strong));
  font-variant-numeric: tabular-nums;
}
.paywall-period {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-base);
  color: var(--ink-mute, var(--text-mute));
  margin-left: 8px;
}

.paywall-features {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: var(--s-2);
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
}
.paywall-features li {
  position: relative;
  padding-left: 26px;
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.5;
}
.paywall-features li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--green-pale) url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23166534' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / 11px;
}
.paywall-status {
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-mute);
}
.paywall-status:empty { display: none; }

/* Inbox tabs */
.inbox-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin: var(--s-5) var(--s-6) 0;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.inbox-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px;
  padding: 0 var(--s-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--r-sm);
  color: var(--text-mute);
  background: transparent;
  border: 0;
}
.inbox-tab.is-active {
  background: var(--surface-1);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
}
.inbox-tab-count {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--surface-3);
  color: var(--text-mute);
  border-radius: var(--r-full);
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.inbox-tab.is-active .inbox-tab-count { background: var(--green-pale); color: var(--green-deep); }

.inbox-body {
  padding: var(--s-5) var(--s-6) var(--s-6);
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
}

/* Inquiry rows */
.inquiry-summary {
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.inquiry-summary .ws-summary-pills { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.inquiry-summary .ws-summary-price { font-weight: 700; color: var(--money-strong); font-family: var(--font-display); }

.inquiry-row {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  display: flex; flex-direction: column;
  gap: 6px;
  background: var(--surface-1);
}
.inquiry-row + .inquiry-row { margin-top: var(--s-3); }
.inquiry-row .top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.inquiry-row .top .who { font-weight: 600; color: var(--text-strong); font-size: var(--text-sm); }
.inquiry-row .top .when { font-size: var(--text-xs); color: var(--text-soft); }
.inquiry-row .what { font-size: var(--text-sm); line-height: 1.5; color: var(--text); }

/* Listing detail */
.listing-detail-body {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--s-6);
  padding: var(--s-6);
  overflow-y: auto;
}
@media (max-width: 720px) { .listing-detail-body { grid-template-columns: 1fr; } }

.listing-detail-photo {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-3);
  aspect-ratio: 4 / 3;
}
.listing-detail-photo img { width: 100%; height: 100%; object-fit: cover; }

.listing-detail-meta {
  font-size: var(--text-sm);
  color: var(--text-mute);
  margin: 0 0 6px;
  line-height: 1.5;
}
.listing-detail-meta strong { color: var(--text-strong); }
.listing-detail-price {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--sap-deep, var(--money-strong));
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  margin: var(--s-3) 0;
  line-height: 1.05;
}
.listing-detail-actions { display: flex; gap: var(--s-2); margin-top: var(--s-4); flex-wrap: wrap; }

.price-block {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-4);
  margin: var(--s-4) 0;
  background: var(--surface-2);
}
.price-block-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--text-sm);
}
.price-block-row + .price-block-row { margin-top: 4px; }
.price-block-delta {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; margin-left: 4px;
}
.price-block-delta.higher { background: var(--gold-bg);    color: var(--gold); }
.price-block-delta.lower  { background: var(--green-pale); color: var(--green-deep); }

/* Listing owner actions */
.listing-owner-actions {
  margin-top: var(--s-5);
  padding: var(--s-4);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--surface-2);
}
.listing-owner-actions .actions-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: var(--s-2);
}
.listing-owner-actions .actions-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.owner-confirm-wrap {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  display: flex; gap: var(--s-2);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.owner-confirm-wrap .input-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}

/* ─── 11. Nav + tabs ────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--s-5);
  padding: 0 max(var(--s-6), var(--safe-l)) 0 max(var(--s-6), var(--safe-r));
  height: var(--nav-h);
}

.brand {
  display: inline-flex; align-items: center;
  gap: var(--s-3);
  color: var(--text-strong);
}
.brand:hover { color: var(--text-strong); }
.brand img { width: 32px; height: 32px; }
.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30, "WONK" 0;
  letter-spacing: -0.018em;
  color: var(--ink-strong, var(--text-strong));
}

/* Tab bar — pill toggle in the centre */
.tabbar {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 4px;
  gap: 2px;
  justify-self: center;
  max-width: max-content;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 34px;
  padding: 0 var(--s-4);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.002em;
  color: var(--text-mute);
  background: transparent;
  border: 0;
  border-radius: var(--r-full);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--text-strong); background: var(--hairline); }
.tab.is-active {
  background: var(--surface-1);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
}
.tab-icon { display: inline-flex; }
.tab-icon svg { display: block; }
.tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.tab.is-active .tab-badge { background: var(--green-deep); }
.tab.tab-link { text-decoration: none; }

/* Lang picker */
.lang-picker {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface-1);
}
.lang-btn {
  height: 28px;
  padding: 0 var(--s-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-mute);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.lang-btn:last-child { border-right: 0; }
.lang-btn.is-active { color: var(--green-deep); background: var(--green-faint); }
.lang-btn:hover { background: var(--hairline); }

/* Auth slot in nav */
.nav-auth { display: inline-flex; gap: var(--s-2); align-items: center; }
.auth-anon { display: inline-flex; gap: var(--s-2); }
.auth-user {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 4px 4px 4px var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-1);
  position: relative;
}

.auth-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth-badge:empty { display: none; }
.auth-badge.trial    { background: var(--gold-bg);    color: var(--gold); }
.auth-badge.expired  { background: var(--danger-bg);  color: var(--danger); }
.auth-badge.pro      { background: var(--green-pale); color: var(--green-deep); }
.auth-badge.admin    { background: #ede9fe;          color: #5b21b6; }

.user-menu {
  display: inline-block;
  position: relative;
}
.user-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px var(--s-2) 4px 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-strong);
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::marker { content: ""; }
.user-menu .user-name { display: inline-block; }

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: -4px;
  min-width: 240px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-4);
  padding: 6px;
  display: flex; flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.user-menu-head {
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.user-menu-head strong {
  font-size: var(--text-sm);
  color: var(--text-strong);
  font-weight: 600;
  display: block;
}
.user-menu-sub { font-size: 11px; color: var(--text-mute); }

.user-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px var(--s-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--t-fast) var(--ease-out);
}
.user-menu-item:hover { background: var(--surface-2); }

/* Notification toggle row in the user menu — same height as .user-menu-item
   but with a switch on the right instead of a chevron. */
.user-menu-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: 8px var(--s-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-top: 4px;
  border-top: 1px solid var(--hairline);
  padding-top: var(--s-3);
}
.user-menu-toggle:hover { background: var(--surface-2); }
.user-menu-toggle .ump-text {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.user-menu-toggle .ump-text strong {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-strong, var(--text-strong));
  font-family: var(--font-sans);
  font-style: normal;
}
.user-menu-toggle .ump-text em {
  font-style: italic;
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  color: var(--ink-mute, var(--text-mute));
  line-height: 1.4;
}
.user-menu-toggle .ump-switch {
  position: relative;
  flex: 0 0 36px;
  width: 36px; height: 20px;
}
.user-menu-toggle .ump-switch input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
  margin: 0;
}
.user-menu-toggle .ump-track {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: var(--r-full);
  transition: background var(--t-base) var(--ease-out);
  display: block;
}
.user-menu-toggle .ump-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--surface-1);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.20);
  transition: transform var(--t-base) var(--ease-out);
}
.user-menu-toggle input:checked + .ump-track {
  background: var(--sap, var(--green));
}
.user-menu-toggle input:checked + .ump-track .ump-thumb {
  transform: translateX(16px);
}
.user-menu-toggle input:focus-visible + .ump-track {
  box-shadow: var(--shadow-focus);
}

/* ─── Threaded inbox: message bubbles + reply form + WhatsApp link ─────── */
.inquiry-thread {
  display: flex; flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-3) 0 var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
}
.inquiry-thread .msg {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  max-width: 88%;
  border: 1px solid transparent;
}
.inquiry-thread .msg.msg-root {
  background: var(--green-faint);
  border-color: var(--green-pale);
}
.inquiry-thread .msg.msg-me {
  background: var(--surface-1);
  border-color: var(--border);
  align-self: flex-end;
}
.inquiry-thread .msg-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: 4px;
}
.inquiry-thread .msg-who {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--ink-strong, var(--text-strong));
}
.inquiry-thread .msg-when {
  font-size: 11px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.inquiry-thread .msg-body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink, var(--text));
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Reply form inside the card */
.inquiry-reply-form {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  align-items: flex-end;
}
.inquiry-reply-form textarea {
  flex: 1;
  min-height: 44px;
  resize: vertical;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  padding: var(--s-2) var(--s-3);
}
.inquiry-reply-form button {
  flex: 0 0 auto;
  white-space: nowrap;
}
/* Brief green "Sent ✓" pill that pulses on the reply form for ~2.2s
   after a successful send. Replaces the alert + inbox-flash flow —
   the user gets clear "your message went through" feedback without
   the whole thread list blinking. */
.inquiry-reply-form { position: relative; }
.inquiry-reply-form.just-sent::after {
  content: "✓ Sent";
  position: absolute;
  top: -10px;
  right: var(--s-3);
  background: var(--green-pale, rgba(21,128,61,0.10));
  color: var(--green-deep, #14532d);
  border: 1px solid rgba(21, 128, 61, 0.35);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--r-full, 999px);
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.18);
  animation: reply-sent-pop 2.2s var(--ease-out, ease-out) both;
  pointer-events: none;
}
@keyframes reply-sent-pop {
  0%   { opacity: 0; transform: translateY(4px) scale(0.92); }
  12%  { opacity: 1; transform: translateY(0)   scale(1); }
  80%  { opacity: 1; transform: translateY(0)   scale(1); }
  100% { opacity: 0; transform: translateY(-4px) scale(0.96); }
}

/* ─── Mobile polish for the inbox reply form ──────────────
   On phones the row-flex (textarea | Send) gets cramped. Stack
   them, full-width the button so it's tap-friendly, and re-park
   the .just-sent pill so it doesn't sit on the textarea border. */
@media (max-width: 600px) {
  .inquiry-reply-form {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-2);
  }
  .inquiry-reply-form textarea {
    min-height: 76px;          /* a little more room to type on phones */
    font-size: 15px;           /* prevents iOS zoom-on-focus */
  }
  .inquiry-reply-form button {
    width: 100%;
    min-height: 44px;
  }
  .inquiry-reply-form.just-sent::after {
    /* Above-form is too tight when the form stacks; centre it
       above the textarea instead. */
    top: -14px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  @keyframes reply-sent-pop {
    0%   { opacity: 0; transform: translateX(-50%) translateY(4px) scale(0.92); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
    80%  { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-4px) scale(0.96); }
  }
}

/* WhatsApp escape link in the meta row */
.inquiry-wa-link {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: var(--s-2);
  background: #25D366;
  color: white;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    background var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
}
.inquiry-wa-link:hover {
  background: #128C7E;
  color: white;
  transform: translateY(-1px);
}
.inquiry-wa-link svg { display: block; }

.inbox-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--green-deep);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── 12. Footer ────────────────────────────────────────────────────────── */
.footer {
  margin-top: var(--s-13);
  padding: var(--s-12) 0 var(--s-7);
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
}
.footer-grid {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--s-6);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--s-9);
}
.footer-brand { display: flex; flex-direction: column; gap: var(--s-3); max-width: 320px; }
.footer-brand-row { display: flex; align-items: center; gap: var(--s-2); color: white; font-weight: 700; }
.footer-brand-row img { width: 28px; height: 28px; }
.footer-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 800;
  letter-spacing: -0.022em;
  color: white;
}
.footer-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.footer-col { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-col h6 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: white;
  font-weight: 700;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--t-fast) var(--ease-out);
}
.footer-col a:hover { color: white; }

.footer-bottom {
  max-width: var(--container-wide);
  margin: var(--s-9) auto 0;
  padding: var(--s-6) var(--s-6) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.4);
  flex-wrap: wrap;
  gap: var(--s-3);
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-7); }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ─── 13. PAGE: Home ────────────────────────────────────────────────────── */

/* Hero */
.hero {
  position: relative;
  padding: var(--s-13) max(var(--s-6), var(--safe-l)) var(--s-12);
  max-width: var(--container-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: var(--s-12);
  align-items: center;
  overflow: visible;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(45% 40% at 18% 28%, rgba(21, 128, 61, 0.10), transparent 60%),
    radial-gradient(40% 38% at 85% 12%, rgba(176, 132, 0, 0.08),  transparent 60%),
    radial-gradient(60% 50% at 50% 100%, rgba(21, 128, 61, 0.06), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  max-width: 560px;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 88px);
  letter-spacing: -0.028em;
  line-height: 0.98;
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
  color: var(--ink-strong, var(--text-strong));
  margin: 0;
}
.hero-text h1 .gold,
.hero-text h1 em {
  color: var(--sap, var(--green));
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-2);
}
.hero-cta.center { justify-content: center; }

.hero-features {
  list-style: none;
  margin: var(--s-5) 0 0;
  padding: var(--s-5) 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
.hero-features li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-features strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  font-variation-settings: "opsz" 28, "SOFT" 20;
  letter-spacing: -0.014em;
  color: var(--ink-strong, var(--text-strong));
}
.hero-features span {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-mute, var(--text-mute));
  line-height: 1.4;
}

.hero-art {
  position: relative;
}
.hero-art figure {
  margin: 0;
  border-radius: var(--r-3xl);
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-4);
  position: relative;
}
.hero-art img { width: 100%; height: auto; display: block; }
.hero-art figcaption {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-mute);
  gap: var(--s-3);
}
.hero-art figcaption strong {
  font-family: var(--font-mono);
  color: var(--sap-deep, var(--money));
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

/* Features */
.features {
  padding: var(--s-13) var(--s-6);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
}
.features > .example-head { max-width: var(--container); margin: 0 auto var(--s-9); }
.feature-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}

/* Three-pillar variant — used for market-first features.
   Skips the 2-up middle breakpoint (which orphans 1 card)
   and goes straight from 3-up to 1-up. */
.feature-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}
@media (max-width: 880px) {
  .feature-grid-3 { grid-template-columns: 1fr; gap: var(--s-4); }
}
.feature-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  transition:
    border-color var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.feature-card .feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-faint);
  color: var(--green-deep);
}
.feature-card h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.016em;
  font-variation-settings: "opsz" 36, "SOFT" 30;
  margin: 0;
}
.feature-card p {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--ink-mute, var(--text-mute));
  line-height: 1.65;
  font-size: var(--text-base);
}

/* Generic section header used across home tab */
.example-head {
  max-width: var(--container-text);
  margin: 0 auto var(--s-7);
  text-align: center;
}
.example-head h2 {
  font-size: clamp(32px, 4.6vw, 56px);
  letter-spacing: -0.024em;
  line-height: 1.08;
  margin: 0 0 var(--s-3);
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-weight: 600;
}
.example-head p {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ink-mute, var(--text-mute));
  margin: 0;
  line-height: 1.65;
}

/* Example section */
.example {
  padding: var(--s-13) var(--s-6);
  background: var(--bg);
}
.example > .example-head { margin-bottom: var(--s-7); }
.example-stage {
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--r-3xl);
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-4);
  position: relative;
}
.example-stage figure,
.example-stage-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  background: var(--surface-3);
  overflow: hidden;
}
.example-stage-input,
.example-stage-annotated {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.example-stage-annotated {
  clip-path: inset(0 100% 0 0);
  animation: ww-stage-reveal 7s var(--ease-out) infinite;
}
.example-stage-scanline {
  position: absolute;
  top: 0; bottom: 0;
  width: 36px;
  left: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(21, 128, 61, 0.20) 50%,
    transparent 100%);
  filter: blur(8px);
  pointer-events: none;
  transform: translateX(-110%);
  animation: ww-stage-sweep 7s var(--ease-out) infinite;
}
.example-stage-badge {
  position: absolute;
  top: var(--s-3); left: var(--s-3);
  display: inline-flex; align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: ww-badge-blink 2.4s var(--ease-out) infinite;
}
.example-stage-badge .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-soft);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.example-stage figcaption {
  padding: var(--s-3) var(--s-5);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-mute);
  text-align: center;
}

.example-kpis {
  max-width: 960px;
  margin: var(--s-7) auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
.example-kpis .kpi {
  padding: var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.example-kpis .kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.example-kpis .kpi .kpi-label { order: 2; margin-top: 4px; }
.example-kpis .kpi .kpi-value { order: 1; }

@media (max-width: 760px) {
  .example-kpis { grid-template-columns: 1fr 1fr; }
}

/* How */
.how {
  padding: var(--s-13) var(--s-6);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}
.how::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 50%;
  background:
    radial-gradient(50% 40% at 20% 30%, rgba(21,128,61,0.06), transparent 60%),
    radial-gradient(50% 40% at 85% 70%, rgba(176,132,0,0.05), transparent 60%);
  z-index: -1;
  pointer-events: none;
}
.how > h2 {
  text-align: center;
  font-size: clamp(28px, 4vw, var(--text-5xl));
  letter-spacing: -0.028em;
  margin-bottom: var(--s-3);
  max-width: var(--container-text);
  margin-left: auto;
  margin-right: auto;
}
.how > .muted, .how > p.muted {
  text-align: center;
  max-width: var(--container-text);
  margin: 0 auto var(--s-9);
  font-size: var(--text-lg);
  color: var(--text-mute);
}
.steps {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
.step {
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--surface-1);
  display: flex; flex-direction: column;
  gap: var(--s-2);
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.step:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.step .step-num {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--green-deep);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green-pale);
  margin-bottom: var(--s-2);
}
.step h3 { font-size: var(--text-lg); letter-spacing: -0.014em; margin: 0; }
.step p { margin: 0; color: var(--text-mute); line-height: 1.55; font-size: var(--text-base); }

@media (max-width: 920px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Marketplace showcase */
.market-showcase {
  padding: var(--s-13) var(--s-6);
  background: var(--bg);
}
.market-showcase > .example-head { margin-bottom: var(--s-7); }
.market-showcase .listing-grid {
  max-width: var(--container-wide);
  margin: 0 auto;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-5);
}
.listing-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition:
    box-shadow var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
}
.listing-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
}
.listing-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.listing-card-body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.listing-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.species-pill, .tier-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.species-pill { background: var(--green-faint); color: var(--green-deep); }
.tier-pill    { background: var(--surface-2);   color: var(--text-mute); border: 1px solid var(--border); }
.listing-price {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--sap-deep, var(--money-strong));
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  margin: 6px 0;
}
.listing-price strong { color: var(--sap-deep, var(--money-strong)); font-weight: 600; }
.listing-unit {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-mute, var(--text-mute));
  margin-left: 6px;
}
.listing-meta {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-mute, var(--text-mute));
  margin: 0;
  line-height: 1.5;
}

/* ─── Market Index — the unique flex on the home page ───────────────────── */
.market-index {
  padding: var(--s-13) var(--s-6);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}
.market-index::before {
  /* Quiet amber wash so this section feels distinct from the other
     white surfaces — a Bloomberg-terminal yellow ghosted through paper. */
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 60%;
  background:
    radial-gradient(45% 35% at 20% 20%, rgba(184, 134, 11, 0.06), transparent 60%),
    radial-gradient(45% 35% at 80% 80%, rgba(21, 128, 61, 0.05),  transparent 60%);
  z-index: -1;
  pointer-events: none;
}
.market-index > .example-head {
  max-width: var(--container-text);
  margin: 0 auto var(--s-9);
  text-align: center;
}

.market-index-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
@media (max-width: 880px) { .market-index-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .market-index-grid { grid-template-columns: 1fr; } }

.mi-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-5);
  display: flex; flex-direction: column;
  gap: var(--s-4);
  transition:
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out);
}
.mi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.mi-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--hairline);
}
.mi-species {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  font-variation-settings: "opsz" 28, "SOFT" 30;
  letter-spacing: -0.014em;
  color: var(--ink-strong, var(--text-strong));
  margin: 0;
  line-height: 1.15;
}
.mi-tier {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-mute, var(--text-mute));
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.mi-prices { display: flex; flex-direction: column; gap: var(--s-2); }
.mi-price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3);
}
.mi-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-mute, var(--text-mute));
}
.mi-value {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--ink-strong, var(--text-strong));
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.008em;
}
.mi-value strong { font-weight: 600; }
.mi-value-sold {
  color: var(--sap-deep, var(--green-deep));
}
.mi-value-sold strong { color: var(--sap-deep, var(--green-deep)); }

.mi-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--ink-mute, var(--text-mute));
}
.mi-count strong {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 600;
  color: var(--ink-strong, var(--text-strong));
  font-variant-numeric: tabular-nums;
}
.mi-split {
  font-family: var(--font-mono);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute, var(--text-mute));
  font-size: 11px;
}

.market-index-footnote {
  max-width: var(--container-text);
  margin: var(--s-6) auto 0;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-mute, var(--text-mute));
}

/* ─── Sparkline inside Market Index card ────────────────────────────────── */
.mi-spark {
  position: relative;
  height: 36px;
  margin: var(--s-3) 0 var(--s-2);
  display: flex; align-items: center; gap: var(--s-2);
}
.mi-spark-svg {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.mi-spark-empty {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--text-soft);
}
.mi-spark-trend {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-mute);
  flex: 0 0 auto;
}
.mi-trend-up   { background: var(--green-pale); color: var(--green-deep); }
.mi-trend-down { background: var(--danger-bg);  color: var(--danger); }
.mi-trend-flat { background: var(--surface-2);  color: var(--text-mute); }

/* ─── Demo (free public price-check) section ─────────────────────────── */
.demo-section {
  padding: var(--s-13) var(--s-6);
  background: var(--paper-deep, var(--bg-warm));
  border-top: 1px solid var(--border);
  position: relative;
  isolation: isolate;
}
.demo-section > .example-head {
  max-width: var(--container-text);
  margin: 0 auto var(--s-7);
  text-align: center;
}
.demo-shell {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3xl);
  padding: var(--s-7);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column;
  gap: var(--s-4);
}
.demo-busy {
  display: flex; align-items: center; gap: var(--s-3);
  justify-content: center;
  padding: var(--s-4);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-mute);
}
.demo-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--sap);
  border-radius: 50%;
  animation: ww-spin 0.9s linear infinite;
}
.demo-result { animation: ww-fade-up 380ms var(--ease-out); }
.demo-result-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
}
.demo-result-head {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 600px) {
  .demo-result-head { grid-template-columns: 1fr 1fr; }
}
.demo-result-table { width: 100%; }
.demo-result-cta {
  padding: var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--green-faint);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
}
.demo-result-cta p { margin: 0; flex: 1; color: var(--sap-deep, var(--green-deep)); }

/* ─── Marketplace action row (filter summary + "Save this search") ────── */
.market-action-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.market-action-row #market-summary { margin: 0; }
.market-action-row .btn { white-space: nowrap; }

/* ─── Saved searches modal ───────────────────────────────────────────── */
.ss-row {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-2);
  background: var(--surface-1);
}
.ss-row.is-paused {
  background: var(--surface-2);
  opacity: 0.7;
}
.ss-row-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
}
.ss-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--text-md);
  color: var(--ink-strong, var(--text-strong));
  letter-spacing: -0.012em;
}
.ss-row-actions { display: inline-flex; gap: 6px; align-items: center; }
.ss-toggle {
  height: 26px; padding: 0 var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.ss-toggle.active {
  background: var(--green-pale);
  color: var(--green-deep);
  border-color: transparent;
}
.ss-toggle:hover { transform: translateY(-1px); }
.ss-delete {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--text-mute);
  font-size: 18px;
  cursor: pointer;
}
.ss-delete:hover { background: var(--danger-bg); color: var(--danger); }
.ss-criteria {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-mute);
}
.ss-create {
  border-top: 1px solid var(--border);
  padding: var(--s-5) var(--s-6);
  background: var(--surface-2);
  display: flex; flex-direction: column;
  gap: var(--s-3);
}
.ss-form-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-md);
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--ink-strong, var(--text-strong));
}
.ss-form-hint { margin: 0; }
.ss-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.ss-form-grid .field select,
.ss-form-grid .field input { height: 36px; font-size: var(--text-sm); }
.ss-form-actions {
  display: flex; justify-content: flex-end;
  margin-top: var(--s-2);
}
@media (max-width: 600px) {
  .ss-form-grid { grid-template-columns: 1fr; }
}

/* Testimonial */
.testimonial-section {
  padding: var(--s-13) var(--s-6);
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.testimonial-frame {
  max-width: var(--container-text);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.testimonial-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-strong);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.testimonial-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 72, "SOFT" 30, "WONK" 0;
  font-size: clamp(28px, 3.6vw, 42px);
  letter-spacing: -0.014em;
  line-height: 1.28;
  color: var(--ink-strong, var(--text-strong));
  margin: 0;
  position: relative;
  padding-left: 0;
}
.testimonial-mark {
  display: none;
}
.testimonial-quote::before {
  content: "“";
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 4em;
  line-height: 0.2;
  color: var(--sap, var(--green));
  position: absolute;
  top: 0.42em;
  left: -0.7em;
}
.testimonial-author { display: flex; align-items: center; gap: var(--s-3); border-top: 1px solid rgba(20,14,10,0.12); padding-top: var(--s-4); }
.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: var(--text-base);
}
.testimonial-attrib { display: flex; flex-direction: column; }
.testimonial-attrib strong { font-weight: 700; color: var(--text-strong); font-size: var(--text-sm); }

/* Final CTA */
.cta-final {
  padding: var(--s-13) var(--s-6);
  background: var(--bg-dark);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-final::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(50% 40% at 50% 40%, rgba(34, 197, 94, 0.18), transparent 60%),
    radial-gradient(40% 40% at 80% 80%, rgba(176, 132, 0, 0.10), transparent 60%);
  pointer-events: none;
}
.cta-final h2 {
  color: white;
  position: relative;
  font-size: clamp(32px, 5vw, var(--text-6xl));
  letter-spacing: -0.030em;
  max-width: var(--container-text);
  margin: 0 auto var(--s-4);
}
.cta-final .muted, .cta-final p {
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  font-size: var(--text-lg);
  max-width: var(--container-text);
  margin: 0 auto var(--s-7);
}
.cta-final .hero-cta {
  position: relative;
  justify-content: center;
}

/* ─── 14. PAGE: Detect · Price · List ───────────────────────────────────── */
.detect-head {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-12) var(--s-6) var(--s-7);
  text-align: center;
}
.detect-head h1, .detect-head h2 {
  font-size: clamp(40px, 5.6vw, 72px);
  letter-spacing: -0.030em;
  margin: 0 0 var(--s-3);
  line-height: 1.02;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  font-weight: 600;
}
.detect-head p {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ink-mute, var(--text-mute));
  margin: 0 auto;
  max-width: var(--container-text);
  line-height: 1.65;
}

.upload-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-6) var(--s-9);
}

/* Outer card — one shell for both AI and Manual modes */
.upload-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

/* Mode switcher — segmented control inside the card head */
.upload-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.upload-mode {
  display: flex; align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-mute);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out);
}
.upload-mode:hover { background: var(--surface-1); color: var(--text-strong); }
.upload-mode.is-active {
  background: var(--surface-1);
  border-color: var(--border-strong);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
}
.upload-mode-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  color: var(--text-mute);
  flex: 0 0 38px;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}
.upload-mode.is-active .upload-mode-icon {
  background: var(--green-pale);
  color: var(--green-deep);
}
.upload-mode-text {
  display: flex; flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  min-width: 0;
}
.upload-mode-text strong {
  font-size: var(--text-sm);
  font-weight: 600;
  color: inherit;
}
.upload-mode-text em {
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Panel — content body for the active mode */
.upload-panel { padding: var(--s-6); }
.upload-panel[hidden] { display: none; }

/* AI panel split layout */
.upload-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-6);
  margin-bottom: var(--s-5);
}
.upload-drop-col { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.upload-settings-col {
  display: flex; flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
.settings-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin: 0;
}
.settings-sub { margin: 0 0 var(--s-2); }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.settings-grid .field { gap: 4px; }
.settings-grid .field select,
.settings-grid .field input { height: 36px; font-size: var(--text-sm); }

/* CTA bar at the bottom of the AI panel */
.upload-cta {
  display: flex; flex-direction: column;
  gap: var(--s-3);
}
.upload-cta .btn.big { height: 48px; font-size: var(--text-sm); }

/* Tip text for the manual panel */
.upload-tip {
  text-align: center;
  margin: var(--s-3) auto 0;
  max-width: 480px;
  color: var(--text-mute);
  line-height: 1.5;
}

/* ── Modern dropzone — flatter, less empty space ───────────────────────── */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-xl);
  padding: var(--s-7) var(--s-5);
  background: var(--surface-1);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out);
  position: relative;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.dropzone.dropzone-batch  { min-height: 240px; }
.dropzone.dropzone-single { min-height: 200px; }
.dropzone:hover {
  border-color: var(--green);
  background: var(--green-faint);
}
.dropzone:hover .dz-icon { background: var(--green-pale); color: var(--green-deep); }
.dropzone.is-drag, .dropzone.dragover, .dropzone.drag {
  border-color: var(--green);
  border-style: solid;
  background: var(--green-pale);
  transform: scale(1.003);
}
.dropzone .dropzone-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  pointer-events: none;
}
.dropzone .dz-icon {
  margin: 0 auto var(--s-2);
  color: var(--green-deep);
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-faint);
  border-radius: var(--r-xl);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.dropzone .dz-headline {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
}
.dropzone .dz-headline .link {
  color: var(--green-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.dropzone:hover .dz-headline .link { color: var(--green); }
.dropzone .dz-sub {
  font-size: var(--text-xs);
  color: var(--text-mute);
  margin: 0;
}

/* Responsive: collapse split to single column */
@media (max-width: 880px) {
  .upload-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .upload-settings-col { padding: var(--s-4); }
  .settings-grid { gap: var(--s-3); }
}
@media (max-width: 520px) {
  .upload-mode-switch { grid-template-columns: 1fr; }
  .upload-mode { padding: var(--s-2) var(--s-3); }
  .upload-mode-icon { width: 32px; height: 32px; flex: 0 0 32px; }
  .upload-mode-icon svg { width: 16px; height: 16px; }
  .settings-grid { grid-template-columns: 1fr; }
  .dropzone { padding: var(--s-6) var(--s-4); min-height: 180px; }
  .dropzone.dropzone-batch { min-height: 200px; }
}

.results-stack {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-7) var(--s-6);
}
.results-stack-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.results-stack-head h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.022em;
  margin: 0 0 4px;
}
.results-stack-head p {
  font-size: var(--text-sm);
  color: var(--text-mute);
  margin: 0;
}

/* Result card */
.result-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-2);
  margin-bottom: var(--s-6);
  overflow: hidden;
  animation: ww-fade-up 380ms var(--ease-out);
}
.result-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.result-card-head h3 {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0;
}
.result-card-body { padding: var(--s-5); }
.result-card img {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  max-width: 100%;
  margin: 0 auto var(--s-4);
}

.result-listing-prompt {
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--green-faint);
  border: 1px solid var(--green-pale);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.result-listing-prompt p { margin: 0; color: var(--green-deep); font-weight: 500; }
.result-listing-prompt .actions { display: flex; gap: var(--s-2); }
.dismiss-prompt {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.dismiss-prompt:hover { color: var(--text-strong); background: var(--hairline); }

.warnings {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
}
.warnings ul { margin: 4px 0 0 var(--s-5); padding: 0; }

/* Market prices */
.market-prices {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-7) var(--s-6) var(--s-12);
}
.market-prices > .example-head {
  margin-bottom: var(--s-5);
  text-align: center;
}
.market-prices-cta {
  margin-top: var(--s-4);
  text-align: right;
  display: flex;
  justify-content: flex-end;
}
.market-prices-cta .btn { height: 32px; padding: 0 var(--s-4); font-size: var(--text-xs); }

/* ─── 15. PAGE: Marketplace ─────────────────────────────────────────────── */
.market {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--s-9) var(--s-6) var(--s-12);
}
.market > .example-head {
  text-align: left;
  margin: 0 0 var(--s-7);
  max-width: var(--container-text);
}
.market > .example-head h2 {
  font-size: clamp(34px, 5vw, var(--text-5xl));
}

/* ─── Pricing explainer (collapsible card on the marketplace) ──────────── */
.pricing-explainer {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  margin-bottom: var(--s-5);
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.pricing-explainer[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}
.pricing-explainer summary {
  display: flex; align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--t-fast) var(--ease-out);
}
.pricing-explainer summary::-webkit-details-marker { display: none; }
.pricing-explainer summary::marker { content: ""; }
.pricing-explainer summary:hover { background: var(--surface-2); }

.pe-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green-faint);
  color: var(--green-deep);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: var(--text-base);
  flex: 0 0 28px;
}
.pe-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  letter-spacing: -0.010em;
  color: var(--ink-strong, var(--text-strong));
}
.pe-chevron {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-mute, var(--text-mute));
  transition: transform var(--t-base) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.pricing-explainer[open] .pe-chevron { transform: rotate(180deg); color: var(--green-deep); }

.pe-body {
  padding: 0 var(--s-5) var(--s-5);
  border-top: 1px solid var(--hairline);
  animation: ww-fade-up 360ms var(--ease-out);
}
.pe-body > p {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink-mute, var(--text-mute));
  margin: var(--s-4) 0 0;
  max-width: 720px;
}

/* Formula strip — terms separated by mono × signs */
.pe-formula {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: var(--s-2);
  margin: var(--s-5) 0;
  padding: var(--s-4);
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
}
.pe-term {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-variation-settings: "opsz" 24, "SOFT" 50;
  font-size: var(--text-md);
  color: var(--sap-deep, var(--green-deep));
  letter-spacing: -0.010em;
}
.pe-mul {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--amber);
}

/* Terms list */
.pe-terms {
  margin: var(--s-3) 0 0;
  padding: 0;
  display: flex; flex-direction: column;
  gap: var(--s-3);
}
.pe-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--hairline);
}
.pe-row:last-child { border-bottom: 0; }
.pe-row dt {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  font-size: var(--text-base);
  color: var(--ink-strong, var(--text-strong));
  letter-spacing: -0.010em;
  margin: 0;
}
.pe-row dd {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-mute, var(--text-mute));
  margin: 0;
}
@media (max-width: 600px) {
  .pe-row { grid-template-columns: 1fr; gap: 4px; }
}

.pe-footnote {
  margin: var(--s-5) 0 0;
  font-style: italic;
  text-align: center;
  color: var(--ink-mute, var(--text-mute));
}

/* ─── Recent prices by size (marketplace tab) ───
   Tier-first grouping of /api/market-prices. Each tier card lists the
   species currently traded at that diameter, asking-avg + range +
   recently-sold avg if any. */
.market-recent-prices {
  margin-bottom: var(--s-7);
}
.market-recent-prices .mrp-head {
  margin-bottom: var(--s-4);
}
.market-recent-prices .mrp-head h3 {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(20px, 2.4vw, 26px);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.market-recent-prices .mrp-head p {
  margin: 0;
  max-width: 60ch;
}
.mrp-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-4);
}
.mrp-tier-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-1);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.mrp-tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--hairline);
}
.mrp-tier-name {
  font-family: var(--font-display, Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mrp-rows {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.mrp-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s-2);
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--hairline);
}
.mrp-row:last-child { border-bottom: none; }
.mrp-species {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mrp-species .species-pill {
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mrp-count {
  font-size: 11.5px;
  color: var(--text-mute);
  letter-spacing: 0.01em;
}
.mrp-price {
  text-align: right;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--text);
}
.mrp-price strong { color: #15803d; font-size: 16px; }
.mrp-price .mrp-unit {
  color: var(--text-mute);
  font-size: 12px;
  margin-left: 2px;
}
.mrp-price .mrp-range {
  display: block;
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 2px;
}
.mrp-sold-col {
  grid-column: 1 / -1;
  text-align: right;
}
.mrp-sold {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--text-mute);
  background: rgba(21,128,61,0.06);
  padding: 2px 8px;
  border-radius: var(--r-full, 999px);
  margin-top: 2px;
}
.mrp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s-6) var(--s-4);
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--r-2xl);
}
.mrp-empty .btn { margin-top: var(--s-2); }

/* ─── Mobile polish for the recent-prices section ──────────────
   Tighter card padding, smaller grid min so 1-column kicks in
   sooner, left-aligned price column (text wraps under the species
   row instead of fighting for the right edge), and visibly larger
   touch targets on the empty-state CTA. */
@media (max-width: 760px) {
  .market-recent-prices { margin-bottom: var(--s-5); }
  .market-recent-prices .mrp-head { margin-bottom: var(--s-3); }
  .market-recent-prices .mrp-head h3 { font-size: 19px; }
  .market-recent-prices .mrp-head p { font-size: 13px; }
  .mrp-body { gap: var(--s-3); grid-template-columns: 1fr; }
  .mrp-tier-card { padding: var(--s-3); border-radius: var(--r-xl, 14px); }
  .mrp-tier-name { font-size: 16px; }
  .mrp-tier-head { padding-bottom: 8px; }
}
@media (max-width: 520px) {
  /* Stack the species ↔ price columns into a single column so long
     names like "Bilinga / Opepe" or "Doussié / Afzelia" never get
     truncated by ellipsis. Price sits directly under its species. */
  .mrp-row {
    grid-template-columns: 1fr;
    padding: 10px 0;
    gap: 4px;
  }
  .mrp-row:last-child { padding-bottom: 4px; }
  .mrp-price { text-align: left; }
  .mrp-price strong { font-size: 17px; }
  .mrp-sold-col { text-align: left; }
  .mrp-species .species-pill {
    white-space: normal;       /* allow wrap on phones */
    overflow: visible;
    text-overflow: clip;
  }
  /* The empty-state CTA now spans full width so it's easy to tap. */
  .mrp-empty { padding: var(--s-5) var(--s-3); border-radius: var(--r-xl, 14px); }
  .mrp-empty .btn { width: 100%; min-height: 44px; }
}

.market-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--s-6);
}
.market-filters .field { gap: 4px; }
.market-filters select { height: 36px; }

@media (max-width: 760px) {
  .market-filters {
    grid-template-columns: 1fr 1fr;
    padding: var(--s-3);
    gap: var(--s-2);
    border-radius: var(--r-xl, 14px);
  }
  /* iOS recommends 44px minimum touch target — desktop's 36px is
     too small to tap reliably with a thumb on small screens. */
  .market-filters select { min-height: 44px; font-size: 15px; }
  .market-filters .field span { font-size: 12px; }
}
@media (max-width: 380px) {
  .market-filters { grid-template-columns: 1fr; }
}

.market-summary {
  display: inline-flex; align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  font-size: var(--text-sm);
  color: var(--text-mute);
  margin-bottom: var(--s-5);
}
.market-summary .pill {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
}
.market-summary .pill strong { color: var(--text-strong); font-weight: 700; }
.market-summary:empty { display: none; }

/* Card grid */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-5);
}
.market-card {
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition:
    box-shadow var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
  text-align: left;
  text-decoration: none;
  color: inherit;
}
.market-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
  border-color: var(--border-strong);
}
.market-card:focus-visible { outline: none; box-shadow: var(--shadow-focus-bg); }

.mc-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-3);
}
.mc-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms var(--ease-out);
}
.market-card:hover .mc-photo { transform: scale(1.04); }
.mc-photo-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  font-size: 38px;
  background: var(--surface-3);
}
.mc-photo-overlay {
  position: absolute;
  top: var(--s-3); left: var(--s-3);
  display: flex; gap: 6px;
}

.mc-body {
  flex: 1;
  padding: var(--s-4) var(--s-5);
  display: flex; flex-direction: column;
  gap: 6px;
}
.mc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.mc-header h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  letter-spacing: -0.014em;
  line-height: 1.2;
  color: var(--ink-strong, var(--text-strong));
  margin: 0;
  flex: 1;
}
.mc-price {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.012em;
  color: var(--sap-deep, var(--money-strong));
}
.mc-price strong { color: var(--sap-deep, var(--money-strong)); font-weight: 600; }
.mc-unit {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--ink-mute, var(--text-mute));
  margin-left: 4px;
  letter-spacing: 0;
}
.mc-meta {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--text-mute);
}
.mc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mc-sold { font-size: var(--text-xs); color: var(--text-mute); font-weight: 500; }
.mc-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--text-xs);
  color: var(--text-mute);
}
.mc-actions { display: inline-flex; gap: var(--s-2); }
.mc-actions .inquire-btn,
.mc-actions .btn.sm.primary {
  background: var(--sap-deep);
  color: var(--paper, #fbf6e6);
  border: 1px solid var(--sap-deep);
  height: 28px;
  padding: 0 var(--s-4);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-sm);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 1px 2px rgba(5, 46, 22, 0.22);
  transition:
    background var(--t-base) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
.mc-actions .inquire-btn:hover {
  background: #0e5d2b;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 4px 10px rgba(5, 46, 22, 0.28);
}

/* Loading row inside grid */
.market-grid > .muted.center {
  grid-column: 1 / -1;
  padding: var(--s-12) !important;
}

/* ─── 16. Feedback FAB + utilities ──────────────────────────────────────── */
.feedback-fab {
  position: fixed;
  right: max(var(--s-6), var(--safe-r));
  bottom: max(var(--s-6), var(--safe-b));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 44px;
  padding: 0 var(--s-5);
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--text-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-3);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}
.feedback-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-4);
  border-color: var(--green);
  color: var(--green-deep);
}
.feedback-fab svg { color: var(--green); }
.feedback-fab:hover svg { color: var(--green-deep); }

/* Utilities */
[hidden] { display: none !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.row    { display: flex; align-items: center; gap: var(--s-3); }
.col    { display: flex; flex-direction: column; gap: var(--s-3); }
.flex   { display: flex; }
.grid   { display: grid; }
.gap-2  { gap: var(--s-2); }
.gap-3  { gap: var(--s-3); }
.gap-4  { gap: var(--s-4); }
.w-full { width: 100%; }
.hide-on-mobile { }
.show-on-mobile { display: none; }

/* ─── 16b. JS-injected component classes ────────────────────────────────── */
/* These classes never appear in static HTML — only in template strings
 * inside app.js. Listed in the order they're emitted by JS. */

/* Dropzone drag state (JS adds .drag) */
.dropzone.drag { border-color: var(--green); background: var(--green-pale); transform: scale(1.005); }

/* Queue items inside upload form */
.queue-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.queue-thumb {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
  flex: 0 0 36px;
}
.queue-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.queue-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-size { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-mute); font-variant-numeric: tabular-nums; }
.queue-remove {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-mute);
  border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.queue-remove:hover { background: var(--danger-bg); color: var(--danger); }

/* Result card child elements (JS-generated) */
.result-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: var(--s-3);
}
.result-card-title {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--text-strong);
}
.result-card-image {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: var(--s-4);
}
.result-card-image img { width: 100%; height: auto; display: block; }
.result-card-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-strong, var(--text-strong));
}
.result-listing-prompt-actions { display: flex; gap: var(--s-2); align-items: center; }

/* Result KPI strip — used inside result cards */
.result-card .kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding: var(--s-4);
  background: var(--surface-2);
  border-radius: var(--r-lg);
}
@media (max-width: 760px) {
  .result-card .kpi-strip { grid-template-columns: 1fr 1fr; }
}
.result-card .kpi-strip .kpi-value { font-size: var(--text-2xl); }

/* Per-log table styling — JS injects these classes */
.logs-table .micro { font-size: var(--text-xs); color: var(--text-mute); }
.micro { font-size: var(--text-xs); color: var(--text-mute); }

.species-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  background: var(--green-faint);
  color: var(--green-deep);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--r-full);
}
.species-pill.low-conf, .species-pill.lowConf { background: var(--warn-bg); color: var(--warn); }
.tier-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
}

/* Listing-detail content (modal body) */
.listing-detail-content {
  display: flex; flex-direction: column;
  gap: var(--s-3);
}
.listing-detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--text-sm);
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.listing-detail-row:last-child { border-bottom: 0; }
.listing-detail-row .label { color: var(--text-mute); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.listing-detail-row .value {
  font-family: var(--font-mono);
  color: var(--ink-strong, var(--text-strong));
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.005em;
}
.listing-detail-notes {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: var(--s-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  margin: var(--s-3) 0;
  border-left: 3px solid var(--green-pale);
}

.listing-photo, .listing-photo-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-3);
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; }
.listing-photo-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  font-size: 38px;
}

/* Inquiry card (in Inbox modal) */
.inquiry-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  background: var(--surface-1);
  display: flex; flex-direction: column; gap: 6px;
}
.inquiry-card + .inquiry-card { margin-top: var(--s-3); }
.inquiry-card.unread { border-color: var(--green); background: var(--green-faint); }
.inquiry-card.is-me  { background: var(--surface-2); }
.inquiry-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
}
.inquiry-card-meta {
  display: flex; gap: var(--s-3);
  font-size: var(--text-xs);
  color: var(--text-soft);
}
.inquiry-card-meta strong { color: var(--text-strong); font-weight: 600; }
.inquiry-card-message {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}
.inquiry-card-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); justify-content: flex-end; }
.inquiry-listing {
  font-size: var(--text-xs);
  color: var(--text-mute);
  font-weight: 500;
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Inquiry summary block (read-only header in publish/inquiry dialogs) */
.inquiry-summary {
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  gap: 6px;
  font-size: var(--text-sm);
}
.inquiry-summary-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.inquiry-summary-meta { color: var(--text-mute); font-size: var(--text-xs); }
.inquiry-summary-price {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--sap-deep, var(--money-strong));
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.005em;
}

/* Admin users panel */
.admin-users-wrap { padding: var(--s-4); overflow-x: auto; }
.admin-users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
.admin-users-table th {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
  padding: var(--s-2) var(--s-3);
  text-align: left;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
}
.admin-users-table td {
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-row-btn {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 var(--s-3);
  font-size: 11px; font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--text-strong);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.admin-row-btn:hover { border-color: var(--green); background: var(--green-faint); color: var(--green-deep); }
.admin-row-btn.danger { color: var(--danger); }
.admin-row-btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

/* Paywall block (gates a section when not subscribed) */
.paywall-block {
  padding: var(--s-9) var(--s-6);
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-xl);
  text-align: center;
  color: var(--text);
  margin: var(--s-5) auto;
  max-width: 560px;
}
.paywall-block h3 { margin-bottom: var(--s-2); font-size: var(--text-xl); }
.paywall-block p { color: var(--text-mute); margin: 0 0 var(--s-4); }
.paywall-cell { padding: 0 !important; }

/* Price-block extras */
.price-block-label { font-size: var(--text-xs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.price-block-sub   { font-size: var(--text-xs); color: var(--text-mute); }
.price-block-value {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-strong, var(--text-strong));
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.005em;
}
.price-compare {
  display: flex; gap: var(--s-3); align-items: center;
  font-size: var(--text-sm);
  flex-wrap: wrap;
}

/* List-btn / list-all-btn (per-log "List for lease") */
.list-btn, .list-all-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 var(--s-3);
  font-size: var(--text-xs); font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--green-faint);
  color: var(--green-deep);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.list-btn:hover, .list-all-btn:hover { background: var(--green-pale); border-color: var(--green); }
.list-btn.is-listed { background: var(--surface-2); color: var(--text-mute); cursor: default; }
.list-btn.is-listed:hover { background: var(--surface-2); border-color: transparent; }

/* mc-seller — adds the seller name to marketplace cards */
.mc-seller { font-size: var(--text-xs); color: var(--text-mute); font-weight: 500; }

/* Owner-action footer (inside listing detail) */
.owner-action-footer {
  display: flex; gap: var(--s-2);
  justify-content: flex-end;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Reveal stagger variants */
.reveal-stagger { transition-delay: 100ms; }
.reveal-stagger.s-1 { transition-delay: 100ms; }
.reveal-stagger.s-2 { transition-delay: 200ms; }
.reveal-stagger.s-3 { transition-delay: 300ms; }
.reveal-stagger.s-4 { transition-delay: 400ms; }

/* Generic .show + .panel-is-entering (tab transitions) */
.show { animation: ww-fade-in 280ms var(--ease-out) both; }
.panel-is-entering { animation: ww-fade-up 380ms var(--ease-out) both; }

/* Download link */
.download-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--green-deep);
}
.download-link:hover { color: var(--green); text-decoration: underline; }

/* Tab badge inside the marketplace tab */
.tab-market-count { /* same styling as .tab-badge already applied via class */ }

/* Stage badge text (visible label) */
.example-stage-badge-text { color: inherit; }

/* Footer locale */
.footer-locale { color: rgba(255,255,255, 0.4); font-size: var(--text-xs); }

/* Asking-vs-estimate inline note */
.asking { color: var(--money-strong); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ─── 17. Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-9); padding: var(--s-12) var(--s-6) var(--s-9); }
  .hero-art { order: -1; }
}

@media (max-width: 880px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root {
    --nav-h: 52px;
  }
  .nav {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: var(--nav-h) auto;
    height: auto;
    padding: 0 var(--s-4);
    row-gap: 0;
    column-gap: var(--s-3);
  }
  .brand { grid-column: 1; grid-row: 1; }
  .brand-name { display: none; }
  .nav .tabbar {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    max-width: none;
    border-radius: 0;
    border-left: 0; border-right: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 4px var(--s-3);
    scrollbar-width: none;
  }
  .nav .tabbar::-webkit-scrollbar { display: none; }
  .nav .tab { flex: 0 0 auto; }
  .nav .lang-picker { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav .nav-auth    { grid-column: 3; grid-row: 1; justify-self: end; }
  .auth-user .who   { display: none; }

  .hero { padding: var(--s-11) var(--s-4) var(--s-9); }
  .hero-text h1 { font-size: clamp(34px, 9.5vw, 52px); }
  .hero-features { grid-template-columns: 1fr 1fr; }
  .hero-features li:nth-child(3) { grid-column: 1 / -1; }

  .features, .example, .how, .market-showcase, .testimonial-section, .cta-final {
    padding: var(--s-11) var(--s-4);
  }

  .feature-grid { grid-template-columns: 1fr; gap: var(--s-3); }

  .detect-head { padding: var(--s-9) var(--s-4) var(--s-5); }
  .upload-section, .results-stack, .market-prices, .market { padding-left: var(--s-4); padding-right: var(--s-4); }
  .upload-section form#analyze-form, #manual-form { padding: var(--s-5); border-radius: var(--r-2xl); }

  .market-head { flex-direction: column; align-items: flex-start; }
  .market-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s-3); }
  .mc-body { padding: var(--s-3) var(--s-4); }
  .mc-header h4 { font-size: var(--text-sm); }
  .mc-price { font-size: var(--text-sm); }

  .testimonial-quote { font-size: var(--text-2xl); }
  .cta-final h2 { font-size: var(--text-4xl); }

  .footer { padding: var(--s-7) var(--s-4); flex-direction: column; align-items: flex-start; }

  .hide-on-mobile { display: none !important; }
  .show-on-mobile { display: initial; }

  .feedback-fab {
    padding: 0 var(--s-3);
    height: 40px;
    font-size: var(--text-xs);
  }
}
