/* PropSize Calculator — shared styles (pairs with compiled css/tailwind.css) */

/* Self-hosted variable fonts (Fontshare) — no third-party font CDN: visitor
   IPs stay off Google's servers, matching the journal's no-upload promise.
   Satoshi carries body/UI; Clash Display carries h1/h2 only. */
@font-face {
  font-family: "Satoshi";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../assets/fonts/satoshi-variable.woff2") format("woff2");
}
@font-face {
  font-family: "Clash Display";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("../assets/fonts/clash-display-variable.woff2") format("woff2");
}

:root {
  --ps-bg: #020617;       /* slate-950 */
  --ps-panel: #0f172a;    /* slate-900 */
  --ps-border: #1e293b;   /* slate-800 */
  --ps-accent: #38bdf8;   /* sky-400 */
  --ps-accent-2: #22d3ee; /* cyan-400 */
  --ps-up: #34d399;       /* emerald-400 */
  --ps-down: #f87171;     /* red-400 */
  --ps-warn: #fbbf24;     /* amber-400 */
  --ps-muted: #94a3b8;    /* slate-400 */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Satoshi", system-ui, -apple-system, sans-serif;
  background: var(--ps-bg);
  color: #e2e8f0;
  min-height: 100vh;
}

/* Display face for page + section headings only. Clash Display tops out at
   700, so the font-extrabold (800) utilities on h1s clamp there — intended.
   h3+ and all UI stay in Satoshi. */
h1,
h2 {
  font-family: "Clash Display", "Satoshi", system-ui, sans-serif;
  letter-spacing: -0.01em;
}

/* Satoshi's default digits are proportional; a sizing tool lives on numbers.
   Lock every numeric surface to tabular figures so live-updating values and
   table columns don't jitter or misalign. */
input,
table,
.result-value,
.result-unit,
.stat-value,
#viz-donut-big,
.viz-rr-label,
.sim-day-input,
.sim-day-row {
  font-variant-numeric: tabular-nums;
}

/* Subtle grid background */
.bg-grid {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Sticky nav */
.site-nav {
  backdrop-filter: blur(12px);
  background: rgba(2, 6, 23, 0.85);
  border-bottom: 1px solid var(--ps-border);
}

.nav-link {
  color: var(--ps-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-link:hover,
.nav-link.active {
  color: #f1f5f9;
}

/* Preset market badges */
.badge-futures,
.badge-cfd,
.badge-soft {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}
.badge-futures {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.badge-cfd {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.35);
}
.badge-soft {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.badge-verified,
.badge-unverified {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}
.badge-verified {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.badge-unverified {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Journal */
.journal-flash {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
  font-size: 0.875rem;
}

/* Firm-first preset picker */
.preset-picker {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--ps-border);
  background: rgba(15, 23, 42, 0.55);
}
.preset-step .preset-group-label {
  display: block;
  margin-bottom: 0;
}
.preset-firm.active,
.preset-chip.active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}
.preset-firm {
  font-size: 0.8125rem;
}
.preset-firm .preset-firm-count {
  opacity: 0.55;
  font-size: 0.7rem;
  margin-left: 0.25rem;
}
.preset-chip .preset-chip-meta {
  display: block;
  font-size: 0.65rem;
  opacity: 0.65;
  font-weight: 500;
  margin-top: 0.1rem;
}

/* Binding-constraint panel (which rule set the size) */
.constraint-panel {
  border: 1px solid var(--ps-border);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.65);
  padding: 0.75rem 0.875rem;
}
.constraint-binding {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  max-width: 70%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.constraint-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.constraint-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.35);
}
.constraint-stage.is-binding {
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.constraint-stage-label {
  min-width: 0;
}
.constraint-stage-size {
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}
.constraint-stage.is-binding .constraint-stage-size {
  color: #7dd3fc;
}
.constraint-tag {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-left: 0.25rem;
}

/* Insider tip — mascot feature (secret brotherhood section) */
.insider-feature {
  position: relative;
  border-radius: 1.25rem;
  border: 1px solid rgba(251, 191, 36, 0.32);
  background:
    linear-gradient(135deg, rgba(69, 26, 3, 0.35) 0%, rgba(15, 23, 42, 0.98) 42%, rgba(2, 6, 23, 0.99) 100%);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.08),
    0 0 60px -12px rgba(251, 191, 36, 0.28),
    0 24px 50px -28px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.insider-feature-glow {
  pointer-events: none;
  position: absolute;
  top: -40%;
  left: -10%;
  width: 55%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.14), transparent 65%);
  z-index: 0;
}
.insider-feature::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b 35%, rgba(245, 158, 11, 0.15));
  z-index: 2;
}
.insider-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 0.5rem 1.75rem;
  align-items: end;
  padding: 1.25rem 1.5rem 0 1.25rem;
}
@media (max-width: 768px) {
  .insider-feature-grid {
    grid-template-columns: 1fr;
    padding: 1.25rem 1.25rem 0;
    gap: 0;
    align-items: center;
  }
}
.insider-mascot-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 260px;
  margin-bottom: 0;
  background: transparent;
  isolation: isolate;
}

/* Ambient FX layer behind the sticker */
.mascot-stage {
  position: absolute;
  inset: 8% 5% 12%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.mascot-aura {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 78%;
  height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(251, 191, 36, 0.28) 0%, rgba(245, 158, 11, 0.1) 40%, transparent 70%);
  filter: blur(6px);
  animation: mascot-aura-pulse 3.6s ease-in-out infinite;
}

.mascot-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, 0.35);
  transform: translate(-50%, -50%);
  opacity: 0;
}
.mascot-ring--a {
  width: 72%;
  height: 58%;
  animation: mascot-ring-pulse 3.2s ease-out infinite;
}
.mascot-ring--b {
  width: 88%;
  height: 70%;
  border-color: rgba(56, 189, 248, 0.22);
  animation: mascot-ring-pulse 3.2s ease-out 1.1s infinite;
}

/* Whisper sparkles */
.mascot-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 10px 2px rgba(251, 191, 36, 0.75);
  opacity: 0;
  animation: mascot-spark-float 3.8s ease-in-out infinite;
}
.mascot-spark--1 { left: 62%; top: 28%; animation-delay: 0s; }
.mascot-spark--2 { left: 72%; top: 38%; width: 4px; height: 4px; animation-delay: 0.7s; background: #7dd3fc; box-shadow: 0 0 10px 2px rgba(56, 189, 248, 0.65); }
.mascot-spark--3 { left: 58%; top: 42%; width: 3px; height: 3px; animation-delay: 1.4s; }
.mascot-spark--4 { left: 78%; top: 48%; width: 4px; height: 4px; animation-delay: 2s; background: #fbbf24; }
.mascot-spark--5 { left: 68%; top: 22%; width: 3px; height: 3px; animation-delay: 2.6s; background: #e0e7ff; box-shadow: 0 0 8px 2px rgba(199, 210, 254, 0.7); }

/* Soft “psst” lines by the hand/mouth area */
.mascot-whisper {
  position: absolute;
  left: 58%;
  top: 30%;
  width: 36px;
  height: 28px;
  opacity: 0.55;
  background:
    radial-gradient(circle at 20% 50%, transparent 0 40%, rgba(253, 230, 138, 0.0) 41%),
    repeating-linear-gradient(
      95deg,
      transparent 0 4px,
      rgba(253, 230, 138, 0.55) 4px 5px,
      transparent 5px 9px
    );
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  animation: mascot-whisper 2.4s ease-in-out infinite;
  filter: blur(0.3px);
}

/* Sticker: real transparent PNG + layered drop-shadow */
.insider-mascot {
  position: relative;
  z-index: 1;
  display: block;
  height: clamp(240px, 32vw, 280px);
  width: auto;
  max-width: min(100%, 320px);
  object-fit: contain;
  object-position: bottom center;
  background: transparent !important;
  border: none;
  border-radius: 0;
  filter:
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25))
    drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 28px rgba(251, 191, 36, 0.18));
  transform-origin: 50% 85%;
  animation: mascot-float 4.5s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(-1deg); }
}
@keyframes mascot-aura-pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@keyframes mascot-ring-pulse {
  0% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.86); }
  70% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}
@keyframes mascot-spark-float {
  0% { opacity: 0; transform: translate(0, 6px) scale(0.6); }
  20% { opacity: 1; }
  70% { opacity: 0.85; transform: translate(10px, -18px) scale(1); }
  100% { opacity: 0; transform: translate(16px, -28px) scale(0.4); }
}
@keyframes mascot-whisper {
  0%, 100% { opacity: 0.15; transform: translateX(0) scaleX(0.85); }
  40% { opacity: 0.7; transform: translateX(6px) scaleX(1.05); }
  70% { opacity: 0.35; transform: translateX(10px) scaleX(1); }
}

@media (max-width: 768px) {
  .insider-mascot-wrap {
    min-height: 0;
    margin-bottom: -0.25rem;
  }
  .insider-mascot {
    height: 250px;
  }
  @keyframes mascot-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(0.5deg); }
  }
}

/* Accessibility: calm static sticker when motion is reduced */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .insider-mascot,
  .mascot-aura,
  .mascot-ring,
  .mascot-spark,
  .mascot-whisper {
    animation: none !important;
  }
  .insider-mascot {
    transform: rotate(-2deg);
  }
  .mascot-aura { opacity: 0.5; }
  .mascot-ring,
  .mascot-spark,
  .mascot-whisper {
    opacity: 0;
  }
}
.insider-feature-copy {
  padding: 0.5rem 0.25rem 1.5rem 0;
}
@media (max-width: 768px) {
  .insider-feature-copy {
    padding: 0 0 1.35rem;
    text-align: left;
  }
}
.insider-feature-title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fffbeb;
  line-height: 1.2;
  margin: 0.35rem 0 0.5rem;
}
/* Compact insider card (guides) */
.insider-card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(120, 53, 15, 0.25), rgba(15, 23, 42, 0.95) 45%, rgba(2, 6, 23, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 1rem;
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.06),
    0 18px 40px -24px rgba(251, 191, 36, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.insider-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #fbbf24, #f59e0b 40%, transparent);
}
.insider-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}
.insider-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #020617;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}
.insider-from {
  font-size: 0.7rem;
  color: #a8a29e;
  font-style: italic;
}
.insider-lead {
  font-size: 1rem;
  font-weight: 600;
  color: #fef3c7;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}
.insider-body {
  font-size: 0.9rem;
  color: #d6d3d1;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.insider-body em {
  color: #fde68a;
  font-style: normal;
  font-weight: 600;
}
.insider-wink {
  font-size: 0.9rem;
  color: #fcd34d;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.insider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  align-items: center;
}
.insider-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  text-decoration: none;
  border-bottom: 1px solid rgba(251, 191, 36, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.insider-link:hover {
  color: #fde68a;
  border-color: #fde68a;
}
.insider-link-muted {
  font-size: 0.8rem;
  color: #a8a29e;
  text-decoration: none;
  transition: color 0.15s ease;
}
.insider-link-muted:hover {
  color: #e7e5e4;
}

#preset-note {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.preset-group-label {
  width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-top: 0.35rem;
}


/* Cards */
.ps-card {
  background: var(--ps-panel);
  border: 1px solid var(--ps-border);
  border-radius: 1rem;
}

.ps-card-glow {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08), 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

/* Inputs */
.ps-input,
.ps-select {
  width: 100%;
  background: #020617;
  border: 1px solid #334155;
  color: #f1f5f9;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ps-input:focus,
.ps-select:focus {
  outline: none;
  border-color: var(--ps-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.ps-input::placeholder {
  color: #64748b;
}
.ps-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ps-muted);
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

/* Toggle pills */
.toggle-group {
  display: inline-flex;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.25rem;
  gap: 0.25rem;
}
.toggle-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  color: var(--ps-muted);
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}
.toggle-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #020617;
  box-shadow: 0 4px 14px -4px rgba(14, 165, 233, 0.5);
}

/* Preset chips */
.preset-chip {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid #334155;
  background: #020617;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.preset-chip:hover {
  border-color: var(--ps-accent);
  color: #f1f5f9;
}
.preset-chip.active {
  border-color: var(--ps-accent);
  background: rgba(56, 189, 248, 0.12);
  color: var(--ps-accent);
}

/* Result numbers */
.result-hero {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}
.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ps-muted);
  margin-left: 0.35rem;
}

/* Risk bar */
.risk-bar-track {
  height: 0.625rem;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease, background 0.3s ease;
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
}
.risk-bar-fill.warn {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}
.risk-bar-fill.danger {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

/* Stat rows */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  font-size: 0.875rem;
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-label {
  color: var(--ps-muted);
}
.stat-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #f1f5f9;
}
.stat-value.up { color: var(--ps-up); }
.stat-value.down { color: var(--ps-down); }
.stat-value.warn { color: var(--ps-warn); }

/* Warning banner */
.warning-banner {
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  display: none;
}
.warning-banner.show {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

/* Instrument table */
.inst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.inst-table th {
  text-align: left;
  color: var(--ps-muted);
  font-weight: 500;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--ps-border);
  white-space: nowrap;
}
.inst-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  font-variant-numeric: tabular-nums;
}
.inst-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
.inst-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}
.inst-table tbody tr.selected {
  background: rgba(56, 189, 248, 0.1);
}
.inst-table tbody tr.selected td:first-child {
  color: var(--ps-accent);
  font-weight: 600;
}

/* Formula chip */
.formula-chip {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #94a3b8;
  overflow-x: auto;
}

/* AdSense placeholder slots — reserve height to reduce CLS */
.ad-slot {
  min-height: 90px;
  border: 1px dashed #334155;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ad-slot[data-ad="mid-rectangle"] {
  min-height: 250px;
}
/* Live units are supplied by AdSense — drop the dashed placeholder chrome */
.ad-slot.ad-slot-live {
  border: none;
  background: none;
  display: block;
  min-height: 0;
}

/* Affiliate offer cards — rendered by js/monetize.js, hidden until a link is set */
.aff-card {
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.07), rgba(15, 23, 42, 0.4));
  padding: 1.15rem 1.25rem;
  margin: 2rem 0;
}
.aff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.aff-kind {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
}
.aff-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.aff-verdict {
  color: #cbd5e1;
  font-size: 0.925rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}
.aff-cta {
  font-size: 0.8125rem !important;
  padding: 0.65rem 1.1rem !important;
}
.aff-disclosure {
  margin: 0.85rem 0 0;
  font-size: 0.7rem;
  line-height: 1.6;
  color: #64748b;
}
.aff-disclosure a {
  color: #94a3b8;
  text-decoration: underline;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #020617;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 8px 24px -8px rgba(14, 165, 233, 0.55);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(14, 165, 233, 0.65);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  color: #cbd5e1;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover {
  border-color: var(--ps-accent);
  color: #f1f5f9;
}

/* Guide / prose pages */
.prose-guide h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.prose-guide h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}
.prose-guide p {
  color: #94a3b8;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.prose-guide ul,
.prose-guide ol {
  color: #94a3b8;
  line-height: 1.75;
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}
.prose-guide li {
  margin-bottom: 0.375rem;
}
.prose-guide strong {
  color: #e2e8f0;
  font-weight: 600;
}
.prose-guide code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
  color: #7dd3fc;
}
.prose-guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1.25rem 0 1.75rem;
}
.prose-guide th {
  text-align: left;
  color: #94a3b8;
  font-weight: 500;
  padding: 0.75rem;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}
.prose-guide td {
  padding: 0.75rem;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.prose-guide tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}
.prose-guide blockquote {
  border-left: 3px solid var(--ps-accent);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  background: rgba(14, 165, 233, 0.06);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #cbd5e1;
}
.checklist li {
  list-style: none;
  padding-left: 0.25rem;
}
.checklist li::before {
  content: "☐ ";
  color: var(--ps-accent);
  margin-right: 0.35rem;
}

/* Rules verification stamp — the trust signal on firm pages.
 * Default state is UNVERIFIED (amber). Verified (emerald) is opt-in per page,
 * so a page can never silently claim a check that did not happen. */
.verified-stamp {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem 0.7rem 1.05rem;
  margin: 1.5rem 0;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.5;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #cbd5e1;
  overflow: hidden;
}
.verified-stamp::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--ps-warn), transparent);
}
.verified-stamp.is-verified {
  background: rgba(52, 211, 153, 0.07);
  border-color: rgba(52, 211, 153, 0.28);
}
.verified-stamp.is-verified::before {
  background: linear-gradient(180deg, var(--ps-up), transparent);
}
.verified-stamp-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--ps-warn);
}
.verified-stamp.is-verified .verified-stamp-icon {
  color: var(--ps-up);
}
.verified-stamp-label {
  font-weight: 700;
  color: #fcd34d;
}
.verified-stamp.is-verified .verified-stamp-label {
  color: #6ee7b7;
}
.verified-stamp time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.verified-stamp a {
  color: var(--ps-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.verified-stamp a:hover {
  color: var(--ps-accent-2);
}

/* Comparison table — per-firm verification marking.
 * The point of difference: every other comparison table on the internet
 * presents scraped numbers with equal confidence. This one says which
 * figures were actually checked against the firm and which were not. */
.cmp-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--ps-border);
  border-radius: 0.75rem;
  background: var(--ps-panel);
}
.cmp-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.cmp-table th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: rgba(2, 6, 23, 0.6);
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--ps-border);
  white-space: nowrap;
}
.cmp-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.cmp-table tbody tr:last-child td {
  border-bottom: 0;
}
.cmp-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}
.cmp-firm {
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}
.cmp-firm a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(56, 189, 248, 0.4);
}
.cmp-firm a:hover {
  color: var(--ps-accent);
}
/* Verification marker — emerald dot = checked against the firm, amber ring = not */
.v-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.v-mark::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.v-mark.v-yes {
  color: #6ee7b7;
}
.v-mark.v-yes::before {
  background: var(--ps-up);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}
.v-mark.v-no {
  color: #fcd34d;
}
.v-mark.v-no::before {
  background: transparent;
  border: 1.5px solid var(--ps-warn);
}
.cmp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
  border: 1px solid var(--ps-border);
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.6);
  font-size: 0.78rem;
  color: #94a3b8;
}
.cmp-scroll-hint {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 900px) {
  .cmp-scroll-hint {
    display: none;
  }
}

/* ── Trailing drawdown simulator ────────────────────────────────────── */
.sim-panel {
  background: var(--ps-panel);
  border: 1px solid var(--ps-border);
  border-radius: 0.9rem;
  padding: 1.15rem;
}
.sim-scenarios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sim-scenario {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--ps-border);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.sim-scenario:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e2e8f0;
}
.sim-scenario.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--ps-accent);
  color: #7dd3fc;
}
.sim-scenario:focus-visible,
.sim-day-del:focus-visible,
.sim-add:focus-visible {
  outline: 2px solid var(--ps-accent);
  outline-offset: 2px;
}
.sim-blurb {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 1rem;
  min-height: 3.2em;
}
.sim-chart-wrap {
  width: 100%;
  overflow-x: auto;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid var(--ps-border);
  border-radius: 0.6rem;
  padding: 0.5rem;
}
#sim-chart {
  width: 100%;
  min-width: 520px;
  height: auto;
  display: block;
}
.sim-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.7rem;
  font-size: 0.72rem;
  color: #94a3b8;
}
.sim-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.sim-legend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.sim-verdict {
  margin-top: 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.sim-verdict.is-alive {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}
.sim-verdict.is-dead {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}
.sim-compare {
  margin-top: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.83rem;
  line-height: 1.55;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid var(--ps-border);
}
.sim-compare.is-warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
  font-weight: 600;
}
.sim-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}
@media (min-width: 640px) {
  .sim-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.sim-stat {
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid var(--ps-border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}
.sim-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.sim-stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}
.sim-stat-value.warn {
  color: var(--ps-warn);
}
.sim-day-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.sim-day-label {
  flex: none;
  width: 3.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  padding-bottom: 0.45rem;
}
.sim-day-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sim-day-field span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
}
.sim-day-input {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--ps-border);
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.sim-day-input:focus {
  outline: 2px solid var(--ps-accent);
  outline-offset: 1px;
  border-color: transparent;
}
.sim-day-del {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.4rem;
  border: 1px solid var(--ps-border);
  background: rgba(2, 6, 23, 0.6);
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.sim-day-del:hover {
  color: var(--ps-down);
  border-color: rgba(248, 113, 113, 0.5);
}
.sim-add {
  margin-top: 0.7rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 0.45rem;
  cursor: pointer;
}
.sim-add:hover {
  background: rgba(56, 189, 248, 0.18);
}
.sim-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sim-field label,
.sim-radio-group > span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 700;
}
.sim-field input[type="number"] {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--ps-border);
  border-radius: 0.45rem;
  padding: 0.5rem 0.65rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.sim-field input[type="number"]:focus {
  outline: 2px solid var(--ps-accent);
  outline-offset: 1px;
}
.sim-radio {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.3rem 0;
}
.sim-radio input {
  accent-color: var(--ps-accent);
  width: 1rem;
  height: 1rem;
}
.sim-radio input:focus-visible {
  outline: 2px solid var(--ps-accent);
  outline-offset: 2px;
}

/* Mobile nav */
.mobile-menu {
  display: none;
}
.mobile-menu.open {
  display: block;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--ps-border);
  background: #020617;
}

/* Utility */
.tabular {
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  .result-value {
    font-size: 2rem;
  }
}

/* ==========================================================================
   Motion — "Instrument"
   Precision-tool feel: short, crisp, no overshoot. Motion exists to build
   trust in the numbers (confirm a change, reveal hierarchy), never to
   decorate. Scroll reveals are progressive enhancement — Firefox has no
   scroll-driven-animation support and simply renders the final state.
   ========================================================================== */

:root {
  /* Fast out, fully settled — no bounce. An instrument does not wobble. */
  --ps-ease: cubic-bezier(0.2, 0, 0, 1);
  --ps-snap: 90ms;   /* state changes the user caused: press, select */
  --ps-tick: 600ms;  /* value-changed flash decay */
}

/* --- Scroll reveal ------------------------------------------------------
   12px rise + fade across the first 60% of the entry range. Entry only:
   content must never animate *out* on a page people scroll to compute. */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes ps-rise {
      from {
        opacity: 0;
        transform: translateY(12px);
      }
    }

    [data-reveal] {
      animation: ps-rise auto var(--ps-ease) backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }

    /* Stagger children so a card grid resolves in reading order rather
       than snapping in as one slab. 40ms reads as sequence, not lag. */
    [data-reveal-stagger] > * {
      animation: ps-rise auto var(--ps-ease) backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    [data-reveal-stagger] > *:nth-child(2) { animation-range: entry 4% entry 59%; }
    [data-reveal-stagger] > *:nth-child(3) { animation-range: entry 8% entry 63%; }
    [data-reveal-stagger] > *:nth-child(4) { animation-range: entry 12% entry 67%; }
  }
}

/* --- Value tick ---------------------------------------------------------
   The single most important moment on the page: the number the user came
   for just changed. A terminal flashes; it does not count up. Count-up
   would lag behind live typing and read as sluggish. */
@keyframes ps-tick-flash {
  from {
    color: var(--ps-accent);
    text-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
  }
}
@keyframes ps-tick-flash-soft {
  from {
    color: var(--ps-accent);
  }
}

.is-ticking {
  animation: ps-tick-flash var(--ps-tick) var(--ps-ease);
}
.stat-value.is-ticking,
.is-ticking-soft {
  animation: ps-tick-flash-soft var(--ps-tick) var(--ps-ease);
}

/* --- Interaction feedback ----------------------------------------------
   Scope transitions to the properties that actually change. `all` forces
   the browser to watch every property and animates layout ones by
   accident; it is also why these felt mushy at 150ms. */
.toggle-btn,
.preset-chip {
  transition:
    color var(--ps-snap) var(--ps-ease),
    border-color var(--ps-snap) var(--ps-ease),
    background-color var(--ps-snap) var(--ps-ease),
    box-shadow var(--ps-snap) var(--ps-ease),
    transform var(--ps-snap) var(--ps-ease);
}

/* Physical press. Confirms the tap landed before any value updates. */
.toggle-btn:active,
.preset-chip:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .toggle-btn:active,
  .preset-chip:active {
    transform: none;
  }
}
