/* ==========================================================
   GutCareHub v2 — Recovery companion web app
   Warm cream + deep teal + coral. App-first, not blog-first.
   ========================================================== */

:root {
  /* Brand */
  --teal: #0F4C4A;
  --teal-dark: #0A3735;
  --teal-light: #1B6B68;
  --teal-50: #E8F1F0;
  --coral: #EA580C;
  --coral-dark: #C2410C;
  --coral-50: #FFF1E6;
  --gold: #D97706;
  --gold-50: #FEF7E6;

  /* Surfaces */
  --bg: #FBF7EE;
  --bg-cream: #F5EFDF;
  --surface: #FFFFFF;
  --surface-soft: #FAF5E8;

  /* Ink */
  --ink: #1A1F2C;
  --ink-soft: #4A5060;
  --ink-mute: #7A8090;
  --ink-dim: #A8AEBC;

  /* Lines */
  --border: #E8E0CC;
  --border-soft: #F0E9D4;
  --border-strong: #C9BFA3;

  /* Status */
  --success: #047857;
  --success-50: #D1FAE5;
  --warning: #D97706;
  --warning-50: #FEF3C7;
  --danger: #B91C1C;
  --danger-50: #FEE2E2;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(15, 76, 74, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 76, 74, 0.06), 0 1px 2px rgba(15, 76, 74, 0.04);
  --shadow: 0 4px 12px rgba(15, 76, 74, 0.07), 0 2px 4px rgba(15, 76, 74, 0.04);
  --shadow-md: 0 8px 20px rgba(15, 76, 74, 0.08), 0 4px 8px rgba(15, 76, 74, 0.05);
  --shadow-lg: 0 20px 40px rgba(15, 76, 74, 0.10), 0 8px 16px rgba(15, 76, 74, 0.05);
  --shadow-coral: 0 8px 20px rgba(234, 88, 12, 0.20);

  /* Type */
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Layout */
  --r-sm: 8px;
  --r: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;
  --container: 1200px;
  --container-narrow: 720px;
  --container-app: 1100px;
  --header-h: 70px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ==========================================================
   Type
   ========================================================== */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--teal-dark);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 0.55em;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.028em;
}

h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.018em;
}

h4 {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--teal-dark);
  letter-spacing: -0.005em;
}

p { margin: 0 0 1.1em; }

p.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(15, 76, 74, 0.25);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--coral-dark); text-decoration-color: var(--coral); }

ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }
li::marker { color: var(--coral); }

strong { font-weight: 700; color: var(--teal-dark); }
em { font-style: italic; }

::selection { background: var(--coral-50); color: var(--teal-dark); }

/* ==========================================================
   Layout
   ========================================================== */

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 1.5rem; }
.container-app { width: 100%; max-width: var(--container-app); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 5rem 0; }
@media (max-width: 720px) { section { padding: 3rem 0; } }

.section-tight { padding: 2.5rem 0; }
.bg-cream { background: var(--bg-cream); }
.bg-surface { background: var(--surface); }
.bg-teal { background: var(--teal); color: #fff; }
.bg-teal h1, .bg-teal h2, .bg-teal h3, .bg-teal h4 { color: #fff; }

/* Grain texture overlay (subtle, non-intrusive) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.025;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(15, 76, 74, 0.4) 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(234, 88, 12, 0.4) 1px, transparent 1px);
  background-size: 80px 80px, 110px 110px;
  mix-blend-mode: multiply;
}

/* ==========================================================
   Top notice
   ========================================================== */

.notice {
  background: var(--teal-dark);
  color: rgba(255,255,255,0.92);
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  text-align: center;
  letter-spacing: 0.005em;
  position: relative;
  z-index: 10;
}
.notice strong { color: #fff; font-weight: 700; }

/* ==========================================================
   Header / Nav
   ========================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 247, 238, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.nav {
  height: var(--header-h);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--teal-dark);
  text-decoration: none;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}
.brand:hover { color: var(--coral-dark); text-decoration: none; }

.brand-mark {
  width: 34px; height: 34px;
  background: var(--teal);
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
}
.brand-mark::before {
  content: "";
  width: 14px; height: 14px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  top: 11px; left: 13px;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
  padding: 0.4rem 0;
  position: relative;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--teal-dark);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 2.5px;
  background: var(--coral);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  width: 40px; height: 40px;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  margin: 4px auto;
  border-radius: 2px;
  transition: 0.25s;
}

@media (max-width: 920px) {
  .nav-cta-mobile-hide { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.2s, transform 0.2s;
  }
  .nav-links a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 1rem;
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links .btn { margin-top: 0.6rem; justify-content: center; }
}

/* ==========================================================
   Buttons
   ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.15s;
  letter-spacing: -0.005em;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; transform: none;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-coral {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  box-shadow: var(--shadow-coral);
}
.btn-coral:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
  color: #fff;
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.30);
}

.btn-ghost {
  background: transparent;
  color: var(--teal-dark);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.btn-text {
  background: transparent;
  color: var(--teal);
  border-color: transparent;
  padding: 0.5rem 0.8rem;
}
.btn-text:hover {
  color: var(--coral-dark);
  background: var(--coral-50);
  transform: none;
}

.btn-sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }

.btn-arrow::after {
  content: "→";
  margin-left: 0.15em;
  transition: transform 0.2s;
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* ==========================================================
   Hero (app-first)
   ========================================================== */

.hero {
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding: 2.5rem 0 2rem; }
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  color: var(--teal-dark);
  padding: 0.45rem 0.9rem;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.4rem;
}
.eyebrow-pill .dot {
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.hero h1 .accent {
  background: linear-gradient(105deg, var(--coral) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
  font-weight: 500;
  display: inline-block;
}

.hero-cta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  margin-bottom: 1.5rem;
}

.hero-trust {
  display: flex;
  gap: 1.6rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-mute);
}
.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-trust-item::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
}

/* App preview card (hero right side) */
.app-preview {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
}
.app-preview::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--coral) 0%, transparent 50%);
  opacity: 0.15;
  z-index: -1;
  filter: blur(20px);
}
.app-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.app-preview-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-r { background: #FF6B5B; }
.dot-y { background: #FFB94B; }
.dot-g { background: #4BD964; }
.app-preview-title {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-left: auto;
  font-weight: 500;
}

.preview-step-head {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral-dark);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.preview-q {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.preview-options { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.2rem; }
.preview-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 0.92rem;
  background: var(--surface);
}
.preview-option.is-selected {
  border-color: var(--coral);
  background: var(--coral-50);
  color: var(--coral-dark);
  font-weight: 600;
}
.preview-option-marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}
.preview-option.is-selected .preview-option-marker {
  border-color: var(--coral);
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--surface) inset;
}
.preview-progress {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.preview-progress-step {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
}
.preview-progress-step.is-done { background: var(--teal); }
.preview-progress-step.is-active { background: var(--coral); }

/* ==========================================================
   App tool cards (homepage)
   ========================================================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}
@media (max-width: 800px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 1.8rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 1.2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.tool-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal-light);
  color: inherit;
}

.tool-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--teal-50);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  font-weight: 700;
  font-family: var(--font-display);
}
.tool-card-icon.is-coral { background: var(--coral-50); color: var(--coral); }
.tool-card-icon.is-gold { background: var(--gold-50); color: var(--gold); }
.tool-card-body { flex: 1; }
.tool-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  letter-spacing: -0.018em;
}
.tool-card p {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.tool-card-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--ink-mute);
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.tool-card-meta span {
  background: var(--bg-cream);
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  font-weight: 500;
}
.tool-card-cta {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tool-card:hover .tool-card-cta { color: var(--coral-dark); }
.tool-card-cta::after { content: "→"; transition: transform 0.2s; }
.tool-card:hover .tool-card-cta::after { transform: translateX(4px); }

.tool-card.is-flagship {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  grid-column: 1 / -1;
  padding: 2.2rem;
}
.tool-card.is-flagship h3 { color: #fff; font-size: 1.45rem; }
.tool-card.is-flagship p { color: rgba(255,255,255,0.85); font-size: 1rem; max-width: 50ch; }
.tool-card.is-flagship .tool-card-icon { background: rgba(255,255,255,0.12); color: #fff; }
.tool-card.is-flagship .tool-card-meta span { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.tool-card.is-flagship .tool-card-cta { color: var(--coral-50); font-size: 1rem; }
.tool-card.is-flagship .tool-card-cta::before {
  content: "Start now";
  background: var(--coral);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  margin-right: 0.4rem;
}
.tool-card.is-flagship .tool-card-cta::after { content: ""; }

/* ==========================================================
   Section heading
   ========================================================== */

.section-head {
  margin-bottom: 2.5rem;
  max-width: 600px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: 0.6rem;
}
.section-head h2 { margin: 0 0 0.6rem; }
.section-head p { color: var(--ink-soft); font-size: 1.02rem; margin: 0; max-width: 55ch; }

/* ==========================================================
   App-style tool pages (plan, tracker, checker)
   ========================================================== */

.app-shell {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 760px;
  margin: 2.5rem auto;
}
@media (max-width: 700px) {
  .app-shell { padding: 1.6rem; border-radius: var(--r); margin: 1.5rem auto; }
}

.app-shell-wide {
  max-width: 980px;
}

.app-progress {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.app-progress-step {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  transition: background 0.25s;
}
.app-progress-step.is-active { background: var(--coral); }
.app-progress-step.is-done { background: var(--teal); }

.app-step-num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: 0.5rem;
}
.app-step-help {
  color: var(--ink-soft);
  font-size: 1rem;
  margin: 0 0 1.5rem;
  max-width: 60ch;
}

.app-step { display: none; }
.app-step.is-active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.5rem 0;
}
.app-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  width: 100%;
  line-height: 1.4;
}
.app-option:hover {
  border-color: var(--teal-light);
  background: var(--teal-50);
}
.app-option.is-selected {
  border-color: var(--coral);
  background: var(--coral-50);
}
.app-option-marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  background: var(--surface);
}
.app-option.is-selected .app-option-marker {
  border-color: var(--coral);
  background: var(--coral);
}
.app-option.is-selected .app-option-marker::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: #fff;
  border-radius: 50%;
}
.app-option-content { flex: 1; }
.app-option-title { display: block; font-weight: 600; }
.app-option-sub { display: block; font-size: 0.84rem; color: var(--ink-mute); margin-top: 0.15rem; font-weight: 400; }

.app-input {
  width: 100%;
  padding: 0.85rem 1.05rem;
  font-family: inherit;
  font-size: 0.96rem;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  transition: border-color 0.15s;
}
.app-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-50);
}
.app-input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 0.4rem;
}

.app-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}

/* ==========================================================
   App result (plan output, etc.)
   ========================================================== */

.result-banner {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  padding: 1.8rem 2rem;
  border-radius: var(--r-md);
  margin-bottom: 1.8rem;
  position: relative;
  overflow: hidden;
}
.result-banner::before {
  content: "";
  position: absolute;
  top: -50%; right: -10%;
  width: 50%; height: 200%;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.25), transparent 60%);
  pointer-events: none;
}
.result-banner.is-urgent {
  background: linear-gradient(135deg, var(--danger) 0%, #7F1D1D 100%);
}
.result-banner-eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.result-banner h2 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}
.result-banner p {
  color: rgba(255,255,255,0.9);
  margin: 0;
  font-size: 0.96rem;
  position: relative;
}

/* Plan blocks */
.plan-section {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 1.4rem;
  margin-bottom: 1.1rem;
}
.plan-section-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.plan-section-num {
  width: 30px; height: 30px;
  background: var(--teal);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.plan-section h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.plan-section p { margin: 0 0 0.7rem; color: var(--ink-soft); font-size: 0.94rem; }
.plan-section ul { margin: 0; padding-left: 1.2em; }
.plan-section li { margin-bottom: 0.35em; font-size: 0.92rem; color: var(--ink-soft); }
.plan-section li::marker { color: var(--coral); }

/* Affiliate product chip in plan */
.plan-product {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin: 0.7rem 0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.88rem;
}
.plan-product:hover {
  border-color: var(--coral);
  background: var(--coral-50);
  text-decoration: none;
}
.plan-product-icon {
  width: 36px; height: 36px;
  background: var(--bg-cream);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.plan-product-body { flex: 1; }
.plan-product-name { font-weight: 600; color: var(--teal-dark); display: block; }
.plan-product-meta { font-size: 0.78rem; color: var(--ink-mute); }
.plan-product-action {
  font-weight: 600;
  color: var(--coral-dark);
  font-size: 0.84rem;
  flex-shrink: 0;
}

/* Recommended articles in result */
.result-recs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 1.2rem 0;
}
@media (max-width: 600px) { .result-recs { grid-template-columns: 1fr; } }
.result-rec {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.result-rec:hover {
  background: var(--coral-50);
  border-color: var(--coral);
  color: var(--coral-dark);
  text-decoration: none;
}
.result-rec::after { content: "→"; }

/* ==========================================================
   Tracker (daily symptom logger)
   ========================================================== */

.tracker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 760px) { .tracker-grid { grid-template-columns: 1fr; } }

.tracker-stat {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 1.2rem;
}
.tracker-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.tracker-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--teal-dark);
  letter-spacing: -0.025em;
  line-height: 1;
}
.tracker-stat-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

.pain-scale {
  display: flex;
  gap: 0.3rem;
  margin: 1rem 0;
}
.pain-scale-step {
  flex: 1;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.9rem;
  transition: all 0.12s;
}
.pain-scale-step:hover {
  border-color: var(--teal-light);
  transform: translateY(-1px);
}
.pain-scale-step.is-selected {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  box-shadow: var(--shadow-sm);
}
.pain-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 0.3rem;
}

.tracker-entry-list {
  margin-top: 2rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
}
.tracker-entry {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
}
.tracker-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.84rem;
}
.tracker-entry-date { font-weight: 700; color: var(--teal-dark); }
.tracker-entry-pain {
  background: var(--coral-50);
  color: var(--coral-dark);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 0.78rem;
}
.tracker-entry-notes {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
}
.tracker-empty {
  text-align: center;
  color: var(--ink-mute);
  padding: 2rem 1rem;
  font-size: 0.92rem;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}
.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  user-select: none;
  transition: all 0.12s;
}
.checkbox-pill:hover { border-color: var(--teal-light); }
.checkbox-pill input { display: none; }
.checkbox-pill.is-checked {
  background: var(--teal-50);
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 600;
}
.checkbox-pill.is-checked::before {
  content: "✓";
  font-weight: 800;
  color: var(--teal);
}

/* Tracker chart (simple bar viz) */
.tracker-chart {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 1.4rem;
  margin: 1.5rem 0;
}
.tracker-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.tracker-chart-head h4 { margin: 0; font-size: 0.95rem; }
.tracker-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.chart-bar {
  flex: 1;
  background: var(--teal);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
  transition: opacity 0.15s;
}
.chart-bar:hover { opacity: 0.85; }
.chart-bar.is-empty { background: var(--border); min-height: 3px; }
.chart-bar.severe { background: var(--coral); }
.chart-bar.high { background: #F59E0B; }
.chart-bar-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--ink-mute);
  font-weight: 600;
}

/* ==========================================================
   Doctor prep
   ========================================================== */

.doctor-output {
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--r);
  padding: 2rem;
  margin: 1.5rem 0;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.55;
}
.doctor-output h3 { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 0.8rem; }
.doctor-output strong { color: var(--teal-dark); }

/* ==========================================================
   Article body (when used)
   ========================================================== */

.article-header {
  background: var(--bg-cream);
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs {
  font-size: 0.82rem;
  color: var(--ink-mute);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--coral-dark); }
.breadcrumbs .sep { color: var(--border-strong); }

.article-header h1 { max-width: 22ch; margin-bottom: 1rem; }
.article-header .lead { max-width: 60ch; margin-bottom: 1.5rem; }

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  align-items: center;
}
.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.review-badge::before {
  content: "✓";
  width: 16px; height: 16px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.article-body-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 3rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
@media (max-width: 1100px) {
  .article-body-wrap { grid-template-columns: minmax(0, 1fr) 280px; }
  .toc-sidebar { display: none; }
}
@media (max-width: 880px) {
  .article-body-wrap { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .ad-sidebar { display: none; }
}

.article-body {
  font-size: 1.04rem;
  line-height: 1.7;
}
.article-body p { max-width: 70ch; }
.article-body h2 { scroll-margin-top: 100px; margin-top: 2.5em; }
.article-body h3 { scroll-margin-top: 100px; margin-top: 2em; }

.toc-sidebar {
  position: sticky; top: calc(var(--header-h) + 16px);
  align-self: start; height: fit-content;
}
.toc-sidebar h4 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1rem;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 0.45rem; }
.toc-list a {
  font-size: 0.86rem;
  color: var(--ink-soft);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
  border-left: 2px solid var(--border);
  padding-left: 0.85rem;
  line-height: 1.4;
  transition: border-color 0.15s, color 0.15s;
}
.toc-list a:hover, .toc-list a.is-active {
  color: var(--teal-dark);
  border-color: var(--coral);
  font-weight: 600;
}

.ad-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

/* Article elements */
.callout {
  background: var(--surface-soft);
  border-left: 4px solid var(--teal);
  padding: 1.3rem 1.5rem;
  border-radius: 0 var(--r) var(--r) 0;
  margin: 2rem 0;
}
.callout h4 { margin: 0 0 0.4rem; font-size: 1rem; color: var(--teal-dark); }
.callout p:last-child { margin-bottom: 0; }
.callout.is-warning { background: var(--coral-50); border-color: var(--coral); }
.callout.is-warning h4 { color: var(--coral-dark); }
.callout.is-warning h4::before { content: "⚠ "; }
.callout.is-tip h4::before { content: "✦ "; color: var(--coral); }
.callout.is-info h4::before { content: "ℹ "; color: var(--teal); }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.compare-table th {
  background: var(--bg-cream);
  font-weight: 700;
  color: var(--teal-dark);
}
.compare-table td:first-child {
  font-weight: 600;
  color: var(--teal-dark);
  background: rgba(245, 239, 223, 0.4);
}
.compare-table tr:last-child td { border-bottom: 0; }

.faq-list { margin: 2rem 0; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 0.7rem;
  overflow: hidden;
}
.faq-q {
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 1.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
  font-family: var(--font-sans);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--coral);
  transition: transform 0.25s;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
details[open] .faq-q::after { content: "−"; }
details[open] .faq-q { border-bottom: 1px solid var(--border); }
.faq-a { padding: 1.1rem 1.3rem; color: var(--ink-soft); font-size: 0.96rem; }
.faq-a p:first-child { margin-top: 0; }
.faq-a p:last-child { margin-bottom: 0; }

/* ==========================================================
   Affiliate product cards
   ========================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin: 2rem 0;
}
@media (max-width: 700px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card.is-pick { border-color: var(--coral); border-width: 2px; }
.product-card.is-pick::before {
  content: "Editor's Pick";
  position: absolute;
  top: -10px; left: 16px;
  background: var(--coral);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
}
.product-card h4 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.product-rating { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.6rem; }
.product-rating .stars { color: var(--coral); letter-spacing: 0.05em; margin-right: 0.35rem; }
.product-card p { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 1rem; line-height: 1.55; flex-grow: 1; }
.product-affiliate-note { font-size: 0.74rem; color: var(--ink-mute); margin: 0.5rem 0 0; font-style: italic; }

/* ==========================================================
   Newsletter
   ========================================================== */

.newsletter-card {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--teal-dark);
}
.newsletter-card::before {
  content: "";
  position: absolute;
  top: -40%; right: -15%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.20), transparent 60%);
  pointer-events: none;
}
.newsletter-card-content { position: relative; max-width: 540px; margin: 0 auto; }
.newsletter-card h2 { color: #fff; margin: 0 0 0.7rem; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.newsletter-card p { color: rgba(255,255,255,0.85); margin: 0 0 1.8rem; font-size: 1rem; }

.newsletter-form {
  display: flex;
  gap: 0.6rem;
  max-width: 460px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.newsletter-form input {
  flex: 1 1 240px;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-pill);
  border: 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: rgba(255,255,255,0.96);
  color: var(--ink);
}
.newsletter-form input:focus { outline: 2px solid var(--coral); outline-offset: 2px; }
.newsletter-form button { flex-shrink: 0; }
.newsletter-fineprint {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
  margin: 1rem 0 0;
}
.newsletter-fineprint a { color: rgba(255,255,255,0.9); }

.newsletter-success {
  display: none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  padding: 1.2rem;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.newsletter-success.show { display: block; }

.newsletter-inline {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 1.6rem;
  margin: 2rem 0;
}
.newsletter-inline h4 {
  color: var(--teal-dark);
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.newsletter-inline p { font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 1rem; }
.newsletter-inline .newsletter-form input { background: var(--surface); border: 1px solid var(--border); }

/* ==========================================================
   Ad slot (AdSense placeholder)
   ========================================================== */

.ad-slot {
  background: linear-gradient(135deg, #f5efdf, #e8e0cc);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
  color: var(--ink-mute);
}
.ad-slot-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
  position: absolute;
  top: 0.5rem; left: 0.8rem;
}
.ad-slot-text { font-size: 0.85rem; text-align: center; padding: 1rem; }
.ad-slot-text code {
  background: rgba(255,255,255,0.6);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.78rem;
}
.ad-slot-leaderboard { min-height: 100px; }
.ad-slot-rectangle { min-height: 250px; }
.ad-slot-sidebar { min-height: 600px; }

/* ==========================================================
   Footer
   ========================================================== */

.app-footer {
  background: var(--teal-dark);
  color: rgba(255,255,255,0.78);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  position: relative;
  z-index: 5;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand h4 { color: #fff; margin: 0.6rem 0; font-size: 1.05rem; }
.footer-brand p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
  line-height: 1.55;
  max-width: 30ch;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
  font-family: var(--font-sans);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col a {
  color: rgba(255,255,255,0.78);
  font-size: 0.88rem;
  text-decoration: none;
}
.footer-col a:hover { color: var(--coral); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: rgba(255,255,255,0.7); text-decoration: none; }
.footer-bottom a:hover { color: var(--coral); }

/* ==========================================================
   Modal
   ========================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 55, 53, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fadeBg 0.25s ease;
}
.modal-backdrop.show { display: flex; }
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) { .modal { padding: 1.8rem; } }

.modal-close {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  width: 34px; height: 34px;
  background: var(--bg-cream);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}
.modal-close:hover { background: var(--coral-50); color: var(--coral-dark); }

.modal-icon {
  width: 64px; height: 64px;
  background: var(--coral-50);
  color: var(--coral);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  margin: 0 auto 1.2rem;
}
.modal h3 { text-align: center; margin: 0 0 0.5rem; font-size: 1.4rem; }
.modal p { text-align: center; color: var(--ink-soft); margin: 0 0 1.5rem; font-size: 0.95rem; }

/* ==========================================================
   Library / articles index
   ========================================================== */

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
  margin-top: 2rem;
}
@media (max-width: 900px) { .library-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .library-grid { grid-template-columns: 1fr; } }

.library-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 1.5rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.library-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--teal-light);
  color: inherit;
}
.library-card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: 0.6rem;
}
.library-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.library-card p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 0 0 1.2rem;
  flex-grow: 1;
  line-height: 1.5;
}
.library-card-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.76rem;
  color: var(--ink-mute);
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-soft);
}
.library-card-meta span::before { content: "•"; margin-right: 0.5rem; color: var(--border-strong); }
.library-card-meta span:first-child::before { content: ""; margin-right: 0; }

/* ==========================================================
   Misc utilities
   ========================================================== */

.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }
.mb-2 { margin-bottom: 2rem; }

.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--teal);
  color: #fff;
  padding: 0.6rem 1rem;
  text-decoration: none;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

.divider-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-mute);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 1.5rem 0;
}
.divider-text::before, .divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: translateY(0); }

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

@media print {
  .app-header, .app-footer, .ad-slot, .newsletter-card, .modal-backdrop, .toc-sidebar, .ad-sidebar, .notice { display: none !important; }
  .article-body-wrap { grid-template-columns: 1fr; padding: 0; }
  body { background: #fff; }
  body::before { display: none; }
}
