:root {
  --bg: #f2eee4;
  --bg-alt: #e9e2d2;
  --paper: #fbfaf5;
  --paper-warm: #f7f3e9;
  --panel: rgba(251, 250, 245, 0.9);
  --panel-strong: rgba(255, 253, 247, 0.96);
  --text: #1e2924;
  --muted: #66716a;
  --line: rgba(56, 55, 48, 0.14);
  --line-strong: rgba(47, 58, 52, 0.28);
  --accent: #173f35;
  --accent-soft: #637f73;
  --accent-quiet: #ebe7dc;
  --gold: #aa8d5f;
  --gold-soft: rgba(170, 141, 95, 0.18);
  --ink: #111816;
  --shadow: 0 28px 70px rgba(48, 43, 33, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --sidebar-width: 292px;
  --display-font: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
    "STSong", "SimSun", "Iowan Old Style", Georgia, serif;
  --body-font: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  /* Stage accent colors */
  --stage-1: #4a8c6f;
  --stage-1-soft: rgba(74, 140, 111, 0.12);
  --stage-2: #3a6b8c;
  --stage-2-soft: rgba(58, 107, 140, 0.12);
  --stage-3: #5c4a8c;
  --stage-3-soft: rgba(92, 74, 140, 0.12);
  --stage-4: #8c5a3a;
  --stage-4-soft: rgba(140, 90, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--body-font);
  background:
    radial-gradient(circle at top left, rgba(115, 150, 138, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(147, 167, 160, 0.2), transparent 22%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(78, 95, 88, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 95, 88, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.34), transparent 92%);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== SITE SHELL & SIDEBAR ===== */

.site-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: rgba(252, 251, 248, 0.72);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(39, 74, 64, 0.18) transparent;
}

.sidebar__brand {
  margin-bottom: 22px;
}

.sidebar__eyebrow,
.section-label,
.eyebrow,
.nav-group__title,
.topbar__course,
.hero__panel-title,
.prompt-box__header span,
.notes-box__title,
.pager__label {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.sidebar__title {
  display: block;
  margin-top: 8px;
  font-family: var(--display-font);
  font-size: 29px;
  line-height: 1.12;
}

/* ===== TREE NAVIGATION ===== */

.nav-group + .nav-group {
  margin-top: 20px;
}

.nav-group__title {
  position: relative;
  padding-left: 20px;
  cursor: pointer;
  user-select: none;
  padding-top: 4px;
  padding-bottom: 4px;
  margin-bottom: 2px;
  transition: color 160ms ease;
}

.nav-group__title:hover {
  color: var(--text);
}

.nav-group__title::before {
  content: "▾";
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.nav-group.is-collapsed .nav-group__title::before {
  transform: translateY(-50%) rotate(-90deg);
}

.nav-group.is-collapsed .nav-link {
  display: none;
}

.nav-link {
  display: block;
  padding: 12px 14px 12px 22px;
  margin-top: 6px;
  border-radius: 14px;
  color: var(--muted);
  transition: 160ms ease;
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.nav-link.is-active {
  background: linear-gradient(135deg, rgba(34, 75, 64, 0.92), rgba(78, 121, 109, 0.9));
  color: #f5faf8;
  box-shadow: 0 10px 25px rgba(38, 62, 56, 0.18);
}

/* ===== MAIN PANEL ===== */

.main-panel {
  width: 100%;
  min-width: 0;
  padding: 24px 0 38px 40px;
}

/* ===== TOPBAR ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  padding: 14px 40px 14px 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: rgba(252, 251, 248, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Search */

.topbar__search {
  flex: 0 1 240px;
  min-width: 0;
}

#search-input {
  width: 100%;
  padding: 7px 14px 7px 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: rgba(239, 244, 241, 0.8);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--body-font);
  outline: none;
  transition: 180ms ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%236d8a7e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
}

#search-input::placeholder {
  color: var(--muted);
  opacity: 0.65;
}

#search-input:focus {
  border-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(39, 74, 64, 0.1);
}

/* Buttons */

.topbar__button,
.ghost-button,
.primary-button,
.secondary-button {
  border: none;
  cursor: pointer;
  font: inherit;
}

.topbar__button,
.ghost-button {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent-quiet);
  color: var(--accent);
}

.topbar__button:hover,
.ghost-button:hover {
  background: rgba(39, 74, 64, 0.12);
}

/* ===== CONTENT VIEW ===== */

.content-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 40px;
}

.panel {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

/* Hero and article header keep more presence */
.hero.panel,
.article-header.panel {
  padding: 40px 0 32px;
  border-bottom: 2px solid rgba(39, 74, 64, 0.18);
}

/* Practice panel (quick start) */
.practice-panel.panel {
  background: rgba(237, 243, 240, 0.5);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 8px 0 24px;
  border: 1px solid rgba(44, 72, 63, 0.1);
}

/* Last panel in a sequence: no bottom border */
.panel:last-child {
  border-bottom: none;
}

/* ===== SAFETY BANNER ===== */

.safety-banner {
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.12), rgba(99, 179, 237, 0.04));
  border: 1px solid rgba(99, 179, 237, 0.3);
}

.safety-banner__title {
  font-family: var(--display-font);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}

.safety-banner__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.safety-banner__list li {
  position: relative;
  padding-left: 22px;
  line-height: 1.65;
  color: var(--muted);
  font-size: 0.92rem;
}

.safety-banner__list li::before {
  content: "💡";
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 0.88rem;
}

/* ===== HERO ===== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(240px, 0.72fr);
  gap: 20px;
  align-items: stretch;
}

.display-title,
.display-subtitle,
.article-header h1,
.practice-panel h2,
.hero__panel-title,
.stage-card h3 {
  font-family: var(--display-font);
}

.display-title {
  margin: 14px 0 0;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 1.04;
}

.display-subtitle {
  margin: 12px 0 0;
  font-size: clamp(1.6rem, 2.5vw, 2.3rem);
  line-height: 1.18;
  color: #304039;
}

.hero__statement {
  margin: 18px 0 0;
  max-width: 44rem;
  color: #233e36;
  font-size: 1.1rem;
  line-height: 1.8;
  font-weight: 600;
}

.lead {
  margin: 18px 0 0;
  max-width: 70ch;
  color: #4f645c;
  font-size: 1.06rem;
  line-height: 1.9;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(239, 244, 241, 0.95);
  border: 1px solid rgba(39, 74, 64, 0.08);
  color: #40564e;
  font-size: 0.92rem;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 120px;
  min-height: 84px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(245, 248, 246, 0.98), rgba(235, 242, 238, 0.92));
  border: 1px solid rgba(39, 74, 64, 0.08);
}

.stat-pill__value {
  font-family: var(--display-font);
  font-size: 2rem;
  line-height: 1;
  color: #213b33;
}

.stat-pill__label {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 24px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, #21473d, #4d776b);
  color: #f6fbf9;
  box-shadow: 0 16px 30px rgba(39, 74, 64, 0.22);
}

.primary-button:hover {
  box-shadow: 0 20px 36px rgba(39, 74, 64, 0.3);
  transform: translateY(-1px);
}

.secondary-button {
  background: #f1f5f2;
  color: var(--accent);
}

.secondary-button:hover {
  background: #e8efe9;
}

.hero__panel {
  padding: 22px 0 22px 28px;
  border-left: 3px solid rgba(39, 74, 64, 0.18);
}

.hero__panel-title {
  margin-bottom: 14px;
}

.hero-focus-list {
  display: grid;
  gap: 12px;
}

.hero-focus-list span {
  display: block;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(39, 74, 64, 0.08);
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 1.2rem;
  line-height: 1.25;
}

.hero__panel-quote {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(39, 74, 64, 0.08);
}

.hero__panel-quote-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 700;
}

.hero__panel-quote p {
  margin: 0;
  color: #2f4740;
  line-height: 1.8;
}

/* ===== GRID LAYOUTS ===== */

.split-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.split-grid--wide {
  grid-template-columns: 1.1fr 1fr;
}

.article-grid--module {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.body-copy,
.article-card p,
.stage-card p,
.nav-card__summary,
.resource-item__note,
.prompt-box pre,
.notes-box li {
  line-height: 1.85;
}

.muted-copy {
  color: var(--muted);
  font-size: 0.94rem;
}

.bullet-list,
.ordered-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #32463f;
}

.bullet-list li,
.ordered-list li {
  margin: 0.35rem 0;
}

.compact-list li {
  margin: 0.28rem 0;
}

.stage-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.learning-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.learning-step {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(248, 250, 248, 0.96), rgba(241, 246, 243, 0.84)),
    radial-gradient(circle at top right, rgba(94, 133, 120, 0.13), transparent 44%);
  transition: 180ms ease;
}

.learning-step:hover {
  transform: translateY(-2px);
  border-color: rgba(44, 72, 63, 0.22);
  box-shadow: 0 18px 34px rgba(47, 66, 59, 0.1);
}

.learning-step__number {
  margin-bottom: 22px;
  color: rgba(39, 74, 64, 0.34);
  font-family: var(--display-font);
  font-size: 2rem;
  line-height: 1;
}

.learning-step__title {
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 1.55rem;
  line-height: 1.2;
}

.learning-step__text {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.96rem;
}

.card-grid--scenes {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stage-card,
.nav-card,
.resource-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  padding: 22px;
  border-radius: var(--radius-md);
  background: rgba(248, 250, 248, 0.95);
  border: 1px solid var(--line);
}

.stage-card h3,
.practice-panel h2,
.article-header h1 {
  margin: 0;
}

.stage-card h3 {
  font-size: 1.45rem;
}

/* Stage card color variants */

.stage-card {
  border-left: 4px solid var(--line);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.stage-card:nth-child(1) { border-left-color: var(--stage-1); }
.stage-card:nth-child(2) { border-left-color: var(--stage-2); }
.stage-card:nth-child(3) { border-left-color: var(--stage-3); }
.stage-card:nth-child(4) { border-left-color: var(--stage-4); }

.stage-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(47, 66, 59, 0.12);
}

/* ===== NAV CARD ===== */

.nav-card {
  transition: 180ms ease;
  position: relative;
  overflow: hidden;
}

.nav-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #31584d, #7aa093);
}

.nav-card:hover,
.resource-item:hover {
  transform: translateY(-2px);
  border-color: rgba(44, 72, 63, 0.2);
  box-shadow: 0 18px 34px rgba(47, 66, 59, 0.1);
}

.nav-card__kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 800;
}

.nav-card__title,
.resource-item__title {
  font-family: var(--display-font);
  font-size: 1.4rem;
  line-height: 1.25;
}

.nav-card__summary,
.resource-item__note {
  color: var(--muted);
  font-size: 0.95rem;
}

.article-header h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.08;
}

.article-header .chip-row {
  margin-top: 18px;
}

/* ===== PRACTICE PANEL ===== */

.practice-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  background:
    linear-gradient(135deg, rgba(237, 243, 240, 0.96), rgba(250, 249, 244, 0.92)),
    radial-gradient(circle at top right, rgba(94, 133, 120, 0.16), transparent 42%);
  border-color: rgba(44, 72, 63, 0.18);
  color: var(--text);
  box-shadow: 0 18px 38px rgba(66, 87, 77, 0.12);
  overflow: hidden;
}

.practice-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  bottom: 26px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
}

.practice-panel .section-label {
  color: var(--accent-soft);
}

.practice-panel h2 {
  color: var(--accent);
}

.practice-panel .body-copy {
  color: var(--muted);
}

/* ===== PROMPT BOX ===== */

.prompt-box {
  margin-top: 14px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(44, 72, 63, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 250, 247, 0.94)),
    radial-gradient(circle at top right, rgba(94, 133, 120, 0.12), transparent 42%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.68),
    0 12px 26px rgba(47, 66, 59, 0.06);
}

.prompt-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(44, 72, 63, 0.12);
  background: linear-gradient(90deg, rgba(237, 243, 240, 0.95), rgba(247, 250, 248, 0.84));
}

.prompt-box__header span {
  color: var(--accent);
  font-weight: 800;
}

.prompt-box pre {
  margin: 0;
  padding: 20px 22px 24px;
  white-space: pre-wrap;
  font-size: 0.95rem;
  color: #29433b;
  font-family: "Cascadia Code", "Consolas", monospace;
  line-height: 1.85;
  background-image: linear-gradient(90deg, rgba(39, 74, 64, 0.06) 0 3px, transparent 3px);
}

.practice-panel .ghost-button {
  background: rgba(94, 133, 120, 0.14);
  color: var(--accent);
}

.practice-panel .ghost-button:hover {
  background: rgba(94, 133, 120, 0.22);
}

/* ===== NOTES BOX ===== */

.notes-box {
  margin-top: 8px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(237, 243, 240, 0.9);
}

/* ===== RESOURCES ===== */

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent-quiet);
  color: var(--accent);
  font-size: 0.93rem;
}

.resource-section-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid rgba(44, 72, 63, 0.16);
}

/* ===== TABLE ===== */

.table-wrapper {
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 18px;
  border: 1px solid rgba(44, 72, 63, 0.16);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(47, 66, 59, 0.06);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.93rem;
  line-height: 1.65;
}

thead th {
  background: linear-gradient(180deg, rgba(237, 243, 240, 0.98), rgba(226, 236, 231, 0.94));
  color: #1f3f36;
  font-weight: 800;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(44, 72, 63, 0.18);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(44, 72, 63, 0.1);
  color: var(--text);
  background: rgba(255, 255, 255, 0.46);
}

tbody tr:nth-child(even) td {
  background: rgba(244, 248, 246, 0.6);
}

tbody td:first-child {
  color: var(--accent);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: transparent;
}

tbody tr:hover td {
  background: rgba(237, 243, 240, 0.86);
}

/* ===== CALLOUT / ALERT BOX ===== */

.callout {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  background: rgba(237, 243, 240, 0.7);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.callout--warning {
  border-left-color: #c8953a;
  background: rgba(252, 245, 230, 0.7);
}

.callout--tip {
  border-left-color: var(--stage-1);
  background: rgba(74, 140, 111, 0.08);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

/* ===== PAGER ===== */

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pager__item {
  min-height: 96px;
  padding: 18px 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(47, 66, 59, 0.08);
  transition: 180ms ease;
}

.pager__item--next {
  text-align: right;
}

.pager__title {
  margin-top: 8px;
  font-family: var(--display-font);
  font-size: 1.3rem;
  line-height: 1.2;
}

.pager__item--ghost {
  visibility: hidden;
}

.pager__item:hover {
  border-color: rgba(44, 72, 63, 0.2);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 34px rgba(47, 66, 59, 0.1);
  transform: translateY(-2px);
}

/* ===== SIDEBAR OVERLAY & TOGGLE ===== */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.4);
  backdrop-filter: blur(3px);
  z-index: 8;
  opacity: 0;
  transition: opacity 250ms ease;
}

.sidebar-overlay.is-visible {
  opacity: 1;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #f5faf8;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(39, 74, 64, 0.3);
  transition: 160ms ease;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(39, 74, 64, 0.4);
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

/* ===== LECTURE MODE ===== */

body.lecture-mode .sidebar {
  display: none;
}

body.lecture-mode .site-shell {
  grid-template-columns: 1fr;
}

body.lecture-mode .main-panel {
  padding: 24px clamp(20px, 5vw, 64px) 40px;
}

body.lecture-mode .panel {
  padding: 38px;
}

body.lecture-mode .article-header h1,
body.lecture-mode .display-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
}

body.lecture-mode .lead,
body.lecture-mode .body-copy,
body.lecture-mode li,
body.lecture-mode .nav-card__summary,
body.lecture-mode .resource-item__note {
  font-size: 1.08rem;
}

body.lecture-mode .chip {
  font-size: 1rem;
}

body.lecture-mode .stat-pill__value {
  font-size: 2.4rem;
}

body.lecture-mode .topbar {
  top: 10px;
}

body.lecture-mode .sidebar-toggle {
  display: none !important;
}

body.lecture-mode .sidebar-overlay {
  display: none !important;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1180px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar__nav {
    flex: none;
    overflow-y: visible;
  }

  .hero,
  .split-grid,
  .article-grid,
  .pager {
    grid-template-columns: 1fr;
  }

  .topbar__search {
    flex: 1 1 auto;
    max-width: 260px;
  }
}

@media (max-width: 720px) {
  .main-panel,
  .sidebar {
    padding: 18px;
  }

  .panel {
    padding: 22px;
    border-radius: 22px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar__meta {
    flex: 1;
  }

  .topbar__search {
    flex: 1 1 100%;
    order: 3;
  }

  .topbar__actions {
    flex: 0 0 auto;
  }

  /* Mobile sidebar overlay */

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: 340px;
    height: 100vh;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 260ms ease;
    border-right: 1px solid var(--line);
    border-bottom: none;
    overflow-y: auto;
    padding-top: 28px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  .sidebar-toggle {
    display: flex;
  }

  body.lecture-mode .sidebar-toggle {
    display: none !important;
  }

  /* Tables responsive */
  .table-wrapper {
    margin: 10px 0;
  }

  table {
    font-size: 0.82rem;
  }

  thead th,
  tbody td {
    padding: 7px 10px;
  }

  .stage-card {
    border-left-width: 3px;
  }

  .pager {
    gap: 12px;
  }

  .pager__item {
    min-height: 80px;
    padding: 14px 16px;
  }
}

/* ===== FOCUS ===== */

a:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
#search-input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

#search-input:focus-visible {
  border-radius: 999px;
}

/* ===== REDUCED MOTION ===== */

/* ===== COURSE CONTENT PATTERNS ===== */

.section-heading {
  font-family: var(--display-font);
  font-size: clamp(1.65rem, 2.1vw, 2.1rem);
  margin: 0 0 18px;
  line-height: 1.2;
  color: var(--accent);
}

.section-panel > .section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
}

.section-panel > .section-heading::before {
  content: "";
  width: 6px;
  height: 1.25em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  flex: 0 0 auto;
}

.home-section-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
}

.home-section-title::after {
  content: "";
  width: 52px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(94, 133, 120, 0.18));
}

.section-panel {
  scroll-margin-top: 90px;
  padding: 28px 0;
}

.section-active {
  /* document mode: no special highlight needed */
}

.template-label {
  margin-top: 18px;
}

.path-grid,
.detail-grid,
.cards-grid {
  display: grid;
  gap: 14px;
}

.path-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.path-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: rgba(248, 250, 248, 0.95);
  border: 1px solid var(--line);
  transition: 180ms ease;
}

.path-card:hover {
  transform: translateY(-2px);
  border-color: rgba(44, 72, 63, 0.22);
  box-shadow: 0 18px 34px rgba(47, 66, 59, 0.1);
}

.path-card__title {
  font-family: var(--display-font);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--accent);
}

.path-card__for,
.path-card__route {
  line-height: 1.7;
  color: var(--muted);
  font-size: 0.94rem;
}

.path-card__route {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.mini-stage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-stage {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 248, 0.95);
  border: 1px solid var(--line);
}

.mini-stage strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}

.mini-stage span {
  display: block;
  line-height: 1.7;
  color: var(--muted);
  font-size: 0.94rem;
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 16px;
}

.detail-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.detail-card {
  position: relative;
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(44, 72, 63, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 246, 0.92)),
    radial-gradient(circle at top right, rgba(94, 133, 120, 0.1), transparent 46%);
  box-shadow: 0 12px 28px rgba(47, 66, 59, 0.055);
  overflow: hidden;
}

.detail-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(39, 74, 64, 0.86), rgba(94, 133, 120, 0.32));
}

.detail-card__label,
.content-block__label {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(237, 243, 240, 0.78);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent);
}

.detail-card p {
  margin: 0;
  line-height: 1.75;
  color: var(--text);
  font-size: 0.98rem;
}

.content-block {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(44, 72, 63, 0.1);
  border-radius: 18px;
  background: rgba(250, 251, 248, 0.66);
}

.case-intro {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: rgba(237, 243, 240, 0.78);
  border-left: 4px solid var(--accent);
}

.case-intro .body-copy {
  margin: 0;
}

.case-audience {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(248, 250, 248, 0.96);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  color: var(--accent);
}

.faq-item p {
  margin: 0;
  padding: 0 18px 10px;
  line-height: 1.8;
  color: var(--text);
}

.faq-item span {
  display: block;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.table-caption {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(237, 243, 240, 0.7);
  border-radius: 12px;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.7;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

.card-simple {
  position: relative;
  padding: 20px 22px 22px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 246, 0.92));
  border: 1px solid rgba(44, 72, 63, 0.14);
  box-shadow: 0 12px 28px rgba(47, 66, 59, 0.06);
  overflow: hidden;
}

.card-simple::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--accent), rgba(94, 133, 120, 0.18));
}

.card-simple__title {
  font-family: var(--display-font);
  font-size: 1.28rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--accent);
  line-height: 1.25;
}

.card-simple__content {
  font-size: 0.96rem;
  line-height: 1.78;
  color: #32463f;
}

.interface-map {
  display: grid;
  grid-template-columns: minmax(380px, 1.35fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.interface-map__mock {
  min-height: 310px;
  display: grid;
  grid-template-columns: 0.78fr 1.5fr 0.9fr;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(39, 74, 64, 0.18);
  background:
    linear-gradient(135deg, rgba(237, 243, 240, 0.95), rgba(248, 250, 248, 0.86)),
    radial-gradient(circle at top left, rgba(94, 133, 120, 0.2), transparent 45%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.interface-map__sidebar,
.interface-map__topbar,
.interface-map__chat,
.interface-map__input,
.interface-map__result {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(39, 74, 64, 0.14);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.88rem;
  text-align: center;
}

.interface-map__sidebar {
  background: rgba(39, 74, 64, 0.9);
  color: #f5faf8;
  writing-mode: vertical-rl;
  letter-spacing: 0.16em;
}

.interface-map__main {
  display: grid;
  grid-template-rows: 50px 1fr 56px;
  gap: 10px;
}

.interface-map__topbar {
  background: rgba(255, 255, 255, 0.94);
}

.interface-map__chat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(237, 243, 240, 0.76));
  color: rgba(39, 74, 64, 0.72);
}

.interface-map__input {
  background: rgba(255, 255, 255, 0.92);
}

.interface-map__result {
  background: rgba(94, 133, 120, 0.13);
  color: var(--accent);
}

.interface-map__cards {
  display: grid;
  gap: 12px;
}

.interface-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(248, 250, 248, 0.96);
}

.interface-card__index {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(39, 74, 64, 0.92);
  color: #f5faf8;
  font-family: var(--display-font);
  font-size: 1.02rem;
}

.interface-card h3 {
  margin: 0 0 6px;
  font-family: var(--display-font);
  font-size: 1.12rem;
  color: var(--accent);
}

.interface-card p {
  margin: 0;
  line-height: 1.65;
  color: var(--text);
}

.interface-card span {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.chapter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 24px;
  align-items: start;
}

.chapter-layout__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chapter-nav {
  position: sticky;
  top: 100px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.chapter-nav__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.chapter-nav__link {
  display: block;
  min-height: 34px;
  padding: 8px 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  transition: color 160ms ease, transform 160ms ease;
}

.chapter-nav__link:hover {
  color: var(--text);
  transform: translateX(3px);
}

.chapter-nav__link.is-active {
  color: var(--accent);
  font-weight: 600;
}

/* ===== DOCUMENT MODE REFINEMENT ===== */

.hero__panel {
  padding: 22px 0 22px 30px;
  border-left: 2px solid rgba(39, 74, 64, 0.24);
}

.hero-focus-list {
  gap: 0;
  border-top: 1px solid rgba(44, 72, 63, 0.14);
}

.hero-focus-list span {
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid rgba(44, 72, 63, 0.12);
  border-radius: 0;
  background: transparent;
  font-size: 1.12rem;
}

.learning-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: learning-step;
  border-top: 1px solid rgba(44, 72, 63, 0.18);
}

.learning-step {
  display: grid;
  grid-template-columns: 76px minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-height: 0;
  padding: 20px 0;
  border: none;
  border-bottom: 1px solid rgba(44, 72, 63, 0.13);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.learning-step:hover {
  transform: none;
  border-color: rgba(44, 72, 63, 0.13);
  box-shadow: none;
  background: linear-gradient(90deg, rgba(237, 243, 240, 0.64), transparent 68%);
}

.learning-step__number {
  margin: 0;
  color: rgba(39, 74, 64, 0.42);
  font-size: 2.2rem;
}

.learning-step__title {
  font-size: 1.35rem;
}

.learning-step__text {
  margin: 0;
  font-size: 1rem;
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(44, 72, 63, 0.18);
}

.nav-card,
.resource-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.22fr) minmax(220px, 0.3fr) minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  min-height: 0;
  padding: 18px 0;
  border: none;
  border-bottom: 1px solid rgba(44, 72, 63, 0.13);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nav-card::before {
  display: none;
}

.nav-card:hover,
.resource-item:hover {
  transform: none;
  border-color: rgba(44, 72, 63, 0.13);
  box-shadow: none;
  background: linear-gradient(90deg, rgba(237, 243, 240, 0.66), transparent 72%);
}

.nav-card__title,
.resource-item__title {
  font-size: 1.22rem;
  color: var(--accent);
}

.nav-card__summary,
.resource-item__note {
  font-size: 0.98rem;
}

.detail-grid,
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 10px 0 18px;
  border-top: 1px solid rgba(44, 72, 63, 0.16);
}

.detail-grid--two {
  grid-template-columns: 1fr;
}

.detail-card,
.card-simple {
  display: grid;
  grid-template-columns: minmax(170px, 0.24fr) minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 15px 0;
  border: none;
  border-bottom: 1px solid rgba(44, 72, 63, 0.11);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.detail-card::before,
.card-simple::before {
  display: none;
}

.detail-card__label,
.content-block__label {
  display: block;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  line-height: 1.7;
}

.detail-card p,
.card-simple__content {
  font-size: 1rem;
  line-height: 1.85;
}

.card-simple__title {
  margin: 0;
  font-size: 1.16rem;
}

.content-block {
  margin-top: 18px;
  padding: 18px 0 0;
  border: none;
  border-top: 1px solid rgba(44, 72, 63, 0.12);
  border-radius: 0;
  background: transparent;
}

.case-intro,
.practice-panel {
  border-radius: 0;
  border: none;
  border-left: 3px solid rgba(39, 74, 64, 0.58);
  background: rgba(237, 243, 240, 0.42);
  box-shadow: none;
}

.practice-panel::before {
  display: none;
}

.prompt-box {
  border-radius: 14px;
  box-shadow: none;
}

.faq-item {
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.faq-item summary {
  padding-left: 0;
  padding-right: 0;
}

.faq-item p,
.faq-item span {
  padding-left: 0;
  padding-right: 0;
}

/* ===== EDITORIAL REPORT THEME ===== */

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(170, 141, 95, 0.14), transparent 26%),
    radial-gradient(circle at 92% 18%, rgba(23, 63, 53, 0.1), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}

body::before {
  background-image:
    linear-gradient(rgba(36, 40, 36, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 40, 36, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 86%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px),
    radial-gradient(circle at 72% 48%, rgba(34, 30, 23, 0.1) 0 1px, transparent 1px);
  background-size: 18px 18px, 26px 26px;
  mix-blend-mode: multiply;
}

.sidebar {
  background: rgba(246, 242, 232, 0.82);
  border-right: 1px solid rgba(47, 58, 52, 0.18);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.48);
}

.sidebar__eyebrow,
.section-label,
.eyebrow,
.nav-group__title,
.topbar__course,
.hero__panel-title,
.prompt-box__header span,
.notes-box__title,
.pager__label {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.sidebar__title {
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.nav-group__title {
  color: #53645c;
}

.nav-link {
  border-radius: 0;
  color: #53645c;
  padding: 10px 12px 10px 20px;
}

.nav-link:hover {
  background: rgba(170, 141, 95, 0.08);
  color: var(--ink);
}

.nav-link.is-active {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  font-weight: 800;
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--gold);
}

.topbar {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 40px 10px 0;
  border-bottom: 1px solid rgba(47, 58, 52, 0.12);
  background: transparent;
  backdrop-filter: none;
}

#search-input {
  background-color: rgba(255, 253, 247, 0.72);
  border-color: rgba(47, 58, 52, 0.16);
}

.topbar__meta {
  margin-right: auto;
  min-height: 34px;
  padding-left: 12px;
  border-left: 2px solid var(--gold);
  color: #617068;
}

.topbar__search {
  flex: 0 0 260px;
}

.topbar__button {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid rgba(47, 58, 52, 0.12);
  background: rgba(255, 253, 247, 0.66);
  box-shadow: none;
}

.panel {
  border-bottom-color: rgba(47, 58, 52, 0.15);
}

.hero.panel,
.article-header.panel {
  border-bottom: 1px solid rgba(47, 58, 52, 0.28);
}

.hero {
  grid-template-columns: minmax(0, 1.95fr) minmax(280px, 0.68fr);
  gap: clamp(30px, 4vw, 72px);
  min-height: 560px;
  align-items: center;
}

.display-title,
.article-header h1 {
  color: var(--ink);
  letter-spacing: -0.065em;
}

.display-title {
  font-size: clamp(4rem, 7.3vw, 8.4rem);
  line-height: 0.9;
  max-width: 12ch;
}

.display-subtitle {
  color: var(--accent);
  font-size: clamp(1.85rem, 2.7vw, 3rem);
  letter-spacing: -0.035em;
}

.lead,
.hero__statement,
.body-copy {
  color: #34433d;
}

.hero__statement {
  max-width: 58rem;
  padding-top: 18px;
  border-top: 1px solid rgba(47, 58, 52, 0.2);
  font-weight: 800;
}

.primary-button,
.secondary-button {
  border-radius: 0;
  min-height: 46px;
  box-shadow: none;
  letter-spacing: 0.02em;
}

.primary-button {
  background: var(--accent);
  color: #fffdf7;
}

.primary-button:hover {
  background: #0f2f27;
  box-shadow: none;
}

.secondary-button {
  background: transparent;
  border: 1px solid rgba(47, 58, 52, 0.24);
  color: var(--accent);
}

.secondary-button:hover {
  background: rgba(170, 141, 95, 0.08);
}

.hero__panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 0 38px 34px;
  border-left: 1px solid rgba(47, 58, 52, 0.25);
}

.hero-focus-list {
  border-top-color: rgba(47, 58, 52, 0.22);
}

.hero-focus-list span {
  color: var(--accent);
  border-bottom-color: rgba(47, 58, 52, 0.16);
  font-size: 1.24rem;
}

.section-heading {
  color: var(--ink);
  font-size: clamp(1.9rem, 2.4vw, 2.8rem);
  letter-spacing: -0.045em;
}

.section-panel > .section-heading::before {
  width: 3px;
  background: var(--gold);
}

.home-section-title::after {
  background: linear-gradient(90deg, var(--gold), rgba(170, 141, 95, 0));
}

.learning-steps,
.card-grid,
.resource-list,
.detail-grid,
.cards-grid {
  border-top-color: rgba(47, 58, 52, 0.24);
}

.learning-step,
.nav-card,
.resource-item,
.detail-card,
.card-simple {
  border-bottom-color: rgba(47, 58, 52, 0.15);
}

.learning-step {
  grid-template-columns: 86px minmax(210px, 0.28fr) minmax(0, 1fr);
  padding: 24px 0;
}

.learning-step:hover,
.nav-card:hover,
.resource-item:hover {
  background: linear-gradient(90deg, rgba(170, 141, 95, 0.08), transparent 74%);
}

.learning-step,
.nav-card,
.resource-item,
.chapter-nav__link,
.advanced-map__item,
.advanced-index__row {
  touch-action: manipulation;
}

.learning-step__number {
  color: var(--gold);
  font-size: 2.45rem;
}

.learning-step__title,
.nav-card__title,
.resource-item__title,
.card-simple__title {
  color: var(--accent);
}

.nav-card,
.resource-item {
  grid-template-columns: minmax(150px, 0.2fr) minmax(240px, 0.28fr) minmax(0, 1fr);
  padding: 20px 0;
}

.nav-card:focus-visible,
.resource-item:focus-visible,
.learning-step:focus-visible,
.advanced-map__item:focus-visible,
.advanced-index__row:focus-visible,
.chapter-nav__link:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.topbar__button:focus-visible,
.ghost-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.nav-card__kicker {
  color: var(--gold);
}

.article-header.panel {
  padding-top: 58px;
  padding-bottom: 42px;
}

.article-header--advanced.panel {
  padding-top: 42px;
  padding-bottom: 30px;
}

.article-header--advanced h1 {
  max-width: 22ch;
}

.article-header h1 {
  max-width: 26ch;
  font-size: clamp(2.65rem, 3.55vw, 4.25rem);
  line-height: 1.08;
}

.article-header .lead {
  max-width: 76ch;
  color: #3d4c45;
  font-size: 1.12rem;
}

.chapter-layout {
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 24px;
}

.chapter-nav {
  border: none;
  border-left: 1px solid rgba(47, 58, 52, 0.2);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  padding: 18px 0 18px 20px;
}

.chapter-nav__title {
  color: var(--gold);
  border-bottom-color: rgba(47, 58, 52, 0.16);
}

.chapter-nav__link.is-active {
  color: var(--accent);
  font-weight: 800;
}

.advanced-map.panel {
  margin: 0 0 34px;
  padding: 22px 40px 24px 0;
  border-top: 1px solid rgba(47, 58, 52, 0.22);
  border-bottom: 1px solid rgba(47, 58, 52, 0.28);
}

.advanced-map__header {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
}

.advanced-map__header h2 {
  margin: 8px 0 0;
  max-width: 12ch;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(1.7rem, 2.45vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.advanced-map__header p {
  margin: 0;
  max-width: 58ch;
  color: #3d4c45;
  font-size: 1rem;
  line-height: 1.85;
}

.advanced-map__rail {
  display: flex;
  margin-top: 20px;
  border-top: 1px solid rgba(47, 58, 52, 0.18);
  border-bottom: 1px solid rgba(47, 58, 52, 0.12);
}

.advanced-map__item {
  position: relative;
  flex: 1 1 0;
  display: block;
  min-height: 76px;
  padding: 14px 18px 12px 0;
  border-right: 1px solid rgba(47, 58, 52, 0.12);
}

.advanced-map__item::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(170, 141, 95, 0.12);
}

.advanced-map__number {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.22rem;
  line-height: 1;
}

.advanced-map__title {
  margin-top: 8px;
  color: var(--accent);
  font-weight: 800;
  line-height: 1.5;
}

.advanced-map__summary {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.advanced-map__summary span {
  padding-left: 14px;
  border-left: 2px solid var(--gold);
  color: #53645c;
  font-size: 0.94rem;
  line-height: 1.65;
}

.advanced-index {
  margin-top: 22px;
  border-top: 1px solid rgba(47, 58, 52, 0.22);
}

.advanced-index__row {
  display: grid;
  grid-template-columns: 54px minmax(120px, 0.18fr) minmax(0, 1fr) minmax(230px, 0.35fr);
  gap: 18px;
  align-items: start;
  padding: 17px 0;
  border-bottom: 1px solid rgba(47, 58, 52, 0.13);
  transition: background 160ms ease, transform 160ms ease;
}

.advanced-index__row:hover {
  background: linear-gradient(90deg, rgba(170, 141, 95, 0.08), transparent 76%);
  transform: translateX(3px);
}

.advanced-index__number {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.5rem;
  line-height: 1;
}

.advanced-index__name {
  color: var(--accent);
  font-weight: 850;
  line-height: 1.55;
}

.advanced-index__problem {
  color: #34433d;
  font-size: 0.95rem;
  line-height: 1.75;
}

.advanced-index__meta {
  display: grid;
  gap: 7px;
  color: #53645c;
  font-size: 0.88rem;
  line-height: 1.55;
}

.advanced-index__meta span {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.advanced-index__meta strong {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.detail-card,
.card-simple {
  grid-template-columns: minmax(180px, 0.22fr) minmax(0, 1fr);
  padding: 18px 0;
}

.detail-card__label,
.content-block__label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 3px 10px 2px;
  border: 1px solid rgba(170, 141, 95, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.78);
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(47, 58, 52, 0.06);
}

.content-block {
  border-top-color: rgba(47, 58, 52, 0.16);
  padding-top: 20px;
}

.content-block__body > :first-child {
  margin-top: 0;
}

.content-block__body > :last-child {
  margin-bottom: 0;
}

.advanced-layout {
  display: grid;
  gap: 22px;
}

.advanced-layout .detail-grid {
  margin-bottom: 2px;
  padding: 0 0 20px;
  border-top: none;
  border-bottom: 1px solid rgba(47, 58, 52, 0.2);
}

.advanced-layout .detail-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 24px;
  padding: 18px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.advanced-layout .detail-card::before {
  display: none;
}

.advanced-layout .detail-card__label {
  margin: 3px 0 0;
}

.advanced-layout .detail-card p {
  max-width: 68ch;
  font-size: 1.02rem;
  line-height: 1.9;
}

.advanced-layout .content-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.24fr) minmax(0, 1fr);
  column-gap: 28px;
  margin-top: 0;
  padding: 22px 0;
  border: none;
  border-top: 1px solid rgba(47, 58, 52, 0.14);
  border-radius: 0;
  background: transparent;
}

.advanced-layout .content-block:first-of-type {
  border-top-color: rgba(47, 58, 52, 0.24);
}

.advanced-layout .content-block__label {
  position: static;
  display: block;
  width: auto;
  max-width: 150px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0 0 0 12px;
  border: none;
  border-left: 2px solid var(--gold);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  line-height: 1.55;
  box-shadow: none;
}

.advanced-layout .content-block__body {
  max-width: 70ch;
}

.advanced-layout .content-block__body .body-copy + .body-copy {
  margin-top: 12px;
}

.advanced-layout .bullet-list,
.advanced-layout .ordered-list {
  padding-left: 1.25rem;
}

.advanced-layout .bullet-list li,
.advanced-layout .ordered-list li {
  margin: 6px 0;
  line-height: 1.85;
}

.practice-panel,
.case-intro {
  background:
    linear-gradient(90deg, rgba(170, 141, 95, 0.12), rgba(251, 250, 245, 0.52));
  border-left: 2px solid var(--gold);
  padding: 24px 28px;
}

.practice-panel.panel {
  background:
    linear-gradient(90deg, rgba(170, 141, 95, 0.12), rgba(251, 250, 245, 0.58));
  border: none;
  border-left: 2px solid var(--gold);
  border-radius: 0;
}

.prompt-box {
  border-radius: 0;
  border-color: rgba(47, 58, 52, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(248, 244, 235, 0.9));
}

.prompt-box__header {
  background: rgba(235, 231, 220, 0.72);
  border-bottom-color: rgba(47, 58, 52, 0.16);
}

.prompt-box__header span {
  color: var(--gold);
}

.prompt-box pre {
  color: #25342f;
  background-image:
    linear-gradient(90deg, rgba(170, 141, 95, 0.22) 0 2px, transparent 2px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(47, 58, 52, 0.07) 32px);
}

.ghost-button {
  min-height: 44px;
  padding-inline: 18px;
  background: rgba(23, 63, 53, 0.08);
  color: var(--accent);
}

.table-wrapper {
  border-radius: 0;
  border-color: rgba(47, 58, 52, 0.2);
  background: rgba(255, 253, 247, 0.58);
  box-shadow: none;
}

thead th {
  background: rgba(235, 231, 220, 0.88);
  color: var(--ink);
  border-bottom-color: rgba(47, 58, 52, 0.22);
}

tbody td {
  background: rgba(255, 253, 247, 0.4);
  border-bottom-color: rgba(47, 58, 52, 0.1);
}

tbody tr:nth-child(even) td {
  background: rgba(242, 238, 228, 0.42);
}

tbody td:first-child {
  color: var(--accent);
}

.faq-item {
  border-bottom-color: rgba(47, 58, 52, 0.15);
}

.faq-item summary {
  color: var(--accent);
}

.resource-link,
.chip {
  border-radius: 0;
  background: rgba(170, 141, 95, 0.1);
  border-color: rgba(170, 141, 95, 0.2);
  color: var(--accent);
}

.pager__item {
  border-radius: 0;
  border-color: rgba(47, 58, 52, 0.16);
  background: rgba(255, 253, 247, 0.66);
  box-shadow: none;
}

body.lecture-mode .main-panel {
  padding-right: clamp(20px, 4vw, 56px);
}

@media (max-width: 1180px) {
  .hero {
    min-height: 0;
  }

  .display-title,
  .article-header h1 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .main-panel {
    padding-right: 18px;
  }

  .learning-step,
  .nav-card,
  .resource-item,
  .detail-card,
  .card-simple {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

mark.search-highlight {
  background: #fde68a;
  padding: 0 2px;
  border-radius: 3px;
}

body.lecture-mode .topbar__search input {
  display: none;
}

body.lecture-mode .topbar__search {
  display: none;
}

@media (min-width: 721px) and (max-width: 900px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(48vw, 360px);
    height: 100vh;
    z-index: 10;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform 260ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  .sidebar-toggle {
    display: flex;
    width: 52px;
    height: 52px;
    right: 24px;
    bottom: 24px;
  }

  .chapter-layout {
    grid-template-columns: 1fr;
  }

  .advanced-map.panel {
    padding: 24px 0;
  }

  .advanced-map__header {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .advanced-map__header h2 {
    max-width: none;
  }

  .advanced-map__rail,
  .advanced-map__summary {
    grid-template-columns: 1fr;
  }

  .advanced-map__item {
    min-height: 0;
    padding: 14px 0 14px 36px;
    border-right: none;
    border-bottom: 1px solid rgba(47, 58, 52, 0.12);
  }

  .advanced-map__item::before {
    top: 20px;
  }

  .advanced-map__number {
    font-size: 1.25rem;
  }

  .advanced-map__title {
    margin-top: 6px;
  }

  .chapter-nav {
    position: static;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-link,
  .nav-card,
  .resource-item,
  .stage-card,
  .pager__item,
  .sidebar-toggle { transition: none; }
  .sidebar { transition: none; }
  .sidebar-overlay { transition: none; }
}

/* ================================================================
   MOBILE READING ADAPTATION - max-width: 720px
   ================================================================ */

@media (max-width: 720px) {

  /* 1. Title downgrades */

  .display-title {
    font-size: 2.6rem;
    line-height: 1.12;
    max-width: 100%;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .display-subtitle {
    font-size: 1.4rem;
    line-height: 1.2;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .article-header h1 {
    font-size: 2rem;
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .section-heading {
    font-size: 1.4rem;
    line-height: 1.2;
  }

  /* 2. Topbar compaction */

  .topbar {
    padding: 8px 10px;
    gap: 6px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 4px;
  }

  #search-input {
    padding: 5px 12px 5px 30px;
    font-size: 0.82rem;
    min-height: 32px;
  }

  .topbar__button {
    min-height: 44px;
    padding: 7px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .topbar__meta {
    grid-column: 1;
    font-size: 0.82rem;
    min-width: 0;
    padding-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar__actions {
    grid-column: 2;
    justify-self: end;
  }

  .topbar__search {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }

  /* 3. Sidebar toggle and drawer */

  .sidebar-toggle {
    width: 52px;
    height: 52px;
    bottom: 20px;
    right: 20px;
    box-shadow: 0 8px 28px rgba(39, 74, 64, 0.38);
  }

  .sidebar-toggle:hover {
    box-shadow: 0 12px 36px rgba(39, 74, 64, 0.48);
  }

  .sidebar {
    width: min(86vw, 340px);
    max-width: none;
  }

  /* 4. Single-column reading layout */

  .main-panel {
    padding: 12px;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .content-view {
    padding-right: 0;
  }

  .hero.panel,
  .article-header.panel {
    padding: 24px 0 20px;
  }

  .panel {
    padding: 20px 0;
    border-radius: 0;
  }

  .section-panel {
    padding: 20px 0;
    scroll-margin-top: 70px;
  }

  .practice-panel.panel {
    padding: 20px 16px;
    margin: 8px 0 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero__copy {
    min-width: 0;
  }

  .hero__panel {
    padding: 16px 0 0;
    border-left: none;
    border-top: 1px solid rgba(47, 58, 52, 0.18);
  }

  .hero__panel-title {
    font-size: 1rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .primary-button,
  .hero__actions .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .hero__statement {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .lead {
    font-size: 0.96rem;
    line-height: 1.75;
  }

  .stat-strip {
    gap: 8px;
  }

  .stat-pill {
    min-width: 100px;
    min-height: 70px;
    padding: 12px 14px;
  }

  .stat-pill__value {
    font-size: 1.5rem;
  }

  .hero-focus-list span {
    font-size: 1rem;
    word-break: break-word;
    padding: 12px 0;
  }

  .split-grid,
  .article-grid,
  .article-grid--module,
  .split-grid--wide {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .learning-steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .learning-step {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 16px 0;
  }

  .learning-step__number {
    font-size: 1.5rem;
    margin-bottom: 4px;
  }

  .learning-step__title {
    font-size: 1.25rem;
  }

  .learning-step__text {
    font-size: 0.9rem;
  }

  .card-grid,
  .stage-grid {
    grid-template-columns: 1fr;
  }

  .nav-card,
  .resource-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 0;
  }

  .nav-card__title,
  .resource-item__title {
    font-size: 1.15rem;
  }

  .nav-card__summary,
  .resource-item__note {
    font-size: 0.9rem;
  }

  .detail-grid,
  .cards-grid,
  .path-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid--two {
    grid-template-columns: 1fr;
  }

  .advanced-layout {
    gap: 14px;
  }

  .advanced-layout .detail-card,
  .advanced-layout .content-block {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 0;
  }

  .advanced-layout .content-block__label {
    position: static;
    max-width: none;
    margin-bottom: 2px;
  }

  .pager {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pager__item {
    min-height: 72px;
    padding: 14px 16px;
  }

  .pager__item--next {
    text-align: left;
  }

  .pager__title {
    font-size: 1.1rem;
  }

  .chapter-layout {
    grid-template-columns: 1fr;
  }

  .chapter-nav {
    position: static;
    max-height: none;
    margin-top: 16px;
    border-radius: var(--radius-sm);
  }

  .chapter-nav__link {
    padding: 9px 0;
    font-size: 0.92rem;
  }

  .interface-map {
    grid-template-columns: 1fr;
  }

  .interface-map__mock {
    min-height: 240px;
    gap: 6px;
    padding: 10px;
  }

  .interface-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .interface-card__index {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  /* 5. Tables, prompts, and cases */

  .table-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin: 12px 0;
  }

  .table-wrapper table {
    min-width: 620px;
  }

  table {
    font-size: 0.78rem;
  }

  thead th,
  tbody td {
    padding: 6px 8px;
  }

  thead th {
    font-size: 0.76rem;
  }

  .prompt-box {
    border-radius: var(--radius-sm);
  }

  .prompt-box pre {
    font-size: 0.8rem;
    padding: 14px 16px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .prompt-box__header {
    padding: 10px 12px;
    gap: 8px;
  }

  .prompt-box__header span {
    font-size: 0.78rem;
  }

  .ghost-button {
    padding: 8px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .practice-panel {
    padding: 16px 14px;
    border-radius: var(--radius-sm);
  }

  .practice-panel::before {
    top: 18px;
    bottom: 18px;
    width: 3px;
  }

  .case-intro {
    padding: 14px 16px;
  }

  .callout {
    padding: 14px 16px;
  }

  .notes-box {
    padding: 14px 16px;
  }

  .content-block {
    padding: 14px;
  }

  .detail-card {
    padding: 14px;
  }

  .detail-card__label,
  .content-block__label {
    min-height: 30px;
    margin-bottom: 10px;
    padding: 4px 10px 3px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  .resource-link {
    font-size: 0.85rem;
    min-height: 36px;
    padding: 0 12px;
  }

  .resource-section-list {
    gap: 12px;
  }

  .faq-item summary {
    padding: 14px;
    font-size: 0.95rem;
  }

  .faq-item p {
    padding: 0 14px 8px;
    font-size: 0.9rem;
  }

  .card-simple {
    padding: 16px;
  }

  .card-simple__title {
    font-size: 1.1rem;
  }

  .card-simple__content {
    font-size: 0.9rem;
  }

  .stage-card h3 {
    font-size: 1.2rem;
  }

  .chip {
    font-size: 0.82rem;
    min-height: 30px;
    padding: 0 10px;
  }

  .eyebrow,
  .section-label,
  .sidebar__eyebrow {
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  /* 6. Overflow and safety guards */

  body {
    overflow-x: hidden;
  }

  .hero__panel-quote p {
    font-size: 0.9rem;
  }
}

/* ================================================================
   TABLET LIGHT OPTIMISATION - max-width: 900px
   ================================================================ */

@media (min-width: 721px) and (max-width: 900px) {

  /* Title moderation between desktop and phone */

  .display-title {
    font-size: clamp(2.4rem, 5vw, 3.4rem);
  }

  .article-header h1 {
    font-size: clamp(2.1rem, 3.8vw, 2.8rem);
  }

  /* Chapter layout: single column, no sticky nav */

  .chapter-layout {
    grid-template-columns: 1fr;
  }

  .chapter-nav {
    position: static;
    max-height: none;
  }

  /* Hero: keep two columns but tighter */

  .hero {
    grid-template-columns: minmax(0, 1.8fr) minmax(200px, 0.8fr);
    gap: 18px;
  }

  .hero__panel {
    padding: 18px 0 18px 22px;
  }

  /* Moderate spacing reduction */

  .main-panel {
    padding: 20px 0 32px 28px;
  }

  .content-view {
    padding-right: 28px;
  }

  .panel {
    padding: 28px 0;
  }
}

@media (max-width: 720px) {
  .advanced-map.panel {
    padding: 24px 0;
  }

  .advanced-map__header,
  .advanced-map__summary {
    grid-template-columns: 1fr;
  }

  .advanced-map__rail {
    flex-direction: column;
  }

  .advanced-map__header {
    gap: 14px;
  }

  .advanced-map__header h2 {
    max-width: none;
    font-size: 2rem;
  }

  .advanced-map__header p {
    max-width: none;
  }

  .advanced-map__item {
    min-height: 0;
    padding: 14px 0 14px 36px;
    border-right: none;
    border-bottom: 1px solid rgba(47, 58, 52, 0.12);
  }

  .advanced-map__item::before {
    top: 20px;
  }

  .advanced-map__title {
    margin-top: 6px;
  }

  .advanced-index {
    margin-top: 18px;
  }

  .advanced-index__row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 15px 0;
  }

  .advanced-index__number {
    grid-row: span 3;
    font-size: 1.35rem;
  }

  .advanced-index__problem,
  .advanced-index__meta {
    grid-column: 2;
  }

  .advanced-index__problem {
    font-size: 0.92rem;
  }

  .advanced-index__meta {
    gap: 5px;
  }
}

/* ===== CHAPTER UI CONSISTENCY PASS ===== */

.chapter-layout {
  align-items: start;
}

.chapter-layout__content {
  gap: 18px;
}

.section-panel {
  padding: 28px 0 30px;
}

.section-panel > .section-heading {
  margin-bottom: 18px;
  color: var(--ink);
  letter-spacing: 0;
}

.section-panel > .section-heading::before {
  width: 4px;
  min-width: 4px;
  height: 1.15em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

.body-copy {
  max-width: 76ch;
  margin: 0 0 12px;
}

.body-copy:last-child {
  margin-bottom: 0;
}

.detail-grid,
.cards-grid {
  gap: 12px;
  margin-top: 14px;
}

.detail-card,
.card-simple,
.content-block,
.case-intro,
.practice-panel,
.table-wrapper,
.prompt-box,
.faq-item,
.resource-item {
  border-radius: 8px;
}

.detail-card,
.card-simple,
.content-block {
  border: 1px solid rgba(47, 58, 52, 0.14);
  background: rgba(255, 253, 247, 0.68);
  box-shadow: none;
}

.detail-card,
.card-simple {
  padding: 18px;
}

.content-block {
  margin-top: 14px;
  padding: 18px;
}

.detail-card__label,
.content-block__label,
.section-label,
.nav-card__kicker {
  letter-spacing: 0;
}

.detail-card__label,
.content-block__label {
  margin-bottom: 10px;
  border-radius: 8px;
  border-color: rgba(170, 141, 95, 0.24);
}

/* Resource cards use a denser layout than the home navigation cards. */
.resource-section-list {
  display: grid;
  gap: 14px;
}

.resource-panel.panel {
  padding-top: 24px;
  padding-bottom: 24px;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 14px;
  border-top: 0;
}

.resource-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 15px;
  border: 1px solid rgba(47, 58, 52, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.92), rgba(241, 246, 243, 0.9)),
    radial-gradient(circle at top right, rgba(170, 141, 95, 0.13), transparent 42%);
  box-shadow: 0 10px 24px rgba(47, 66, 59, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.resource-item:hover {
  transform: translateY(-2px);
  border-color: rgba(170, 141, 95, 0.32);
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.96), rgba(237, 243, 240, 0.94)),
    radial-gradient(circle at top right, rgba(170, 141, 95, 0.18), transparent 44%);
  box-shadow: 0 16px 32px rgba(47, 66, 59, 0.1);
}

.resource-item__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-item__type {
  align-self: flex-start;
  padding: 4px 9px;
  border: 1px solid rgba(170, 141, 95, 0.26);
  border-radius: 999px;
  background: rgba(255, 250, 239, 0.82);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.resource-item__title {
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 1.08rem;
  line-height: 1.25;
  word-break: break-word;
}

.resource-item__summary,
.resource-item__use {
  margin: 0;
  color: #354840;
  font-size: 0.91rem;
  line-height: 1.62;
}

.resource-item__use {
  color: var(--muted);
}

.resource-item__use span {
  color: var(--accent);
  font-weight: 800;
}

.resource-item__link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.resource-item__title:focus-visible,
.resource-item__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* The advanced tips section is a mini playbook, not a normal article stream. */
#section-advanced-tips {
  padding-top: 34px;
}

#section-advanced-tips > .section-heading {
  margin-bottom: 10px;
}

#section-advanced-tips > .body-copy {
  max-width: 68ch;
  margin-bottom: 18px;
  color: #3f524a;
  font-size: 1rem;
  line-height: 1.72;
}

#section-advanced-tips .content-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 12px;
  padding: 18px;
  border: 1px solid rgba(47, 58, 52, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(241, 246, 243, 0.86)),
    radial-gradient(circle at 0 0, rgba(170, 141, 95, 0.15), transparent 36%);
  box-shadow: 0 14px 34px rgba(47, 66, 59, 0.07);
  overflow: hidden;
}

#section-advanced-tips .content-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--accent));
}

#section-advanced-tips .content-block__label {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(170, 141, 95, 0.28);
  border-radius: 12px;
  background: rgba(255, 250, 239, 0.82);
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

#section-advanced-tips .content-block__body {
  min-width: 0;
}

#section-advanced-tips .body-copy {
  margin-bottom: 12px;
  color: #334840;
  line-height: 1.74;
}

#section-advanced-tips .prompt-box {
  margin-top: 10px;
  border-radius: 14px;
  box-shadow: none;
}

#section-advanced-tips .prompt-box__header {
  min-height: 42px;
}

#section-advanced-tips .prompt-box pre {
  padding: 16px 18px;
  font-size: 0.9rem;
  line-height: 1.72;
}

#section-advanced-tips .quote-block {
  margin-top: 12px;
  padding: 12px 14px;
  border-left-color: var(--gold);
  border-radius: 0 12px 12px 0;
  background: rgba(170, 141, 95, 0.1);
  color: #31423b;
  font-size: 0.94rem;
  line-height: 1.68;
}

@media (max-width: 720px) {
  .resource-panel.panel {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .resource-list {
    grid-template-columns: 1fr;
  }

  .resource-item {
    padding: 14px;
  }

  #section-advanced-tips .content-block {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }
}

.card-simple::before,
.detail-card::before {
  display: none;
}

.card-simple__title,
.detail-card__label {
  color: var(--accent);
}

.card-simple__content,
.detail-card p {
  color: #32463f;
}

.bullet-list,
.ordered-list {
  margin-top: 10px;
}

.bullet-list li,
.ordered-list li {
  line-height: 1.78;
}

.prompt-box,
.table-wrapper {
  margin-top: 14px;
}

.prompt-box {
  overflow: hidden;
}

.prompt-box__header {
  min-height: 48px;
}

.table-caption {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.quote-block {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: rgba(170, 141, 95, 0.08);
  color: #2f4039;
  line-height: 1.85;
}

.advanced-layout {
  gap: 16px;
}

.advanced-layout .detail-card,
.advanced-layout .content-block {
  border: 1px solid rgba(47, 58, 52, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.62);
  padding: 18px;
}

.advanced-layout .content-block:first-of-type,
.advanced-layout .content-block {
  border-top: 1px solid rgba(47, 58, 52, 0.14);
}

.advanced-layout .content-block__label {
  align-self: start;
  justify-self: start;
  max-width: none;
  padding: 3px 10px 2px;
  border: 1px solid rgba(170, 141, 95, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.advanced-layout .detail-card__label,
.advanced-layout .content-block__label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  margin: 0;
  padding: 4px 10px 3px;
  border: 1px solid rgba(170, 141, 95, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  color: var(--accent);
  font-family: var(--body-font);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  box-shadow: none;
}

.advanced-layout .detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.advanced-layout .detail-card p {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.78;
}

.advanced-layout .content-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: start;
  padding: 16px 18px;
}

.advanced-layout .content-block__body {
  max-width: 74ch;
}

.advanced-layout .content-block__body .body-copy {
  line-height: 1.78;
}

.advanced-layout .content-block__body .body-copy + .body-copy {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .chapter-layout__content {
    gap: 12px;
  }

  .section-panel {
    padding: 20px 0;
  }

  .section-panel > .section-heading {
    margin-bottom: 14px;
  }

  .content-block,
  .detail-card,
  .card-simple,
  .advanced-layout .detail-card,
  .advanced-layout .content-block {
    padding: 14px;
  }

  .body-copy {
    max-width: 100%;
  }

  .advanced-layout .content-block {
    gap: 10px;
  }
}
