/* ═══════════════════════════════════════════════════════════════════════
   GEONOME TUTORIAL THEME — matches geonome.com.au design system
   Replaces the dark glassmorphism theme with the Geonome brand palette.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Design tokens (Light mode) ─────────────────────────────────────── */
:root {
  --bg:            #fcfcf9;
  --surface:       #ffffff;
  --surface-2:     #f5f5f3;
  --text:          #13343b;
  --text-sec:      #626c71;
  --text-dim:      #a7a9a9;
  --primary:       #1836B2;
  --primary-hover: #142eb0;
  --primary-rgb:   24, 54, 178;
  --border:        rgba(94, 82, 64, 0.18);
  --border-card:   rgba(94, 82, 64, 0.10);
  --accent:        #1836B2;
  --insight-bg:    rgba(24, 54, 178, 0.05);
  --insight-bdr:   rgba(24, 54, 178, 0.22);
  --warning-bg:    rgba(180, 83, 9, 0.06);
  --warning-bdr:   rgba(180, 83, 9, 0.22);
  --warning-txt:   #92400e;
  --code-bg:       #f3f4f6;
  --code-txt:      #1836B2;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:     0 10px 28px rgba(0,0,0,0.08);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-full:   9999px;
  --sidebar-w:     288px;
  --maxw:          1300px;
  --transition:    0.22s ease;
}

/* ── Dark mode ───────────────────────────────────────────────────────── */
html.theme-dark {
  --bg:            #1f2121;
  --surface:       #262828;
  --surface-2:     #2e3030;
  --text:          #f5f5f5;
  --text-sec:      rgba(167,169,169,0.75);
  --text-dim:      rgba(167,169,169,0.45);
  --primary:       #4270E1;
  --primary-hover: #2455d9;
  --primary-rgb:   66, 112, 225;
  --border:        rgba(119,124,124,0.28);
  --border-card:   rgba(119,124,124,0.18);
  --insight-bg:    rgba(66, 112, 225, 0.09);
  --insight-bdr:   rgba(66, 112, 225, 0.28);
  --warning-bg:    rgba(194, 65, 12, 0.10);
  --warning-bdr:   rgba(194, 65, 12, 0.28);
  --warning-txt:   #fbbf24;
  --code-bg:       rgba(66, 112, 225, 0.08);
  --code-txt:      #93c5fd;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.25);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:     0 10px 28px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  html:not(.theme-light) {
    --bg:            #1f2121;
    --surface:       #262828;
    --surface-2:     #2e3030;
    --text:          #f5f5f5;
    --text-sec:      rgba(167,169,169,0.75);
    --text-dim:      rgba(167,169,169,0.45);
    --primary:       #4270E1;
    --primary-hover: #2455d9;
    --primary-rgb:   66, 112, 225;
    --border:        rgba(119,124,124,0.28);
    --border-card:   rgba(119,124,124,0.18);
    --insight-bg:    rgba(66, 112, 225, 0.09);
    --insight-bdr:   rgba(66, 112, 225, 0.28);
    --warning-bg:    rgba(194, 65, 12, 0.10);
    --warning-bdr:   rgba(194, 65, 12, 0.28);
    --warning-txt:   #fbbf24;
    --code-bg:       rgba(66, 112, 225, 0.08);
    --code-txt:      #93c5fd;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.25);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg:     0 10px 28px rgba(0,0,0,0.4);
  }
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════════════
   TOP NAVBAR
   ══════════════════════════════════════════════════════════════════════ */
.tut-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}

.tut-topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tut-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.tut-topbar-logo-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1;
}

.tut-topbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.tut-topbar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.tut-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tut-topbar-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.tut-topbar-link:hover { color: var(--primary); background: var(--insight-bg); }

/* Theme toggle button */
.tut-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.tut-theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--insight-bg);
}
.tut-theme-toggle .icon-sun,
.tut-theme-toggle .icon-moon { display: none; }
html:not(.theme-dark) .tut-theme-toggle .icon-moon,
html.theme-light .tut-theme-toggle .icon-moon { display: block; }
html.theme-dark .tut-theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  html:not(.theme-light):not(.theme-dark) .tut-theme-toggle .icon-sun { display: block; }
  html:not(.theme-light):not(.theme-dark) .tut-theme-toggle .icon-moon { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   PAGE SHELL & LAYOUT
   ══════════════════════════════════════════════════════════════════════ */
.page-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: calc(54px + 20px);
  max-height: calc(100vh - 54px - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

.brand h1 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* TOC toggle */
.toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 8px;
}

/* TOC links */
.toc { display: flex; flex-direction: column; gap: 2px; }

.toc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-sec);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.35;
}
.toc-link:hover {
  background: var(--insight-bg);
  color: var(--primary);
}
.toc-link.active {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  font-weight: 600;
}

.toc-num {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary);
  opacity: 0.7;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.toc-link.active .toc-num { opacity: 1; }

/* Sub-links */
.toc-sub {
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
}

.toc-sub-link {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.15s;
}
.toc-sub-link:hover { color: var(--primary); background: var(--insight-bg); }
.toc-sub-link.active { color: var(--primary); font-weight: 600; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-footer > p {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.5;
}

.sidebar-next-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 9px;
  padding: 9px 11px;
  transition: all 0.18s;
}
.sidebar-next-link:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
}
.sidebar-next-link span:first-child {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.sidebar-next-link span:last-child {
  font-size: 11.5px;
  color: var(--text-sec);
}

/* ══════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════════════ */
.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── HERO ────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg,
    rgba(var(--primary-rgb), 0.05) 0%,
    transparent 70%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.8;
  margin-bottom: 14px;
}

.hero h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-sec);
  line-height: 1.75;
  max-width: 740px;
  margin-bottom: 20px;
}

.hero-next-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.07);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  text-decoration: none;
  margin-bottom: 20px;
  transition: all 0.18s;
}
.hero-next-link:hover { background: rgba(var(--primary-rgb), 0.13); }

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.hero-pills span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sec);
  background: var(--surface-2);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}

.outcomes-box {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-top: 4px;
}
.outcomes-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.outcomes-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.outcomes-list li {
  font-size: 13.5px;
  color: var(--text-sec);
  line-height: 1.6;
}

/* ── SECTIONS ────────────────────────────────────────────────────────── */
section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

section h2 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(var(--primary-rgb), 0.15);
}

section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 8px;
}

section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

section p {
  font-size: 0.94rem;
  color: var(--text-sec);
  line-height: 1.8;
}

section ul, section ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
section li {
  font-size: 0.93rem;
  color: var(--text-sec);
  line-height: 1.7;
}

strong { color: var(--text); font-weight: 600; }
em { color: var(--text-sec); }

/* Section anchor label */
.section-anchor {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.7;
  margin-bottom: -8px;
}

/* ── CALLOUTS ────────────────────────────────────────────────────────── */
.callout {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.callout h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.callout p { font-size: 13.5px !important; }

.callout.insight {
  background: var(--insight-bg);
  border-left: 3px solid var(--primary);
}
.callout.insight h4 { color: var(--primary); }

.callout.warning {
  background: var(--warning-bg);
  border-left: 3px solid #d97706;
}
.callout.warning h4 { color: var(--warning-txt); }
.callout.warning p { color: var(--text-sec) !important; }

/* ── FIGURES ─────────────────────────────────────────────────────────── */
.figure-block {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

/* Real images inside figure blocks */
.figure-block img {
  width: 100%;
  height: auto;
  display: block;
}

/* Dark mode: invert very-light SVG figures for readability */
html.theme-dark .figure-block img.fig-svg-adapt {
  filter: invert(1) hue-rotate(180deg) brightness(0.85);
}

.figure-inner {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(var(--primary-rgb), 0.025) 10px,
    rgba(var(--primary-rgb), 0.025) 20px
  );
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

.fig-caption {
  padding: 10px 16px;
  font-size: 11.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-card);
  font-style: italic;
  line-height: 1.5;
}

/* ── SVG DIAGRAMS ────────────────────────────────────────────────────── */
.svg-diagram {
  width: 100%;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

/* SVG text + line color adaptation */
html:not(.theme-dark) .svg-diagram text,
html:not(.theme-dark) .svg-diagram tspan { fill: var(--text-sec) !important; }
html:not(.theme-dark) .svg-diagram line,
html:not(.theme-dark) .svg-diagram path[stroke],
html:not(.theme-dark) .svg-diagram rect[stroke],
html:not(.theme-dark) .svg-diagram polyline[stroke] { stroke: var(--border) !important; }

@media (prefers-color-scheme: light) {
  .svg-diagram text, .svg-diagram tspan { fill: var(--text-sec); }
}

/* ── TABLES ──────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: rgba(var(--primary-rgb), 0.06);
}

th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-sec);
  border-bottom: 1px solid var(--border-card);
  vertical-align: top;
  line-height: 1.6;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: rgba(var(--primary-rgb), 0.02); }

/* ── CODE ────────────────────────────────────────────────────────────── */
code {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12.5px;
  background: var(--code-bg);
  color: var(--code-txt);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-card);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--code-txt);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ── FORMULA BOX ─────────────────────────────────────────────────────── */
.formula-box {
  background: var(--surface-2);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  white-space: pre-wrap;
}

.formula-box p {
  font-size: 12.5px !important;
  color: var(--text-dim) !important;
  font-style: italic;
  margin-top: 4px;
}

/* ── STEP LIST ───────────────────────────────────────────────────────── */
.step-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.step:hover {
  border-color: rgba(var(--primary-rgb), 0.28);
  box-shadow: var(--shadow-sm);
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content { flex: 1; }
.step-content strong { font-size: 13.5px; font-weight: 700; color: var(--text); }
.step-content p { font-size: 13px; margin-top: 4px; }

/* ── SENSOR / COMPARISON GRID ────────────────────────────────────────── */
.sensor-grid, .compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.sensor-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.sensor-card:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: var(--shadow-sm);
}
.sensor-card h4 { font-size: 13px; color: var(--primary); margin-bottom: 8px; }
.sensor-card p, .sensor-card li { font-size: 12.5px !important; }

/* ── DECISION FRAMEWORK ──────────────────────────────────────────────── */
.decision-framework {
  background: var(--surface-2);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
}
.decision-framework h4 { margin-bottom: 12px; }

/* ── METRIC BLOCK (Tutorial 2) ───────────────────────────────────────── */
.metric-block {
  background: rgba(var(--primary-rgb), 0.05);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}
.metric-block strong { color: var(--primary); }

/* ── PART BANNER (Tutorial 2) ────────────────────────────────────────── */
.part-banner {
  background: linear-gradient(135deg,
    rgba(var(--primary-rgb), 0.12) 0%,
    rgba(var(--primary-rgb), 0.04) 100%);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.part-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--surface);
  background: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.part-banner h2 {
  font-size: 1.15rem !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  color: var(--text) !important;
}

/* ── RECALL / COMPARISON TABLES (Tutorial 2) ─────────────────────────── */
.recall-comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.recall-comparison th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.recall-comparison td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-card);
}

.recall-comparison tr:last-child td { border-bottom: none; }
.recall-comparison .highlight-row { background: rgba(var(--primary-rgb), 0.06); font-weight: 600; }

/* ── IMPORTANCE BAR (Tutorial 2) ─────────────────────────────────────── */
.t2-importance-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}

.t2-importance-label {
  font-size: 12.5px;
  color: var(--text-sec);
  width: 200px;
  flex-shrink: 0;
}

.t2-importance-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.t2-importance-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), rgba(var(--primary-rgb), 0.6));
  transition: width 0.5s ease;
}

.t2-importance-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  width: 48px;
  text-align: right;
  flex-shrink: 0;
}

/* ── T2 SPECIFIC CLASSES ─────────────────────────────────────────────── */
.t2-indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.t2-indicator {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-sec);
}

.t2-reason-list, .t2-control-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t2-reason, .t2-control {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

.t2-reason-icon, .t2-control-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.t2-reason-body h4, .t2-control-body h4 { font-size: 13px; }
.t2-reason-body p, .t2-control-body p { font-size: 12.5px !important; margin-top: 4px; }

.t2-feature-table { width: 100%; }

.t2-score-tiers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t2-tier {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.t2-paradigm-shift {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.dual-pill-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dual-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  color: var(--primary);
}

.redox-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.redox-step {
  background: rgba(var(--primary-rgb), 0.07);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-sec);
}

.redox-arrow {
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 300;
}

/* ── T2 VIDEO ANCHOR ─────────────────────────────────────────────────── */
.t2-video-anchor {
  border-radius: var(--radius);
  border: 1px solid var(--border-card);
  overflow: hidden;
  background: #070e1e;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition);
}

.t2-video-anchor:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
}

.t2-video-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(66, 112, 225, 0.2);
}

.t2-video-label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4270E1;
  flex-shrink: 0;
  animation: vid-pulse 2s infinite;
}

@keyframes vid-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(66,112,225,0.4); }
  50%       { opacity: 0.7; transform: scale(0.9); box-shadow: 0 0 0 4px rgba(66,112,225,0); }
}

.t2-video-label span:last-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.t2-video-wrap {
  position: relative;
  width: 100%;
  line-height: 0;
}

.t2-video-wrap video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: contain;
  background: #070e1e;
}

.t2-video-caption {
  padding: 12px 18px;
  font-size: 12px;
  color: rgba(167, 180, 210, 0.8);
  font-style: italic;
  line-height: 1.6;
  border-top: 1px solid rgba(66, 112, 225, 0.15);
  background: rgba(0, 0, 0, 0.25);
}

/* Light mode: softer frame */
html.theme-light .t2-video-anchor,
html:not(.theme-dark) .t2-video-anchor {
  background: #0a1428;
  border-color: rgba(24, 54, 178, 0.22);
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-shell {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .tut-topbar-title { display: none; }
  .tut-topbar-sep { display: none; }
}

@media (max-width: 600px) {
  .hero { padding: 24px 20px; }
  section h2 { font-size: 1.15rem; }
  .tut-topbar-link { display: none; }
  .t2-paradigm-shift { grid-template-columns: 1fr; }
  .t2-importance-label { width: 140px; }
  .part-banner { flex-direction: column; align-items: flex-start; }
}


/* ====================================================================== */
/* RECOVERED TUTORIAL-2 STYLES (merged from styles.css + tutorial2.css)    */
/* Remapped to the light/dark theme variable system.                      */
/* ====================================================================== */

/* Override: .recall-comparison is used as a 4-col GRID (not a <table>) */
.recall-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
  font-size: 0.88rem;
}
.recall-comparison > div:nth-child(4n+1) { border-right: 1px solid var(--border-card); }
.recall-comparison > div:nth-child(4n+3) { border-right: 1px solid var(--border-card); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.section-label {
  position: absolute;
  top: -1px;
  right: 28px;
}
.section-label span {
  display: inline-block;
  background: linear-gradient(135deg, #60a5fa, #14b8a6);
  color: #060c18;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.05em;
}
.card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
  padding-right: 60px;
}
.section-intro {
  font-size: 1rem;
  color: var(--text-sec);
  line-height: 1.75;
  margin-bottom: 20px;
  border-left: 3px solid rgba(96, 165, 250, 0.3);
  padding-left: 14px;
}
.card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
}
.card h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 6px;
}
.diagram {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 0;
}
.formula-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}
@media (max-width: 920px) {
  .card, .hero { padding: 22px 20px; }
}
@media (max-width: 680px) {
  .mechanism-grid,
  .feature-grid,
  .grid-2 { grid-template-columns: 1fr; }
  .card h3 { font-size: 1.2rem; }
}
.t2-hero .eyebrow { color: #f59e0b; }
.t2-hero h2 {
  background: linear-gradient(120deg, var(--text) 0%, #f59e0b 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.back-link {
  display: block;
  text-decoration: none;
  color: var(--text-sec);
  font-size: 0.82rem;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  margin-bottom: 10px;
  transition: all 0.18s;
}
.back-link:hover { color: var(--text); background: rgba(148,163,184,0.08); }
.toc-part-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  padding: 8px 10px 4px;
  margin-top: 6px;
}
.part-banner-a {
  background: linear-gradient(130deg, rgba(96,165,250,0.12) 0%, transparent 100%);
  border-color: rgba(96,165,250,0.3);
}
.part-banner-b {
  background: linear-gradient(130deg, rgba(245,158,11,0.12) 0%, transparent 100%);
  border-color: rgba(245,158,11,0.3);
}
.pb-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #60a5fa, #5eead4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
}
.part-banner-b .pb-num {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pb-content h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text);
}
.pb-content p { margin: 0; font-size: 0.9rem; color: var(--text-sec); }
.part-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid;
  font-weight: 600;
  font-size: 0.95rem;
}
.part-pill.part-a {
  border-color: rgba(96,165,250,0.3);
  background: rgba(96,165,250,0.08);
  color: var(--text-sec);
}
.part-pill.part-b {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.08);
  color: var(--text-sec);
}
.pp-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.pp-sub {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.7;
}
.ti-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid;
  flex-shrink: 0;
}
.t2-reason-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #060c18;
  font-weight: 800;
  font-size: 0.88rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  margin-top: 2px;
}
.t2-ft-row {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  border-bottom: 1px solid var(--border-card);
  font-size: 0.88rem;
}
.t2-ft-row:last-child { border-bottom: none; }
.t2-ft-row.header {
  background: rgba(96,165,250,0.1);
  font-weight: 700;
  color: var(--text);
}
.t2-ft-row > div { padding: 10px 12px; }
.t2-ft-type { font-weight: 700; font-size: 0.85rem; }
.t2-ft-row:not(.header) > div:last-child { color: var(--text-sec); }
.metric-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid;
}
.metric-name { font-size: 1rem; font-weight: 800; }
.metric-tagline { font-size: 0.82rem; color: var(--text-sec); font-style: italic; }
.rc-label {
  background: rgba(96,165,250,0.1);
  color: var(--text);
  font-weight: 700;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}
.rc-area {
  padding: 9px 12px;
  color: var(--text-sec);
  border-bottom: 1px solid var(--border-card);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}
.rc-val {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-card);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.88rem;
}
.rc-val.spatial { color: #3b82f6; }
.rc-val.temporal { color: #0d9488; }
.rc-uplift {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-card);
  color: #d97706;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: "JetBrains Mono", monospace;
}
.ib-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ib-name {
  width: 160px;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sec);
  font-family: "JetBrains Mono", monospace;
}
.ib-bar {
  height: 16px;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.ib-bar.structural { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.ib-bar.fertility { background: linear-gradient(90deg, #5eead4, #0d9488); }
.ib-bar.texture { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.ib-bar.proximity { background: linear-gradient(90deg, #f59e0b, #d97706); }
.ib-bar.alteration { background: linear-gradient(90deg, #fb7185, #e11d48); }
.ib-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-sec);
  white-space: nowrap;
}
.tc-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
}
.t2-st-row {
  display: grid;
  grid-template-columns: 70px 140px 100px 1fr;
  align-items: center;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid;
  font-size: 0.88rem;
  gap: 12px;
}
.t2-st-pct { font-weight: 800; font-family: "JetBrains Mono", monospace; font-size: 0.82rem; color: var(--text); }
.t2-st-thresh { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; color: var(--text-sec); }
.t2-st-cells { font-family: "JetBrains Mono", monospace; font-size: 0.82rem; color: var(--text); }
.t2-st-note { font-size: 0.83rem; color: var(--text-sec); }
.t2-ps-old, .t2-ps-new {
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid;
}
.t2-ps-old {
  border-color: rgba(100,116,139,0.3);
  background: rgba(100,116,139,0.05);
}
.t2-ps-new {
  border-color: rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.06);
}
.t2-ps-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.t2-ps-new .t2-ps-label { color: #f59e0b; }
.t2-ps-old h4, .t2-ps-new h4 { margin: 0 0 8px; font-size: 0.98rem; }
.t2-ps-old p, .t2-ps-new p { font-size: 0.87rem; margin-bottom: 6px; }
.t2-ps-arrow {
  font-size: 2rem;
  color: var(--text-dim);
  text-align: center;
}
.t2-next-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-card);
}
.t2-next-panel h4 { color: var(--text-sec); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.t2-next-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  transition: all 0.18s;
  cursor: pointer;
}
.t2-next-card:hover:not(.coming-soon) {
  border-color: rgba(96,165,250,0.35);
  background: rgba(96,165,250,0.06);
}
.t2-next-card.coming-soon { opacity: 0.5; cursor: default; }
.t2-next-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3b82f6;
  font-weight: 700;
}
.t2-next-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}
.t2-next-desc { font-size: 0.82rem; color: var(--text-sec); }
@media (max-width: 980px) {
  .t2-ps-arrow { display: none; }
  .t2-ft-row { grid-template-columns: 1fr; }
  .t2-ft-row.header > div:not(:first-child) { display: none; }
  .t2-st-row { grid-template-columns: 70px 1fr; }
  .t2-st-thresh, .t2-st-cells { display: none; }
}
@media (max-width: 680px) {
  .t2-st-row { grid-template-columns: 70px 1fr; }
  .ib-name { width: 110px; }
}

/* ====================================================================== */
/* RECOVERED TUTORIAL-1 STYLES (geological mapping) — from styles.css      */
/* ====================================================================== */
.subsection {
  border-top: 1px solid var(--border-card);
  padding-top: 20px;
  margin-top: 24px;
}
.spec-box {
  background: rgba(96, 165, 250, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
}
.spec-box h5 {
  color: #60a5fa;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}
.mechanism-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.02);
}
.mech-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 1px solid;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}
.mechanism-card h5 {
  font-size: 0.88rem;
  color: var(--text);
  margin: 0 0 8px;
}
.mechanism-card p {
  font-size: 0.85rem;
  color: var(--text-sec);
  margin-bottom: 8px;
}
.feature-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 14px;
}
.feature-item h5 {
  font-size: 0.85rem;
  color: #60a5fa;
  margin: 0 0 6px;
  font-weight: 700;
}
.feature-item p {
  font-size: 0.82rem;
  color: var(--text-sec);
  margin: 0;
}
.evidence-chain {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 16px 0;
  border-left: 2px solid var(--border);
  padding-left: 0;
}
.evidence-step {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  padding: 0 0 0 16px;
  position: relative;
  margin-bottom: 4px;
}
.evidence-step::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 16px;
  width: 10px;
  height: 10px;
  background: #60a5fa;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}
.ev-sensor {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #60a5fa;
  padding: 12px 12px 12px 0;
  align-self: flex-start;
  flex-shrink: 0;
}
.ev-content {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ev-content h5 {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 5px;
}
.ev-content p {
  font-size: 0.88rem;
  color: var(--text-sec);
  margin: 0;
}
.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 10px 12px;
  cursor: default;
}
.checklist input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: #14b8a6;
}
.checklist span {
  font-size: 0.9rem;
  color: var(--text-sec);
  line-height: 1.5;
}
@media (max-width: 920px) {
  .evidence-step {
    grid-template-columns: 1fr;
    padding-left: 20px;
  }
  .ev-sensor { padding: 8px 0 4px; }
}
