/* The Assay — Design Token System */

/* ── Telegram theme passthrough ─────────────────────────────── */
:root {
  /* Telegram injects these; we alias to ensure fallbacks */
  --bg:        var(--tg-theme-bg-color, #ffffff);
  --text:      var(--tg-theme-text-color, #1a1a1a);
  --hint:      var(--tg-theme-hint-color, #707070);
  --btn:       var(--tg-theme-button-color, #2390d9);
  --btn-text:  var(--tg-theme-button-text-color, #ffffff);
  --sec-bg:    var(--tg-theme-secondary-bg-color, #f0f0f0);
  --link:      var(--tg-theme-link-color, #2390d9);

  /* ── Verification semantic palette ──────────────────────────── */
  --verified:  #2FBF71;
  --caution:   #E8A73B;
  --fail:      #E5484D;

  /* ── Typography ─────────────────────────────────────────────── */
  --font-ui:   var(--tg-font, -apple-system, "SF Pro", system-ui, sans-serif);
  --font-data: ui-monospace, "SF Mono", "JetBrains Mono", "Courier New", monospace;

  /* ── Trust-tier accents (vendor reputation bands) ───────────────── */
  --tier-trusted:     var(--verified);
  --tier-established: var(--btn);
  --tier-new:         var(--caution);
  --tier-caution:     var(--fail);

  /* ── Spacing & radius ────────────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ── Type scale ──────────────────────────────────────────────── */
  --fs-0: 11px;   /* micro / labels */
  --fs-1: 12px;   /* small / hints */
  --fs-2: 13px;   /* body-small */
  --fs-3: 15px;   /* body */
  --fs-4: 17px;   /* card / subtitle */
  --fs-5: 20px;   /* section title */
  --fs-6: 26px;   /* hero */

  /* ── Surfaces & elevation ────────────────────────────────────── */
  /* A card surface that reads as raised in light themes and distinct in dark ones. */
  --surface:   color-mix(in srgb, var(--sec-bg) 70%, var(--bg));
  --surface-2: var(--sec-bg);
  --border:    color-mix(in srgb, var(--hint) 18%, transparent);
  --border-strong: color-mix(in srgb, var(--hint) 32%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);

  /* ── Hairline divider ────────────────────────────────────────── */
  --divider: 1px solid color-mix(in srgb, var(--hint) 25%, transparent);
}

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  /* Clear the tab bar plus the device's bottom safe area (home indicator). */
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ────────────────────────────────────────────── */
#app-root {
  min-height: calc(100vh - 64px);
  /* Keep content clear of the notch/status bar and rounded corners. */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ── Tab bar ─────────────────────────────────────────────────── */
#tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  /* Extend the bar under the home indicator without shrinking the tap targets. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: content-box;
  background: var(--bg);
  border-top: var(--divider);
  display: flex;
  align-items: stretch;
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hint);
  font-family: var(--font-ui);
  font-size: 10px;
  padding: var(--sp-1) 0;
  transition: color 0.15s ease;
}

.tab-btn .tab-icon { font-size: 22px; line-height: 1; }
.tab-btn.active { color: var(--btn); }

/* ── In-page primary CTA ─────────────────────────────────────────
   Fallback for the native Telegram MainButton when the app runs outside a
   real Telegram client (platform "unknown"). Floats above the tab bar. */
.dom-main-btn {
  position: fixed;
  left: var(--sp-4); right: var(--sp-4);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 90;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--btn);
  color: var(--btn-text);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: filter 0.15s ease, transform 0.05s ease;
}
.dom-main-btn:hover { filter: brightness(1.05); }
.dom-main-btn:active { transform: translateY(1px); }
.dom-main-btn:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; }
.dom-main-btn[hidden] { display: none; }
/* Keep the last item of a scrolling view clear of the floating CTA. */
body.has-main-btn .view { padding-bottom: calc(64px + 72px); }

/* ── View container ──────────────────────────────────────────── */
.view { padding: var(--sp-4); }
.view-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  border-bottom: var(--divider);
  padding-bottom: var(--sp-3);
}
.view-title {
  font-size: 18px;
  font-weight: 600;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:active { transform: scale(0.99); box-shadow: none; }
.card-title {
  font-size: var(--fs-4);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-2);
}
.card-hint {
  font-size: var(--fs-1);
  color: var(--hint);
  font-family: var(--font-data);
}

/* Static (non-clickable) card variant — forms, summaries. */
.card.card-static { cursor: default; }
.card.card-static:active { transform: none; box-shadow: var(--shadow-sm); }

/* ── THE ASSAY STRIP — signature element ────────────────────── */
.assay-strip {
  font-family: var(--font-data);
  font-size: 11px;
  line-height: 1.5;
  /* Wrap rather than clip — the verdict (✓ VERIFIED) must never be truncated. */
  white-space: normal;
  overflow-wrap: anywhere;
  padding: var(--sp-2) var(--sp-3);
  background: color-mix(in srgb, var(--sec-bg) 80%, transparent);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--caution);
  margin-top: var(--sp-2);
}
.assay-strip.verified   { border-left-color: var(--verified); }
.assay-strip.fail       { border-left-color: var(--fail); }
.assay-strip.unverified { border-left-color: var(--caution); }

.assay-verified  { color: var(--verified); font-weight: 700; }
.assay-caution   { color: var(--caution);  font-weight: 700; }
.assay-fail      { color: var(--fail);     font-weight: 700; }

.assay-hash-link {
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-data);
}

/* ── Product detail hero strip ───────────────────────────────── */
.hero-assay-strip {
  font-family: var(--font-data);
  font-size: 13px;
  line-height: 1.6;
  padding: var(--sp-4);
  background: var(--sec-bg);
  border-radius: var(--radius);
  border-left: 4px solid var(--caution);
  margin-bottom: var(--sp-5);
}
.hero-assay-strip.verified   { border-left-color: var(--verified); }
.hero-assay-strip.fail       { border-left-color: var(--fail); }
.hero-assay-strip .assay-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
.hero-assay-strip .assay-label { color: var(--hint); }

/* ── Data typography ─────────────────────────────────────────── */
.data { font-family: var(--font-data); }
.data-lg { font-family: var(--font-data); font-size: 20px; font-weight: 600; }
.price { font-family: var(--font-data); font-size: 16px; font-weight: 600; }
.hash  { font-family: var(--font-data); font-size: 11px; color: var(--hint); }

/* ── Status badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-verified  { background: color-mix(in srgb, var(--verified) 15%, transparent); color: var(--verified); }
.badge-caution   { background: color-mix(in srgb, var(--caution) 15%, transparent);  color: var(--caution);  }
.badge-fail      { background: color-mix(in srgb, var(--fail) 15%, transparent);     color: var(--fail);     }
.badge-neutral   { background: color-mix(in srgb, var(--hint) 15%, transparent);     color: var(--hint);     }

/* ── Skeleton loader ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--sec-bg) 25%,
    color-mix(in srgb, var(--hint) 10%, var(--sec-bg)) 50%,
    var(--sec-bg) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--sec-bg); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-line { height: 14px; margin-bottom: var(--sp-2); }
.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-line.w40 { width: 40%; }
.skel-card { height: 100px; margin-bottom: var(--sp-3); }

/* ── Empty & error states ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  color: var(--hint);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: var(--sp-3); }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: var(--sp-2); }
.empty-state .empty-body  { font-size: 13px; line-height: 1.5; }

.error-state {
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--fail) 10%, transparent);
  color: var(--fail);
  font-size: 13px;
  margin-bottom: var(--sp-3);
}
.error-state .error-action { margin-top: var(--sp-2); color: var(--link); cursor: pointer; text-decoration: underline; }

/* ── Gate screen (not in Telegram) ──────────────────────────── */
#gate-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-6);
  text-align: center;
  gap: var(--sp-4);
}
#gate-screen .gate-title { font-size: 22px; font-weight: 700; }
#gate-screen .gate-body  { font-size: 14px; color: var(--hint); line-height: 1.6; }
#gate-screen .gate-link  {
  display: inline-block;
  background: var(--btn);
  color: var(--btn-text);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--btn);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.1s ease;
}
.btn:active  { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--btn);
  border: 1.5px solid var(--btn);
}
.btn-danger { background: var(--fail); color: #fff; }

/* ── Form elements ───────────────────────────────────────────── */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 12px; color: var(--hint); margin-bottom: var(--sp-1); }
.field select,
.field input,
.field textarea {
  width: 100%;
  padding: var(--sp-3);
  background: var(--sec-bg);
  border: var(--divider);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.field select:focus,
.field input:focus,
.field textarea:focus { border-color: var(--btn); }

/* ── Section divider ─────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--hint);
  margin: var(--sp-5) 0 var(--sp-3);
}
hr.divider { border: none; border-top: var(--divider); margin: var(--sp-4) 0; }

/* ── Review stars ────────────────────────────────────────────── */
.stars { font-size: 14px; }
.stars .filled { color: var(--caution); }
.stars .empty  { color: var(--hint); }

/* ── Progress bar (pool) ─────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--sec-bg);
  border-radius: 3px;
  overflow: hidden;
  margin: var(--sp-2) 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--verified);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Order timeline ──────────────────────────────────────────── */
.timeline { margin: var(--sp-3) 0; }
.timeline-item {
  display: flex;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--divider);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sec-bg);
  border: 2px solid var(--hint);
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-dot.done    { border-color: var(--verified); background: var(--verified); }
.timeline-dot.current { border-color: var(--btn); background: var(--btn); }
.timeline-text { font-size: 13px; }
.timeline-time { font-family: var(--font-data); font-size: 11px; color: var(--hint); }

/* ── Cart badge ──────────────────────────────────────────────── */
.tab-icon-wrap { position: relative; display: inline-block; }
.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--fail);
  color: #fff;
  border-radius: 9px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-data);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.cart-count.hidden { display: none; }

/* ── Utility ─────────────────────────────────────────────────── */
.text-hint   { color: var(--hint); }
.text-small  { font-size: 12px; }
.flex        { display: flex; }
.flex-between{ display: flex; justify-content: space-between; align-items: center; }
.flex-gap    { gap: var(--sp-3); }
.mt-2        { margin-top: var(--sp-2); }
.mt-3        { margin-top: var(--sp-3); }
.mt-4        { margin-top: var(--sp-4); }
.mb-2        { margin-bottom: var(--sp-2); }
.mb-3        { margin-bottom: var(--sp-3); }

/* ── Verify view ─────────────────────────────────────────────── */
.verify-proof {
  font-family: var(--font-data);
  font-size: 12px;
  word-break: break-all;
  background: var(--sec-bg);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

/* ── Focus ring (accessibility) ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--btn);
  outline-offset: 2px;
}

/* ── Payment QR ──────────────────────────────────────────────── */
.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 16px 0;
}
.qr-wrap svg {
  /* The SVG carries its own white quiet-zone so it scans in dark themes; round the corners. */
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* ═══════════════════════════════════════════════════════════════
   REFINEMENT LAYER — product cards, reputation, badging, reviews,
   vendor dashboard. Builds on the tokens above.
   ═══════════════════════════════════════════════════════════════ */

/* ── Larger view title ───────────────────────────────────────── */
.view > h2:first-child,
.view-heading {
  font-size: var(--fs-6);
  font-weight: 720;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
}
.view-sub { color: var(--hint); font-size: var(--fs-2); margin: calc(-1 * var(--sp-3)) 0 var(--sp-4); line-height: 1.5; }

/* ── Category rail (horizontal, scroll-snap, hidden scrollbar) ── */
.cat-rail {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 2px var(--sp-4) var(--sp-3);
  margin: 0 calc(-1 * var(--sp-4)) var(--sp-2);
  scrollbar-width: none;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-2);
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.cat-pill.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }

/* ── Product card (browse) ───────────────────────────────────── */
.product-card { display: flex; gap: var(--sp-3); align-items: flex-start; }
.product-thumb {
  width: 76px; height: 76px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.product-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--hint);
}
.product-body { flex: 1; min-width: 0; }
.product-body .card-title { margin-bottom: 3px; }
.product-vendor-row {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: 2px 0 var(--sp-2); flex-wrap: wrap;
}
.product-vendor-name { font-size: var(--fs-1); color: var(--hint); }
.product-card .price { font-size: var(--fs-4); margin-top: var(--sp-2); display: block; }
.product-card .assay-strip { margin-top: var(--sp-2); }

/* ── Chips (compact signal pills) ─────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-data);
  font-size: var(--fs-0); font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hint) 12%, transparent); color: var(--hint);
  text-transform: uppercase; white-space: nowrap;
}
.chip-verified { background: color-mix(in srgb, var(--verified) 15%, transparent); color: var(--verified); }
.chip-caution  { background: color-mix(in srgb, var(--caution) 15%, transparent);  color: var(--caution); }
.chip-fail     { background: color-mix(in srgb, var(--fail) 15%, transparent);     color: var(--fail); }
.chip-info     { background: color-mix(in srgb, var(--btn) 15%, transparent);      color: var(--btn); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Tier / reputation badges ────────────────────────────────── */
.badge-tier {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-data); font-size: var(--fs-0); font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
  padding: 3px 8px 3px 7px; border-radius: var(--radius-pill);
}
.badge-tier::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-tier.trusted     { background: color-mix(in srgb, var(--tier-trusted) 15%, transparent);     color: var(--tier-trusted); }
.badge-tier.established  { background: color-mix(in srgb, var(--tier-established) 15%, transparent); color: var(--tier-established); }
.badge-tier.new         { background: color-mix(in srgb, var(--tier-new) 15%, transparent);         color: var(--tier-new); }
.badge-tier.caution     { background: color-mix(in srgb, var(--tier-caution) 15%, transparent);     color: var(--tier-caution); }

/* ── Trust meter (vendor reputation gauge) ───────────────────── */
.trust-meter { margin-top: var(--sp-2); }
.trust-meter-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.trust-score { font-family: var(--font-data); font-weight: 700; font-size: var(--fs-2); }
.trust-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: var(--sp-2); }
.trust-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.trust-bar-fill.trusted { background: var(--tier-trusted); }
.trust-bar-fill.established { background: var(--tier-established); }
.trust-bar-fill.new { background: var(--tier-new); }
.trust-bar-fill.caution { background: var(--tier-caution); }
.trust-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); }
.trust-stat { font-size: var(--fs-1); color: var(--hint); }
.trust-stat b { font-family: var(--font-data); color: var(--text); font-weight: 700; }

/* ── Rating summary (aggregate) ──────────────────────────────── */
.rating-summary { display: flex; gap: var(--sp-4); align-items: center; }
.rating-big { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.rating-big .num { font-family: var(--font-data); font-size: 30px; font-weight: 720; line-height: 1; }
.rating-big .count { font-size: var(--fs-0); color: var(--hint); margin-top: 3px; }
.rating-dist { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rating-dist-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-0); color: var(--hint); }
.rating-dist-row .lbl { width: 10px; text-align: right; font-family: var(--font-data); }
.rating-dist-bar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.rating-dist-bar > span { display: block; height: 100%; background: var(--caution); border-radius: 3px; }

/* ── Fractional star rating ──────────────────────────────────── */
.stars-frac { position: relative; display: inline-block; font-size: 15px; line-height: 1; font-family: var(--font-ui); white-space: nowrap; }
.stars-frac .base { color: var(--border-strong); }
.stars-frac .fill { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--caution); white-space: nowrap; }

/* ── Review card ─────────────────────────────────────────────── */
.review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.review-body { font-size: var(--fs-2); line-height: 1.5; margin-top: var(--sp-2); }
.review-date { font-family: var(--font-data); font-size: var(--fs-0); color: var(--hint); }

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-3); color: var(--btn-text);
  background: var(--btn);
}
.avatar.lg { width: 56px; height: 56px; font-size: var(--fs-5); }

/* ── Star input (review form) ────────────────────────────────── */
.star-input { display: flex; gap: var(--sp-2); font-size: 34px; line-height: 1; }
.star-input .star { cursor: pointer; color: var(--border-strong); transition: transform 0.08s ease, color 0.1s ease; }
.star-input .star.on { color: var(--caution); }
.star-input .star:active { transform: scale(1.2); }

/* ── Toggle / checkbox row ───────────────────────────────────── */
.check-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; cursor: pointer; }
.check-box {
  width: 22px; height: 22px; border-radius: var(--radius-sm); flex-shrink: 0;
  border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
  color: var(--btn-text); font-size: 14px; transition: background 0.12s ease, border-color 0.12s ease;
}
.check-row.on .check-box { background: var(--btn); border-color: var(--btn); }
.check-label { font-size: var(--fs-2); }

/* ── Segmented control (dashboard tabs) ──────────────────────── */
.segmented { display: flex; background: var(--surface-2); border-radius: var(--radius); padding: 3px; margin-bottom: var(--sp-4); }
.segmented button {
  flex: 1; border: none; background: none; cursor: pointer;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-size: var(--fs-2); font-weight: 600; color: var(--hint);
  transition: background 0.12s ease, color 0.12s ease;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ── Dashboard stat grid ─────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.stat-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); }
.stat-cell .val { font-family: var(--font-data); font-size: var(--fs-5); font-weight: 720; }
.stat-cell .lbl { font-size: var(--fs-0); color: var(--hint); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* ── Manage-product row ──────────────────────────────────────── */
.manage-row { display: flex; align-items: center; gap: var(--sp-3); }
.manage-row .product-thumb { width: 48px; height: 48px; }
.manage-row .grow { flex: 1; min-width: 0; }
.manage-row .grow .t { font-weight: 600; font-size: var(--fs-3); }
.manage-row .grow .s { font-size: var(--fs-1); color: var(--hint); font-family: var(--font-data); margin-top: 2px; }

/* ── Icon button (small inline actions) ──────────────────────── */
.btn-sm { width: auto; padding: 7px 14px; font-size: var(--fs-2); border-radius: var(--radius-sm); }
.btn-row { display: flex; gap: var(--sp-2); }

/* ── Refined section label with count ────────────────────────── */
.section-label .count { color: var(--hint); font-weight: 400; }

/* ── Product detail hero image ───────────────────────────────── */
.detail-hero {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--radius-lg); margin-bottom: var(--sp-4);
  background: var(--surface-2); border: 1px solid var(--border);
}
.detail-title { font-size: var(--fs-6); font-weight: 720; letter-spacing: -0.02em; margin-bottom: var(--sp-2); }

/* ── Variant option ──────────────────────────────────────────── */
.variant-opt {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2);
  cursor: pointer; background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.variant-opt.selected { border-color: var(--btn); box-shadow: inset 0 0 0 1px var(--btn); }
.variant-opt .flex-between { align-items: center; }
.variant-opt .v-name { font-weight: 600; font-size: var(--fs-3); }

/* ── CAS tag ─────────────────────────────────────────────────── */
.cas-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--sp-4); }
