/* =====================================================================
   KrishiGramAi — design system
   Plus Jakarta Sans (Latin) + Hind Siliguri (Bangla)
   Light and dark themes driven by [data-theme] on <html>.
   ===================================================================== */

/* ---------------------------------------------------------------- Tokens */
:root {
  color-scheme: light;

  /* Surfaces */
  --canvas:      #F7F8F5;
  --surface:     #FFFFFF;
  --surface-2:   #F1F4F0;
  --surface-3:   #E9EEE8;

  /* Ink */
  --ink:         #10201A;
  --ink-2:       #4A5C53;
  --ink-3:       #78877E;

  /* Brand */
  --forest:      #0F4D2E;
  --forest-2:    #0A3A22;
  --leaf:        #2F9E5F;
  --leaf-soft:   #E6F2EA;
  --grain:       #D98324;
  --grain-soft:  #FBF0E1;

  /* Semantic */
  --ok:          #2F9E5F;
  --warn:        #D98324;
  --danger:      #C0392F;
  --danger-soft: #FBECEB;

  /* Lines */
  --line:        #E2E8E1;
  --line-2:      #CBD5C9;

  /* Effects */
  --ring:        0 0 0 3px rgba(47,158,95,.28);
  --shadow-sm:   0 1px 2px rgba(16,32,26,.05);
  --shadow:      0 6px 20px rgba(16,32,26,.07);
  --shadow-lg:   0 24px 56px rgba(10,58,34,.16);
  --grad:        linear-gradient(135deg, #0F4D2E 0%, #2F9E5F 62%, #56C285 100%);
  --grad-warm:   linear-gradient(135deg, #B8690F 0%, #D98324 100%);

  /* Type scale — 1.25 minor third, tuned for a 17px base */
  --t-xs:   .8125rem;
  --t-sm:   .9375rem;
  --t-md:   1.0625rem;
  --t-lg:   1.1875rem;
  --t-xl:   1.5rem;
  --t-2xl:  1.9375rem;
  --t-3xl:  2.5rem;
  --t-4xl:  3.25rem;
  --t-5xl:  4.25rem;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --maxw: 1200px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --canvas:      #0D1512;
  --surface:     #141F1A;
  --surface-2:   #1B2A23;
  --surface-3:   #22342B;

  --ink:         #E8EFE9;
  --ink-2:       #A9BCB0;
  --ink-3:       #7C9086;

  --forest:      #4FBF7F;   /* interactive green lifts in the dark */
  --forest-2:    #6FD199;
  --leaf:        #56C285;
  --leaf-soft:   #16301F;
  --grain:       #E9A34A;
  --grain-soft:  #33230F;

  --ok:          #56C285;
  --warn:        #E9A34A;
  --danger:      #E4685C;
  --danger-soft: #35191A;

  --line:        #253830;
  --line-2:      #33493E;

  --ring:        0 0 0 3px rgba(86,194,133,.32);
  --shadow-sm:   0 1px 2px rgba(0,0,0,.4);
  --shadow:      0 6px 20px rgba(0,0,0,.42);
  --shadow-lg:   0 24px 56px rgba(0,0,0,.55);
  --grad:        linear-gradient(135deg, #1E6E43 0%, #3FAF6F 58%, #7BD9A5 100%);
}

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, -apple-system, sans-serif;
  font-size: var(--t-md);
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Bengali glyphs sit taller and need more room to breathe than Latin. */
:lang(bn), .bn { line-height: 1.85; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.16;
}
h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); letter-spacing: -.02em; }
h3 { font-size: var(--t-lg); letter-spacing: -.012em; }
p  { margin: 0; }
a  { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img, svg { max-width: 100%; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

.wrap   { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.muted  { color: var(--ink-2); }
.small  { font-size: var(--t-sm); }
.tiny   { font-size: var(--t-xs); line-height: 1.6; }
.na     { color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; }

/* ---------------------------------------------------------------- Brand */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1875rem; letter-spacing: -.03em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,77,46,.28);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-word { display: inline-flex; }
.brand-word .ai { color: var(--leaf); }
.brand-sub {
  display: block; font-size: 10.5px; font-weight: 600;
  color: var(--ink-3); letter-spacing: .02em; line-height: 1;
  margin-top: 3px;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-family: inherit; font-size: var(--t-md); font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-2); }
[data-theme="dark"] .btn-primary { color: #06130C; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); background: var(--leaf-soft); }

.btn-amber { background: var(--grain); color: #fff; }
.btn-amber:hover { filter: brightness(.93); }
[data-theme="dark"] .btn-amber { color: #1A1004; }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: var(--t-sm); border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- Theme toggle */
.theme-toggle {
  width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer;
  transition: border-color .16s ease, color .16s ease;
}
.theme-toggle:hover { border-color: var(--line-2); color: var(--forest); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun  { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------------------------------------------------------------- Marketing header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 30px; height: 74px; }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: var(--t-sm); }
.nav-links a { color: var(--ink-2); font-weight: 500; }
.nav-links a:hover { color: var(--forest); text-decoration: none; }
.header-cta { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- Hero */
.hero {
  position: relative;
  padding: 80px 0 72px;
  overflow: hidden;
}
/* One soft horizon wash — the only decorative gradient on the page. */
.hero::before {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 62%;
  background: radial-gradient(120% 100% at 18% 100%,
              color-mix(in srgb, var(--leaf) 14%, transparent) 0%,
              transparent 62%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 60px; align-items: center; }

.hero-flag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--forest);
  border: 1px solid var(--line-2);
  padding: 7px 14px; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 600;
  margin-bottom: 24px;
}
.hero-flag .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); flex: none;
}
.hero h1 { font-size: var(--t-4xl); max-width: 16ch; margin-bottom: 22px; }
.hero-sub { font-size: var(--t-lg); color: var(--ink-2); max-width: 48ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero-note { font-size: var(--t-sm); color: var(--ink-3); }

/* Product preview — where the page raises its voice */
.preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px;
  background: var(--grad);
  color: #fff;
}
.preview-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.38); }
.preview-bar span { font-size: var(--t-xs); font-weight: 600; margin-left: 8px; }
.preview-body { padding: 22px; }

.gauge { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.gauge-ring {
  --pct: 86;
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--leaf) calc(var(--pct) * 1%), var(--surface-3) 0);
  display: grid; place-items: center;
}
.gauge-ring::after {
  content: ''; width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface); grid-area: 1/1;
}
.gauge-ring b {
  grid-area: 1/1; z-index: 1;
  font-size: 1.125rem; font-weight: 700; letter-spacing: -.03em; color: var(--forest);
}
.gauge-label { font-weight: 700; font-size: var(--t-md); letter-spacing: -.015em; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.metric {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 13px;
  background: var(--surface-2);
}
.metric dt { font-size: var(--t-xs); color: var(--ink-3); margin: 0 0 4px; font-weight: 500; }
.metric dd { margin: 0; font-size: 1.1875rem; font-weight: 700; letter-spacing: -.028em; }
.metric.ok dd   { color: var(--ok); }
.metric.warn dd { color: var(--warn); }

.ai-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--leaf);
  background: var(--leaf-soft);
  border-radius: var(--r-sm);
  padding: 14px 16px;
}
.ai-note .who { font-size: var(--t-xs); font-weight: 700; color: var(--forest); margin-bottom: 4px; }
.ai-note p { font-size: var(--t-sm); color: var(--ink); }
.ai-stamp { font-size: var(--t-xs); color: var(--ink-3); margin-top: 9px; }

/* ---------------------------------------------------------------- Trust strip */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.strip-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 36px; padding: 22px 28px; }
.strip-item { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.strip-note { font-size: var(--t-sm); color: var(--ink-3); margin-left: auto; }

/* ---------------------------------------------------------------- Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 42px; }
.section-head h2 { margin-bottom: 14px; }
.section-head p { color: var(--ink-2); }

/* Problem columns — a rule above each, not a card around it */
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.problem { padding-top: 20px; border-top: 2px solid var(--grain); }
.problem h3 { font-size: var(--t-md); margin-bottom: 8px; }
.problem p { font-size: var(--t-sm); color: var(--ink-2); }

/* ---------------------------------------------------------------- Feature flip cards */
.flip-hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--t-xs); color: var(--ink-3);
  background: var(--canvas); border: 1px solid var(--line);
  padding: 6px 13px; border-radius: 999px;
  margin-bottom: 28px;
}
.flip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.flip-card {
  perspective: 1300px; min-height: 244px;
  border: 0; padding: 0; margin: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border-radius: var(--r);
}
.flip-card:focus-visible { box-shadow: var(--ring); }
.flip-inner {
  position: relative; width: 100%; height: 100%; min-height: 244px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.22,.68,.28,1);
}
.flip-card:hover .flip-inner,
.flip-card:focus-visible .flip-inner,
.flip-card[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: var(--r); padding: 24px;
  display: flex; flex-direction: column;
}
.flip-front { background: var(--canvas); border: 1px solid var(--line); }
.section-alt .flip-front { background: var(--canvas); }
.flip-front h3 { margin-bottom: 8px; }
.flip-front p { font-size: var(--t-sm); color: var(--ink-2); }
.flip-front .turn { margin-top: auto; font-size: var(--t-xs); color: var(--ink-3); font-weight: 600; }
.flip-back {
  background: var(--grad); color: #fff;
  border: 1px solid transparent;
  transform: rotateY(180deg); overflow: hidden;
}
.flip-back h3 { color: #fff; font-size: var(--t-md); margin-bottom: 11px; }
.flip-back ul { list-style: none; margin: 0; padding: 0; }
.flip-back li {
  font-size: var(--t-sm); color: rgba(255,255,255,.92);
  display: flex; gap: 9px; padding: 3px 0; line-height: 1.6;
}
.flip-back li::before { content: '·'; color: rgba(255,255,255,.6); font-weight: 700; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  .flip-card:hover .flip-inner,
  .flip-card:focus-visible .flip-inner,
  .flip-card[aria-pressed="true"] .flip-inner { transform: none; }
  .flip-back { transform: none; opacity: 0; }
  .flip-card:hover .flip-back,
  .flip-card:focus-visible .flip-back,
  .flip-card[aria-pressed="true"] .flip-back { opacity: 1; }
}

.feature-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--leaf-soft); color: var(--forest);
  display: grid; place-items: center;
  margin-bottom: 15px;
}

/* ---------------------------------------------------------------- Sequence */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.flow-step { position: relative; padding-right: 24px; }
.flow-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--forest); color: #fff;
  display: grid; place-items: center;
  font-size: var(--t-xs); font-weight: 700;
  margin-bottom: 14px;
}
[data-theme="dark"] .flow-num { color: #06130C; }
.flow-step h3 { font-size: var(--t-md); margin-bottom: 6px; }
.flow-step p { font-size: var(--t-sm); color: var(--ink-2); }
.flow-step::after {
  content: ''; position: absolute; top: 15px; left: 38px; right: 16px;
  height: 1px; background: var(--line-2);
}
.flow-step:last-child::after { display: none; }

/* ---------------------------------------------------------------- Chat mockup */
.chat {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.bubble {
  max-width: 84%; padding: 12px 15px; border-radius: 14px;
  font-size: var(--t-sm); margin-bottom: 12px;
}
.bubble-user { margin-left: auto; background: var(--forest); color: #fff; border-bottom-right-radius: 4px; }
[data-theme="dark"] .bubble-user { color: #06130C; }
.bubble-ai {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-bottom-left-radius: 4px;
}
.bubble-ai b { color: var(--forest); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-quick span {
  font-size: var(--t-xs); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 13px; color: var(--ink-2); background: var(--surface);
}
.chat-foot { font-size: var(--t-xs); color: var(--ink-3); margin-top: 12px; }

/* ---------------------------------------------------------------- Chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 999px; padding: 8px 16px;
  font-size: var(--t-sm); color: var(--ink-2);
}
a.chip:hover { border-color: var(--forest); color: var(--forest); text-decoration: none; }
.chip b { color: var(--ink); font-weight: 600; }
.chip.on { background: var(--leaf-soft); border-color: var(--leaf); color: var(--forest); }

/* ---------------------------------------------------------------- Plan table */
.table-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow-x: auto;
}
.plans { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.plans th, .plans td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; }
.plans thead th { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--line-2); }
.plans th:first-child { width: 48%; }
.plans td.yes { color: var(--ok); font-weight: 700; }
.plans td.no  { color: var(--ink-3); }
.plans tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- Pricing */
.pricing { background: var(--forest); color: #fff; padding: 88px 0; }
[data-theme="dark"] .pricing { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pricing h2, .pricing h3 { color: #fff; }
[data-theme="dark"] .pricing h2, [data-theme="dark"] .pricing h3 { color: var(--ink); }
.pricing-grid { display: grid; grid-template-columns: 1fr 410px; gap: 60px; align-items: start; }
.pricing-lede { color: rgba(255,255,255,.78); margin: 14px 0 30px; max-width: 46ch; }
[data-theme="dark"] .pricing-lede { color: var(--ink-2); }

.benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 24px; list-style: none; padding: 0; margin: 0; }
.benefits li { font-size: var(--t-sm); color: rgba(255,255,255,.88); display: flex; gap: 10px; }
.benefits li::before { content: '✓'; color: #7BD9A5; font-weight: 700; flex: none; }
[data-theme="dark"] .benefits li { color: var(--ink-2); }

.price-card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px;
  box-shadow: var(--shadow-lg);
}
.price-amount { display: flex; align-items: baseline; gap: 7px; }
.price-amount .num {
  font-size: var(--t-5xl); font-weight: 800; letter-spacing: -.045em; line-height: .9;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.price-amount .per { font-size: var(--t-md); color: var(--ink-2); font-weight: 600; }
.price-tax {
  display: inline-block; margin-top: 14px;
  background: var(--grain-soft); color: var(--grain);
  border: 1px solid color-mix(in srgb, var(--grain) 34%, transparent);
  padding: 5px 12px; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 700;
}
.price-offer { margin: 20px 0 24px; font-size: var(--t-sm); color: var(--ink-2); }
.price-card .btn { margin-bottom: 14px; }
.price-fine { font-size: var(--t-xs); color: var(--ink-3); }

.operators { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.operators h4 { font-size: var(--t-xs); color: var(--ink-3); font-weight: 700; margin: 0 0 11px; }
.op-row { display: flex; justify-content: space-between; gap: 14px; font-size: var(--t-sm); padding: 6px 0; }
.op-row b { font-weight: 600; }
.op-row code { color: var(--ink-2); font-family: inherit; }

.ribbon { display: flex; flex-wrap: wrap; gap: 10px; }
.ribbon-step {
  flex: 1 1 152px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-sm); padding: 14px 16px;
}
[data-theme="dark"] .ribbon-step { background: var(--surface); border-color: var(--line); }
.ribbon-step b { display: block; font-size: var(--t-sm); margin-bottom: 3px; color: #fff; }
.ribbon-step span { font-size: var(--t-xs); color: rgba(255,255,255,.7); }
[data-theme="dark"] .ribbon-step b { color: var(--ink); }
[data-theme="dark"] .ribbon-step span { color: var(--ink-3); }

/* ---------------------------------------------------------------- Honesty */
.honesty {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.honesty h3 { font-size: var(--t-md); margin-bottom: 8px; }
.honesty p { font-size: var(--t-sm); color: var(--ink-2); }
.tag {
  display: inline-block; margin-bottom: 12px;
  font-size: var(--t-xs); font-weight: 700;
  padding: 4px 11px; border-radius: 6px;
}
.tag-ai   { background: var(--leaf-soft); color: var(--forest); }
.tag-soon { background: var(--grain-soft); color: var(--grain); }

/* ---------------------------------------------------------------- FAQ */
.faq { max-width: 80ch; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  padding: 17px 20px; font-weight: 600; font-size: var(--t-sm);
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--ink-3); font-weight: 400; font-size: 1.35rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .answer { padding: 16px 20px 19px; font-size: var(--t-sm); color: var(--ink-2); }

/* ---------------------------------------------------------------- Footer */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 100px; background: var(--surface); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.footer-col h4 { font-size: var(--t-sm); margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { font-size: var(--t-sm); color: var(--ink-2); padding: 4px 0; }
.footer-legal {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--ink-3); max-width: 82ch;
}

/* ---------------------------------------------------------------- Mobile CTA */
.mobile-cta {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  gap: 12px; align-items: center;
  box-shadow: 0 -4px 22px rgba(0,0,0,.1);
}
.mobile-cta .mc-price { font-size: var(--t-sm); font-weight: 700; color: var(--forest); line-height: 1.3; }
.mobile-cta .mc-price small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11px; }
.mobile-cta .btn { margin-left: auto; }

/* ---------------------------------------------------------------- Auth shell */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 36px;
  box-shadow: var(--shadow);
}
.auth-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-top .theme-toggle { margin-left: auto; }

/* ---------------------------------------------------------------- Forms */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: var(--t-sm); font-weight: 600; margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--t-md); font-family: inherit;
  background: var(--surface); color: var(--ink);
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--forest); box-shadow: var(--ring); outline: none;
}
.field input[disabled] { background: var(--surface-2); color: var(--ink-3); }
.field .hint { font-size: var(--t-xs); color: var(--ink-3); margin-top: 7px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

.alert { padding: 13px 16px; border-radius: var(--r-sm); font-size: var(--t-sm); margin-bottom: 20px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); }
.alert-ok    { background: var(--leaf-soft); color: var(--forest); border: 1px solid color-mix(in srgb, var(--leaf) 30%, transparent); }

/* ---------------------------------------------------------------- App shell */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--forest); color: #fff; padding: 11px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

.app-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.app-bar .brand { font-size: 1.0625rem; }
.app-bar .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.app-bar .brand-mark svg { width: 17px; height: 17px; }
.app-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--forest); text-decoration: none; }
.nav-toggle { display: none; }

/* Unsubscribe — deliberately loud/red so it reads as a serious, distinct
   action next to the quiet icon buttons around it. */
.btn-unsub-header {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1.5px solid var(--danger); background: var(--danger-soft);
  color: var(--danger); font-size: 0.83rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.btn-unsub-header:hover {
  background: var(--danger); color: #fff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--danger) 45%, transparent);
}
.btn-unsub-header span { font-size: 0.95rem; line-height: 1; }

.unsub-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(20, 20, 20, .55);
  align-items: center; justify-content: center; padding: 16px;
}
.unsub-modal-overlay.active { display: flex; }
.unsub-modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; max-width: 380px; width: 100%;
  padding: 28px 24px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: unsubPopIn .18s ease;
}
@keyframes unsubPopIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.unsub-modal-icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--danger-soft); border: 2px solid var(--danger);
  display: grid; place-items: center; font-size: 26px;
}
.unsub-modal h3 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.unsub-modal p { margin: 0 0 20px; font-size: 0.88rem; color: var(--ink-2); line-height: 1.6; }
.unsub-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-unsub-confirm {
  background: var(--danger); color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 0.92rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.btn-unsub-confirm:hover { opacity: .88; }
.btn-unsub-cancel {
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.btn-unsub-cancel:hover { border-color: var(--line-2); color: var(--ink); }

.dot-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.ent-pill {
  font-size: var(--t-xs); font-weight: 700;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.ent-pill.ok  { background: var(--leaf-soft); color: var(--forest); border: 1px solid color-mix(in srgb, var(--leaf) 30%, transparent); }
.ent-pill.off { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); }

.app-shell { display: grid; grid-template-columns: 254px 1fr; align-items: start; }

.sidebar {
  position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 14px 28px;
}
.nav-group {
  font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  margin: 20px 11px 7px; letter-spacing: .015em;
}
.nav-group:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-2);
}
.nav-item:hover { background: var(--surface-2); color: var(--forest); text-decoration: none; }
.nav-item.active { background: var(--leaf-soft); color: var(--forest); font-weight: 700; }
.nav-item svg { flex: none; }
.sidebar-foot { margin-top: 22px; padding: 14px 11px 0; border-top: 1px solid var(--line); }

.app-main { padding: 30px 30px 100px; min-width: 0; max-width: 1160px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { display: flex; align-items: center; gap: 11px; font-size: var(--t-xl); margin-bottom: 6px; }
.page-head h1 svg { color: var(--forest); }

/* ---------------------------------------------------------------- Panels */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); margin-bottom: 20px;
}
.panel-head {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: var(--t-md); }
.panel-head .btn { margin-left: auto; flex: none; }
.panel-body { padding: 22px; }
.panel-body > :last-child { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.empty { text-align: center; padding: 34px 20px; }
.empty p { color: var(--ink-2); margin-bottom: 18px; font-size: var(--t-sm); }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat dt { font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 6px; }
.stat dd { margin: 0; font-size: 1.625rem; font-weight: 700; letter-spacing: -.03em; }
.stat.ok dd { color: var(--ok); }
.stat.warn dd { color: var(--warn); }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-block; font-size: var(--t-xs); font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.badge-ok      { background: var(--leaf-soft); color: var(--forest); }
.badge-warn    { background: var(--grain-soft); color: var(--grain); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }

/* ---------------------------------------------------------------- Tables */
.dtable { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.dtable th, .dtable td { padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--line); }
.dtable thead th { font-weight: 700; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: var(--surface-2); }
.dtable .actions { text-align: right; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

.ai-stamp-block {
  margin-top: 16px; padding: 12px 14px;
  background: var(--grain-soft); border: 1px solid color-mix(in srgb, var(--grain) 26%, transparent);
  border-radius: var(--r-sm);
  font-size: var(--t-xs); color: var(--grain); line-height: 1.7;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: var(--t-xs); color: var(--ink-3); flex: none; width: 98px; }

.stage-track { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-track span {
  font-size: var(--t-xs); padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-3);
}
.stage-track span.done    { background: var(--leaf-soft); border-color: color-mix(in srgb, var(--leaf) 30%, transparent); color: var(--forest); }
.stage-track span.current { background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 700; }
[data-theme="dark"] .stage-track span.current { color: #06130C; }

.bottom-nav { display: none; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1040px) {
  .hero-grid, .pricing-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero h1 { max-width: 20ch; }
}

@media (max-width: 960px) {
  :root { --t-4xl: 2.6rem; --t-3xl: 2.1rem; --t-2xl: 1.7rem; --t-5xl: 3.4rem; }
  .app-shell { grid-template-columns: 1fr; }
  .nav-toggle { display: grid; }
  .sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0; width: 268px; z-index: 70;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .app-main { padding: 22px 18px 96px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .flip-grid, .problem-grid, .honesty { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; gap: 30px 22px; }
  .flow-step::after { display: none; }
  .flow-step { padding-right: 0; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 65;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px; font-size: 11px; color: var(--ink-3); font-weight: 500;
  }
  .bottom-nav a.active { color: var(--forest); }
  .bottom-nav a:hover { text-decoration: none; }
}

@media (max-width: 640px) {
  :root { --t-4xl: 2.1rem; --t-3xl: 1.8rem; --t-2xl: 1.5rem; --t-5xl: 2.9rem; --t-lg: 1.0625rem; }
  .wrap { padding: 0 18px; }
  .hero { padding: 48px 0 44px; }
  .section { padding: 56px 0; }
  .pricing { padding: 56px 0; }
  .flip-grid, .problem-grid, .honesty, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; gap: 26px; }
  .benefits { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .header-cta .btn-ghost { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .mobile-cta { display: flex; }
  .site-footer { padding-bottom: 120px; }
  .strip-note { margin-left: 0; flex-basis: 100%; }
  .ent-pill { display: none; }
  .page-head h1 { font-size: 1.3rem; }
  .panel-head { flex-wrap: wrap; }
  .panel-head .btn { margin-left: 0; }
  .auth-card { padding: 26px 22px; }
  .flip-card, .flip-inner { min-height: 218px; }
}
