/* Automatic Driving Lessons London — Flagship Editorial Educational Library Design System
 * © Masud Choudhury · 20 Years UK DVSA Approved Driving Instructor (ADI) · Driving Instructor Trainer · 07715 340108
 */
:root {
  --navy-950: #06101f;
  --navy-900: #0b1c36;
  --navy-800: #122b52;
  --navy-700: #1b3d73;
  --canvas: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --border: #dde5f0;
  --border-strong: #c4d2e5;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-50: #ecfdf5;
  --gold-600: #b45309;
  --gold-500: #f59e0b;
  --gold-400: #facc15;
  --gold-50: #fffbeb;
  --sky-600: #0284c7;
  --sky-50: #f0f9ff;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(6, 16, 31, 0.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink-900);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { max-width: 100%; height: auto; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* TOP CREDENTIAL BAR */
.top-trust {
  background: var(--navy-950);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 700;
  border-bottom: 1px solid rgba(250, 204, 21, 0.25);
}
.top-trust-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.top-trust strong { color: var(--gold-400); }
.top-trust a { color: #86efac; text-decoration: none; font-weight: 800; }

/* STICKY EDITORIAL NAVIGATION */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 28, 54, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold-400);
  box-shadow: 0 6px 24px rgba(6, 16, 31, 0.22);
}
.site-nav-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 11px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #059669, #1d4ed8);
  border: 2px solid var(--gold-400);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 950;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-text strong { display: block; font-size: 15.5px; font-weight: 900; color: #fff; letter-spacing: -0.01em; line-height: 1.2; }
.brand-text span { display: block; font-size: 11px; font-weight: 700; color: var(--gold-400); margin-top: 1px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nav-link {
  text-decoration: none;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(250, 204, 21, 0.45); }
.nav-link.active { background: var(--emerald-600); color: #fff; border-color: #6ee7b7; }
.nav-cta {
  text-decoration: none;
  background: var(--gold-400);
  color: var(--navy-950);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid #fef08a;
  transition: transform 0.14s ease, background 0.14s ease;
}
.nav-cta:hover { background: #fde047; transform: translateY(-1px); }

/* BREADCRUMBS */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 14px;
}
.breadcrumbs a { color: #cbd5e1; text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold-400); text-decoration: underline; }
.breadcrumbs span.sep { opacity: 0.5; }

/* DARK AUTHORITY HERO */
.lib-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.2), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(56, 189, 248, 0.16), transparent 45%),
    linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 52%, var(--navy-800) 100%);
  color: #f8fafc;
  padding: 44px 0 42px;
  border-bottom: 3px solid var(--gold-400);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.65);
  color: #fde047;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 14px;
}
.lib-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 950;
  line-height: 1.13;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 14px;
  max-width: 920px;
}
.lib-hero h1 em { font-style: normal; color: var(--gold-400); }
.hero-lead {
  font-size: 17px;
  color: #dbe7f6;
  max-width: 820px;
  margin-bottom: 22px;
  line-height: 1.62;
}

/* AI QUICK-ANSWER / KEY TAKEAWAY BOX */
.ai-summary-box {
  background: rgba(6, 16, 31, 0.78);
  border: 1.5px solid #34d399;
  border-left: 5px solid #10b981;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 22px;
  max-width: 940px;
}
.ai-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6ee7b7;
  margin-bottom: 6px;
}
.ai-summary-box p { font-size: 15px; color: #f1f5f9; line-height: 1.6; }
.ai-summary-box strong { color: #fde047; }

/* FACT STRIP */
.fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 22px 0 24px;
}
.fact-tile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  padding: 13px 15px;
}
.fact-tile small { display: block; font-size: 11px; font-weight: 800; color: #93c5fd; text-transform: uppercase; letter-spacing: 0.05em; }
.fact-tile strong { display: block; font-size: 15px; font-weight: 900; color: #fff; margin-top: 3px; }

/* BUTTONS */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}
.btn-emerald { background: var(--emerald-600); border-color: #6ee7b7; color: #fff; box-shadow: 0 8px 22px rgba(5, 150, 105, 0.28); }
.btn-emerald:hover { background: var(--emerald-700); transform: translateY(-1px); }
.btn-gold { background: var(--gold-400); border-color: #fef08a; color: var(--navy-950); }
.btn-gold:hover { background: #fde047; transform: translateY(-1px); }
.btn-navy { background: var(--navy-800); border-color: #3b63a3; color: #fff; }
.btn-navy:hover { background: var(--navy-700); border-color: var(--gold-400); }
.btn-light { background: #fff; border-color: var(--border-strong); color: var(--navy-900); }
.btn-light:hover { border-color: var(--emerald-600); color: var(--emerald-700); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

/* MAIN EDITORIAL SECTIONS */
.lib-section { padding: 48px 0; }
.lib-section.alt { background: #ffffff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lib-section.dark {
  background: linear-gradient(155deg, var(--navy-950), var(--navy-900));
  color: #f8fafc;
}
.sec-head { margin-bottom: 26px; max-width: 820px; }
.sec-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald-700);
  background: var(--emerald-50);
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.lib-section.dark .sec-eyebrow {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.5);
  color: var(--gold-400);
}
.sec-head h2 {
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink-900);
  margin-bottom: 8px;
}
.lib-section.dark .sec-head h2 { color: #ffffff; }
.sec-head p { font-size: 15.5px; color: var(--ink-700); }
.lib-section.dark .sec-head p { color: #cbd5e1; }

/* CARDS & GRIDS */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.ed-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.ed-card:hover { transform: translateY(-2px); border-color: var(--emerald-500); box-shadow: var(--shadow-md); }
.ed-card.featured { border: 2px solid var(--gold-500); background: linear-gradient(180deg, #fffdf5 0%, #ffffff 42%); }
.ed-card.dark-card {
  background: #0e203e;
  border-color: #244070;
  color: #f8fafc;
}
.ed-card.dark-card:hover { border-color: var(--gold-400); }
.ed-card.dark-card p { color: #cbd5e1; }

.tag-pill {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3.5px 10px;
  border-radius: 999px;
  background: var(--sky-50);
  color: var(--sky-600);
  border: 1px solid #bae6fd;
}
.tag-pill.gold { background: var(--gold-50); color: var(--gold-600); border-color: #fde68a; }
.tag-pill.green { background: var(--emerald-50); color: var(--emerald-700); border-color: #a7f3d0; }
.ed-card.dark-card .tag-pill { background: rgba(250, 204, 21, 0.14); color: #fde047; border-color: rgba(250, 204, 21, 0.5); }

.ed-card h3 { font-size: 18.5px; font-weight: 900; line-height: 1.28; color: var(--ink-900); }
.ed-card.dark-card h3 { color: #fff; }
.ed-card p { font-size: 14.5px; color: var(--ink-700); }
.ed-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 4px 0 8px; }
.ed-list li { font-size: 14px; color: var(--ink-700); padding-left: 20px; position: relative; }
.ed-list li::before { content: "✓"; position: absolute; left: 0; color: var(--emerald-600); font-weight: 950; }
.ed-card.dark-card .ed-list li { color: #e2e8f0; }
.ed-card.dark-card .ed-list li::before { color: #4ade80; }

/* 2-COLUMN READING ARTICLE LAYOUT (STICKY TOC + CONTENT) */
.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 36px 0 56px;
}
@media (max-width: 940px) {
  .article-layout { grid-template-columns: 1fr; }
}
.toc-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.toc-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.toc-box h4 {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  margin-bottom: 10px;
}
.toc-box ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toc-box a {
  display: block;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink-700);
  padding: 5px 8px;
  border-radius: 7px;
  border-left: 2.5px solid transparent;
}
.toc-box a:hover { background: var(--emerald-50); color: var(--emerald-700); border-left-color: var(--emerald-600); }
.sidebar-cta {
  background: linear-gradient(145deg, var(--navy-900), var(--navy-800));
  color: #f8fafc;
  border: 1.5px solid var(--gold-400);
  border-radius: var(--radius-md);
  padding: 18px;
}
.sidebar-cta strong { display: block; font-size: 15px; font-weight: 900; color: var(--gold-400); margin-bottom: 5px; }
.sidebar-cta p { font-size: 13px; color: #cbd5e1; margin-bottom: 12px; line-height: 1.5; }

/* ARTICLE PROSE */
.article-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.prose-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.prose-card h2 {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--navy-900);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--canvas);
}
.prose-card h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--navy-800);
  margin: 18px 0 8px;
}
.prose-card p { font-size: 15.5px; color: var(--ink-700); margin-bottom: 12px; }
.prose-card p:last-child { margin-bottom: 0; }
.prose-card ul, .prose-card ol { padding-left: 22px; margin: 10px 0 14px; color: var(--ink-700); }
.prose-card li { margin-bottom: 7px; font-size: 15px; }
.prose-card li strong { color: var(--ink-900); }

/* TRAINER CALLOUTS */
.trainer-tip {
  background: var(--emerald-50);
  border: 1.5px solid #a7f3d0;
  border-left: 5px solid var(--emerald-600);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
}
.trainer-tip.gold {
  background: var(--gold-50);
  border-color: #fde68a;
  border-left-color: var(--gold-500);
}
.trainer-tip strong.tip-title {
  display: block;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald-700);
  margin-bottom: 4px;
}
.trainer-tip.gold strong.tip-title { color: var(--gold-600); }
.trainer-tip p { font-size: 14.5px; color: var(--ink-900); margin: 0; }

/* TABLES */
.ed-table-wrap { overflow-x: auto; border-radius: 14px; border: 1.5px solid var(--border); box-shadow: var(--shadow-sm); }
.ed-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.ed-table th, .ed-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.ed-table th { background: var(--navy-900); color: var(--gold-400); font-weight: 900; font-size: 13.5px; }
.ed-table tr:last-child td { border-bottom: none; }
.ed-table td.yes { color: var(--emerald-700); font-weight: 850; background: #f3fdf8; }
.ed-table td.no { color: #b91c1c; font-weight: 700; }

/* SEARCH & FILTER BAR (LIBRARY HUB) */
.lib-search-bar {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: -28px;
  position: relative;
  z-index: 10;
}
.lib-search-input {
  flex: 1 1 280px;
  border: 1.5px solid var(--border-strong);
  border-radius: 11px;
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  outline: none;
}
.lib-search-input:focus { border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.fpill {
  background: var(--canvas);
  color: var(--ink-700);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}
.fpill:hover { border-color: var(--emerald-600); color: var(--emerald-700); }
.fpill.active { background: var(--navy-900); color: var(--gold-400); border-color: var(--navy-900); }

/* FAQ ACCORDIONS */
.ed-faq {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 15px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.ed-faq summary {
  font-size: 15.5px;
  font-weight: 900;
  color: var(--navy-900);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ed-faq summary::after { content: "+"; font-size: 20px; font-weight: 900; color: var(--emerald-600); }
.ed-faq[open] summary::after { content: "−"; }
.ed-faq p { margin-top: 10px; font-size: 14.8px; color: var(--ink-700); line-height: 1.62; }

/* E-E-A-T AUTHOR BIO CARD */
.author-box {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: #f8fafc;
  border: 2px solid var(--gold-400);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.author-meta { display: flex; align-items: center; gap: 15px; max-width: 720px; }
.author-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #2563eb);
  border: 2.5px solid var(--gold-400);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 950;
  color: #fff;
  flex-shrink: 0;
}
.author-meta strong { display: block; font-size: 17px; font-weight: 950; color: #fff; }
.author-meta .cred { display: block; font-size: 12.5px; font-weight: 850; color: var(--gold-400); margin: 2px 0 5px; }
.author-meta p { font-size: 13.5px; color: #cbd5e1; line-height: 1.5; margin: 0; }

/* AREA PILLS */
.area-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.area-pill {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--ink-900);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
a.area-pill:hover { border-color: var(--emerald-600); color: var(--emerald-700); background: var(--emerald-50); }

/* RICH INTERNAL-LINKING FOOTER */
.site-footer {
  background: var(--navy-950);
  color: #cbd5e1;
  border-top: 3px solid var(--gold-400);
  padding: 46px 0 84px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 26px;
  margin-bottom: 28px;
}
.site-footer h4 { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gold-400); margin-bottom: 11px; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.site-footer a { text-decoration: none; font-size: 13.5px; color: #cbd5e1; font-weight: 600; }
.site-footer a:hover { color: var(--gold-400); }
.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
}
.footer-bottom strong { color: var(--gold-400); }

/* DIAGRAM BOX */
.diagram-box {
  background: var(--navy-950);
  border: 2px solid #264273;
  border-radius: 16px;
  padding: 18px;
  margin: 16px 0;
  text-align: center;
}
.diagram-caption { font-size: 12.5px; color: #cbd5e1; margin-top: 10px; font-weight: 700; }

/* INTERACTIVE FLASHCARDS (SHOW ME TELL ME) */
.fc-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.fc-card:hover { border-color: var(--emerald-600); }
.fc-q { font-size: 16px; font-weight: 900; color: var(--navy-900); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fc-a {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--border-strong);
  font-size: 14.5px;
  color: var(--ink-700);
  display: none;
}
.fc-card.open .fc-a { display: block; }
.fc-card.open { border-color: var(--emerald-600); background: #fcfffd; }

/* CHECKLIST */
.chk-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  margin-bottom: 8px;
}
.chk-row input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--emerald-600); cursor: pointer; }
.chk-row.checked { background: var(--emerald-50); border-color: #6ee7b7; }
.chk-row.checked span { text-decoration: line-through; color: var(--ink-500); }

/* ============================================================================
 * RESPONSIVE POLISH — TABLET (<= 1024px) & MOBILE (<= 640px)
 * Ensures zero horizontal overflow & crisp tap targets across Phone, Tablet & Desktop
 * ============================================================================ */
html, body { max-width: 100%; overflow-x: clip; }

@media (max-width: 1024px) {
  .wrap { padding: 0 16px; }
  .site-nav-in { padding: 10px 16px; gap: 10px; }
  .lib-hero { padding: 34px 0 32px; }
  .lib-section { padding: 38px 0; }
  .article-layout { grid-template-columns: 1fr; gap: 20px; padding: 26px 0 42px; }
  .toc-sidebar { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .top-trust-in { padding: 6px 12px; font-size: 11.5px; justify-content: center; text-align: center; }
  .site-nav-in { padding: 9px 12px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; font-size: 16px; }
  .brand-text strong { font-size: 14px; }
  .brand-text span { font-size: 10px; }
  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
  }
  .nav-link, .nav-cta { white-space: nowrap; flex-shrink: 0; font-size: 11.8px; padding: 6px 9px; }
  .lib-hero { padding: 26px 0 26px; }
  .hero-kicker { font-size: 11px; padding: 4px 10px; }
  .lib-hero h1 { font-size: 26px; line-height: 1.16; }
  .hero-lead { font-size: 15px; }
  .ai-summary-box { padding: 14px 15px; }
  .ai-summary-box p { font-size: 14px; }
  .fact-strip, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .btn-row .btn { width: 100%; justify-content: center; min-height: 44px; }
  .ed-card .btn-row .btn, .btn-sm { width: auto; min-height: 38px; }
  .lib-section { padding: 30px 0; }
  .ed-card, .prose-card { padding: 18px 16px; }
  .prose-card h2 { font-size: 20px; }
  .lib-search-bar { padding: 12px; margin-top: -18px; }
  .lib-search-input { width: 100%; font-size: 14.5px; }
  .fpill { font-size: 12px; padding: 7px 11px; }
  .author-box { padding: 18px 16px; }
  .author-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .ed-table th, .ed-table td { padding: 10px 11px; font-size: 13px; }
}

