/* =============================================================================
 * style.css — Marketplace Profit Calculator
 *
 * Structure: tokens → reset → primitives → layout → components → responsive
 * → print. Theming is driven by [data-theme] on <html>.
 * ========================================================================== */

/* ══════════════════════════ TOKENS ══════════════════════════ */
:root {
  --primary: #2563EB;
  --primary-600: #1D4ED8;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #EF4444;

  --bg: #F8FAFC;
  --bg-elev: #FFFFFF;
  --text: #0F172A;
  --text-dim: #475569;
  --text-mute: #64748B;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.16);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-brd: rgba(255, 255, 255, 0.85);
  --glass-blur: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .05), 0 10px 24px -4px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, .12), 0 24px 60px -12px rgba(15, 23, 42, .14);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sp: 8px;
  --container: 1180px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
          Arial, 'Noto Sans', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0F172A;
  --bg-elev: #1E293B;
  --text: #F1F5F9;
  --text-dim: #CBD5E1;
  --text-mute: #94A3B8;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);

  --glass-bg: rgba(30, 41, 59, 0.62);
  --glass-brd: rgba(148, 163, 184, 0.18);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .35), 0 10px 24px -4px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, .5), 0 24px 60px -12px rgba(0, 0, 0, .55);
}

/* ══════════════════════════ RESET ══════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}

/* Ambient gradient wash */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1000px 620px at 88% -8%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(820px 520px at 4% 4%, rgba(22, 163, 74, .08), transparent 58%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(1000px 620px at 88% -8%, rgba(37, 99, 235, .20), transparent 60%),
    radial-gradient(820px 520px at 4% 4%, rgba(22, 163, 74, .13), transparent 58%);
}

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 200;
  background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ══════════════════════════ PRIMITIVES ══════════════════════════ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.container.narrow { max-width: 820px; }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}
.glass-sm {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}
.card-pad { padding: clamp(18px, 3vw, 34px); }

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-tight { padding: clamp(32px, 4vw, 52px) 0; }

.section-head { margin-bottom: clamp(20px, 3vw, 34px); }
.section-head h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.section-head p { color: var(--text-dim); margin-top: 6px; font-size: 1.02rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600; font-size: .94rem;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .32);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(37, 99, 235, .42); }

.btn-soft {
  background: var(--bg-elev);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-soft:hover { border-color: var(--border-strong); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { background: var(--bg-elev); }

.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }

#advancedToggle svg { transition: transform .25s var(--ease); }
#advancedToggle.is-open svg { transform: rotate(180deg); }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  transition: color .2s, border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: rotate(12deg); }

/* ══════════════════════════ NAV ══════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 100;
  transition: background .25s var(--ease), box-shadow .25s var(--ease),
              border-color .25s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: var(--glass-bg);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
/* The logo is a tall hexagon (5:6), so size it by HEIGHT and let width follow —
   constraining it to a square would letterbox it and shrink the mark. */
.brand-mark { display: grid; place-items: center; flex-shrink: 0; }
.brand-mark img {
  height: 40px; width: auto; display: block;
  transition: transform .2s var(--ease);
}
.brand:hover .brand-mark img { transform: scale(1.06); }
.brand-text { font-weight: 750; letter-spacing: -0.02em; font-size: 1.06rem; }

@media (max-width: 460px) {
  .brand-mark img { height: 34px; }
  .brand-text { font-size: .96rem; }
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 8px 13px; border-radius: 999px;
  color: var(--text-dim); font-weight: 550; font-size: .92rem;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev); text-decoration: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span {
  width: 22px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════ HERO ══════════════════════════ */
.hero { position: relative; padding: clamp(44px, 7vw, 86px) 0 clamp(36px, 5vw, 60px); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.orb-1 { width: 380px; height: 380px; background: rgba(37,99,235,.34); top: -110px; right: -60px; animation: float 19s ease-in-out infinite; }
.orb-2 { width: 300px; height: 300px; background: rgba(22,163,74,.28); bottom: -90px; left: -50px; animation: float 23s ease-in-out infinite reverse; }
.orb-3 { width: 220px; height: 220px; background: rgba(245,158,11,.20); top: 44%; left: 46%; animation: float 27s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(26px, -22px) scale(1.06); }
  66% { transform: translate(-18px, 16px) scale(.95); }
}

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(24px, 4vw, 54px); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  padding: 6px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--text-dim);
  margin-bottom: 18px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(22,163,74,.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); }
  70% { box-shadow: 0 0 0 9px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.03;
  margin-bottom: 18px;
}
.grad {
  background: linear-gradient(120deg, var(--primary) 0%, var(--success) 62%, var(--warning) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.lede { font-size: clamp(1.02rem, 1.7vw, 1.2rem); color: var(--text-dim); max-width: 54ch; }
.hero-fact {
  margin-top: 14px; padding: 12px 16px;
  border-left: 3px solid var(--success);
  background: rgba(22,163,74,.07);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .95rem; color: var(--text-dim); max-width: 56ch;
}
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: .82rem; color: var(--text-mute); }

.hero-art { position: relative; }
.hero-svg { width: 100%; height: auto; animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.art-panel { fill: var(--glass-bg); stroke: var(--glass-brd); stroke-width: 1.5; }
.art-chip-bg { fill: var(--success); opacity: .16; }
.art-chip-text { fill: var(--success); font-size: 13px; font-weight: 700; font-family: var(--font); }
.art-dot { animation: ping 3s ease-out infinite; transform-origin: 344px 92px; }
@keyframes ping { 0%,100% { r: 8; } 50% { r: 10; } }
.art-line { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s var(--ease) forwards .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ══════════════════════════ ADS ══════════════════════════
 * AD SIZES — these reservations must match config.js `adsense.slots` exactly.
 * They are two halves of one contract: script.js renders each unit at a FIXED
 * width/height, and the height reserved here is what stops the page jumping
 * when the ad fills. Change one, change the other.
 *
 *   topBanner / bottomBanner : 320×100 mobile · 728×90 desktop
 *   middleBanner             : 300×250 mobile · 336×280 desktop
 *
 * `height` (not min-height) is deliberate — the box occupies its final size
 * from first paint, whether the ad loads, fails, or is never configured.
 * ==================================================================== */
.ad-wrap { margin: clamp(20px, 3vw, 34px) 0; display: flex; justify-content: center; }
.ad-slot {
  width: 100%;
  display: grid; place-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  background: rgba(148, 163, 184, .05);
  overflow: hidden;
}
.ad-top .ad-slot, .ad-bottom .ad-slot { height: 100px; }
.ad-mid .ad-slot { height: 250px; }
@media (min-width: 768px) {
  .ad-top .ad-slot, .ad-bottom .ad-slot { height: 90px; }
  .ad-mid .ad-slot { height: 280px; }
}
/* Ads must never be printed or baked into an exported report. */
@media print { .ad-wrap { display: none !important; } }
.ad-placeholder {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute); opacity: .5;
}

/* ══════════════════════════ FORM ══════════════════════════ */
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(37, 99, 235, .12);
  color: var(--primary);
}
.panel-head h3 { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; }

.grid-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: .84rem; font-weight: 650; color: var(--text-dim); }
.field small { font-size: .74rem; color: var(--text-mute); line-height: 1.4; }

.field input, .field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: .96rem; font-weight: 550;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  padding-right: 34px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field input.field-error { border-color: var(--danger); }
.field input.field-error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }

.validation:not(:empty) { margin-top: 14px; display: grid; gap: 7px; }
.vmsg {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .84rem; padding: 9px 12px; border-radius: var(--r-sm);
}
.vmsg svg { flex-shrink: 0; margin-top: 2px; }
.vmsg-error { background: rgba(239, 68, 68, .1); color: var(--danger); }
.vmsg-warn { background: rgba(245, 158, 11, .12); color: #B45309; }
[data-theme="dark"] .vmsg-warn { color: var(--warning); }

/* ══════════════════════════ CALLOUTS ══════════════════════════ */
.callouts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 26px;
}
.callout {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 18px;
}
.callout-good { border-color: rgba(22, 163, 74, .3); background: rgba(22, 163, 74, .07); }
.callout-bad { border-color: rgba(239, 68, 68, .28); background: rgba(239, 68, 68, .06); }
/* Every marketplace loses money — the "best" one is only the least bad, so it
   must not be dressed in success green. */
.callout-warn { border-color: rgba(245, 158, 11, .32); background: rgba(245, 158, 11, .08); }
.callout-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
}
.callout-icon.good { background: rgba(22, 163, 74, .16); color: var(--success); }
.callout-icon.bad { background: rgba(239, 68, 68, .14); color: var(--danger); }
.callout-icon.warn { background: rgba(245, 158, 11, .18); color: var(--warning); }
.callout-warn .callout-name { color: #B45309; }
[data-theme="dark"] .callout-warn .callout-name { color: var(--warning); }
.callout-label { display: block; font-size: .74rem; color: var(--text-mute); font-weight: 600; }
.callout-name { display: block; font-size: 1.1rem; font-weight: 750; letter-spacing: -0.02em; }
.callout-good .callout-name { color: var(--success); }
.callout-bad .callout-name { color: var(--danger); }
.callout-sub { display: block; font-size: .82rem; color: var(--text-dim); }

.headline-msg {
  margin-top: 18px; text-align: center;
  font-size: clamp(1rem, 2vw, 1.18rem); color: var(--text-dim);
}
.headline-msg strong { color: var(--success); font-weight: 800; }
.headline-msg.is-loss strong { color: var(--danger); }

/* ══════════════════════════ MARKETPLACE CARDS ══════════════════════════ */
.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px; margin-top: 24px;
}
.mp-card {
  --accent: var(--primary);
  position: relative;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
  display: flex; flex-direction: column;
}
.mp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mp-card.is-best {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .1), var(--shadow);
}
.mp-card.is-loss { border-color: rgba(239, 68, 68, .5); }

.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.mp-name { display: flex; align-items: center; gap: 8px; }
.mp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.mp-name h3 { font-size: 1.04rem; font-weight: 750; letter-spacing: -0.02em; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}
.chip-best { background: var(--success); color: #fff; }

.mp-profit {
  background: rgba(22, 163, 74, .07);
  border-radius: var(--r); padding: 14px; margin-bottom: 12px;
}
.mp-card.is-loss .mp-profit { background: rgba(239, 68, 68, .08); }
.mp-profit-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem; color: var(--text-dim); font-weight: 600; margin-bottom: 4px;
}
.mp-card.is-loss .mp-profit-label { color: var(--danger); }
.mp-profit-value {
  font-size: clamp(1.6rem, 3.2vw, 2.05rem);
  font-weight: 800; letter-spacing: -0.035em; color: var(--success);
  font-variant-numeric: tabular-nums;
}
.mp-card.is-loss .mp-profit-value { color: var(--danger); }

.mp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat {
  background: rgba(148, 163, 184, .08);
  border-radius: var(--r-sm); padding: 9px 11px;
  display: flex; flex-direction: column; gap: 1px;
}
.stat-label { font-size: .7rem; color: var(--text-mute); font-weight: 600; }
.stat-value { font-size: 1.02rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.mp-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.fee-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; }
.fee-row.muted { opacity: .55; }
.fee-label { color: var(--text-dim); }
.fee-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fee-value.neg { color: var(--danger); }
.fee-row.total-fees { font-weight: 700; }
.fee-divider { height: 1px; background: var(--border); margin: 5px 0; }
.fee-row[title] { cursor: help; }

.mp-foot { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 650;
  padding: 4px 9px; border-radius: 999px;
  text-decoration: none; line-height: 1.3;
}
.badge:hover { text-decoration: none; opacity: .82; }
.badge-verified { background: rgba(22, 163, 74, .12); color: var(--success); }
.badge-partial { background: rgba(245, 158, 11, .14); color: #B45309; }
.badge-estimate { background: rgba(239, 68, 68, .1); color: var(--danger); }
[data-theme="dark"] .badge-partial { color: var(--warning); }

.card-warn {
  margin-top: 9px; font-size: .74rem; color: var(--danger);
  background: rgba(239, 68, 68, .08); padding: 7px 10px; border-radius: var(--r-sm);
}

/* ══════════════════════════ ASSUMPTIONS ══════════════════════════ */
.assumptions {
  margin-top: 22px; padding: 13px 16px;
  background: rgba(37, 99, 235, .06);
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.assumptions-text { font-size: .84rem; color: var(--text-dim); }
.assumptions-text strong { color: var(--text); font-weight: 650; }
.assumptions-text .sep { opacity: .45; }

.advanced {
  margin-top: 14px; padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(148, 163, 184, .05);
  animation: slideDown .28s var(--ease);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.adv-note {
  font-size: .84rem; color: var(--text-dim);
  padding: 11px 13px; margin-bottom: 16px;
  background: rgba(37, 99, 235, .07);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--primary);
}
.adv-note strong { display: block; color: var(--text); margin-bottom: 2px; }

/* ══════════════════════════ WHAT-IF ══════════════════════════ */
.whatif { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.slider-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px;
}
.slider-field { display: flex; flex-direction: column; gap: 7px; }
.slider-field label { font-size: .82rem; font-weight: 650; color: var(--text-dim); }
.slider-field output {
  font-size: 1.02rem; font-weight: 750; color: var(--primary);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--primary);
  box-shadow: var(--shadow-sm); cursor: grab;
  transition: transform .16s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.16); }
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
input[type="range"]::-moz-range-thumb {
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--primary);
  box-shadow: var(--shadow-sm); cursor: grab;
}

/* ══════════════════════════ ACTIONS ══════════════════════════ */
.actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);
}
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.share-label { font-size: .82rem; color: var(--text-mute); font-weight: 600; }
.share-btn {
  padding: 6px 13px; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text-dim);
  transition: all .18s var(--ease);
}
.share-btn:hover { color: #fff; transform: translateY(-1px); }
.share-btn.wa:hover { background: #25D366; border-color: #25D366; }
.share-btn.li:hover { background: #0A66C2; border-color: #0A66C2; }
.share-btn.x:hover { background: #0F172A; border-color: #0F172A; }
.share-btn.fb:hover { background: #1877F2; border-color: #1877F2; }
.share-btn.em:hover { background: var(--text-dim); border-color: var(--text-dim); }
.share-btn.nv:hover { background: var(--primary); border-color: var(--primary); }

/* ══════════════════════════ INSIGHTS ══════════════════════════ */
.insight-list { list-style: none; display: grid; gap: 10px; }
.insight {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--r);
  font-size: .92rem; line-height: 1.5;
  border-left: 3px solid transparent;
}
.insight-icon { flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; }
.insight-best { background: rgba(22,163,74,.08); border-left-color: var(--success); }
.insight-best .insight-icon { color: var(--success); }
.insight-good { background: rgba(22,163,74,.07); border-left-color: var(--success); }
.insight-good .insight-icon { color: var(--success); }
.insight-warn { background: rgba(245,158,11,.1); border-left-color: var(--warning); }
.insight-warn .insight-icon { color: var(--warning); }
.insight-danger { background: rgba(239,68,68,.09); border-left-color: var(--danger); }
.insight-danger .insight-icon { color: var(--danger); }
.insight-info { background: rgba(37,99,235,.07); border-left-color: var(--primary); }
.insight-info .insight-icon { color: var(--primary); }

/* ══════════════════════════ BREAKDOWN ══════════════════════════ */
.bd-row { margin-bottom: 15px; }
.bd-row:last-child { margin-bottom: 0; }
.bd-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.bd-label { font-size: .86rem; font-weight: 600; color: var(--text-dim); }
.bd-value { font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-track {
  height: 9px; border-radius: 999px;
  background: rgba(148, 163, 184, .18); overflow: hidden;
}
.bd-fill {
  height: 100%; width: 0; border-radius: 999px;
  transition: width .7s var(--ease);
}
.bar-cost { background: linear-gradient(90deg, #64748B, #94A3B8); }
.bar-fee { background: linear-gradient(90deg, #EF4444, #F87171); }
.bar-ship { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.bar-pack { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.bar-ads { background: linear-gradient(90deg, #EC4899, #F472B6); }
.bar-tax { background: linear-gradient(90deg, #0EA5E9, #38BDF8); }
.bar-profit { background: linear-gradient(90deg, #16A34A, #4ADE80); }

.bd-total {
  margin-top: 16px; padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--text-mute); text-align: right;
}
.bd-total-off {
  color: var(--danger); font-weight: 650; text-align: left;
  background: rgba(239, 68, 68, .08);
  padding: 9px 11px; border-radius: var(--r-sm); border-top: 0;
}

/* ══════════════════════════ CHARTS ══════════════════════════ */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { padding: 20px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 { font-size: .98rem; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.01em; }
.chart-holder { position: relative; height: 260px; }
.chart-holder.tall { height: 320px; }
.chart-fallback {
  padding: 30px; text-align: center; color: var(--text-mute); font-size: .9rem;
  border: 1px dashed var(--border); border-radius: var(--r);
}

/* ══════════════════════════ PROJECTION ══════════════════════════ */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 13px; }
.stat-card { padding: 17px; display: flex; flex-direction: column; gap: 4px; }
.stat-k { font-size: .76rem; color: var(--text-mute); font-weight: 600; }
.stat-v {
  font-size: clamp(1.15rem, 2.2vw, 1.42rem); font-weight: 800;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}

/* ══════════════════════════ FAQ ══════════════════════════ */
.faq-list { display: grid; gap: 11px; }
.faq-item { overflow: hidden; transition: box-shadow .2s; }
.faq-item.is-open { box-shadow: var(--shadow); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 19px; text-align: left;
  font-weight: 650; font-size: .98rem; color: var(--text);
}
.faq-q svg { flex-shrink: 0; color: var(--text-mute); transition: transform .26s var(--ease); }
.faq-item.is-open .faq-q svg { transform: rotate(180deg); color: var(--primary); }
.faq-a { padding: 0 19px 17px; color: var(--text-dim); font-size: .92rem; }
.faq-a p + p { margin-top: 9px; }

/* ══════════════════════════ ARTICLES ══════════════════════════ */
.article { padding: clamp(28px, 4vw, 52px) 0 clamp(40px, 6vw, 72px); }
.crumbs { font-size: .82rem; color: var(--text-mute); margin-bottom: 18px; }
.crumbs a { color: var(--text-dim); }
.crumbs span { opacity: .5; margin: 0 6px; }

.art-head { margin-bottom: 26px; }
.art-head h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 850;
  letter-spacing: -.035em; line-height: 1.1; margin-bottom: 12px;
}
.art-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-mute);
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.art-meta strong { color: var(--text-dim); font-weight: 600; }
.art-standfirst {
  font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--text-dim);
  margin: 18px 0 0; line-height: 1.6;
}

.art-body { font-size: 1rem; line-height: 1.75; color: var(--text-dim); }
.art-body > * + * { margin-top: 16px; }
.art-body h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem); font-weight: 750;
  color: var(--text); letter-spacing: -.02em; margin-top: 38px;
  scroll-margin-top: 84px;
}
.art-body h3 {
  font-size: 1.06rem; font-weight: 700; color: var(--text); margin-top: 26px;
}
.art-body strong { color: var(--text); font-weight: 650; }
.art-body ul, .art-body ol { padding-left: 22px; display: grid; gap: 7px; }
.art-body li { line-height: 1.65; }
.art-body a { text-decoration: underline; text-underline-offset: 2px; }

.art-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.art-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  min-width: 460px;
}
.art-table th {
  text-align: left; font-weight: 700; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute);
  padding: 9px 12px; border-bottom: 2px solid var(--border-strong); white-space: nowrap;
}
.art-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.art-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.art-table tbody tr:hover { background: rgba(148,163,184,.06); }

.callout-box {
  padding: 15px 18px; border-radius: var(--r);
  border-left: 3px solid var(--primary);
  background: rgba(37,99,235,.06);
  font-size: .94rem;
}
.callout-box.warn { border-left-color: var(--warning); background: rgba(245,158,11,.08); }
.callout-box.good { border-left-color: var(--success); background: rgba(22,163,74,.07); }
.callout-box.danger { border-left-color: var(--danger); background: rgba(239,68,68,.07); }
.callout-box strong:first-child { display: block; color: var(--text); margin-bottom: 4px; }

.art-cta {
  margin-top: 34px; padding: 22px; text-align: center;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(37,99,235,.09), rgba(22,163,74,.08));
  border: 1px solid var(--border);
}
.art-cta h3 { font-size: 1.14rem; font-weight: 750; color: var(--text); margin-bottom: 5px; }
.art-cta p { font-size: .9rem; color: var(--text-dim); margin-bottom: 14px; }

.art-sources {
  margin-top: 34px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: rgba(148,163,184,.04); font-size: .84rem;
}
.art-sources h3 { font-size: .92rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.art-sources ul { list-style: none; padding: 0; display: grid; gap: 5px; }
.art-sources li { color: var(--text-mute); }

.art-more { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border); }
.art-more h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 13px; }
.art-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.art-card {
  display: block; padding: 15px 17px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--bg-elev);
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
.art-card:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: var(--primary); box-shadow: var(--shadow);
}
.art-card strong { display: block; color: var(--text); font-size: .95rem; margin-bottom: 3px; }
.art-card span { font-size: .82rem; color: var(--text-mute); }

/* ══════════════════════════ FOOTER ══════════════════════════ */
.footer {
  margin-top: clamp(40px, 6vw, 72px);
  padding: clamp(34px, 5vw, 52px) 0 30px;
  border-top: 1px solid var(--border);
  background: rgba(148, 163, 184, .04);
}
.footer-grid {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 26px; flex-wrap: wrap; margin-bottom: 26px;
}
.footer-tag { font-size: .86rem; color: var(--text-mute); margin-top: 5px; max-width: 42ch; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-size: .88rem; color: var(--text-dim); }
.footer-links a:hover { color: var(--primary); }

.disclaimer {
  padding: 16px 18px; border-radius: var(--r);
  background: rgba(245, 158, 11, .07);
  border: 1px solid rgba(245, 158, 11, .2);
  font-size: .8rem; color: var(--text-dim); line-height: 1.55;
}
.disclaimer p + p { margin-top: 8px; }
.disclaimer strong { color: var(--text); }

.copyright { margin-top: 20px; font-size: .8rem; color: var(--text-mute); text-align: center; }

/* ══════════════════════════ CONSENT BAR ══════════════════════════
 * DPDP notice for Indian visitors. EEA/UK visitors get Google's certified CMP
 * instead, enabled in the AdSense dashboard — see consent.js.
 * ==================================================================== */
.consent-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 120;
  max-width: 720px; margin-inline: auto;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  opacity: 0; transform: translateY(14px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.consent-bar.is-in { opacity: 1; transform: translateY(0); }
.consent-bar.is-leaving { opacity: 0; transform: translateY(14px); }
.consent-text { font-size: .84rem; color: var(--text-dim); line-height: 1.5; }
.consent-ok { flex-shrink: 0; }

@media (max-width: 560px) {
  .consent-bar { flex-direction: column; align-items: stretch; gap: 11px; }
  .consent-ok { width: 100%; }
}
/* Never print or export the notice. */
@media print { .consent-bar { display: none !important; } }
.exporting .consent-bar { display: none !important; }

/* ══════════════════════════ BACK TO TOP ══════════════════════════ */
.to-top {
  position: fixed; bottom: 22px; right: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, .4);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--primary-600); transform: translateY(-2px); }

/* ══════════════════════════ RESPONSIVE ══════════════════════════ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 400px; margin-inline: auto; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: auto; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 20px 18px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 11px 13px; }
  .icon-btn { align-self: flex-start; margin-top: 6px; }

  .callouts { grid-template-columns: 1fr; }
  .assumptions { flex-direction: column; align-items: flex-start; }
  .actions .btn { flex: 1 1 calc(50% - 5px); }
}

@media (max-width: 460px) {
  .container { padding-inline: 15px; }
  .mp-stats { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; }
  .hero-cta .btn { flex: 1 1 100%; }
}

/* ══════════════════════════ PRINT ══════════════════════════ */
@media print {
  .nav, .to-top, .ad-wrap, .actions, .share-row, .hero-art, .hero-bg,
  .whatif, #advancedToggle, .skip-link, .nav-toggle { display: none !important; }

  body { background: #fff; color: #000; }
  body::before { display: none; }

  .glass, .glass-sm, .mp-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .section { padding: 14px 0; page-break-inside: avoid; }
  .mp-grid { grid-template-columns: repeat(3, 1fr); }
  .mp-card, .chart-card, .faq-item { page-break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .7em; color: #555; }
  .disclaimer { border: 1px solid #999 !important; background: #fff !important; }
}

/* ══════════════════════════ PDF / PNG REPORT ══════════════════════════
 * A standalone document built by export.js and rendered offscreen. It is NOT
 * the live UI — exporting the app itself photographs input boxes and sliders
 * and paginates badly. Everything here is deliberately hard-coded to print
 * colours and A4 width, and must NOT inherit the site's theme tokens: the
 * report is black-on-white whether the visitor is in dark mode or not.
 * ==================================================================== */
.pdf-report-holder { background: #fff; }

/* One real A4 page. export.js measures blocks against this height and flows
   them, so these numbers are load-bearing — PAGE_PAD in export.js must equal
   the padding here. */
.pdf-page {
  width: 794px;                 /* 210mm at 96dpi */
  height: 1123px;               /* 297mm at 96dpi */
  padding: 44px;
  background: #fff;
  color: #0F172A;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}
.pdf-page * { color: inherit; }
.pdf-page .r-group { margin-bottom: 2px; }

.r-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 2px solid #2563EB;
}
.pdf-page h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #0F172A; }
.r-head-right { text-align: right; }
.r-brand { font-weight: 700; font-size: 13px; color: #2563EB; }
.r-sub { font-size: 11px; color: #64748B; }

.r-h2 {
  font-size: 13px; font-weight: 700; color: #0F172A;
  margin: 16px 0 7px; padding-bottom: 4px;
  border-bottom: 1px solid #E2E8F0;
}
.r-group:first-child .r-h2 { margin-top: 0; }

.r-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.r-table th {
  text-align: left; font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .04em; color: #64748B;
  padding: 7px 8px; border-bottom: 1.5px solid #CBD5E1; white-space: nowrap;
}
.r-table th.num, .r-table td.num { text-align: right; }
.r-table td { padding: 7px 8px; border-bottom: 1px solid #F1F5F9; }
.r-table tr.is-best td { background: #F0FDF4; font-weight: 650; }
.r-table tr.r-total td {
  border-top: 1.5px solid #CBD5E1; border-bottom: 0;
  font-weight: 750; background: #F8FAFC;
}
.r-table.kv td:first-child { color: #475569; width: 45%; }
.r-table.kv td:last-child { text-align: right; font-weight: 650; }

.r-assume {
  font-size: 11px; color: #475569; background: #F8FAFC;
  border-left: 3px solid #2563EB; padding: 8px 11px; border-radius: 0 4px 4px 0;
}

.r-winner {
  margin-top: 18px; padding: 13px 16px;
  background: #F0FDF4; border: 1px solid #86EFAC; border-radius: 8px;
  display: flex; flex-direction: column; gap: 1px;
}
.r-winner-k { font-size: 10px; font-weight: 700; color: #15803D;
  text-transform: uppercase; letter-spacing: .05em; }
.r-winner-v { font-size: 18px; font-weight: 800; color: #14532D; letter-spacing: -.02em; }
.r-winner-s { font-size: 11.5px; color: #166534; }
.r-winner-n { font-size: 11px; color: #15803D; font-weight: 600; margin-top: 3px; }

/* Loss variant — see the `allLose` branch in export.js. */
.r-winner-loss { background: #FFFBEB; border-color: #FCD34D; }
.r-winner-loss .r-winner-k { color: #B45309; }
.r-winner-loss .r-winner-v { color: #78350F; }
.r-winner-loss .r-winner-s { color: #92400E; }
.r-winner-loss .r-winner-n { color: #B45309; }

.r-note { font-size: 10px; color: #64748B; margin-top: 7px; font-style: italic; }

.r-insights { list-style: none; margin: 0; padding: 0; }
.r-insights li {
  font-size: 11px; padding: 7px 10px; margin-bottom: 5px;
  border-left: 3px solid #CBD5E1; background: #F8FAFC; border-radius: 0 4px 4px 0;
  page-break-inside: avoid;
}
.r-insights li.r-ins-best, .r-insights li.r-ins-good {
  border-left-color: #16A34A; background: #F0FDF4; }
.r-insights li.r-ins-warn { border-left-color: #F59E0B; background: #FFFBEB; }
.r-insights li.r-ins-danger { border-left-color: #EF4444; background: #FEF2F2; }
.r-insights li.r-ins-info { border-left-color: #2563EB; background: #EFF6FF; }

.r-disc {
  margin-top: 16px; padding: 11px 13px;
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 6px;
  font-size: 10px; color: #78350F; page-break-inside: avoid;
}
.r-disc strong { display: block; margin-bottom: 3px; color: #78350F; }

.r-foot {
  margin-top: 18px; padding-top: 10px; border-top: 1px solid #E2E8F0;
  font-size: 9.5px; color: #94A3B8; text-align: center;
}

/* Legacy hook — kept because window.print() still prints the live page, and
   backdrop-filter renders unpredictably in print engines. */
.exporting .glass, .exporting .glass-sm, .exporting .mp-card {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: var(--bg-elev) !important;
}
.exporting .ad-wrap, .exporting .to-top { display: none !important; }

/* Entity line in the footer — Jenria Infotech LLP identity, rendered from
   CONFIG.company by the data-config-text hook. */
.footer-entity { font-size: .74rem; opacity: .75; display: inline-block; margin-top: 3px; }
