/* ══════════════════════════════════════════════════════════
   Herbalytics — Design System
   ══════════════════════════════════════════════════════════ */

:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  --teal-400:  #2dd4bf;
  --teal-500:  #14b8a6;
  --teal-600:  #0d9488;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --red-400:   #f87171;
  --red-500:   #ef4444;
  --blue-500:  #3b82f6;
  --purple-500:#a855f7;

  --primary:   var(--green-600);
  --primary-light: var(--green-500);
  --primary-dark:  var(--green-800);
  --accent:    var(--teal-500);

  --bg:        #0f1a14;
  --bg-card:   #16211a;
  --bg-card2:  #1c2b22;
  --bg-input:  #1a2a20;
  --border:    #2a3d30;
  --border-light: #3a5040;

  --text-1:    #e8f5ec;
  --text-2:    #9bb89e;
  --text-3:    #6a8d6e;

  --sidebar-w: 240px;
  --topbar-h:  64px;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
}

:root[data-theme="light"] {
  --primary:   #2f855a;
  --primary-light: #2f9e67;
  --primary-dark:  #276749;
  --accent:    #0f766e;

  --bg:        #f5f8f7;
  --bg-card:   #ffffff;
  --bg-card2:  #eef4f1;
  --bg-input:  #ffffff;
  --border:    #d7e3dd;
  --border-light: #c6d7cf;

  --text-1:    #1f3a2d;
  --text-2:    #476657;
  --text-3:    #70897d;

  --shadow-sm: 0 1px 3px rgba(15, 33, 24, .12);
  --shadow:    0 4px 16px rgba(15, 33, 24, .14);
  --shadow-lg: 0 8px 32px rgba(15, 33, 24, .18);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  height: 100vh;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; }

/* ══════════════════════════════════════════════════════════
   LANDING PAGE — LIGHT THEME
   ══════════════════════════════════════════════════════════ */
.marketing-site {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at top left, rgba(74, 222, 128, 0.18), transparent 35%),
    radial-gradient(ellipse at 90% 15%, rgba(45, 212, 191, 0.12), transparent 30%),
    radial-gradient(ellipse at 50% 80%, rgba(22, 163, 74, 0.07), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f0fdf4 35%, #e8f5ee 100%);
  z-index: 10;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(22, 101, 52, 0.10);
  box-shadow: 0 1px 12px rgba(15, 42, 26, 0.06);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.landing-brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #15803d;
}

.landing-brand-subtitle {
  color: #476657;
  font-size: .78rem;
  line-height: 1.35;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #476657;
  font-size: .92rem;
  font-weight: 500;
}

.landing-nav a:hover { color: #0f2a1a; }

.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-main {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
  gap: 36px;
  align-items: center;
  min-height: calc(100vh - 130px);
  padding: 30px 0 38px;
}

.landing-kicker,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #15803d;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.landing-kicker::before,
.section-eyebrow::before {
  content: '';
  width: 30px;
  height: 2px;
  background: #16a34a;
  border-radius: 2px;
}

.landing-hero-copy h1 {
  margin-top: 18px;
  max-width: 11ch;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -0.04em;
  color: #0f2a1a;
}

.landing-lead {
  margin-top: 22px;
  max-width: 720px;
  color: #334155;
  font-size: 1.08rem;
  line-height: 1.75;
}

.landing-hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.landing-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.landing-proof-item,
.community-point {
  padding: 18px 20px;
  border: 1px solid rgba(22, 101, 52, 0.18);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 42, 26, 0.08);
}

.landing-proof-item strong,
.community-point strong {
  display: block;
  font-size: .95rem;
  color: #0f2a1a;
}

.landing-proof-item span,
.community-point span {
  display: block;
  margin-top: 8px;
  color: #476657;
  font-size: .9rem;
  line-height: 1.6;
}

.landing-hero-visual {
  display: flex;
  justify-content: center;
}

.hero-visual-card,
.cta-panel,
.impact-quote {
  position: relative;
  border: 1px solid rgba(22, 101, 52, 0.16);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 8px 40px rgba(15, 42, 26, 0.10);
}

.hero-visual-card {
  width: 100%;
  padding: 24px;
}

.hero-visual-badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.28);
  font-size: .8rem;
  font-weight: 600;
}

.hero-visual-svg {
  width: 100%;
  height: auto;
  margin-top: 14px;
  display: block;
}

.hero-visual-caption {
  margin-top: 12px;
  color: #476657;
  line-height: 1.7;
  font-size: .9rem;
}

.landing-section,
.landing-band {
  padding: 56px 0;
}

.landing-band {
  margin: 10px 0 0;
}

.section-heading {
  max-width: 880px;
}

.section-heading h2 {
  margin-top: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #0f2a1a;
}

.section-heading p {
  margin-top: 18px;
  color: #476657;
  font-size: 1rem;
  line-height: 1.8;
}

.mission-grid,
.feature-grid,
.impact-grid {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.mission-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.impact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mission-card,
.feature-card,
.impact-column {
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(22, 101, 52, 0.15);
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 42, 26, 0.07);
  transition: transform .2s, box-shadow .2s;
}

.mission-card:hover,
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(15, 42, 26, 0.13);
  border-color: rgba(22, 163, 74, 0.35);
}

.mission-card h3,
.feature-card h3,
.impact-column h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.18rem;
  line-height: 1.25;
  color: #0f2a1a;
}

.mission-card p,
.feature-card p,
.impact-column p,
.community-story p {
  margin-top: 14px;
  color: #476657;
  line-height: 1.8;
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  border: 1px solid rgba(22, 163, 74, 0.25);
  font-size: 1.45rem;
  margin-bottom: 16px;
}

.section-contrast {
  background: linear-gradient(180deg, #f0fdf4 0%, #e8f5ee 100%);
  border-radius: 32px;
  padding-left: 48px !important;
  padding-right: 48px !important;
  margin: 0 -24px;
}

.section-contrast .impact-column {
  background: #ffffff;
}

.impact-quote {
  margin-top: 28px;
  padding: 32px 36px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
  border-color: rgba(22, 163, 74, 0.28) !important;
}

.impact-quote p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.55;
  color: #166534;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 24px;
  margin-top: 28px;
}

.community-story,
.community-points {
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(22, 101, 52, 0.15);
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 42, 26, 0.07);
}

.community-points {
  display: grid;
  gap: 14px;
}

.section-cta {
  padding-bottom: 20px;
}

.cta-panel {
  padding: 52px 52px;
  overflow: hidden;
  background: linear-gradient(135deg, #0a2116 0%, #14532d 50%, #166534 100%) !important;
  border-color: #166534 !important;
  box-shadow: 0 16px 56px rgba(10, 33, 22, 0.28) !important;
}

.cta-panel .section-eyebrow { color: #86efac; }
.cta-panel .section-eyebrow::before { background: #86efac; }
.cta-panel .section-heading h2 { color: #ffffff; }
.cta-panel .section-heading p { color: #bbf7d0; }
.cta-panel .btn-primary {
  background: #4ade80;
  color: #052e16;
  font-weight: 600;
}
.cta-panel .btn-primary:hover { background: #86efac; }
.cta-panel .btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-color: rgba(255,255,255,0.30);
}
.cta-panel .btn-secondary:hover { background: rgba(255,255,255,0.20); }

.cta-panel::before {
  content: '';
  position: absolute;
  inset: auto -10% -45% auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.18), transparent 65%);
  pointer-events: none;
}

.landing-footer {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 48px;
  border-top: 1px solid rgba(22, 101, 52, 0.14);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  gap: 24px;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand p {
  margin-top: 6px;
  color: #476657;
  line-height: 1.6;
  font-size: .9rem;
}

.footer-links,
.footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.footer-links {
  color: #476657;
  font-size: .92rem;
}

.footer-links a:hover { color: #15803d; }

/* Landing page header button overrides */
.marketing-site .btn-ghost {
  color: #476657;
  border: 1px solid rgba(22, 101, 52, 0.22);
}
.marketing-site .btn-ghost:hover {
  background: rgba(22, 101, 52, 0.06);
  color: #15803d;
}
.marketing-site .btn-secondary {
  background: #ffffff;
  color: #15803d;
  border: 1.5px solid #15803d;
}
.marketing-site .btn-secondary:hover { background: #f0fdf4; }
.marketing-site .btn-primary {
  background: #16a34a;
  padding: 9px 20px;
  font-size: .92rem;
}
.marketing-site .btn-primary:hover { background: #15803d; }

/* ── Capabilities Strip ────────────────────────────────── */
.landing-caps-strip {
  background: linear-gradient(135deg, #0f2a1a 0%, #166534 100%);
  border-radius: 24px;
  padding: 28px 36px;
  margin: -8px 0 48px;
}

.caps-strip-inner {
  display: flex;
  align-items: center;
  gap: 0;
}

.cap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 4px 20px;
}

.cap-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cap-label {
  color: #bbf7d0;
  font-size: .88rem;
  line-height: 1.45;
}

.cap-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.14);
  flex-shrink: 0;
}

/* ── How It Works ──────────────────────────────────────── */
.how-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0;
  align-items: start;
  margin-top: 40px;
}

.how-step {
  background: #ffffff;
  border: 1px solid rgba(22, 101, 52, 0.15);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(15, 42, 26, 0.07);
  transition: transform .2s, box-shadow .2s;
}
.how-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(15, 42, 26, 0.13);
}

.how-step-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #dcfce7;
  line-height: 1;
  margin-bottom: 16px;
}

.how-step h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  color: #0f2a1a;
  line-height: 1.3;
  margin-bottom: 12px;
}

.how-step p {
  color: #476657;
  line-height: 1.75;
  font-size: .95rem;
}

.how-step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  padding-top: 60px;
  color: #86efac;
  font-size: 1.8rem;
  font-weight: 300;
  flex-shrink: 0;
}

/* ── Who It's For ──────────────────────────────────────── */
.who-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
}

.who-card {
  background: #ffffff;
  border: 1px solid rgba(22, 101, 52, 0.15);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 2px 10px rgba(15, 42, 26, 0.07);
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.who-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(15, 42, 26, 0.13);
  border-color: rgba(22, 163, 74, 0.40);
}

.who-card-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  display: block;
}

.who-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f2a1a;
  margin-bottom: 10px;
}

.who-card p {
  color: #476657;
  font-size: .88rem;
  line-height: 1.7;
}

/* ── Vision Banner ─────────────────────────────────────── */
.vision-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #d1fae5 100%);
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 32px;
  padding: 56px 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  box-shadow: 0 4px 24px rgba(15, 42, 26, 0.08);
}

.vision-banner-text h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #0f2a1a;
  margin-bottom: 18px;
}

.vision-banner-text p {
  color: #334155;
  line-height: 1.8;
  font-size: 1.02rem;
  max-width: 640px;
}

.vision-banner-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.vision-join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: #16a34a;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
}
.vision-join-btn:hover {
  background: #15803d;
  box-shadow: 0 6px 24px rgba(22, 163, 74, 0.45);
  transform: translateY(-2px);
}

.vision-note {
  color: #476657;
  font-size: .82rem;
  text-align: center;
}

/* ── Responsive landing ────────────────────────────────── */
@media (max-width: 1024px) {
  .caps-strip-inner { flex-wrap: wrap; gap: 16px; }
  .cap-item { flex: 0 0 calc(50% - 8px); padding: 4px 8px; }
  .cap-divider { display: none; }
  .who-grid { grid-template-columns: repeat(2, 1fr); }
  .vision-banner { grid-template-columns: 1fr; gap: 32px; }
  .vision-banner-action { flex-direction: row; }
  .how-steps { grid-template-columns: 1fr; gap: 0; }
  .how-step-arrow { transform: rotate(90deg); padding: 12px 0; height: 44px; }
}

@media (max-width: 768px) {
  .landing-header { padding: 14px 20px; }
  .landing-nav { display: none; }
  .landing-caps-strip { padding: 20px 18px; border-radius: 16px; }
  .caps-strip-inner { flex-direction: column; gap: 14px; }
  .cap-item { flex: unset; width: 100%; padding: 0 4px; }
  .mission-grid, .feature-grid, .impact-grid { grid-template-columns: 1fr; }
  .community-layout { grid-template-columns: 1fr; }
  .landing-hero { grid-template-columns: 1fr; min-height: unset; }
  .landing-hero-visual { display: none; }
  .landing-proof { grid-template-columns: 1fr; }
  .who-grid { grid-template-columns: 1fr; }
  .cta-panel { padding: 32px 24px; }
  .section-contrast { border-radius: 20px; padding-left: 24px !important; padding-right: 24px !important; }
  .vision-banner { padding: 32px 24px; border-radius: 20px; }
  .vision-banner-action { flex-direction: column; }
  .landing-footer { grid-template-columns: 1fr; }
  .footer-links, .footer-cta { display: none; }
}

/* ── Utility ───────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.full-width { width: 100%; }
.text-sm { font-size: .8rem; }
.text-xs { font-size: .7rem; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green-400); }
.font-mono { font-family: 'Space Grotesk', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   AUTH OVERLAY
   ══════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 30% 40%, #0d2218 0%, #060d09 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  overflow-y: auto; padding: 24px;
}

.auth-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-1);
  cursor: pointer;
  font-size: 1.2rem;
}

.auth-close:hover {
  background: var(--bg-input);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon { font-size: 2.8rem; }
.auth-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem; font-weight: 700;
  color: var(--green-400);
  margin: 4px 0 6px;
}
.auth-logo p { color: var(--text-2); font-size: .85rem; }

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 4px; margin-bottom: 24px;
}
.tab-btn {
  flex: 1; padding: 9px;
  background: transparent;
  border: none; cursor: pointer;
  color: var(--text-2); border-radius: var(--radius-sm);
  font-weight: 500; transition: all .2s;
}
.tab-btn.active {
  background: var(--primary);
  color: white;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-hint {
  text-align: center; font-size: .75rem;
  color: var(--text-3); margin-top: -4px;
}

/* ══════════════════════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden; transition: width .25s;
}

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 1.4rem; flex-shrink: 0; }
.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 1.1rem;
  color: var(--green-400); white-space: nowrap;
}
.sidebar-toggle {
  display: none;
  margin-left: auto; background: none; border: none;
  color: var(--text-3); cursor: pointer; font-size: 1.2rem;
  padding: 4px;
}
@media (max-width: 700px) {
  .sidebar-toggle { display: block; }
}

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 10px;
  scrollbar-width: thin;
}
.nav-section-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
  padding: 12px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.nav-item:hover { background: var(--bg-card2); color: var(--text-1); }
.nav-item.active { background: var(--green-900); color: var(--green-400); font-weight: 500; }
.nav-icon { font-size: 1rem; flex-shrink: 0; }
.nav-label { font-size: .875rem; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 14px 14px;
  display: flex; align-items: center; gap: 8px;
}
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: var(--text-3); }
.logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 1.25rem; padding: 8px;
  border-radius: var(--radius-sm); transition: all .15s;
}
.logout-btn:hover { background: var(--bg-card2); color: var(--red-400); }

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
}

.top-bar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  background: var(--bg-card); flex-shrink: 0;
}
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem; font-weight: 600;
  white-space: nowrap;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  min-width: 102px;
}
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 14px;
  min-width: 280px;
}
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text-1); font-size: .875rem; width: 100%;
}
.search-bar input::placeholder { color: var(--text-3); }

.page-content {
  flex: 1; overflow-y: auto;
  padding: 24px; scrollbar-width: thin;
}

/* ══════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════ */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .95rem; font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-size: .875rem; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: white;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary {
  background: var(--bg-card2); color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); background: var(--bg-input); }
.btn-accent {
  background: var(--accent); color: white;
}
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-card2); color: var(--text-1); }
.btn-danger { background: var(--red-500); color: white; }
.btn-sm { padding: 5px 11px; font-size: .8rem; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 1.25rem; transition: all .15s;
}
.btn-icon:hover { background: var(--bg-card2); color: var(--text-1); }

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1); padding: 8px 12px;
  font-size: .875rem; width: 100%;
  transition: border-color .15s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}
select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 80px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .02em;
}
.badge-green  { background: var(--green-900); color: var(--green-400); }
.badge-teal   { background: #0a2020; color: var(--teal-400); }
.badge-amber  { background: #2a1a00; color: var(--amber-400); }
.badge-red    { background: #2a0a0a; color: var(--red-400); }
.badge-blue   { background: #0a1a2a; color: #60a5fa; }
.badge-purple { background: #1a0a2a; color: #c084fc; }
.badge-gray   { background: var(--bg-card2); color: var(--text-2); }
.badge-orange { background: #2a1500; color: #fb923c; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align:left; padding:9px 12px; font-size:.75rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--text-3); border-bottom:1px solid var(--border); }
.data-table td { padding:10px 12px; font-size:.85rem; border-bottom:1px solid var(--border); vertical-align:top; }
.data-table tbody tr:hover { background: var(--bg-card2); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  text-align: left; padding: 10px 14px;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3);
}
td { padding: 11px 14px; font-size: .875rem; border-bottom: 1px solid var(--border); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--bg-card2); }
tbody tr:last-child td { border-bottom: none; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: .75rem; color: var(--text-3); font-weight: 500; }
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700; line-height: 1;
}
.stat-sub { font-size: .78rem; color: var(--text-2); }

/* Plant / Study cards */
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer; transition: all .15s;
}
.item-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.item-card-title {
  font-weight: 600; font-size: .95rem; margin-bottom: 4px;
}
.item-card-sub {
  font-size: .78rem; color: var(--text-2);
  font-style: italic; margin-bottom: 10px;
}
.item-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

/* Pipeline steps */
.pipeline-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
  background: var(--bg-card2);
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.step-num.done { background: var(--green-800); border-color: var(--green-600); color: var(--green-400); }
.step-num.running { background: #1a2a10; border-color: var(--amber-500); color: var(--amber-400); }
.step-num.failed { background: #2a0a0a; border-color: var(--red-400); color: var(--red-400); }
.step-info { flex: 1; }
.step-name { font-size: .875rem; font-weight: 500; }
.step-desc { font-size: .75rem; color: var(--text-3); margin-top: 2px; }

/* Evidence bar */
.evidence-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.evidence-level {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.level-A { background: var(--green-800); color: var(--green-400); }
.level-B { background: #1a2a10; color: var(--teal-400); }
.level-C { background: #2a2210; color: var(--amber-400); }
.level-D { background: #2a1a00; color: #fb923c; }

/* Severity indicator */
.severity-bar { display: flex; gap: 3px; align-items: center; }
.severity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.severity-dot.filled-green  { background: var(--green-500); }
.severity-dot.filled-amber  { background: var(--amber-400); }
.severity-dot.filled-red    { background: var(--red-400); }

/* Interaction severity */
.sev-mild         { color: var(--green-400); }
.sev-moderate     { color: var(--amber-400); }
.sev-severe       { color: var(--red-400); }
.sev-contraindicated { color: #ff3b3b; font-weight: 700; }

/* Form errors */
.form-error {
  background: #2a0a0a; border: 1px solid var(--red-500);
  color: var(--red-400); padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: .82rem;
}

/* Section headers */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem; font-weight: 600;
}

/* Filter bar */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  width: auto; min-width: 160px;
}

/* Catalog modal search row */
.catalog-search-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.catalog-search-controls input {
  flex: 1 1 320px;
  min-width: 240px;
  width: auto;
}
.catalog-search-controls select {
  flex: 0 0 190px;
  min-width: 190px;
  width: 190px;
}

/* Detail view */
.detail-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 24px;
}
.detail-icon {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: var(--green-900); border: 1px solid var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
}
.detail-meta { flex: 1; }
.detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem; font-weight: 700; margin-bottom: 4px;
}
.detail-subtitle { color: var(--text-2); font-style: italic; }
.collab-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.collab-main { min-width: 0; }
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.toggle-switch:hover {
  border-color: var(--border-light);
  background: var(--bg-card2);
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-slider {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background .18s ease;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(16px);
}
.toggle-switch:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, white);
  outline-offset: 2px;
}
.member-search-result {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.member-search-result:hover {
  background: var(--bg-card);
  border-color: var(--border);
}
.member-search-result.active {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .15);
}

/* Tabs inside pages */
.inner-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.inner-tab {
  padding: 8px 16px; background: none; border: none;
  color: var(--text-2); cursor: pointer; font-size: .875rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .15s;
}
.inner-tab.active {
  color: var(--primary-light); border-bottom-color: var(--primary-light);
  font-weight: 500;
}
.inner-tab-content.hidden { display: none; }

/* Empty state */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-3);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-title { font-size: 1rem; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: .85rem; }

/* Loading */
.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 48px; color: var(--text-2);
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}

/* ── Compound structure SVG ──────────────────────────────── */
#cmp-struct-wrap svg { display: block; max-width: 100%; height: auto; }

/* ── Zoom slider ─────────────────────────────────────────── */
input[type="range"].zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
input[type="range"].zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--primary-dark);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
input[type="range"].zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--primary-dark);
  cursor: pointer;
}
input[type="range"].zoom-slider::-webkit-slider-thumb:hover { background: var(--primary-light); transform: scale(1.2); }
input[type="range"].zoom-slider::-moz-range-thumb:hover    { background: var(--primary-light); }
input[type="range"].zoom-slider::-webkit-slider-runnable-track { border-radius: 99px; }
input[type="range"].zoom-slider::-moz-range-track    { height: 5px; border-radius: 99px; background: var(--border); }
input[type="range"].zoom-slider::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--primary); }

/* ══════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 600px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.modal-close {
  background: none; border: none; color: var(--text-3);
  font-size: 1.4rem; cursor: pointer; padding: 2px 6px;
  border-radius: var(--radius-sm); transition: all .15s;
}
.modal-close:hover { background: var(--bg-card2); color: var(--text-1); }
.modal-body {
  padding: 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-body .field-group { gap: 6px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 999;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px; font-size: .875rem;
  box-shadow: var(--shadow); min-width: 240px;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .2s ease;
}
.toast-success { border-left: 3px solid var(--green-500); }
.toast-error   { border-left: 3px solid var(--red-500); }
.toast-info    { border-left: 3px solid var(--blue-500); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ══════════════════════════════════════════════════════════
   DASHBOARD SPECIFIC
   ══════════════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-500); margin-top: 6px; flex-shrink: 0;
}
.activity-text { font-size: .85rem; color: var(--text-2); line-height: 1.5; }
.activity-time { font-size: .75rem; color: var(--text-3); white-space: nowrap; }

/* Quick actions */
.quick-actions {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.quick-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px; cursor: pointer;
  transition: all .15s; text-align: left;
  color: var(--text-1);
}
.quick-action:hover {
  border-color: var(--primary);
  background: var(--bg-card2);
}
.qa-icon { font-size: 1.5rem; margin-bottom: 8px; }
.qa-title { font-size: .875rem; font-weight: 600; }
.qa-desc { font-size: .75rem; color: var(--text-3); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════
   INTERACTION CHECKER
   ══════════════════════════════════════════════════════════ */
.interaction-result {
  border-left: 3px solid var(--border);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-card2); margin-bottom: 10px;
}
.interaction-result.mild          { border-left-color: var(--green-500); }
.interaction-result.moderate      { border-left-color: var(--amber-400); }
.interaction-result.severe        { border-left-color: var(--red-400); }
.interaction-result.contraindicated { border-left-color: #ff3b3b; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .landing-header {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .landing-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .landing-hero,
  .community-layout,
  .landing-footer {
    grid-template-columns: 1fr;
  }
  .mission-grid,
  .feature-grid,
  .impact-grid,
  .landing-proof {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 200; width: 240px;
    transform: translateX(-100%); transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); }
  /* Dim backdrop when sidebar open */
  .sidebar.open::after {
    content: '';
    position: fixed;
    inset: 0;
    left: 240px;
    background: rgba(0,0,0,.4);
    z-index: -1;
  }
  .main-content { grid-column: 1; width: 100%; min-width: 0; }
  .top-bar { padding: 0 14px; gap: 10px; }
  .search-bar { display: none; }
  .theme-toggle { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .catalog-search-controls select,
  .catalog-search-controls input {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  .marketing-site {
    position: fixed;
  }
  .landing-header {
    padding: 16px 18px;
  }
  .landing-main,
  .landing-footer {
    width: min(100% - 28px, 1240px);
  }
  .landing-nav {
    gap: 14px;
    font-size: .87rem;
  }
  .landing-header-actions {
    width: 100%;
    justify-content: stretch;
  }
  .landing-header-actions .btn {
    flex: 1;
  }
  .landing-hero {
    min-height: auto;
    padding-top: 8px;
    gap: 24px;
  }
  .landing-hero-copy h1 {
    max-width: none;
    font-size: clamp(2.3rem, 13vw, 3.8rem);
  }
  .mission-grid,
  .feature-grid,
  .impact-grid,
  .landing-proof {
    grid-template-columns: 1fr;
  }
  .cta-panel,
  .community-story,
  .community-points,
  .hero-visual-card {
    padding: 22px;
  }
  .footer-cta {
    justify-content: stretch;
  }
  .footer-cta .btn {
    flex: 1;
  }
  .auth-card {
    padding: 32px 22px 24px;
  }
}

/* ══════════════════════════════════════════════════════════
   VIRTUAL HERBAL GARDEN
   ══════════════════════════════════════════════════════════ */
.garden-tabs {
  display: flex; gap: 6px; padding: 0 0 18px 0; flex-wrap: wrap;
}
.garden-tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text-2);
  font-size: .85rem; font-weight: 500; cursor: pointer; transition: all .18s;
}
.garden-tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.garden-tab-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; box-shadow: 0 2px 8px rgba(var(--primary-rgb, 45,149,150),.25);
}
.garden-panel { display: none; }
.garden-panel.active { display: block; }

/* Network Graph */
#garden-cy {
  width: 100%; height: 600px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-card2);
}
.garden-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 10px 0; font-size: .8rem; color: var(--text-2);
}
.garden-legend-item {
  display: flex; align-items: center; gap: 6px;
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.legend-line {
  width: 24px; height: 3px; border-radius: 2px; flex-shrink: 0;
}

/* Taxonomy Tree */
#garden-tree-svg { width: 100%; overflow: visible; }

.garden-tree-card { position: relative; }

.garden-tree-resizable {
  position: relative;
  height: 620px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.garden-tree-wrap {
  width: 100%; flex: 1; min-height: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-card2);
  overflow: hidden; position: relative;
}
.garden-tree-wrap svg text { font-family: inherit; fill: var(--text-1); }

/* Fullscreen mode */
.garden-tree-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1500 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 16px 18px 0 !important;
  display: flex;
  flex-direction: column;
}
.garden-tree-fullscreen .garden-tree-resizable {
  flex: 1;
  height: auto !important;
}
.garden-tree-fullscreen .garden-tree-wrap {
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
}
.garden-tree-fullscreen .garden-map-resize-handle { display: none; }

/* Map */
.garden-map-card { position: relative; }

.garden-map-resizable {
  position: relative;
  height: 580px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

#garden-map {
  width: 100%;
  flex: 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  z-index: 0;
  min-height: 0;
}

.garden-map-resize-handle {
  flex-shrink: 0;
  height: 10px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.garden-map-resize-handle::before {
  content: '';
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background .15s;
}
.garden-map-resize-handle:hover::before { background: var(--primary); }

/* Fullscreen mode */
.garden-map-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1500 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 16px 18px 0 !important;
  display: flex;
  flex-direction: column;
}
.garden-map-fullscreen .garden-map-resizable {
  flex: 1;
  height: auto !important;
}
.garden-map-fullscreen #garden-map {
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
}
.garden-map-fullscreen .garden-map-resize-handle { display: none; }

/* Molecular Garden */
.mol-garden-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.mol-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-card); overflow: hidden; cursor: pointer;
  transition: all .18s;
}
.mol-card:hover {
  border-color: var(--primary); box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: translateY(-2px);
}
.mol-card-svg {
  width: 100%; height: 150px; background: var(--bg-card2);
  display: flex; align-items: center; justify-content: center;
}
.mol-card-svg svg { width: 100%; height: 100%; }
.mol-card-info {
  padding: 10px 12px;
}
.mol-card-name { font-size: .82rem; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.mol-card-plant { font-size: .75rem; color: var(--text-3); }
.mol-card-class { font-size: .72rem; margin-top: 4px; }

/* Node tooltip */
.garden-tooltip {
  position: fixed; pointer-events: none; z-index: 9999;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  font-size: .8rem; color: var(--text-1); box-shadow: 0 4px 16px rgba(0,0,0,.18);
  max-width: 240px; display: none;
}
.garden-tooltip.visible { display: block; }

/* Map plant name labels */
.garden-map-label {
  background: rgba(0,0,0,0.65) !important;
  border: none !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: .72rem !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}
.garden-map-label::before { display: none !important; }

/* ══════════════════════════════════════════════════════════
   PLANT IMAGE UPLOAD
   ══════════════════════════════════════════════════════════ */
.plant-img-picker {
  width: 100%;
  min-height: 140px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s;
  position: relative;
}
.plant-img-picker:hover,
.plant-img-picker.drag-over {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--bg-card2));
}
.plant-img-placeholder {
  color: var(--text-3);
  font-size: .85rem;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}
.plant-img-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}
.plant-img-preview-existing {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* Plant detail image in modal header */
.plant-detail-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.plant-card-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: block;
}

/* ══════════════════════════════════════════════════════════
   PLANT DETAIL HERO IMAGE
   ══════════════════════════════════════════════════════════ */
.plant-detail-hero {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  cursor: pointer;
  position: relative;
}
.plant-detail-hero-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: var(--bg-card2);
  display: block;
  transition: transform .3s;
}
.plant-detail-hero:hover .plant-detail-hero-img { transform: scale(1.02); }
.plant-detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px 12px;
  font-size: .78rem;
  color: rgba(255,255,255,0);
  transition: all .2s;
  border-radius: var(--radius-lg);
}
.plant-detail-hero:hover .plant-detail-hero-overlay {
  background: rgba(0,0,0,.25);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
}
.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
  display: block;
}
.lightbox-caption {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  font-style: italic;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* Plant image picker tabs */
.plant-img-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.plant-img-tab {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.plant-img-tab:hover { border-color: var(--primary); color: var(--primary); }
.plant-img-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.plant-imgtab-panel { display: block; }
.plant-imgtab-panel.hidden { display: none; }

/* ══════════════════════════════════════════════════════════
   ACCOUNT SETTINGS / TOTP
   ══════════════════════════════════════════════════════════ */
.totp-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .9rem;
}
.totp-enabled  { background: color-mix(in srgb, var(--green-500) 12%, var(--bg-card2)); border: 1px solid var(--green-500); }
.totp-disabled { background: color-mix(in srgb, var(--amber-400) 12%, var(--bg-card2)); border: 1px solid var(--amber-400); }

.totp-setup-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 4px;
}
@media (max-width: 600px) { .totp-setup-grid { grid-template-columns: 1fr; } }

.totp-qr-box {
  background: #fff;
  padding: 10px;
  border-radius: var(--radius);
  display: inline-block;
  border: 1px solid var(--border);
}

.totp-secret-code {
  display: block;
  margin-top: 6px;
  font-family: monospace;
  font-size: .8rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  letter-spacing: .08em;
  word-break: break-all;
  color: var(--primary);
}

#settings-btn {
  opacity: 0.75;
}
#settings-btn:hover { opacity: 1; }

/* Account settings breathing room */
#acct-tabs { margin-bottom: 24px; }

#acct-tab-profile,
#acct-tab-password,
#acct-tab-totp {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#acct-tab-profile .field-row,
#acct-tab-password .field-row { gap: 14px; }

#acct-tab-profile .btn,
#acct-tab-password .btn,
#acct-tab-totp .btn { margin-top: 8px; align-self: flex-start; }

#acct-tab-totp p { margin: 0; line-height: 1.6; }

.totp-status { margin-bottom: 4px; }

.totp-setup-grid { margin-top: 8px; gap: 28px; }

/* Mobile top bar navigation buttons */
.mobile-nav-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-1);
  font-size: 1.5rem;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background .15s;
}
.mobile-nav-btn:hover { background: var(--bg-card2); }

@media (max-width: 700px) {
  .mobile-nav-btn { display: flex; }
}
