/* ==========================================================================
   Indicogni Design System — Prove It: Formally Verified Software in Lean 4
   Zero external fonts, zero trackers, CSP-strict (style-src 'self').
   ========================================================================== */

:root {
  --paper: #FBF8F1;
  --surface: #F3EEE3;
  --surface-elevated: #FFFFFF;
  --code-bg: #F6F2E8;
  --ink: #1E2227;
  --muted: #5B616B;
  --rule: #E2DBCA;
  --accent: #3A3DB0;
  --accent-soft: rgba(58, 61, 176, 0.10);
  --accent-strong: #2A2D8F;

  /* Proof Semantic Colors (Light) */
  --verified: #1E7A4C;
  --verified-soft: rgba(30, 122, 76, 0.11);
  --open-goal: #9A5B13;
  --open-goal-soft: rgba(154, 91, 19, 0.12);
  --refuted: #A62626;
  --refuted-soft: rgba(166, 38, 38, 0.11);

  --shadow-sm: 0 1px 3px rgba(30, 34, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 34, 39, 0.08);

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --max-prose: 760px;
  --max-wide: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1116;
    --surface: #161B22;
    --surface-elevated: #1C222B;
    --code-bg: #12171E;
    --ink: #E7E2D7;
    --muted: #9AA0A8;
    --rule: #262B33;
    --accent: #9EA2FF;
    --accent-soft: rgba(158, 162, 255, 0.14);
    --accent-strong: #B8BBFF;

    --verified: #56D38A;
    --verified-soft: rgba(86, 211, 138, 0.13);
    --open-goal: #F0B45B;
    --open-goal-soft: rgba(240, 180, 91, 0.14);
    --refuted: #FF7B72;
    --refuted-soft: rgba(255, 123, 114, 0.14);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --paper: #0E1116;
  --surface: #161B22;
  --surface-elevated: #1C222B;
  --code-bg: #12171E;
  --ink: #E7E2D7;
  --muted: #9AA0A8;
  --rule: #262B33;
  --accent: #9EA2FF;
  --accent-soft: rgba(158, 162, 255, 0.14);
  --accent-strong: #B8BBFF;

  --verified: #56D38A;
  --verified-soft: rgba(86, 211, 138, 0.13);
  --open-goal: #F0B45B;
  --open-goal-soft: rgba(240, 180, 91, 0.14);
  --refuted: #FF7B72;
  --refuted-soft: rgba(255, 123, 114, 0.14);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.68;
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: 1.8em;
  margin-bottom: 0.55em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  margin-top: 0.4em;
}

h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.32em;
}

h3 {
  font-size: 1.25rem;
}

p, ul, ol {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

p code, li code, td code, h2 code, h3 code {
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 0.12em 0.38em;
  border-radius: 4px;
}

kbd {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.18rem 0.44rem;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule);
  color: var(--ink);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.56;
  margin: 0 0 1.25rem 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.72rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-org {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--muted);
  text-decoration: none;
}

.brand-org:hover {
  color: var(--accent);
  text-decoration: underline;
}

.brand-sep {
  color: var(--rule);
  font-weight: 400;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-title:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.36rem 0.68rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.progress-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--verified);
  background: var(--verified-soft);
  border: 1px solid var(--verified);
  padding: 0.22rem 0.56rem;
  border-radius: 999px;
  white-space: nowrap;
}

.icon-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.34rem 0.62rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   Layout Containers & Buttons
   ========================================================================== */

.container-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.container-prose {
  max-width: var(--max-prose);
  margin: 0 auto;
}

.chapter-shell {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--surface-elevated);
  color: var(--ink);
  transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

:root[data-theme="dark"] .btn-primary {
  color: #0E1116;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary {
    color: #0E1116;
  }
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #FFFFFF;
}

:root[data-theme="dark"] .btn-primary:hover {
  color: #0E1116;
}

.btn-verified {
  background: var(--verified-soft);
  border-color: var(--verified);
  color: var(--verified);
}

.btn-verified.is-complete {
  background: var(--verified);
  color: #FFFFFF;
}

:root[data-theme="dark"] .btn-verified.is-complete {
  color: #0E1116;
}

.btn-sm {
  padding: 0.36rem 0.72rem;
  font-size: 0.82rem;
}

.btn-danger {
  color: var(--refuted);
  border-color: var(--refuted);
  background: var(--refuted-soft);
}

/* ==========================================================================
   Landing Page Hero, Stats, Resume Banner & Diagrams
   ========================================================================== */

.resume-banner {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.resume-banner[hidden] {
  display: none;
}

.resume-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.resume-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.resume-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero {
  padding: 1.5rem 0 2.25rem;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  max-width: 18ch;
  margin-top: 0.15rem;
  margin-bottom: 0.6rem;
}

.hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 66ch;
  margin-bottom: 1.45rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.05rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  background: var(--surface-elevated);
}

.card h3 {
  margin-top: 0.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
}

.badge-verified {
  color: var(--verified);
  border-color: var(--verified);
  background: var(--verified-soft);
}

.badge-open {
  color: var(--open-goal);
  border-color: var(--open-goal);
  background: var(--open-goal-soft);
}

.badge-refuted {
  color: var(--refuted);
  border-color: var(--refuted);
  background: var(--refuted-soft);
}

.badge-accent {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Architectural SVG Figures */
.diagram-figure {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.diagram-svg {
  width: 100%;
  height: auto;
  display: block;
}

.svg-panel {
  fill: var(--paper);
  stroke: var(--rule);
  stroke-width: 1.5;
}

.svg-box {
  fill: var(--surface-elevated);
  stroke: var(--rule);
  stroke-width: 1.5;
}

.svg-box-accent {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.8;
}

.svg-box-verified {
  fill: var(--verified-soft);
  stroke: var(--verified);
  stroke-width: 1.8;
}

.svg-box-open {
  fill: var(--open-goal-soft);
  stroke: var(--open-goal);
  stroke-width: 1.8;
}

.svg-box-refuted {
  fill: var(--refuted-soft);
  stroke: var(--refuted);
  stroke-width: 1.8;
}

.svg-title {
  fill: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
}

.svg-label {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
}

.svg-mono {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.svg-mono-ink {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

.svg-arrow {
  stroke: var(--muted);
  stroke-width: 1.8;
  fill: none;
}

.svg-arrow-accent {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
}

.svg-arrow-verified {
  stroke: var(--verified);
  stroke-width: 2;
  fill: none;
}

.svg-arrow-refuted {
  stroke: var(--refuted);
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
  fill: none;
}

.svg-head-muted { fill: var(--muted); }
.svg-head-accent { fill: var(--accent); }
.svg-head-verified { fill: var(--verified); }
.svg-head-refuted { fill: var(--refuted); }

.diagram-caption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ==========================================================================
   Expandable Curriculum Accordion
   ========================================================================== */

.part-details {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
}

.part-summary {
  padding: 1.05rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--surface);
  list-style: none;
}

.part-summary::-webkit-details-marker {
  display: none;
}

.part-summary:hover {
  background: var(--accent-soft);
}

.chapter-list {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.12s ease;
}

.chapter-row:last-child {
  border-bottom: 0;
}

.chapter-row:hover {
  background: var(--surface);
  text-decoration: none;
}

.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.chapter-row.is-checkpoint .chapter-num {
  color: var(--open-goal);
}

.chapter-info strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

.chapter-info span {
  font-size: 0.86rem;
  color: var(--muted);
}

.chapter-status-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--muted);
}

.chapter-status-pill.done {
  color: var(--verified);
  border-color: var(--verified);
  background: var(--verified-soft);
}

/* ==========================================================================
   Chapter Page Components: Puzzle, Socratic Gate, Split-View Infoview
   ========================================================================== */

.chapter-header {
  max-width: var(--max-prose);
  margin: 0 auto 2rem;
}

.chapter-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.puzzle-box {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--refuted);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin: 1.5rem 0;
}

.puzzle-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--refuted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
}

/* Socratic Prediction Card */
.prediction-card {
  background: var(--surface-elevated);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-sm);
}

.prediction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.prediction-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1rem 0;
}

.prediction-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.45;
  cursor: pointer;
}

.prediction-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.prediction-option.is-selected {
  border-color: var(--accent);
  border-width: 2px;
  background: var(--accent-soft);
}

.prediction-option.is-correct {
  border-color: var(--verified);
  border-width: 2px;
  background: var(--verified-soft);
}

.prediction-option.is-wrong {
  border-color: var(--refuted);
  background: var(--refuted-soft);
}

.prediction-option:disabled {
  cursor: default;
}

.option-letter {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  min-width: 1.4rem;
}

.prediction-reveal {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.prediction-reveal[hidden] {
  display: none;
}

/* Split-View Code <-> Lean Infoview Workbench */
.workbench {
  margin: 2.25rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.workbench-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.1rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--rule);
}

.workbench-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.step-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 0.4rem;
}

.workbench-split {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  min-height: 340px;
}

@media (max-width: 900px) {
  .workbench-split {
    grid-template-columns: 1fr;
  }
}

.code-pane {
  padding: 1rem;
  background: var(--code-bg);
  border-right: 1px solid var(--rule);
  overflow-x: auto;
}

@media (max-width: 900px) {
  .code-pane {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
}

.code-lines {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.62;
}

.code-line {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 0.5rem;
  padding: 0.08rem 0.45rem;
  border-radius: 4px;
  white-space: pre;
}

.code-line.is-steppable {
  cursor: pointer;
}

.code-line.is-steppable:hover {
  background: var(--accent-soft);
}

.code-line.is-active {
  background: var(--accent-soft);
  outline: 1px solid var(--accent);
}

.line-no {
  color: var(--muted);
  user-select: none;
  text-align: right;
  font-size: 0.76rem;
}

.infoview-pane {
  padding: 1.05rem 1.15rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.infoview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
}

.infoview-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.infoview-section-label {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
  display: block;
}

.infoview-block {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  white-space: pre-wrap;
}

.infoview-goal {
  border-left: 3px solid var(--open-goal);
  font-weight: 600;
}

.infoview-goal.is-verified {
  border-left-color: var(--verified);
  color: var(--verified);
  background: var(--verified-soft);
}

.infoview-goal.is-refuted {
  border-left-color: var(--refuted);
  color: var(--refuted);
  background: var(--refuted-soft);
}

.infoview-note {
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--surface-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.workbench-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.1rem;
  background: var(--surface-elevated);
  border-top: 1px solid var(--rule);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Callouts, Chapter Completion & Prev/Next Footer
   ========================================================================== */

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.callout-verified {
  border-left-color: var(--verified);
}

.callout-open {
  border-left-color: var(--open-goal);
}

.chapter-complete-bar {
  margin: 2.5rem 0 1.75rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chapter-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .chapter-pager {
    grid-template-columns: 1fr;
  }
}

.pager-card {
  display: block;
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  text-decoration: none;
  color: var(--ink);
}

.pager-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.pager-card.align-right {
  text-align: right;
}

.pager-dir {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  display: block;
}

.pager-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
}

/* ==========================================================================
   Interactive Browser Labs Styles
   ========================================================================== */

.lab-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 1.75rem;
}

.lab-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.lab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: var(--surface-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.lab-select, .lab-input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}

.lab-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.trace-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.trace-step {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 0.68rem;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--rule);
}

.trace-step.is-violation {
  border-color: var(--refuted);
  background: var(--refuted-soft);
  color: var(--refuted);
}

.funnel-ring {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--rule);
  margin-top: 0.45rem;
}

.funnel-safe {
  border-style: solid;
  border-color: var(--open-goal);
  background: var(--open-goal-soft);
}

.funnel-inductive {
  border-style: solid;
  border-color: var(--verified);
  background: var(--verified-soft);
}

.funnel-reachable {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.bit-strip {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin: 0.65rem 0;
}

.bit-cell {
  text-align: center;
  padding: 0.2rem 0;
  border-radius: 3px;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.bit-cell.is-one {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* ==========================================================================
   Reference Tables, Search Filter & Glossary
   ========================================================================== */

.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1.25rem 0 1.5rem;
}

.search-input {
  flex: 1 1 260px;
  padding: 0.58rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--surface-elevated);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.94rem;
}

.rosetta-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1.15rem;
}

.rosetta-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

@media (max-width: 820px) {
  .rosetta-pair {
    grid-template-columns: 1fr;
  }
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.68rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  background: var(--surface);
  font-weight: 600;
}

/* ==========================================================================
   Keyboard Shortcut Modal & Footer
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 17, 22, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.4rem;
  box-shadow: var(--shadow-md);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.48rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding: 2rem 1.25rem;
  background: var(--surface);
  font-size: 0.86rem;
  color: var(--muted);
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
