/* ─── Reset / base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f;
  --bg-card: #14141d;
  --bg-elevated: #1c1c2a;
  --border: #2a2a3d;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #00d48a;
  --accent-soft: rgba(0, 212, 138, 0.12);
  --warn: #fbbf24;
  --bad: #ef4444;
  --info: #818cf8;
}
html {
  scroll-behavior: smooth;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

input, button { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ─── Layout ─── */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── Header ─── */
.hdr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 8px 4px 4px;
}
.hdr-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.hdr-title span {
  color: var(--accent);
}
.hdr-logo {
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.hdr-trial {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* BETA: badge styling applied to .hdr-trial when state.trial.beta is true */
.hdr-trial.beta-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  animation: none;
}
.beta-pill {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 8.5px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
  animation: beta-pulse 2.4s ease-in-out infinite;
}
@keyframes beta-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
  50%      { box-shadow: 0 0 16px rgba(239, 68, 68, 0.55); }
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.step {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.picker-faq-link {
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 14px 0;
}
.picker-faq-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.picker-faq-link a:hover {
  text-decoration: underline;
}

/* ─── Photo recognition ─── */
.photo-cta {
  margin-bottom: 14px;
}
.btn-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, rgba(0,212,138,0.18), rgba(0,212,138,0.08));
  border: 1px solid rgba(0, 212, 138, 0.45);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 12px;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 48px;
}
.btn-photo:hover { box-shadow: 0 4px 14px rgba(0, 212, 138, 0.2); }
.btn-photo:active { transform: scale(0.98); }
.btn-photo:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-photo .photo-icon { font-size: 18px; }
.photo-status {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: 8px;
  line-height: 1.5;
}
.photo-status-success { color: var(--accent); border: 1px solid rgba(0, 212, 138, 0.3); font-size: 13px; }
.photo-status-error { color: var(--bad); border: 1px solid rgba(239, 68, 68, 0.3); font-size: 13px; }
.photo-status-loading {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 212, 138, 0.5);
  background: rgba(0, 212, 138, 0.1);
  box-shadow: 0 0 18px rgba(0, 212, 138, 0.15);
}
.photo-status .dots {
  display: inline-block;
  margin-left: 2px;
  letter-spacing: 2px;
}
.photo-status .dots span {
  opacity: 0;
  animation: dot-pulse 1.4s infinite;
}
.photo-status .dots span:nth-child(1) { animation-delay: 0s; }
.photo-status .dots span:nth-child(2) { animation-delay: 0.2s; }
.photo-status .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 60%, 100% { opacity: 0; }
  30% { opacity: 1; }
}

/* ─── Machine search ─── */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.machine-search {
  width: 100%;
  padding: 12px 40px 12px 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.machine-search:focus {
  border-color: var(--accent);
}
.machine-search::placeholder {
  color: var(--text-dim);
}
.machine-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
}
.search-clear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* ─── Machine list ─── */
.machine-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.machine-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease;
  min-height: 60px;
}
.machine-btn:hover,
.machine-btn:focus-visible {
  border-color: var(--accent);
  background: rgba(0, 212, 138, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  outline: none;
}
.machine-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: none;
}
.machine-btn:hover .arrow {
  color: var(--accent);
  transform: translateX(2px);
  transition: color 0.2s ease, transform 0.2s ease;
}
.machine-btn .name { font-weight: 700; font-size: 16px; }
.machine-btn .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.machine-btn .meta-denom {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
  font-style: italic;
}
.machine-btn .arrow { color: var(--text-dim); font-size: 18px; flex-shrink: 0; }
.loading { color: var(--text-muted); text-align: center; padding: 18px; font-size: 14px; }

/* ─── Meter input ─── */
.machine-summary {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.machine-summary .ms-name { font-weight: 700; font-size: 16px; }
.machine-summary .ms-range { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.meter-hint-top {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Per-tier input rows */
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tier-row {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.15s ease;
}
.tier-row.invalid { border-color: var(--bad); }
.tier-row.invalid .tier-input-wrap { border-color: var(--bad); }
.tier-row.overridden { border-color: var(--warn); }
.tier-row.overridden .tier-input-wrap { border-color: var(--warn); }
.tier-row.overridden .tier-error { color: var(--warn); }
.tier-row-reference {
  opacity: 0.65;
  border-style: dashed;
}
.tier-row-reference .tier-input-wrap {
  border-style: dashed;
}
.tier-row-static {
  opacity: 0.85;
  border-style: dashed;
}
.tier-static-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tier-static-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}
.static-pay {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.3;
}
.static-denom {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
}
.tier-ref-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  vertical-align: 2px;
  cursor: help;
}
.reference-toggle {
  margin-bottom: 4px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: 6px;
}
.ref-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.ref-toggle-label input { margin: 0; cursor: pointer; }
.tier-result-reference {
  opacity: 0.65;
}
.tr-edge-ref {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11px;
}
.link-override, .link-cancel-override {
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  padding: 0 4px;
}
.link-override:hover, .link-cancel-override:hover { color: var(--text); }
.tier-row-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tier-error {
  font-size: 11px;
  color: var(--bad);
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.tier-row-label { flex: 1; min-width: 0; }
.tier-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.tier-range {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.tier-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 2px 10px;
  flex: 1.1;
  min-width: 0;
  max-width: 180px;
  transition: border-color 0.15s ease;
}
.tier-input-wrap:focus-within { border-color: var(--accent); }
.tier-prefix {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}
.tier-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 22px;
  font-weight: 700;
  padding: 10px 0;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  width: 100%;
}
.tier-input::-webkit-outer-spin-button,
.tier-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tier-input[type=number] { -moz-appearance: textfield; }
.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 1.2em;
}
.hint.err { color: var(--bad); }

/* ─── Buttons ─── */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-primary, .btn-secondary {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  min-height: 48px;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #04140d;
  box-shadow: 0 4px 14px rgba(0, 212, 138, 0.25);
}
.btn-primary:disabled {
  background: var(--bg-elevated);
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(0, 212, 138, 0.4);
}
.btn-primary:not(:disabled):active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 212, 138, 0.2);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.02);
}
.btn-secondary:active {
  transform: translateY(0) scale(0.99);
}
.btn-big {
  padding: 18px 22px;
  font-size: 16px;
}

/* ─── Result ─── */
.result-card {
  text-align: center;
  position: relative; /* anchor for the celebration-layer absolute children */
  overflow: hidden;   /* clip particles that fly past the card edges */
}
.result-headline-signal {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.result-edge {
  font-size: 52px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 6px;
}

/* ─── Celebration fireworks ─── */
/* Particle burst overlay positioned over the result card. Particles are
   generated by JS, animate outward, fade, and self-clean. Container has no
   interactive surface (pointer-events: none) so it never blocks taps. */
.celebration-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
  border-radius: inherit;
}
.celebration-particle {
  position: absolute;
  left: 50%;
  top: 25%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-color, #00d48a);
  box-shadow: 0 0 8px var(--p-color, #00d48a), 0 0 14px var(--p-color, #00d48a);
  animation: firework-burst var(--p-duration, 1s) ease-out forwards;
  will-change: transform, opacity;
}
.celebration-particle.spark {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 6px var(--p-color, #fde047);
}
@keyframes firework-burst {
  0% {
    transform: translate(-50%, -50%) rotate(var(--p-angle, 0deg)) translateX(0) scale(1);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--p-angle, 0deg)) translateX(var(--p-distance, 150px)) scale(0.3);
    opacity: 0;
  }
}
/* Respect reduce-motion: suppress fireworks but still flash a brief solid color */
@media (prefers-reduced-motion: reduce) {
  .celebration-particle { display: none; }
  .celebration-layer.active {
    background: radial-gradient(circle at 50% 30%, rgba(0, 212, 138, 0.25), transparent 60%);
    animation: reduce-motion-flash 0.6s ease-out forwards;
  }
  @keyframes reduce-motion-flash {
    0%, 100% { opacity: 0; }
    40% { opacity: 1; }
  }
}

/* ─── Result-reveal animations ─── */
/* When `result-card` gets the .animate class (added by JS each time renderResult
   runs), the headline and edge slide+fade in. For positive-EV signals, an
   additional one-time glow celebrates the result without continuous animation. */
@keyframes result-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes result-edge-pop {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes ev-celebrate {
  0%   { text-shadow: 0 0 0 rgba(0, 212, 138, 0); }
  40%  { text-shadow: 0 0 24px rgba(0, 212, 138, 0.55), 0 0 40px rgba(0, 212, 138, 0.25); }
  100% { text-shadow: 0 0 12px rgba(0, 212, 138, 0.45); }
}
@keyframes amber-celebrate {
  0%   { text-shadow: 0 0 0 rgba(251, 191, 36, 0); }
  40%  { text-shadow: 0 0 20px rgba(251, 191, 36, 0.50), 0 0 36px rgba(251, 191, 36, 0.22); }
  100% { text-shadow: 0 0 0 rgba(251, 191, 36, 0); }
}
.result-card.animate .result-headline-signal {
  animation: result-fade-in 0.35s ease-out both;
}
.result-card.animate .result-edge {
  animation: result-edge-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.1s;
}
/* Celebration glow for genuinely positive signals (one-time, ends statically) */
.result-card.animate .signal-highly,
.result-card.animate .signal-meter-chase {
  animation: ev-celebrate 1.4s ease-out 0.5s both;
}
.result-card.animate .signal-moderately {
  animation: amber-celebrate 1.2s ease-out 0.5s both;
}
/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .result-card.animate .result-headline-signal,
  .result-card.animate .result-edge,
  .result-card.animate .signal-highly,
  .result-card.animate .signal-meter-chase,
  .result-card.animate .signal-moderately {
    animation: none;
  }
}
.result-confidence {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--text-muted);
  margin: 6px 0 10px;
}
.conf-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  margin: 0 2px;
}
.conf-verified {
  color: var(--accent);
  background: rgba(0, 212, 138, 0.12);
  border-color: rgba(0, 212, 138, 0.45);
}
.conf-community-reported {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.45);
}
.conf-estimated {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border);
}
.result-machine {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.edge-cap-warning {
  margin: 10px auto 4px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 10px;
  line-height: 1.5;
  max-width: 360px;
}
.edge-cap-warning strong { color: var(--accent); }
.counter-cap-note {
  margin: 10px auto 4px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-left: 3px solid var(--border);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
  max-width: 360px;
  text-align: left;
}
.math-review-warning {
  margin: 10px auto 4px;
  padding: 10px 14px;
  font-size: 12px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 8px;
  line-height: 1.5;
  max-width: 380px;
  text-align: left;
}
.math-review-warning strong { color: #fde047; }

/* Variant warning — blue callout for machines with multiple variants (Buffalo Link,
   Phoenix Link, Piggies, Hens, Frankenstein, both Huff N' Puff entries). Distinct
   color from the amber math-review warning so the two don't blur together. */
.variant-warning {
  margin: 14px auto 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #93c5fd;
  background: rgba(129, 140, 248, 0.10);
  border: 1px solid rgba(129, 140, 248, 0.50);
  border-radius: 8px;
  line-height: 1.5;
  max-width: 420px;
  text-align: left;
}
.variant-warning strong { color: #bfdbfe; }

/* Photo verification banner — shown only on Frankenstein after photo flow */
.photo-verify-banner {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photo-verify-banner[hidden] { display: none; }
.photo-verify-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #fbbf24;
}
.photo-verify-text strong { color: #fde047; display: block; margin-bottom: 4px; }
.photo-verify-dismiss {
  align-self: flex-end;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.18);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 6px;
  cursor: pointer;
}
.photo-verify-dismiss:hover { background: rgba(245, 158, 11, 0.28); }
.result-divider {
  border-top: 1px solid var(--border);
  margin: 16px 0 12px;
}
.result-tiers-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 4px;
}
.result-tiers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  text-align: left;
}
.tier-result {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.tier-result.best {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 212, 138, 0.25);
}
.tier-result .tr-left { min-width: 0; }
.tier-result .tr-right { text-align: right; }
.tr-name { font-weight: 700; font-size: 14px; }
.tr-meter { font-size: 11px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.tr-override { font-size: 10px; color: var(--warn); margin-top: 3px; font-weight: 600; }
.tr-position { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-edge { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
/* Per-tier ripeness colors — describe how close the meter is to hitting */
.ripeness-cold       { color: #94a3b8; }   /* gray */
.ripeness-warming    { color: #fbbf24; }   /* amber */
.ripeness-hot        { color: #00d48a; }   /* accent green */
.ripeness-very-hot   { color: #00d48a; text-shadow: 0 0 10px rgba(0, 212, 138, 0.55); }
.result-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}
.result-summary .label { color: var(--text-dim); }

/* Help icon button */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Tooltip popover */
.tooltip {
  position: fixed;
  z-index: 200;
  max-width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.result-notes {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  margin-top: 8px;
  line-height: 1.45;
}
/* Signal colors */
.signal-not-yet      { color: var(--bad); }
.signal-break-even   { color: var(--text-muted); }
.signal-slightly     { color: var(--warn); }
.signal-moderately   { color: var(--accent); }
.signal-highly       { color: var(--accent); text-shadow: 0 0 12px rgba(0, 212, 138, 0.45); }
.signal-meter-low    { color: var(--text-muted); }
.signal-meter-mid    { color: var(--text-muted); }
.signal-meter-high   { color: var(--warn); }
.signal-meter-chase  { color: var(--accent); }

/* Denomination selector — shown in meter card for machines with multiple denoms */
.denom-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
}
.denom-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}
.denom-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.denom-btn {
  flex: 1;
  min-width: 50px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.denom-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.denom-btn.active {
  background: rgba(0, 212, 138, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Gate overlay ─── */
.gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.gate[hidden] { display: none; }
.gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.gate-icon { font-size: 36px; margin-bottom: 8px; }
.gate-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.gate-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.55; }
.gate-footnote {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 12px;
  margin-bottom: 0;
}
/* DEV ONLY — remove .gate-dev-reset rule before going live */
.gate-dev-reset {
  margin-top: 14px;
  width: 100%;
}

/* ─── Disclaimer gate (first-visit clickwrap) ─── */
.disclaimer-gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.disclaimer-gate[hidden] { display: none; }
.disclaimer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.disclaimer-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
  text-align: center;
}
.disclaimer-lead {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: left;
}
.disclaimer-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.disclaimer-list li {
  font-size: 13px;
  color: var(--text);
  padding: 8px 0 8px 22px;
  position: relative;
  line-height: 1.5;
}
.disclaimer-list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  top: 8px;
  color: var(--accent);
  font-weight: 800;
}
.disclaimer-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}
.disclaimer-checkbox-row input {
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.disclaimer-checkbox-row:has(input:checked) {
  border-color: var(--accent);
  background: rgba(0, 212, 138, 0.08);
}
#disclaimer-accept-btn {
  width: 100%;
}
#disclaimer-accept-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.disclaimer-footnote {
  font-size: 12px;
  text-align: center;
  margin-top: 14px;
}
.disclaimer-footnote a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}
.disclaimer-footnote a:hover {
  color: #4ade80;
}

/* Modal links to full disclaimer */
.disclaimer-list a, .disclaimer-link-inline {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 700;
}
.disclaimer-list a:hover, .disclaimer-link-inline:hover {
  color: #4ade80;
}

/* ─── Full disclaimer page (standalone) ─── */
.disclaimer-page { max-width: 720px; }
.disclaimer-article {
  text-align: left;
  padding: 24px 22px;
}
.disclaimer-article h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.disc-effective {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.disc-intro {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.disclaimer-article h2 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 22px;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.disclaimer-article p {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 10px;
}
.disclaimer-article ul {
  margin: 8px 0 12px 0;
  padding-left: 22px;
}
.disclaimer-article li {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 5px;
}
.disclaimer-article a {
  color: var(--accent);
  text-decoration: underline;
}
.disclaimer-article a:hover {
  color: #4ade80;
}
.disclaimer-article strong { color: var(--text); }
.disc-closing {
  margin-top: 24px;
  padding: 12px 14px;
  background: rgba(0, 212, 138, 0.07);
  border: 1px solid rgba(0, 212, 138, 0.25);
  border-radius: 8px;
  font-style: italic;
}
.disc-back-link {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
}
.disc-back-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.disc-back-link a:hover { text-decoration: underline; }

/* FAQ accordion (uses native <details> / <summary>) */
.faq-item {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.faq-item summary {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  padding-right: 24px;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--accent);
  font-weight: 400;
  line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] {
  background: rgba(0, 212, 138, 0.05);
  border-color: rgba(0, 212, 138, 0.35);
}
.faq-item p, .faq-item ul {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.65;
}
.faq-item ul {
  padding-left: 22px;
}
.faq-item li {
  margin-bottom: 5px;
}
.faq-item a {
  color: var(--accent);
  text-decoration: underline;
}

/* ─── Footer ─── */
.ftr {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 14px 8px 4px;
}
.ftr-disclaimer {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  font-size: 12px;
  line-height: 1.55;
  color: #fbbf24;
  font-weight: 600;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.ftr-pricing {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.ftr-links {
  margin-top: 12px;
  font-size: 11px;
}
.ftr-links a {
  color: var(--text-muted);
  text-decoration: underline;
}
.ftr-links a:hover {
  color: var(--accent);
}
.result-disclaimer {
  font-size: 12px;
  color: #fbbf24;
  font-weight: 600;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
  text-align: left;
}
.disclaimer-link {
  color: #fbbf24;
  text-decoration: underline;
  font-weight: 700;
}
.disclaimer-link:hover {
  color: #fde047;
}

/* Dev-only reset button on the picker card.
   DEV NOTE: remove `.picker-footer` block + the button in index.html + the
   wiring in app.js before going live. */
.picker-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  text-align: center;
}
.btn-small {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  min-height: 36px;
  border-radius: 8px;
}
