/* ============================================
   Color System — OKLCH with blue-tinted neutrals
   ============================================ */
:root {
  /* --- Primary (blue) --- */
  --color-primary: oklch(58% 0.16 250);          /* #4285f4 equivalent */
  --color-primary-hover: oklch(50% 0.16 250);
  --color-primary-focus: oklch(58% 0.16 250 / 0.25);
  --color-primary-subtle: oklch(95% 0.03 250);   /* light blue bg */
  --color-primary-border: oklch(82% 0.08 250);   /* blue border */
  --color-primary-text: oklch(35% 0.12 250);     /* dark blue text — 7:1+ on white */

  /* --- Semantic: success (green) --- */
  --color-success: oklch(55% 0.16 155);
  --color-success-subtle: oklch(95% 0.03 155);
  --color-success-text: oklch(35% 0.10 155);     /* 7:1+ on white */

  /* --- Semantic: error (red) --- */
  --color-error: oklch(55% 0.20 25);
  --color-error-subtle: oklch(95% 0.02 25);
  --color-error-border: oklch(82% 0.08 25);
  --color-error-text: oklch(35% 0.12 25);        /* 7:1+ on white */

  /* --- Semantic: warning (amber) --- */
  --color-warning: oklch(65% 0.16 75);
  --color-warning-subtle: oklch(96% 0.03 75);
  --color-warning-border: oklch(75% 0.12 75);
  --color-warning-text: oklch(35% 0.10 75);      /* 7:1+ on white */

  /* --- Neutrals: blue-tinted for cohesion --- */
  --color-neutral-50: oklch(98% 0.005 250);      /* page background */
  --color-neutral-100: oklch(96% 0.008 250);     /* card/surface bg */
  --color-neutral-200: oklch(92% 0.008 250);     /* borders, dividers */
  --color-neutral-300: oklch(87% 0.008 250);     /* disabled borders */
  --color-neutral-400: oklch(60% 0.01 250);      /* placeholder text */
  --color-neutral-500: oklch(37% 0.01 250);      /* secondary/muted text — 7:1+ on white */
  --color-neutral-600: oklch(40% 0.01 250);      /* body text */
  --color-neutral-700: oklch(35% 0.01 250);      /* headings */
  --color-neutral-800: oklch(25% 0.01 250);      /* high-emphasis text */
  --color-neutral-900: oklch(15% 0.01 250);      /* max contrast */

  /* --- Surfaces --- */
  --color-surface: oklch(99.5% 0.003 250);       /* main bg, not pure white */
  --color-surface-raised: oklch(100% 0 0);       /* cards — near-white */
  --color-surface-overlay: oklch(98% 0.005 250); /* overlays, dropdowns */

  /* --- Map to Pico variables --- */
  --pico-primary: oklch(58% 0.16 250);
  --pico-primary-hover: oklch(50% 0.16 250);
  --pico-primary-focus: oklch(58% 0.16 250 / 0.25);
  --pico-primary-inverse: var(--color-surface-raised);
  --pico-background-color: var(--color-surface);
  --pico-card-background-color: var(--color-surface-raised);
  --pico-muted-color: var(--color-neutral-500);
  --pico-muted-border-color: var(--color-neutral-200);
  --pico-color: var(--color-neutral-700);
  --pico-contrast: var(--color-neutral-800);
  --pico-contrast-inverse: var(--color-surface-raised);

  /* --- Typography (unchanged) --- */
  --pico-font-family: 'DM Sans', 'DM Sans-Fallback', system-ui, sans-serif;

  /* Type scale — 1.25 ratio (major third), fixed rem for app UI */
  --text-xs: 0.75rem;    /* 12px — captions, legal */
  --text-sm: 0.875rem;   /* 14px — secondary UI, metadata, badges */
  --text-base: 1rem;     /* 16px — body */
  --text-lg: 1.25rem;    /* 20px — subheadings, lead text */
  --text-xl: 1.563rem;   /* 25px — section headings (h2) */
  --text-2xl: 1.953rem;  /* ~31px — page headings (h1) */

  /* Weight strategy */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;

  /* Line heights */
  --leading-tight: 1.2;   /* headings */
  --leading-snug: 1.35;   /* subheadings, labels */
  --leading-normal: 1.6;  /* body text */
}

/* Metric-matched fallback to minimize layout shift */
@font-face {
  font-family: 'DM Sans-Fallback';
  src: local('Arial');
  size-adjust: 96%;
  ascent-override: 92%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* ============================================
   Accessibility — focus, skip link, keyboard
   ============================================ */

/* Focus-visible: show ring only for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--color-neutral-900);
  color: var(--color-surface-raised);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: 0 0 0.375rem 0.375rem;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* ARIA live region for dynamic updates (visually hidden) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Base typography */
body {
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Text overflow — production resilience
   ============================================ */

/* Prevent long URLs/filenames from breaking layout */
.source-full a, .source-short a, .result-filename, .lg-caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Alt text cells allow wrapping but prevent extreme overflow */
.alt-cell {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Review thumbnails: contain broken images gracefully */
.review-thumb {
  min-height: 72px;
}

/* Prevent flex children from overflowing in nav, toolbar, badges */
.site-nav, .review-toolbar, .flex-row, .flex-row--sm {
  min-width: 0;
}
.site-nav > * {
  min-width: 0;
}

/* Heading hierarchy */
h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}
h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

/* Body and secondary text */
p, li, td, th, label, input, select, textarea {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
small, .text-sm {
  font-size: var(--text-sm);
}
.text-xs {
  font-size: var(--text-xs);
}

/* Data tables: tabular figures for aligned numbers */
table {
  font-variant-numeric: tabular-nums;
}

/* Readable line lengths */
article > p, .prose p {
  max-width: 65ch;
}

/* Semantic color utilities — replace inline styles in templates */
.text-muted { color: var(--color-neutral-500); }
.text-success { color: var(--color-success-text); }
.text-placeholder { color: var(--color-neutral-400); }
.status-badge--processing { background: var(--color-warning-subtle); color: var(--color-warning-text); }
.past-due-banner { background: var(--color-warning-subtle); border: 1px solid var(--color-warning-border); border-radius: 0.5rem; padding: 1rem; margin-bottom: 1rem; text-align: center; }

/* Layout utilities */
.flex-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.flex-row--sm { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.narrow-content { max-width: 600px; margin: 0 auto; }

/* Dashboard */
.dashboard-greeting { margin-bottom: 1.5rem; }

/* Small inline buttons (classification toggle in review table) */
.btn-classify {
  background: none;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: var(--text-xs);
  width: auto;
}
.btn-classify:hover { background: var(--pico-card-background-color); }

/* Small action buttons (retry, export, toolbar) */
.btn-sm {
  font-size: var(--text-sm);
  padding: 0.5rem 1rem;
}

/* Inline spinner (used during generation progress) */
.progress-spinner--inline {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
  margin-right: 0.5rem;
  border-width: 2px;
}

/* Quota link in nav (unstyled anchor) */
.nav-quota-link {
  text-decoration: none;
  color: inherit;
}

/* Footer */
footer {
  border-top: 1px solid var(--color-neutral-200);
  margin-top: 3rem;
  padding-top: 1.5rem;
}
footer hr { display: none; }
footer small {
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
}

/* ============================================
   Landing page — bold, confident, utilitarian
   ============================================ */

/* Hero: dramatic scale, generous space */
.landing-hero {
  padding: clamp(3rem, 5vw, 6rem) 0 clamp(2rem, 4vw, 4rem);
  max-width: 640px;
  margin: 0 auto;
}
.hero-heading {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-neutral-900);
  margin-bottom: 1rem;
}
.hero-subtext {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-neutral-500);
  max-width: 50ch;
  margin: 0 auto;
}

/* CTA form: prominent, larger button */
.landing-cta {
  max-width: 560px;
  margin: 2.5rem auto 0;
}
.landing-cta .cta-group input {
  height: 3.25rem;
  line-height: 3.25rem;
  font-size: var(--text-base);
}
.landing-cta .cta-group button {
  height: 3.25rem;
  line-height: 3.25rem;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  padding-left: 2rem;
  padding-right: 2rem;
  letter-spacing: 0.01em;
}
.landing-cta small {
  display: block;
  margin-top: 0.5rem;
}

/* Trust section: clean grid, no emoji, tight copy */
.trust-section {
  padding: clamp(2rem, 4vw, 4rem) 0;
  border-top: 1px solid var(--color-neutral-200);
  border-bottom: 1px solid var(--color-neutral-200);
}
.trust-badges {
  text-align: left;
}
.trust-badges p {
  margin-bottom: 0.25rem;
}
.trust-badges small {
  color: var(--color-neutral-500);
}
.trust-badge-marker {
  display: inline-block;
  width: 1.5rem;
  text-align: center;
  color: var(--color-primary);
  font-weight: var(--weight-bold);
  margin-right: 0.25rem;
}

/* How It Works: numbered steps with visual weight */
.steps-section {
  padding: clamp(2.5rem, 4vw, 5rem) 0 clamp(2rem, 3vw, 3rem);
}
.steps-section h2 {
  text-align: center;
  margin-bottom: clamp(1.5rem, 3vw, 3rem);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.step-item {
  text-align: left;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-neutral-900);
  color: var(--color-surface-raised);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.75rem;
}
.step-item h3 {
  font-weight: var(--weight-bold);
  margin-bottom: 0.5rem;
}
.step-item p {
  color: var(--color-neutral-500);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .steps-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .step-item { display: flex; gap: 1rem; align-items: flex-start; }
  .step-number { flex-shrink: 0; margin-bottom: 0; }
  .step-content { flex: 1; }
}

/* ============================================
   Wizard step indicator — minimal progress bar
   ============================================ */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-neutral-400);
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--color-neutral-300);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.wizard-step--active .wizard-step-num {
  background: var(--color-neutral-900);
  color: var(--color-surface-raised);
  border-color: var(--color-neutral-900);
}
.wizard-step--active {
  color: var(--color-neutral-800);
}
.wizard-step--done .wizard-step-num {
  background: var(--color-success-subtle);
  color: var(--color-success-text);
  border-color: var(--color-success-subtle);
}
.wizard-step--done {
  color: var(--color-neutral-500);
}
.wizard-step-line {
  flex: 1;
  height: 1.5px;
  background: var(--color-neutral-300);
  margin: 0 0.5rem;
  min-width: 1rem;
}
.wizard-step--done + .wizard-step-line {
  background: var(--color-success-subtle);
}
@media (max-width: 480px) {
  .wizard-step span:not(.wizard-step-num) { display: none; }
  .wizard-step-line { min-width: 0.5rem; margin: 0 0.25rem; }
}

/* Dashboard empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-neutral-500);
}
.empty-state p {
  margin-bottom: 1.5rem;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

/* Site navigation */
.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 0.75rem;
}
.nav-toggle { display: none; }
.nav-toggle-label {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--pico-primary);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-brand-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--pico-primary);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-brand-link:hover { text-decoration: none; }
.nav-logo { display: block; }
.nav-quota { margin-left: auto; flex-shrink: 0; }
.nav-links {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: auto;
  min-width: 10rem;
  background: var(--pico-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px oklch(15% 0.01 250 / 0.1);
  padding: 0.25rem 0;
  z-index: 100;
  text-align: left;
  list-style: none;
  margin: 0;
}
.nav-toggle:checked ~ .nav-links { display: flex; }
.nav-links li { list-style: none; }
.nav-links li a, .nav-links li span { display: block; padding: 0.5rem 1rem; }

/* CTA input + button same height */
.cta-group input,
.cta-group button {
  height: 3rem;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 3rem;
  margin-bottom: 0;
}
.cta-group input { flex: 1 1 0; min-width: 0; }
.cta-group button { flex: 0 0 auto; width: auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* CSS-only tab switching (wizard source selector) */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 1rem;
}
.tab-radio { display: none; }
.tab-label {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--pico-muted-color);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.wizard-card:has(#tab-domain:checked) label[for="tab-domain"],
.wizard-card:has(#tab-urls:checked) label[for="tab-urls"],
.wizard-card:has(#tab-upload:checked) label[for="tab-upload"] {
  color: var(--pico-color);
  font-weight: var(--weight-bold);
  border-bottom-color: var(--pico-primary);
}
.tab-panel { display: none; }
#tab-domain:checked ~ #panel-domain,
#tab-urls:checked ~ #panel-urls,
#tab-upload:checked ~ #panel-upload { display: block; }

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pico-contrast);
  color: var(--pico-contrast-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: 0 4px 12px oklch(15% 0.01 250 / 0.15);
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 6s forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* Banner styles (error/warning/info) */
.banner { padding: 0.75rem 1rem; border-radius: 0.25rem; margin-bottom: 1rem; font-size: var(--text-sm); }
.banner-error { background: var(--color-error-subtle); border-left: 4px solid var(--color-error); color: var(--color-error-text); }
.banner-warning { background: var(--color-warning-subtle); border-left: 4px solid var(--color-warning); color: var(--color-warning-text); }
.banner-info { background: var(--color-primary-subtle); border-left: 4px solid var(--color-primary); color: var(--color-primary-text); }

/* Progress spinner */
.progress-spinner {
  width: 2rem; height: 2rem;
  border: 3px solid var(--pico-muted-border-color);
  border-top-color: var(--pico-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .progress-spinner { animation-duration: 2s; }
  .toast { animation: none; }
}

/* Quota display (for auth nav) */
.quota-display {
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--pico-muted-color);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
}
.quota-count { font-weight: var(--weight-medium); color: var(--pico-color); }
.quota-compact { display: none; font-weight: var(--weight-medium); color: var(--pico-color); font-size: var(--text-xs); }
.quota-full { display: inline; }
@media (max-width: 768px) {
  .quota-compact { display: inline; }
  .quota-full { display: none; }
}
.quota-banner { background: var(--color-primary-subtle); border: 1px solid var(--color-primary-border); border-radius: 0.375rem; padding: 0.625rem 0.875rem; margin-bottom: 0.75rem; font-size: var(--text-sm); color: var(--color-primary-text); }
.quota-banner-exhausted { background: var(--color-error-subtle); border-color: var(--color-error-border); color: var(--color-error-text); }

/* Landing page trust badges: responsive grid */
@media (max-width: 768px) {
  .trust-badges { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .trust-badges { grid-template-columns: 1fr; }
}

/* Dashboard responsive table — card layout on mobile */
@media (max-width: 768px) {
  .dashboard-table thead { display: none; }
  .dashboard-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
  }
  .dashboard-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border: none;
  }
  .dashboard-table td::before {
    content: attr(data-label);
    font-weight: var(--weight-medium);
    margin-right: 1rem;
    flex-shrink: 0;
  }
}

/* Dashboard source URL: full on desktop, short on mobile */
.source-short { display: none; }
@media (max-width: 768px) {
  .source-full { display: none; }
  .source-short { display: inline; }
}

/* Review table styles (keep for wizard_review.html) */
.review-row--editing { background: var(--color-primary-subtle); }
.review-row--saved { animation: save-flash 600ms ease forwards; }
@keyframes save-flash { 0% { background-color: var(--color-success-subtle); } 100% { background-color: var(--color-surface-raised); } }
@media (prefers-reduced-motion: reduce) { .review-row--saved { animation: none; background-color: var(--color-success-subtle); } }
.review-row--decorative { opacity: 0.55; }
.review-row--failed { background: var(--color-error-subtle); }
.alt-cell { cursor: pointer; }
.alt-cell:hover { text-decoration: underline dotted; }
.alt-cell--decorative { color: var(--pico-muted-color); font-style: italic; cursor: default; }
.alt-cell--decorative:hover { text-decoration: none; }
.char-counter { font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--pico-muted-color); text-align: right; margin-top: 0.25rem; }
.char-counter--over { color: var(--color-error-text); font-weight: var(--weight-bold); }
.status-badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 9999px; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.status-badge--generated { background: var(--color-success-subtle); color: var(--color-success-text); }
.status-badge--edited { background: var(--color-primary-subtle); color: var(--color-primary-text); }
.status-badge--failed { background: var(--color-error-subtle); color: var(--color-error-text); }
.status-badge--decorative { background: var(--color-neutral-100); color: var(--color-neutral-500); }
.status-badge--completed { background: var(--color-success-subtle); color: var(--color-success-text); }
.status-badge--running { background: var(--color-warning-subtle); color: var(--color-warning-text); }
.status-badge--pending { background: var(--color-neutral-100); color: var(--color-neutral-500); }

/* Review table column widths */
.review-table col:nth-child(1) { width: 72px; }
.review-table col:nth-child(3) { width: 68px; }
.review-table col:nth-child(4) { width: 96px; }
.review-table col:nth-child(5) { width: 80px; }

/* Review page utilities */
.review-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.stats-bar { font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--pico-muted-color); }
.review-thumb { width: 72px; height: 72px; object-fit: contain; border-radius: 4px; background: var(--color-neutral-100); display: block; }
.error-text { color: var(--color-error-text); font-size: var(--text-sm); }
.filter-select { font-size: var(--text-sm); width: auto; padding: 0.25rem 0.5rem; }
.btn-retry-row { background: none; border: 1px solid var(--pico-muted-border-color); border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 1rem; width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; }
.btn-retry-row:hover { background: var(--pico-card-background-color); }

/* ============================================
   Pricing page — clear hierarchy, tight grouping
   ============================================ */

/* Page header */
.pricing-header {
    text-align: center;
    padding: clamp(2rem, 4vw, 4rem) 0 1rem;
}
.pricing-header p {
    color: var(--color-neutral-500);
    margin-top: 0.5rem;
}

/* Billing toggle */
.billing-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
    margin: 1.5rem 0 2rem;
}
#billing-monthly, #billing-annual { display: none !important; }
.billing-toggle label {
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    cursor: pointer;
    border: 1px solid var(--color-neutral-200);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#billing-monthly:checked ~ .billing-toggle label[for="billing-monthly"],
#billing-annual:checked ~ .billing-toggle label[for="billing-annual"] {
    background: var(--color-neutral-900);
    color: var(--color-surface-raised);
    border-color: var(--color-neutral-900);
}

/* Card grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--color-neutral-200);
    border: 1px solid var(--color-neutral-200);
    border-radius: 0.75rem;
    overflow: hidden;
}
@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual card */
.pricing-card {
    text-align: center;
    padding: 2rem 1.5rem 1.75rem;
    position: relative;
    background: var(--color-surface-raised);
    display: flex;
    flex-direction: column;
}

/* Featured card: subtle tint, label out of flow */
.pricing-card-featured {
    background: var(--color-primary-subtle);
    padding-top: 2rem;
}
.pricing-card-featured .pricing-label {
    position: absolute;
    top: 0.75rem;
    left: 0;
    right: 0;
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary-text);
}

/* Plan name */
.pricing-card h3 {
    font-weight: var(--weight-bold);
    font-size: var(--text-lg);
    letter-spacing: -0.01em;
    margin-bottom: 0.125rem;
}

/* Subtitle */
.pricing-subtitle {
    font-size: var(--text-sm);
    color: var(--color-neutral-500);
    margin-bottom: 1.25rem;
}

/* Price cluster: price + credits + per-image — tight group */
.pricing-price {
    font-size: 2.75rem;
    font-weight: var(--weight-bold);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0 0 0.25rem;
    color: var(--color-neutral-900);
}
.pricing-price small {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    color: var(--color-neutral-500);
    letter-spacing: 0;
}
.pricing-credits {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
    color: var(--color-neutral-800);
}
.pricing-per-image {
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    color: var(--color-neutral-500);
    margin-bottom: 0;
}

/* Annual savings hint */
.pricing-annual-hint {
    margin-top: 0.5rem;
    margin-bottom: 0;
}
.pricing-annual-hint a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: var(--weight-medium);
    font-size: var(--text-sm);
}
.pricing-billed {
    font-size: var(--text-xs);
    color: var(--color-neutral-500);
    margin-bottom: 0;
    margin-top: 0.25rem;
}

/* CTA: pushed to bottom of card */
.pricing-card [role="button"] {
    margin-top: auto;
    padding-top: 1.5rem;
}

/* All plans include */
.plans-include {
    text-align: center;
    padding: clamp(2rem, 4vw, 4rem) 0;
    border-top: 1px solid var(--color-neutral-200);
    margin-top: clamp(2rem, 4vw, 4rem);
}
.plans-include h3 {
    margin-bottom: 1.5rem;
}
.plans-include-grid {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    max-width: 700px;
    margin: 0 auto;
}
.plans-include-item {
    text-align: left;
    flex: 0 1 180px;
}
.plans-include-item strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    margin-bottom: 0.125rem;
}
.plans-include-item small {
    color: var(--color-neutral-500);
}

/* ============================================
   Blog pages
   ============================================ */
.blog-breadcrumb {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: var(--text-sm);
  color: var(--color-neutral-500);
  margin-bottom: 0.75rem;
}
.blog-breadcrumb li { white-space: nowrap; }
.blog-breadcrumb li:last-child {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
.blog-breadcrumb [aria-current="page"] {
  font-weight: var(--weight-medium);
  color: var(--color-neutral-700);
}
.blog-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.blog-meta {
  color: var(--color-neutral-500);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

/* Article body */
.blog-content {
  line-height: 1.75;
  max-width: 65ch;
}
.blog-content h2 {
  margin-top: 2rem;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}
.blog-content h3 {
  margin-top: 1.5rem;
  font-size: var(--text-lg);
}
.blog-content code {
  font-size: 0.875em;
  padding: 0.125rem 0.25rem;
  background: var(--color-neutral-100);
  border-radius: 0.25rem;
}
.blog-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
  color: var(--color-neutral-600);
}
.blog-content ul, .blog-content ol {
  padding-left: 1.25rem;
}
.blog-content li + li {
  margin-top: 0.375rem;
}
.blog-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.blog-content a:hover {
  color: var(--color-primary-hover);
}

/* CTA block */
.blog-cta {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-primary-subtle);
  border: 1px solid var(--color-primary-border);
  border-radius: 0.5rem;
}
.blog-cta p { margin: 0; }
.blog-cta a {
  font-weight: var(--weight-medium);
}

/* Related articles */
.blog-related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-neutral-200);
}
.blog-related h2 {
  font-size: var(--text-lg);
  margin-bottom: 0.5rem;
}
.blog-related ul {
  padding-left: 0;
  list-style: none;
}
.blog-related li + li {
  margin-top: 0.375rem;
}
.blog-related a {
  text-decoration: none;
  color: var(--pico-primary);
}
.blog-related a:hover {
  text-decoration: underline;
}

/* Blog index list */
.blog-list-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-neutral-200);
}
.blog-list-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.blog-list-item h2 {
  margin-bottom: 0.25rem;
  font-size: var(--text-xl);
}
.blog-list-item h2 a {
  text-decoration: none;
  color: var(--color-neutral-800);
}
.blog-list-item h2 a:hover {
  color: var(--pico-primary);
}
.blog-list-item .blog-meta { margin-bottom: 0.5rem; }
.blog-list-item p:last-child {
  margin: 0;
  max-width: 65ch;
  color: var(--color-neutral-600);
}

/* Blog responsive adjustments */
@media (max-width: 576px) {
  .blog-cta {
    padding: 1rem;
  }
  .blog-content {
    line-height: 1.65;
  }
  .blog-related h2 {
    font-size: var(--text-base);
  }
}

/* Billing toggle visibility */
#billing-monthly:checked ~ .pricing-grid .price-annual,
#billing-monthly:checked ~ .pricing-grid .cta-annual,
#billing-monthly:checked ~ .pricing-grid .pricing-billed { display: none; }
#billing-annual:checked ~ .pricing-grid .price-monthly,
#billing-annual:checked ~ .pricing-grid .cta-monthly,
#billing-annual:checked ~ .pricing-grid .pricing-annual-hint { display: none; }

/* Billing page - usage bar */
.usage-section { margin: 1.5rem 0; }
.usage-numbers { margin-bottom: 0.5rem; font-size: 1.1rem; }
.usage-bar-track {
    width: 100%;
    height: 12px;
    background: var(--pico-secondary-background);
    border-radius: 6px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
    .usage-bar-fill { transition: none; }
}
.usage-bar-green { background: #22863a; }
.usage-bar-yellow { background: #b08800; }
.usage-bar-red { background: #cb2431; }
.usage-reset { margin-top: 0.5rem; font-size: 0.875rem; color: var(--pico-muted-color); }
.past-due-notice {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 2px solid #cb2431;
    border-radius: var(--pico-border-radius);
    color: #cb2431;
}
.tier-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tier-starter { background: #e3f2fd; color: #1565c0; }
.tier-pro { background: #f3e5f5; color: #7b1fa2; }
.tier-agency { background: #e8f5e9; color: #2e7d32; }
