/* =====================================================
   CSS Custom Properties
   ===================================================== */
:root {
  color-scheme: light;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Color palette */
  --color-bg:           #ffffff;
  --color-bg-subtle:    #f8fafc;
  --color-bg-muted:     #f1f5f9;
  --color-surface:      var(--color-bg);
  --color-border:       #e2e8f0;
  --color-border-strong:#cbd5e1;

  --color-text:         #0f172a;
  --color-text-muted:   #64748b;
  --color-text-faint:   #94a3b8;

  --color-accent:       #6366f1;
  --color-accent-hover: #4f46e5;
  --color-accent-light: #eef2ff;
  --color-accent-contrast: #ffffff;

  --color-success:      #10b981;
  --color-success-bg:   #ecfdf5;

  --color-control-bg:       #0f172a;
  --color-control-bg-hover: #1e293b;
  --color-control-text:     #ffffff;

  /* Layout */
  --nav-height: 60px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  /* Charcoal navy rather than near-black: dark, but with visible layers. */
  --color-bg:           #172033;
  --color-bg-subtle:    #202b3f;
  --color-bg-muted:     #2a384e;
  --color-border:       #41516b;
  --color-border-strong:#5b6c86;

  --color-text:         #f4f7fb;
  --color-text-muted:   #d2dbe7;
  --color-text-faint:   #aab6c8;

  --color-accent:       #a5b4fc;
  --color-accent-hover: #c7d2fe;
  --color-accent-light: rgba(129, 140, 248, 0.16);
  --color-accent-contrast: #111827;

  --color-success:      #34d399;
  --color-success-bg:   rgba(16, 185, 129, 0.16);

  --color-control-bg:       #e2e8f0;
  --color-control-bg-hover: #ffffff;
  --color-control-text:     #0f172a;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.28);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.32), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.34), 0 2px 5px rgba(0,0,0,0.24);
  --shadow-lg: 0 16px 38px rgba(0,0,0,0.42), 0 5px 12px rgba(0,0,0,0.28);

  --bs-body-color: var(--color-text);
  --bs-body-bg: var(--color-bg);
  --bs-secondary-color: var(--color-text-muted);
  --bs-secondary-bg: var(--color-bg-muted);
  --bs-tertiary-color: var(--color-text-faint);
  --bs-tertiary-bg: var(--color-bg-subtle);
  --bs-border-color: var(--color-border);
  --bs-emphasis-color: #ffffff;
  --bs-link-color: var(--color-accent);
  --bs-link-hover-color: var(--color-accent-hover);
}

/* =====================================================
   Base Reset
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* =====================================================
   Navbar
   ===================================================== */
.navbar.bg-light {
  background-color: rgba(255,255,255,0.94) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
  height: var(--nav-height);
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-bg-muted);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}
.theme-toggle:focus-visible {
  outline: 3px solid var(--color-accent-light);
  outline-offset: 2px;
}
.theme-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-icon-moon { fill: currentColor; stroke: none; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: inline-block; }

html[data-theme="dark"] .navbar.bg-light {
  background-color: rgba(23,32,51,0.94) !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text) !important;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-link {
  color: var(--color-text-muted) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem !important;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-text) !important;
  background: var(--color-bg-muted);
}

.navbar .btn-outline-dark {
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border-color: var(--color-border-strong);
  color: var(--color-text);
  background: transparent;
  transition: all 0.15s ease;
}
.navbar .btn-outline-dark:hover {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
}

/* =====================================================
   Flash Alerts
   ===================================================== */
.small-alert {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  position: relative;
  border-width: 1px;
}
.small-alert .btn-close {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
}

/* =====================================================
   Hero Section (contentA)
   NOTE: the .contentA–.contentD section styles below are LEGACY for the
   homepage — home.html now uses its own .hx-* namespace (static/home.css).
   They are still load-bearing for login, tos, privacypolicy, extract,
   launch_deal and welcome. Prune only after those pages migrate.
   ===================================================== */
.contentA {
  background: linear-gradient(155deg, #f8fafc 0%, #eef2ff 55%, #f8fafc 100%);
  padding: 5rem 0 4rem;
}
.contentA .container-lg,
.contentA .container-lg.bg-light {
  background: transparent !important;
}
.contentA .card {
  background: transparent;
  border: none;
  box-shadow: none;
}
.contentA .card-title {
  font-size: clamp(1.9rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
}
.contentA .card-text {
  font-size: 1.15rem !important;
  color: var(--color-text-muted) !important;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* =====================================================
   Add to Chrome Button
   ===================================================== */
.add-chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1.6rem;
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}
.add-chrome-btn .btn-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.add-chrome-btn:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(99,102,241,0.12);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--color-text);
}
.add-chrome-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* =====================================================
   Features Section (contentB)
   ===================================================== */
.contentB {
  background: var(--color-bg);
  padding: 3rem 0;
}
.contentB .container-lg.bg-light,
.contentB .container-lg {
  background: transparent !important;
}
.contentB h2 {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text);
}
.contentB h3.fw-bold {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  color: var(--color-text);
}
.contentB .lead.text-muted {
  font-size: 1rem;
  color: var(--color-text-muted) !important;
  line-height: 1.7;
}

/* =====================================================
   Why / How It Works (contentC)
   ===================================================== */
.contentC {
  background: var(--color-bg-subtle);
  padding: 2rem 0;
}
.contentC .container-lg.bg-light,
.contentC .container-lg {
  background: transparent !important;
}
.contentC .card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  background: var(--color-bg);
}
.contentC h2 {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text);
}
.contentC h4.fw-bold {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.contentC .lead.text-muted {
  font-size: 0.975rem;
  color: var(--color-text-muted) !important;
  line-height: 1.7;
}

/* CTA buttons in contentC */
.contentC .btn-outline-dark {
  border-radius: var(--radius-full);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-color: var(--color-border-strong);
  color: var(--color-text);
  transition: all 0.15s;
}
.contentC .btn-outline-dark:hover {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
}
.contentC .btn-dark {
  border-radius: var(--radius-full);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
  transition: all 0.15s;
}
.contentC .btn-dark:hover {
  background: var(--color-control-bg-hover);
  border-color: var(--color-control-bg-hover);
  box-shadow: var(--shadow-sm);
}

/* From the Blog strip */
.container-lg .card.h-100.border-0.shadow-sm {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--color-bg);
  transition: box-shadow 0.2s, transform 0.2s;
}
.container-lg .card.h-100.border-0.shadow-sm:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}
.container-lg .card.h-100.border-0.shadow-sm a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9rem;
}
.container-lg .card.h-100.border-0.shadow-sm a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* =====================================================
   Social Proof Banner
   ===================================================== */
.social-proof {
  background: linear-gradient(180deg, #f8fafc 0%, var(--color-bg) 100%);
}
.sp-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.sp-title {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}
.badge-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-circle:hover {
  transform: scale(1.1);
}

/* =====================================================
   Testimonials Scroller
   ===================================================== */
.testimonial-row-wrapper {
  overflow: hidden;
  width: 100%;
  margin-bottom: 1.5rem;
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.testimonial-row {
  display: flex;
  gap: 1rem;
  animation: scroll-left 40s linear infinite;
}
.testimonial-row.reverse {
  animation: scroll-right 40s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes scroll-right {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}

.testimonial-card {
  flex: 0 0 230px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.testimonial-card .face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: 0.6rem;
  object-fit: cover;
  border: 2px solid var(--color-border);
}
.testimonial-card .quote {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.55;
  margin: 0 0 0.5rem;
}
.testimonial-card .meta {
  font-size: 0.775rem;
  color: var(--color-text-faint);
  font-weight: 500;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  box-shadow: var(--shadow-xs);
  color: var(--color-text);
}

/* =====================================================
   Pricing Section (contentD)
   ===================================================== */
.contentD,
.contentD.bg-light {
  background: var(--color-bg-subtle) !important;
}
.container-lg.bg-light.text-center.my-5 {
  background: transparent !important;
}
#pricing h2.fw-bold {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text);
}
#pricing .lead.text-muted {
  color: var(--color-text-muted) !important;
  font-size: 1.05rem;
}

/* Pricing cards */
.card.rounded-3.shadow-sm {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--color-bg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card.rounded-3.shadow-sm:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-3px);
}
.card.rounded-3.shadow-sm.border-dark {
  border: 1.5px solid var(--color-text) !important;
  box-shadow: var(--shadow-md) !important;
}
.card.rounded-3.shadow-sm.border-dark:hover {
  box-shadow: var(--shadow-lg) !important;
}

.card-header {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle) !important;
  color: var(--color-text) !important;
}
.card-header.py-3.text-white.bg-dark.border-dark {
  background: var(--color-control-bg) !important;
  color: var(--color-control-text) !important;
  border-bottom: none !important;
}

.pricing-card-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text);
  line-height: 1.1;
}

/* Pricing feature list — override the old bubble style */
ul.list-unstyled.mt-3.mb-4 {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
ul.list-unstyled.mt-3.mb-4 li {
  padding: 0.55rem 0;
  font-size: 0.9rem !important;
  line-height: 1.5;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
ul.list-unstyled.mt-3.mb-4 li:last-child { border-bottom: none; }
ul.list-unstyled.mt-3.mb-4 li::before { display: none; }
ul.list-unstyled.mt-3.mb-4.premium-plan-features li {
  color: var(--color-text);
  font-weight: 500;
}

/* Pricing toggle */
.btn-group .btn-outline-dark {
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-sm) !important;
  padding: 0.3rem 0.85rem;
  border-color: var(--color-border-strong);
  color: var(--color-text-muted);
  transition: all 0.15s;
}
.btn-group .btn-check:checked + .btn-outline-dark {
  background: var(--color-control-bg) !important;
  border-color: var(--color-control-bg) !important;
  color: var(--color-control-text) !important;
}

/* Subscribe / Get started CTA in pricing */
#pricing .btn.btn-lg.btn-dark,
#pricing .btn-lg.btn-dark {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.7rem 1.25rem;
  transition: all 0.15s ease;
}
#pricing .btn.btn-lg.btn-dark:hover,
#pricing .btn-lg.btn-dark:hover {
  background: var(--color-control-bg-hover);
  border-color: var(--color-control-bg-hover);
  color: var(--color-control-text);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* =====================================================
   Promo Highlight
   ===================================================== */
.promo-highlight {
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(99,102,241,0.03) 100%);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  box-shadow: 0 8px 24px rgba(99,102,241,0.1);
}
.promo-toggle-btn {
  background: var(--color-bg);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  color: #4338ca;
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
}
.promo-toggle-btn:hover,
.promo-toggle-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(99,102,241,0.16);
  border-color: rgba(99,102,241,0.35);
  color: #4338ca;
}
.promo-toggle-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.promo-toggle-headline { font-size: 1rem; letter-spacing: 0.06em; font-weight: 700; }
.promo-toggle-sub { font-size: 0.875rem; font-weight: 500; color: rgba(67,56,202,0.65); }
.promo-highlight .promo-top { gap: 0.75rem; }
.promo-highlight .promo-badge {
  font-size: 0.7rem; letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase;
  color: #4338ca; background: rgba(99,102,241,0.12); border-radius: var(--radius-full);
  padding: 0.25rem 0.7rem;
}
.promo-highlight .promo-percent { font-size: 0.85rem; font-weight: 600; color: rgba(67,56,202,0.7); }
.promo-highlight .promo-price-row { gap: 0.5rem; }
.promo-highlight .promo-price { font-size: 2.2rem; font-weight: 800; color: #4338ca; line-height: 1; }
.promo-highlight .promo-duration { font-size: 0.9rem; font-weight: 600; color: rgba(67,56,202,0.7); }
.promo-highlight .promo-code-wrapper {
  display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 0.4rem; padding: 0.5rem 0.85rem;
  background: rgba(99,102,241,0.06); border-radius: var(--radius-md);
  border: 1px solid rgba(99,102,241,0.1); font-size: 0.85rem;
}
.promo-highlight .promo-code-label { color: rgba(67,56,202,0.6); font-weight: 600; }
.promo-highlight .promo-code {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.06em; color: #4338ca; background: var(--color-bg);
  padding: 0.15rem 0.55rem; border-radius: var(--radius-sm);
  border: 1px dashed rgba(99,102,241,0.3);
}
.promo-highlight .promo-footnote { font-size: 0.8rem; color: rgba(67,56,202,0.55); }

/* =====================================================
   FAQ Accordion
   ===================================================== */
.accordion-item {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-md) !important;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.accordion-button {
  font-weight: 600;
  font-size: 0.95rem !important;
  color: var(--color-text);
  background: var(--color-bg);
  padding: 1rem 1.25rem;
}
.accordion-button:not(.collapsed) {
  color: var(--color-accent);
  background: var(--color-accent-light);
  box-shadow: none;
}
.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  outline: none;
}
.accordion-body {
  font-size: 0.925rem !important;
  line-height: 1.7;
  color: var(--color-text-muted);
  padding: 1rem 1.25rem;
  background: var(--color-bg);
}

/* =====================================================
   Login Page
   ===================================================== */
.login-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(155deg, #f8fafc 0%, #eef2ff 100%);
  padding: 5rem 1rem 3rem;
}
.login-page .container-lg { background: transparent !important; }
.login-page .card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  background: var(--color-bg);
}
.login-page .card-body { padding: 2rem 2rem 1.75rem; }
.login-page .card-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}
.login-page .form-control {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-bg-subtle);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-page .form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: var(--color-bg);
  outline: none;
}
.login-page .form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.login-page .form-control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  display: block;
}
.login-page .btn-outline-dark {
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-color: var(--color-border-strong);
  color: var(--color-text);
  width: 100%;
  transition: all 0.15s;
}
.login-page .btn-outline-dark:hover {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
}

/* =====================================================
   Account / Dashboard
   ===================================================== */
.container.mt-4 > .d-flex h4 {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  color: var(--color-text);
}
.container.mt-4 .badge.bg-success {
  background: var(--color-success) !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}
.container.mt-4 .badge.bg-secondary {
  background: var(--color-text-faint) !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}
.card.mb-4.shadow-sm {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--color-bg);
  overflow: hidden;
}
.card.mb-4.shadow-sm .card-body {
  padding: 1.4rem 1.5rem;
}
.credit-reset-progress {
  height: 0.45rem;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
}
.credit-reset-progress .progress-bar {
  background: var(--color-success);
  border-radius: var(--radius-full);
}

/* List group for account info */
.list-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.list-group-item {
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-bg);
}
.list-group-item:last-child { border-bottom: none; }

/* General btn overrides */
.btn.btn-outline-dark {
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  padding: 0.45rem 1rem;
  border-color: var(--color-border-strong);
  color: var(--color-text);
  transition: all 0.15s;
}
.btn.btn-outline-dark:hover {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
}
.btn.btn-sm.btn-outline-dark {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
}
.btn.btn-dark {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}
.btn.btn-dark:hover {
  background: var(--color-control-bg-hover);
  border-color: var(--color-control-bg-hover);
  color: var(--color-control-text);
  box-shadow: var(--shadow-sm);
}

/* =====================================================
   Extract Page
   ===================================================== */
.container.mt-4 > h3 {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}
.container.mt-4 .form-control {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  background: var(--color-bg-subtle);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.container.mt-4 .form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.14);
  background: var(--color-bg);
  outline: none;
}
.container.mt-4 .alert-success {
  background: var(--color-success-bg);
  border-color: rgba(16,185,129,0.25);
  border-radius: var(--radius-md);
  color: #065f46;
  font-size: 0.9rem;
}

/* =====================================================
   Blog Index
   ===================================================== */
.blog-sidebar .card {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--color-bg);
}
.blog-sidebar .card .card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.blog-sidebar .badge.bg-light {
  background: var(--color-bg-muted) !important;
  color: var(--color-text-muted) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-full) !important;
  font-weight: 500;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  text-decoration: none;
  transition: all 0.15s;
}
.blog-sidebar .badge.bg-light:hover {
  background: var(--color-accent-light) !important;
  color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
}
.blog-sidebar .input-group .form-control {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-subtle);
}
.blog-sidebar .input-group .form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  outline: none;
  background: var(--color-bg);
}
.blog-sidebar .input-group .btn-outline-secondary {
  border: 1.5px solid var(--color-border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  transition: all 0.15s;
}
.blog-sidebar .input-group .btn-outline-secondary:hover {
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
  color: var(--color-control-text);
}

/* Blog post card in index */
.card.mb-4.shadow-sm.border-0 {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--color-bg);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card.mb-4.shadow-sm.border-0:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}
.card.mb-4.shadow-sm.border-0 .card-body { padding: 1.25rem 1.35rem; }
.card.mb-4.shadow-sm.border-0 .h5 a {
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  transition: color 0.15s;
}
.card.mb-4.shadow-sm.border-0 .h5 a:hover { color: var(--color-accent); }
.card.mb-4.shadow-sm.border-0 .text-muted.small {
  font-size: 0.8rem;
  color: var(--color-text-faint) !important;
}
.card.mb-4.shadow-sm.border-0 p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.card.mb-4.shadow-sm.border-0 .badge.bg-light {
  background: var(--color-bg-muted) !important;
  color: var(--color-text-muted) !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full) !important;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  transition: all 0.15s;
}
.card.mb-4.shadow-sm.border-0 .badge.bg-light:hover {
  background: var(--color-accent-light) !important;
  color: var(--color-accent) !important;
  border-color: var(--color-accent);
}
.card.mb-4.shadow-sm.border-0 a[href^="/blog/"]:not(.text-decoration-none):not(.badge) {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}
.card.mb-4.shadow-sm.border-0 a[href^="/blog/"]:not(.text-decoration-none):not(.badge):hover {
  text-decoration: underline;
}

/* Pagination */
.pagination .page-link {
  border-radius: var(--radius-sm);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  transition: all 0.15s;
}
.pagination .page-link:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.pagination .page-item.disabled .page-link {
  color: var(--color-text-faint);
  background: var(--color-bg-subtle);
}

/* =====================================================
   Blog Post
   ===================================================== */
.breadcrumb {
  font-size: 0.825rem;
  --bs-breadcrumb-divider-color: var(--color-text-faint);
}
.breadcrumb-item a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-item a:hover { color: var(--color-accent); }
.breadcrumb-item.active { color: var(--color-text-faint); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--color-text-faint); }

.post-content {
  font-size: 1.05rem;
  line-height: 1.78;
  color: var(--color-text);
}
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  line-height: 1.25;
}
.post-content p { margin: 0.9rem 0; }
.post-content ul, .post-content ol { padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.35rem; }
.post-content a { color: var(--color-accent); text-decoration: underline; }
.post-content a:hover { color: var(--color-accent-hover); }
.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  color: var(--color-text-muted);
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.post-content th {
  background: var(--color-bg-muted);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.post-content th, .post-content td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
}
.post-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.post-content code {
  background: var(--color-bg-muted);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  font-family: var(--font-mono);
  color: #e11d48;
}
.post-content pre code { background: transparent; padding: 0; color: inherit; }

/* ── blog prose: surviving a narrow column ────────────────────────────
   A table cannot render narrower than the longest word in each column —
   the widest comparison table we ship needs 750px. In a 382px phone
   column that dragged the WHOLE article sideways: every paragraph got a
   horizontal scrollbar and nothing lined up. blog.wrap_tables() gives
   each table its own scroller (at every width — the article column is
   only ~640px on a laptop), so the table scrolls and the prose does
   not. */
.post-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}
.post-table > table { margin: 0; }
/* Long URLs, slugs and code identifiers break instead of jutting out of
   the column. break-word (not anywhere) so it only kicks in when the
   word genuinely cannot fit. */
.post-content { overflow-wrap: break-word; }
.post-content img { max-width: 100%; height: auto; }

/* Share on X */
.btn-x-share {
  background: #0f1419;
  border-color: #0f1419;
  color: #fff;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.9rem;
  transition: all 0.15s;
}
.btn-x-share:hover, .btn-x-share:focus {
  background: #1c2733;
  border-color: #1c2733;
  color: #fff;
  box-shadow: var(--shadow-xs);
}

/* Post tags */
.mt-4 .badge.bg-light.text-secondary {
  background: var(--color-bg-muted) !important;
  color: var(--color-text-muted) !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full) !important;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  text-decoration: none;
  transition: all 0.15s;
}
.mt-4 .badge.bg-light.text-secondary:hover {
  background: var(--color-accent-light) !important;
  color: var(--color-accent) !important;
  border-color: var(--color-accent);
}

/* =====================================================
   Footer
   ===================================================== */
footer.bg-light {
  background: var(--color-bg-subtle) !important;
  border-top: 1px solid var(--color-border);
  margin-top: 0;
}
footer h5.text-uppercase {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--color-text);
  margin-bottom: 0.9rem;
}
footer p.text-dark {
  color: var(--color-text-muted) !important;
  font-size: 0.875rem;
  line-height: 1.6;
}
footer a.text-dark {
  color: var(--color-text-muted) !important;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
footer a.text-dark:hover { color: var(--color-accent) !important; }
footer .list-unstyled li { margin-bottom: 0.4rem; }
footer .text-center.p-3 {
  font-size: 0.8rem;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-muted) !important;
}

/* =====================================================
   Carousel
   ===================================================== */
.carousel-item img {
  height: 500px;
  object-fit: contain;
  width: auto;
  margin: auto;
  background: var(--color-bg-subtle);
}

/* =====================================================
   Scroll Anchor Offset
   ===================================================== */
#pricing::before {
  content: "";
  display: block;
  height: 80px;
  margin-top: -80px;
  visibility: hidden;
}

/* =====================================================
   Global Bootstrap Overrides
   ===================================================== */
.bg-light { background-color: var(--color-bg-subtle) !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* =====================================================
   Utilities
   ===================================================== */
.disabled-link { opacity: 0.5; cursor: default; pointer-events: none; }

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
    padding: 0.5rem 0 0.75rem;
    box-shadow: var(--shadow-sm);
  }
  .navbar-quick-actions .navbar-toggler {
    margin-left: 0;
  }
  .navbar-collapse .navbar-nav {
    gap: 0.25rem;
  }
  .navbar-collapse .nav-link,
  .navbar-collapse .btn {
    margin: 0.1rem 0;
  }
  .contentA { padding: 3rem 0 2.5rem; }
  .contentA .card-title { font-size: 1.85rem; }
  .contentB, .contentC { padding: 2rem 0; }
  body { padding-top: var(--nav-height); }
  .login-page { padding: 3rem 1rem 2rem; }
}

/* =====================================================
   Dark Theme — legacy and Bootstrap component audit
   ===================================================== */
html[data-theme="dark"] body {
  background: var(--color-bg);
  color: var(--color-text);
}

html[data-theme="dark"] .contentA {
  background: linear-gradient(155deg, #172033 0%, #202b45 55%, #172033 100%);
}
html[data-theme="dark"] .login-page {
  background: linear-gradient(155deg, #172033 0%, #202b45 100%);
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body {
  color: var(--color-text) !important;
}
html[data-theme="dark"] .bg-warning.text-dark,
html[data-theme="dark"] .alert-warning .text-body {
  color: #422006 !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .table {
  background-color: var(--color-bg) !important;
  color: var(--color-text);
  border-color: var(--color-border);
}
html[data-theme="dark"] .accordion-button:not(.collapsed) {
  background: var(--color-accent-light) !important;
  color: var(--color-accent-hover);
}
html[data-theme="dark"] .dropdown-item { color: var(--color-text); }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
  color: var(--color-text);
  background: var(--color-bg-muted);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
  color: var(--color-text);
  background-color: var(--color-bg-subtle);
  border-color: var(--color-border-strong);
}
html[data-theme="dark"] .form-control::placeholder { color: var(--color-text-faint); opacity: 1; }
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  color: var(--color-text);
  background-color: var(--color-bg-subtle);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.2rem var(--color-accent-light);
}
html[data-theme="dark"] .form-check-input {
  background-color: var(--color-bg-subtle);
  border-color: var(--color-border-strong);
}
html[data-theme="dark"] .form-check-input:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }

html[data-theme="dark"] .btn-dark,
html[data-theme="dark"] .btn-outline-dark:hover {
  color: var(--color-control-text) !important;
  background: var(--color-control-bg) !important;
  border-color: var(--color-control-bg) !important;
}
html[data-theme="dark"] .btn-outline-dark {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

html[data-theme="dark"] .hx-btn--primary,
html[data-theme="dark"] .hx-auth-submit,
html[data-theme="dark"] .hx-extract-submit,
html[data-theme="dark"] .acct-btn,
html[data-theme="dark"] .tour-btn--primary,
html[data-theme="dark"] .welcome-widget__cta-primary {
  color: var(--color-control-text) !important;
  background: var(--color-control-bg) !important;
  border-color: var(--color-control-bg) !important;
}

html[data-theme="dark"] .hx-ext-tabs button[aria-pressed="true"] {
  color: var(--color-control-text);
  background: var(--color-control-bg);
  border-color: var(--color-control-bg);
}
html[data-theme="dark"] .hx-net-chip {
  color: #6ee7b7;
  background: var(--color-success-bg);
}
html[data-theme="dark"] .hx-net-tile.is-beta .hx-net-chip {
  color: var(--color-accent-hover);
}
html[data-theme="dark"] .hx-net-tile[data-network="x"] .hx-net-mark,
html[data-theme="dark"] .hx-net-tile[data-network="threads"] .hx-net-mark,
html[data-theme="dark"] .hx-net-tile[data-network="tiktok"] .hx-net-mark {
  fill: var(--color-text);
}

html[data-theme="dark"] .tool-icon-badge,
html[data-theme="dark"] .tool-btn-primary,
html[data-theme="dark"] .tool-btn-schedule,
html[data-theme="dark"] .tool-cta-btn,
html[data-theme="dark"] .acct-action-badge,
html[data-theme="dark"] .lbf-tab--active,
html[data-theme="dark"] .pil-chip[aria-pressed="true"],
html[data-theme="dark"] .sb-step-num,
html[data-theme="dark"] .caw-stage-num,
html[data-theme="dark"] .lbp-rank-num,
html[data-theme="dark"] .rsc-tab[aria-selected="true"],
html[data-theme="dark"] .rsc-bm-link,
html[data-theme="dark"] .archive-revive:hover {
  color: var(--color-accent-contrast) !important;
}
html[data-theme="dark"] .tool-cta-card {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-bg) 100%);
}

html[data-theme="dark"] .acct-chip--ok,
html[data-theme="dark"] .acct-next em { color: #6ee7b7; }
html[data-theme="dark"] .acct-chip--warn { color: #fbbf24; }
html[data-theme="dark"] .acct-attn--connect {
  color: #fde68a;
  background: rgba(217,119,6,.14);
  border-color: rgba(251,191,36,.45);
}
html[data-theme="dark"] .acct-attn--connect a { color: #fcd34d; }
html[data-theme="dark"] .acct-attn--tray,
html[data-theme="dark"] .acct-attn--tray a {
  color: var(--color-accent-hover);
  border-color: rgba(165,180,252,.4);
}

html[data-theme="dark"] .blog-toc a { color: var(--color-text-muted); }
html[data-theme="dark"] .blog-toc a:hover { color: var(--color-text); }
html[data-theme="dark"] .ph-blog-cta {
  color: var(--color-text) !important;
  background: var(--color-bg-subtle) !important;
  border-color: var(--color-border) !important;
}
html[data-theme="dark"] .ph-blog-cta p { color: var(--color-text-muted) !important; }
html[data-theme="dark"] .ph-blog-cta p:first-child { color: var(--color-text) !important; }

html[data-theme="dark"] .promo-toggle-btn,
html[data-theme="dark"] .promo-toggle-btn:hover,
html[data-theme="dark"] .promo-toggle-btn:focus,
html[data-theme="dark"] .promo-highlight .promo-badge,
html[data-theme="dark"] .promo-highlight .promo-price,
html[data-theme="dark"] .promo-highlight .promo-code {
  color: var(--color-accent-hover);
}
html[data-theme="dark"] .promo-toggle-sub,
html[data-theme="dark"] .promo-highlight .promo-percent,
html[data-theme="dark"] .promo-highlight .promo-duration,
html[data-theme="dark"] .promo-highlight .promo-code-label,
html[data-theme="dark"] .promo-highlight .promo-footnote {
  color: var(--color-text-muted);
}
html[data-theme="dark"] .container.mt-4 .alert-success { color: #6ee7b7; }
html[data-theme="dark"] .container.mt-4 .badge.bg-success,
html[data-theme="dark"] .container.mt-4 .badge.bg-secondary {
  color: #0b1120 !important;
}

html[data-theme="dark"] .ps-test-body[data-state="error"],
html[data-theme="dark"] .stu-pop-err,
html[data-theme="dark"] .stu-act-err,
html[data-theme="dark"] .tier-b-counter[data-state="error"] strong,
html[data-theme="dark"] .ptp-counter.ptp-over,
html[data-theme="dark"] .qrg-error,
html[data-theme="dark"] .sb-error,
html[data-theme="dark"] .cpt-del,
html[data-theme="dark"] .lbp-del,
html[data-theme="dark"] .smr-del,
html[data-theme="dark"] .pa-bio-meta--over,
html[data-theme="dark"] .lbf-counter.lbf-over,
html[data-theme="dark"] .utm-error,
html[data-theme="dark"] .utm-req,
html[data-theme="dark"] .hda-density[data-tier="red"] {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .tier-b-counter[data-state="warn"] strong,
html[data-theme="dark"] .cpf-flags,
html[data-theme="dark"] .lpp-flags,
html[data-theme="dark"] .bpc-warn,
html[data-theme="dark"] .hda-density[data-tier="yellow"] {
  color: #fcd34d !important;
}
html[data-theme="dark"] .cpf-flags.cpf-flags-good,
html[data-theme="dark"] .lpp-flags.lpp-flags-good,
html[data-theme="dark"] .bpc-ok,
html[data-theme="dark"] .hda-density[data-tier="green"] {
  color: #6ee7b7 !important;
}
html[data-theme="dark"] .hx-btn--primary:hover,
html[data-theme="dark"] .hx-auth-submit:hover,
html[data-theme="dark"] .hx-extract-submit:hover,
html[data-theme="dark"] .acct-btn:hover,
html[data-theme="dark"] .tour-btn--primary:hover,
html[data-theme="dark"] .welcome-widget__cta-primary:hover {
  color: var(--color-control-text) !important;
  background: var(--color-control-bg-hover) !important;
}

html[data-theme="dark"] .hx-btn--ghost,
html[data-theme="dark"] .hx-net-tile,
html[data-theme="dark"] .hx-step,
html[data-theme="dark"] .hx-ext,
html[data-theme="dark"] .hx-ext-tabs button,
html[data-theme="dark"] .hx-sort a[aria-pressed="true"],
html[data-theme="dark"] .hx-blogcard,
html[data-theme="dark"] .hx-auth-card,
html[data-theme="dark"] .hx-extract-card,
html[data-theme="dark"] .acct-chip,
html[data-theme="dark"] .acct-action,
html[data-theme="dark"] .acct-tile,
html[data-theme="dark"] .acct-card,
html[data-theme="dark"] .acct-btn--ghost,
html[data-theme="dark"] .tour-card,
html[data-theme="dark"] .ps-test-card,
html[data-theme="dark"] .srl-card,
html[data-theme="dark"] .adm-section {
  color: var(--color-text);
  background: var(--color-bg) !important;
  border-color: var(--color-border) !important;
}
/* .acct-btn above forces dark text with !important (right for the solid
   button); the ghost variant keeps a dark background, so at rest its label
   was near-black on near-black. Hover flips to a light fill, so leave it. */
html[data-theme="dark"] .acct-btn--ghost:not(:hover) {
  color: var(--color-text) !important;
}

html[data-theme="dark"] .tour-slide,
html[data-theme="dark"] .ps-test-card--persona,
html[data-theme="dark"] .ps-test-feedback,
html[data-theme="dark"] .srl-filters,
html[data-theme="dark"] .srl-card-quote,
html[data-theme="dark"] .srl-empty,
html[data-theme="dark"] .streak-card--empty {
  color: var(--color-text);
  background: var(--color-bg-subtle) !important;
  border-color: var(--color-border) !important;
}

html[data-theme="dark"] .tour-head h1,
html[data-theme="dark"] .tour-headline,
html[data-theme="dark"] .tour-caption strong,
html[data-theme="dark"] .tour-btn,
html[data-theme="dark"] .ps-test-body,
html[data-theme="dark"] .ps-test-feedback-q,
html[data-theme="dark"] .srl-title,
html[data-theme="dark"] .srl-meta strong,
html[data-theme="dark"] .srl-card-reply,
html[data-theme="dark"] .srl-empty h3,
html[data-theme="dark"] .srl-empty a,
html[data-theme="dark"] .streak-card__headline,
html[data-theme="dark"] .streak-card__meta strong,
html[data-theme="dark"] .streak-card__meta a {
  color: var(--color-text) !important;
}
html[data-theme="dark"] .tour-sub,
html[data-theme="dark"] .tour-caption,
html[data-theme="dark"] .tour-meta-link,
html[data-theme="dark"] .ps-test-card-h,
html[data-theme="dark"] .ps-test-subtle,
html[data-theme="dark"] .srl-meta,
html[data-theme="dark"] .srl-card-quote-label,
html[data-theme="dark"] .srl-card-quote-text,
html[data-theme="dark"] .srl-empty,
html[data-theme="dark"] .streak-card__sub,
html[data-theme="dark"] .streak-card__meta {
  color: var(--color-text-muted) !important;
}

html[data-theme="dark"] .tour-dot { background: var(--color-border-strong); }
html[data-theme="dark"] .tour-dot.active { background: var(--color-text); }
html[data-theme="dark"] .welcome-widget {
  background: linear-gradient(135deg, rgba(14,116,144,.18) 0%, rgba(5,150,105,.16) 100%);
  border-color: #2c6472;
}
html[data-theme="dark"] .welcome-widget__title,
html[data-theme="dark"] .welcome-widget__values strong { color: var(--color-text); }
html[data-theme="dark"] .welcome-widget__lede,
html[data-theme="dark"] .welcome-widget__values { color: var(--color-text-muted); }
html[data-theme="dark"] .welcome-widget__cta-secondary {
  color: var(--color-text);
  background: var(--color-bg);
  border-color: var(--color-border-strong);
}
html[data-theme="dark"] .streak-card {
  background: linear-gradient(135deg, rgba(180,83,9,.18) 0%, rgba(161,98,7,.14) 100%);
  border-color: #784f28;
}

html[data-theme="dark"] .xp-price-card { background: var(--color-bg); }
html[data-theme="dark"] footer .text-center.p-3 {
  background: var(--color-bg-muted) !important;
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* =====================================================
   Dashboard Shell (scoped — only affects pages that
   extend dashboard_layout.html)
   ===================================================== */
.dashboard-shell {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

/* Desktop-only: below md, Bootstrap's offcanvas-md positions the
   sidebar (fixed drawer). Overriding position there puts the hidden
   drawer back into normal flow, reserving a tall blank block above
   the page content. */
@media (min-width: 768px) {
  .dashboard-shell .dashboard-sidebar {
    flex: 0 0 232px;
    width: 232px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
    max-height: calc(100vh - var(--nav-height) - 2rem);
    overflow-y: auto;
  }
}

.dashboard-shell .dashboard-sidebar-body {
  padding: 1rem 0.75rem;
}

.dashboard-shell .dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-shell .dashboard-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background 0.15s ease, color 0.15s ease;
}
/* "↳ username" under the Dashboard item: whose dashboard this is. */
.dashboard-shell .dashboard-nav-user {
  display: flex; align-items: center; gap: 0.4rem;
  margin: -0.35rem 0 0.35rem 0; padding: 0 0.75rem 0 2.3rem;
  font-size: 0.78rem; color: var(--color-text-faint, #94a3b8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dashboard-shell .dashboard-nav-user i { font-size: 0.8rem; opacity: .8; }
.dashboard-shell .dashboard-nav-user span { overflow: hidden; text-overflow: ellipsis; }
.dashboard-shell .dashboard-nav-link:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}
.dashboard-shell .dashboard-nav-link.active {
  background: var(--color-accent-light);
  color: var(--color-accent-hover);
  font-weight: 600;
}
.dashboard-shell .dashboard-nav-link i {
  font-size: 1rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.dashboard-shell .dashboard-nav-divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 0.6rem 0.25rem;
}

.dashboard-shell .dashboard-main {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-shell .dashboard-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

@media (max-width: 767.98px) {
  .dashboard-shell {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0.75rem 2rem;
  }
  .dashboard-shell .dashboard-sidebar-toggle {
    display: inline-flex;
    margin-bottom: 0.5rem;
  }
  /* offcanvas-md handles the off-canvas behavior below md; just cap
     the drawer width so it never spans the whole phone screen */
  .dashboard-shell .dashboard-sidebar {
    --bs-offcanvas-width: min(20rem, 85vw);
  }
}

/* Footer Free Tools list — icon chip + linkified entries */
.footer-tools-list li {
  margin-bottom: 0.25rem;
}
.footer-tools-list a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.footer-tools-list a:hover {
  color: var(--color-accent) !important;
}
.footer-tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #a855f7 100%);
  color: var(--color-accent-contrast, #fff);
  font-size: 12px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}
.footer-tools-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.6rem 0;
  list-style: none;
}

/* Two-column footer tool list: uses CSS multi-column so it stays
   crawlable as a flat <ul> (no JS, every link still in the DOM). */
.footer-tools-list--two-col {
  column-count: 2;
  column-gap: 1.25rem;
}
.footer-tools-list--two-col li {
  break-inside: avoid;
  page-break-inside: avoid;
}
/* The "All free tools →" link and the divider should span both
   columns so they read as a section break, not a list item. */
.footer-tools-list--two-col .footer-tools-all,
.footer-tools-list--two-col .footer-tools-divider {
  column-span: all;
}
@media (max-width: 767.98px) {
  .footer-tools-list--two-col {
    column-count: 1;
  }
}

/* Scheduler collapsible group in the dashboard sidebar */
.dashboard-shell .dashboard-nav-group-toggle .dashboard-nav-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}
.dashboard-shell .dashboard-nav-group-toggle[aria-expanded="true"] .dashboard-nav-chevron {
  transform: rotate(180deg);
}
.dashboard-shell .dashboard-nav-sublink {
  padding-left: 2.4rem;
  font-size: 0.85rem;
}

/* Third level: compose-mode links nested under Compose */
.dashboard-shell .dashboard-nav-subsublink {
  padding-left: 3.6rem;
  font-size: 0.8rem;
  opacity: 0.9;
}
.dashboard-shell .dashboard-nav-subsublink i { font-size: 0.75rem; }

/* Top navbar, laptop widths (992–1199px): eight links + the button cluster
   need ~960px and the container is exactly 960px, so labels were breaking
   onto two lines ("Scheduler / Studio", "AI / Assistants"). Keep every
   label on one line and tighten the spacing only in this band. */
@media (min-width: 992px) {
  .navbar .navbar-nav .nav-link,
  .navbar .navbar-nav .btn { white-space: nowrap; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar .navbar-nav .nav-link { padding-left: .42rem; padding-right: .42rem; font-size: .9rem; }
  .navbar .navbar-nav .btn { padding-left: .75rem; padding-right: .75rem; font-size: .88rem; }
  .navbar .navbar-nav .btn.me-2 { margin-right: .35rem !important; }
}
/* 992–1099px is tighter still: at 992 the login button ran 9px off-screen. */
@media (min-width: 992px) and (max-width: 1099.98px) {
  .navbar .navbar-nav .nav-link { padding-left: .3rem; padding-right: .3rem; font-size: .86rem; }
  .navbar .navbar-nav .btn { padding-left: .6rem; padding-right: .6rem; font-size: .84rem; }
}
/* Signed in, the home page shows two buttons (Dashboard, Log Out) where a
   visitor has one, so the same row needs ~30px more. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar .navbar-nav--auth .nav-link { padding-left: .3rem; padding-right: .3rem; }
  /* the logo already links home; dropping the text link here frees ~60px,
     which is sturdier than shaving more padding off every label */
  .navbar .navbar-nav--auth .nav-link.active { display: none; }
}

/* Official brand icons that must not shrink below 20px (YouTube
   branding guidelines, API policy III.F.2a). */
.stu-brand-img { height: 20px; width: auto; vertical-align: -5px; flex: none; }
