:root {
  --ink: #1a2332; --ink-soft: #2e3a4f;
  --cream: #faf7f2; --cream-deep: #f4eee3; --paper: #fdfbf7;
  --rule: #d6cfc1; --rule-soft: #e8e2d4;
  --muted: #78716c; --muted-soft: #a8a29e;
  --a2: #1e3a8a; --a2-soft: #dbeafe; --a2-mid: #3b82f6;
  --a3: #b45309; --a3-soft: #fef3c7; --a3-mid: #d97706;

  /* Speech-act colors */
  --str: #15803d; --str-soft: #dcfce7;
  --dx: #b91c1c; --dx-soft: #fee2e2;
  --enb: #1e40af; --enb-soft: #dbeafe;
  --bar: #a16207; --bar-soft: #fef3c7;

  /* Readiness tier colors */
  --strong: #15803d; --emerging: #0891b2;
  --testing: #a16207; --exploratory: #78716c;

  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shadow-soft: 0 1px 2px rgba(26,35,50,0.04), 0 4px 12px rgba(26,35,50,0.06);
  --shadow-drawer: -8px 0 40px rgba(26,35,50,0.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0.05 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  opacity: 0.5; pointer-events: none; z-index: 0; mix-blend-mode: multiply;
}

.wrap { max-width: 1480px; margin: 0 auto; padding: 0 40px; position: relative; z-index: 1; }

/* ========== MASTHEAD ========== */
.masthead {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--ink);
  position: relative;
}
.masthead::after {
  content: "§"; position: absolute; top: 52px; right: 18px;
  width: 56px; height: 56px; border: 1px solid var(--ink); border-radius: 50%;
  font-family: var(--serif); font-size: 38px; color: var(--a3);
  font-style: italic; font-weight: 300;
  display: flex; align-items: center; justify-content: center; line-height: 0;
}
.eyebrow {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: 2.5px;
  text-transform: uppercase; font-weight: 500; color: var(--muted);
  margin: 0 0 18px;
}
.eyebrow strong { color: var(--a3); font-weight: 600; }
.masthead__title {
  font-family: var(--serif);
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 360; font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.022em; line-height: 0.98;
  margin: 0 0 8px; max-width: 1100px;
}
.masthead__title em {
  font-style: italic; font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  color: var(--a2);
}
.masthead__sub {
  font-family: var(--serif); font-size: 21px; font-weight: 300; font-style: italic;
  color: var(--ink-soft); margin: 10px 0 24px; max-width: 900px;
}
.masthead__meta {
  font-size: 12px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--mono); letter-spacing: 0.02em;
}
.masthead__meta strong { color: var(--ink); font-weight: 500; }

/* ========== STATS STRIP ========== */
.strip {
  border-bottom: 1px solid var(--rule);
  padding: 32px 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
}
.stat { padding: 0 22px 0 0; border-right: 1px solid var(--rule-soft); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: none; }
.stat + .stat { padding-left: 22px; }
.stat__num {
  font-family: var(--serif); font-weight: 350;
  font-variation-settings: "opsz" 144, "SOFT" 20;
  font-size: clamp(38px, 4vw, 58px);
  line-height: 0.95; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: 6px;
}
.stat__num em {
  font-style: italic; font-weight: 300; color: var(--a3);
  font-size: 0.5em; margin-right: 3px;
}
.stat__lbl {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  color: var(--ink); margin-bottom: 2px;
}
.stat__sub { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--muted); }

/* ========== TABS ========== */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--ink);
  margin-top: 40px; background: var(--cream);
  position: sticky; top: 0; z-index: 40; padding-top: 8px;
}
.tab {
  background: transparent; border: 1px solid transparent; border-bottom: none;
  padding: 14px 22px 12px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.03em; color: var(--muted); cursor: pointer;
  transition: all 0.2s;
  position: relative; bottom: -1px;
  display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  background: var(--paper); border-color: var(--ink);
  color: var(--ink); font-weight: 600;
}
.tab__num {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--a3); font-weight: 500; opacity: 0.8;
}

/* ========== PANELS ========== */
.panel { display: none; padding: 40px 0 96px; min-height: 60vh; }
.panel.is-active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-head {
  display: grid; grid-template-columns: 180px 1fr; gap: 40px;
  margin-bottom: 40px; padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.panel-head__label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; color: var(--muted);
  text-transform: uppercase; padding-top: 6px;
}
.panel-head__title {
  font-family: var(--serif); font-size: 34px; font-weight: 360;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.015em; line-height: 1.1;
  margin: 0 0 10px;
}
.panel-head__title em { font-style: italic; color: var(--a2); font-weight: 300; }
.panel-head__lede {
  font-family: var(--serif); font-size: 17px; font-weight: 300;
  color: var(--ink-soft); max-width: 820px; line-height: 1.55;
}

/* ========== OVERVIEW PANEL ========== */
.findings { display: grid; grid-template-columns: 180px 1fr; gap: 40px; }
.finding__num {
  font-family: var(--serif); font-size: 52px; font-weight: 300; font-style: italic;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  color: var(--a3); line-height: 1; letter-spacing: -0.03em;
  padding: 28px 0 32px; border-top: 1px solid var(--rule);
}
.finding__body { padding: 28px 0 32px; border-top: 1px solid var(--rule); }
.finding__title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  font-variation-settings: "opsz" 24, "SOFT" 20;
  line-height: 1.25; color: var(--ink);
  margin: 0 0 10px; letter-spacing: -0.01em;
}
.finding__text { font-size: 15px; color: var(--ink-soft); max-width: 720px; line-height: 1.65; }
.finding__text code, .finding__text .chip {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--cream-deep); padding: 2px 6px;
  border-radius: 2px; color: var(--a2); font-weight: 500;
}

/* Speech-act donut illustrating the tag distribution */
.sa-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 36px 0; border-top: 1px solid var(--rule);
  margin-top: 36px; align-items: center;
}
.sa-donut svg { width: 100%; max-width: 320px; height: auto; display: block; }
.sa-legend { display: flex; flex-direction: column; gap: 14px; }
.sa-item { display: flex; align-items: center; gap: 14px; }
.sa-swatch { width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.sa-item__name { font-family: var(--serif); font-size: 17px; }
.sa-item__name em { font-style: italic; font-weight: 300; font-size: 14px; color: var(--muted); }
.sa-item__count {
  margin-left: auto; font-family: var(--mono); font-size: 12px;
  color: var(--muted);
}
.sa-item__count strong { color: var(--ink); font-weight: 500; }

/* ========== STRATEGY REGISTER ========== */
.reg-controls {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 16px; align-items: end;
  padding: 20px 24px;
  background: var(--paper); border: 1px solid var(--rule);
  margin-bottom: 24px;
}
.reg-ctl { display: flex; flex-direction: column; gap: 6px; }
.reg-ctl__label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.reg-search {
  padding: 9px 14px; border: 1px solid var(--rule); background: var(--cream);
  font-family: var(--sans); font-size: 13.5px; border-radius: 2px;
  outline: none; transition: border-color 0.15s; min-width: 280px;
}
.reg-search:focus { border-color: var(--ink); background: var(--paper); }

.toggle-group {
  display: flex; border: 1px solid var(--rule); border-radius: 2px;
  overflow: hidden; background: var(--cream);
}
.toggle {
  padding: 7px 12px;
  font-size: 11.5px; font-family: var(--sans); font-weight: 500;
  background: transparent; border: none; border-right: 1px solid var(--rule);
  color: var(--muted); cursor: pointer; letter-spacing: 0.02em;
  transition: all 0.12s;
}
.toggle:last-child { border-right: none; }
.toggle:hover { background: var(--cream-deep); color: var(--ink); }
.toggle.is-on { background: var(--ink); color: var(--cream); }

/* Readiness tier pill */
.tier-pill {
  display: inline-block;
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px;
  font-weight: 600;
}
.tier-strong { background: #dcfce7; color: #15803d; }
.tier-emerging { background: #cffafe; color: #0e7490; }
.tier-testing { background: #fef3c7; color: #92400e; }
.tier-exploratory { background: #f3f4f6; color: #52525b; }

/* Strategy rows — parent groups */
.parent-block {
  margin-bottom: 36px;
}
.parent-hdr-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 8px;
}
.parent-swatch-lg {
  width: 6px; height: 36px; border-radius: 2px;
}
.parent-name {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  font-variation-settings: "opsz" 48, "SOFT" 20;
  letter-spacing: -0.01em; color: var(--ink); flex: 1;
}
.parent-count {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.06em;
}

.strat-row {
  display: grid;
  grid-template-columns: 100px 1fr 140px 80px;
  gap: 18px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
  align-items: start;
}
.strat-row:hover {
  border-color: var(--ink);
  background: var(--cream);
  transform: translateX(2px);
}
.strat-row__code {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: white; padding: 4px 8px; border-radius: 2px;
  letter-spacing: 0.04em;
  text-align: center; align-self: start;
  height: 22px; line-height: 14px;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.strat-row__content { min-width: 0; }
.strat-row__name {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.02em;
  text-transform: uppercase; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.strat-row__statement {
  font-family: var(--serif); font-size: 15px; font-weight: 300;
  color: var(--ink); line-height: 1.5;
  font-variation-settings: "opsz" 14, "SOFT" 40;
}
.strat-row__meta {
  display: flex; flex-direction: column; gap: 4px;
  align-items: flex-end; padding-top: 4px;
}
.breadth-bar {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px;
}
.breadth-bar__bar {
  width: 70px; height: 8px; background: var(--rule-soft); border-radius: 2px;
  overflow: hidden; position: relative;
}
.breadth-bar__fill {
  height: 100%; border-radius: 2px;
  transition: width 0.2s;
}
.breadth-bar__count {
  font-weight: 600; color: var(--ink); min-width: 26px; text-align: right;
}
.strat-row__mentions {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.04em;
}
.strat-row__arrow {
  font-size: 18px; color: var(--muted-soft); align-self: center;
  text-align: right; transition: transform 0.15s, color 0.15s;
}
.strat-row:hover .strat-row__arrow { color: var(--a3); transform: translateX(4px); }

.empty-strat {
  padding: 40px 20px; text-align: center;
  font-family: var(--serif); font-style: italic;
  color: var(--muted); font-size: 15px;
}

/* ========== REVIEW CONTROLS ========== */
.strat-row { position: relative; padding-left: 50px; }
.strat-row.is-validated {
  border-left: 3px solid var(--str);
  padding-left: 48px;
}
.review-check {
  position: absolute;
  left: 14px; top: 18px;
  width: 22px; height: 22px;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  z-index: 2;
  padding: 0;
}
.review-check:hover { border-color: var(--str); transform: scale(1.08); }
.review-check svg {
  width: 12px; height: 12px;
  color: transparent;
  transition: color 0.15s;
}
.review-check.is-on { background: var(--str); border-color: var(--str); }
.review-check.is-on svg { color: white; }

.row-pills {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 6px;
}
.edited-pill, .notes-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 2px;
}
.edited-pill { background: #fef3c7; color: #92400e; }
.notes-pill { background: #dbeafe; color: #1e3a8a; }

.row-edit-btn {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 3px 9px;
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); cursor: pointer;
  border-radius: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.12s;
  margin-top: 4px;
}
.row-edit-btn:hover { border-color: var(--ink); color: var(--ink); background: white; }

/* progress + export bar */
.review-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 2px;
}
.review-progress {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 1; min-width: 200px;
}
.review-progress__bar {
  flex: 1; max-width: 200px; height: 6px;
  background: var(--rule-soft);
  border-radius: 2px; overflow: hidden;
}
.review-progress__fill { height: 100%; background: var(--str); transition: width 0.3s; }
.review-progress__num { color: var(--ink); font-weight: 600; }
.review-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review-btn {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 6px 12px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  color: var(--ink); cursor: pointer;
  border-radius: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.review-btn:hover { border-color: var(--ink); background: var(--cream); }
.review-btn--primary { background: var(--ink); color: white; border-color: var(--ink); }
.review-btn--primary:hover { background: var(--ink-soft); }
.review-btn--danger { color: var(--dx); border-color: #fecaca; }
.review-btn--danger:hover { background: #fee2e2; border-color: var(--dx); color: var(--dx); }
.review-btn--ghost { border-color: transparent; }

/* drawer editor */
.review-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 2px;
  margin: 14px 0;
  font-size: 13px; color: var(--ink-soft);
}
.review-banner.is-validated { background: #dcfce7; border-color: #86efac; color: #166534; }
.review-banner__check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--str); color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.review-banner__check svg { width: 12px; height: 12px; }
.review-banner__text { flex: 1; }
.review-banner__ts {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.04em; margin-top: 2px;
}

.editor-block { margin: 16px 0; }
.editor-block__label {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.editor-block__label-actions { display: flex; gap: 6px; }
.editor-input, .editor-textarea {
  font-family: var(--serif); font-size: 15px; font-weight: 300;
  color: var(--ink); line-height: 1.55;
  border: 1px solid var(--rule);
  background: white; padding: 10px 12px;
  border-radius: 2px; outline: none;
  width: 100%; box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.15s, background 0.15s;
}
.editor-input:focus, .editor-textarea:focus { border-color: var(--ink); background: white; }
.editor-textarea { min-height: 90px; }
.editor-textarea--notes {
  font-family: var(--sans); font-size: 14px;
  min-height: 60px;
}
.editor-input { font-size: 16px; font-weight: 400; }
.editor-saved {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--str); letter-spacing: 0.06em;
  text-transform: uppercase; opacity: 0;
  transition: opacity 0.2s;
}
.editor-saved.is-on { opacity: 1; }

.field-readonly {
  font-family: var(--serif); font-size: 15px; font-weight: 300;
  color: var(--ink); line-height: 1.55;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
}
.field-readonly--name {
  font-family: var(--serif); font-size: 21px; font-weight: 360;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  letter-spacing: -0.005em; line-height: 1.2;
  background: transparent; border: none; padding: 0;
}

.editor-actions {
  display: flex; gap: 8px; margin-top: 8px;
}

.import-input { display: none; }

/* Sidebar validation dots */
.code-item__dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-left: 6px; vertical-align: middle;
}
.code-item__dot.is-validated { background: var(--str); }
.code-item__dot.is-edited    { background: var(--a3); }
.code-item__dot.is-noted     { background: var(--a2-mid); }

/* Code detail review block */
.code-review-block {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin: 14px 0;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 2px;
}
.code-review-block.is-validated {
  background: #f0fdf4; border-color: #86efac;
}
.code-review-block__label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--ink); letter-spacing: 0.05em;
  flex: 1;
}
.code-review-block__sub {
  font-family: var(--sans); font-size: 11.5px; font-weight: 400;
  color: var(--muted); letter-spacing: 0;
  text-transform: none;
}

/* ========== THEME EXPLORER ========== */
.expl-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 0;
  min-height: 60vh;
}
.expl-sidebar {
  border-right: 1px solid var(--rule);
  padding: 12px 28px 40px 0;
}
.sidebar-head {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.expl-search {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--rule); background: var(--paper);
  font-family: var(--sans); font-size: 13px;
  border-radius: 2px; outline: none; margin-bottom: 18px;
}
.expl-search:focus { border-color: var(--ink); }
.parent-group { margin-bottom: 14px; }
.parent-hdr-sb {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
  cursor: pointer; user-select: none;
}
.parent-hdr-sb:hover { color: var(--a2); }
.parent-hdr-sb__swatch { width: 10px; height: 10px; border-radius: 2px; }
.parent-hdr-sb__count {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); font-weight: 400;
}
.parent-hdr-sb__caret {
  font-size: 9px; color: var(--muted);
  transition: transform 0.15s;
}
.parent-group.is-collapsed .parent-hdr-sb__caret { transform: rotate(-90deg); }
.parent-group.is-collapsed .code-list { display: none; }
.code-list { padding: 2px 0 4px 18px; }
.code-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 8px;
  font-family: var(--sans); font-size: 12.5px;
  cursor: pointer; border-radius: 3px;
  margin-bottom: 1px; transition: background 0.12s;
  border-left: 2px solid transparent;
}
.code-item:hover { background: var(--cream-deep); }
.code-item.is-active {
  background: var(--cream-deep);
  border-left-color: var(--a3); font-weight: 500;
}
.code-item__id {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--a2); min-width: 62px;
}
.code-item__id.inductive { color: #a21caf; font-style: italic; }
.code-item__name {
  flex: 1; color: var(--ink-soft); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.code-item__freq {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); background: var(--cream-deep);
  padding: 2px 6px; border-radius: 2px;
}

/* Content */
.expl-content {
  padding: 0 0 40px 40px;
  min-width: 0;
}
.expl-empty {
  text-align: center; padding: 80px 20px;
  color: var(--muted); font-family: var(--serif); font-style: italic;
  font-size: 20px;
}
.expl-empty__title {
  font-size: 40px; font-family: var(--serif); font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  color: var(--a2); margin-bottom: 10px; font-style: italic;
}

.theme-head {
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.theme-head__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 12px;
}
.theme-head__swatch { width: 14px; height: 14px; border-radius: 3px; }
.theme-head__id {
  font-family: var(--mono); font-size: 14px; color: var(--a3);
  font-weight: 600; letter-spacing: 0.06em; margin-right: 14px;
}
.theme-head__title {
  font-family: var(--serif); font-size: 32px;
  font-weight: 360; font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.015em; line-height: 1.15;
  margin: 0 0 12px;
}
.theme-head__title em { color: #a21caf; font-style: italic; font-weight: 400; }
.theme-head__def {
  font-family: var(--serif); font-size: 16px; font-weight: 300;
  color: var(--ink-soft); line-height: 1.55;
  max-width: 900px;
}

.theme-statement-box {
  margin: 20px 0 24px;
  padding: 16px 22px;
  background: var(--str-soft);
  border-left: 3px solid var(--str);
  border-radius: 0;
}
.theme-statement-box__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--str);
  font-weight: 600; margin-bottom: 6px;
}
.theme-statement-box__text {
  font-family: var(--serif); font-size: 16px; font-weight: 400;
  color: var(--ink); line-height: 1.55;
}

.theme-meta {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  margin: 0 0 24px;
  padding: 18px 0;
  border-top: 1px dotted var(--rule);
  border-bottom: 1px dotted var(--rule);
}
.theme-meta__k {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.theme-meta__v {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  font-variation-settings: "opsz" 48, "SOFT" 20;
  color: var(--ink);
}
.theme-meta__v em {
  font-style: italic; font-weight: 300; color: var(--a2); font-size: 0.6em;
}
.theme-source-list {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.04em;
}
.theme-source-list .chip {
  background: var(--cream-deep); padding: 2px 8px;
  border-radius: 2px; margin-right: 4px; color: var(--ink);
  display: inline-block;
}

/* Speech-act distribution bar */
.sa-bar-section {
  margin: 0 0 24px;
  padding: 14px 0;
}
.sa-bar-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
  font-weight: 600;
}
.sa-bar {
  display: flex; height: 10px; border-radius: 2px;
  overflow: hidden; background: var(--rule-soft);
  margin-bottom: 10px;
}
.sa-bar-seg { transition: flex 0.2s; }
.sa-bar-seg.sa-str { background: var(--str); }
.sa-bar-seg.sa-dx  { background: var(--dx); }
.sa-bar-seg.sa-enb { background: var(--enb); }
.sa-bar-seg.sa-bar { background: var(--bar); }
.sa-bar-key {
  display: flex; gap: 18px; font-family: var(--mono); font-size: 11px;
  color: var(--muted); flex-wrap: wrap;
}
.sa-bar-key__item { display: flex; align-items: center; gap: 6px; }
.sa-bar-key__swatch { width: 10px; height: 10px; border-radius: 1px; }
.sa-bar-key__swatch.str { background: var(--str); }
.sa-bar-key__swatch.dx  { background: var(--dx); }
.sa-bar-key__swatch.enb { background: var(--enb); }
.sa-bar-key__swatch.bar { background: var(--bar); }
.sa-bar-key strong { color: var(--ink); font-weight: 600; }

/* Filter row */
.filters {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filters__label {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--muted); letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Quote list */
.quotes-hdr {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--a3);
  margin: 28px 0 14px; font-weight: 600;
}
.quote {
  padding: 18px 22px 20px;
  background: var(--paper); border: 1px solid var(--rule);
  border-left: 3px solid var(--a2);
  margin-bottom: 12px;
  transition: border-left-color 0.15s;
}
.quote.a3 { border-left-color: var(--a3); }
.quote__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 8px; flex-wrap: wrap;
}
.quote__src {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.04em;
}
.quote__src strong { color: var(--ink); font-weight: 600; }
.quote__tags {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.sa-tag {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 2px; letter-spacing: 0.08em;
}
.sa-tag.sa-str { background: var(--str-soft); color: var(--str); }
.sa-tag.sa-dx  { background: var(--dx-soft);  color: var(--dx); }
.sa-tag.sa-enb { background: var(--enb-soft); color: var(--enb); }
.sa-tag.sa-bar { background: var(--bar-soft); color: var(--bar); }
.quote__codes {
  display: flex; gap: 4px; flex-wrap: wrap;
  justify-content: flex-end;
}
.code-chip {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border-radius: 2px;
  background: var(--cream-deep); color: var(--ink-soft);
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
  cursor: pointer; transition: all 0.1s;
}
.code-chip:hover { background: var(--ink); color: var(--cream); }
.code-chip.is-current {
  background: var(--a3); color: white; border-color: var(--a3);
  font-weight: 600;
}
.quote__q {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  font-weight: 300; color: var(--muted);
  margin-bottom: 10px; line-height: 1.4;
  padding-bottom: 10px; border-bottom: 1px dotted var(--rule-soft);
}
.quote__text {
  font-family: var(--serif); font-size: 15px; line-height: 1.65;
  color: var(--ink); font-weight: 300; white-space: pre-wrap;
}

/* Co-occurrence panel */
.cooc-panel {
  margin-top: 32px; padding: 20px 24px;
  background: var(--cream-deep); border: 1px solid var(--rule);
}
.cooc-panel__title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink);
  font-weight: 600; margin-bottom: 10px;
}
.cooc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0;
  border-top: 1px dotted var(--rule);
  font-family: var(--sans);
}
.cooc-row:first-child { border-top: none; }
.cooc-row__id {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 2px; color: white;
  min-width: 80px; text-align: center;
  cursor: pointer;
}
.cooc-row__name { flex: 1; font-size: 13px; color: var(--ink-soft); }
.cooc-row__count { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ========== NETWORK ========== */
.network-wrap {
  background: var(--paper); border: 1px solid var(--ink);
  padding: 24px; margin-top: 20px;
  min-height: 600px; position: relative;
}
#network-svg {
  width: 100%;
  height: 780px;
  display: block;
  cursor: grab;
}
#network-svg:active { cursor: grabbing; }
.net-legend {
  position: absolute; top: 24px; right: 24px;
  background: rgba(250, 247, 242, 0.95);
  padding: 12px 16px; border: 1px solid var(--rule);
  border-radius: 2px; max-width: 260px;
}
.net-legend__title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  margin-bottom: 8px;
}
.net-legend-row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 10.5px;
  color: var(--ink); padding: 3px 0;
}
.net-legend-swatch {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
}
.net-controls {
  position: absolute; top: 24px; left: 24px;
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(250, 247, 242, 0.95);
  padding: 12px 16px; border: 1px solid var(--rule);
}
.net-ctrl__label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.net-thresh {
  width: 160px; accent-color: var(--a2);
}
.net-thresh-val {
  font-family: var(--mono); font-size: 11px; color: var(--ink); font-weight: 600;
}

/* ========== DRAWER ========== */
.scrim {
  position: fixed; inset: 0;
  background: rgba(26,35,50,0.45);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s; z-index: 90;
}
.scrim.is-on { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: -780px; height: 100vh; width: 740px;
  background: var(--paper);
  border-left: 1px solid var(--ink);
  box-shadow: var(--shadow-drawer);
  transition: right 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
  display: flex; flex-direction: column;
  max-width: 96vw;
}
.drawer.is-on { right: 0; }
.drawer__top {
  padding: 20px 32px 16px;
  border-bottom: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--cream-deep);
}
.drawer__eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase;
}
.drawer__close {
  background: transparent; border: 1px solid var(--ink);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 16px; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.drawer__close:hover { background: var(--ink); color: var(--cream); }
.drawer__body { flex: 1; overflow-y: auto; padding: 32px 40px 64px; }
.drawer__title {
  font-family: var(--serif); font-size: 26px; font-weight: 360;
  font-variation-settings: "opsz" 72, "SOFT" 20;
  letter-spacing: -0.015em; line-height: 1.15;
  margin: 0 0 14px;
}
.drawer__sub {
  font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--muted);
  margin-bottom: 18px;
}

/* ========== COLOPHON ========== */
footer.colophon {
  border-top: 1px solid var(--ink);
  padding: 40px 0 60px; margin-top: 32px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.04em;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;
}
footer.colophon strong { color: var(--ink); font-weight: 500; }
footer.colophon .mark {
  font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--a3);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-soft); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .expl-layout { grid-template-columns: 1fr; }
  .expl-sidebar {
    border-right: none; border-bottom: 1px solid var(--rule);
    padding: 20px 0 20px;
  }
  .expl-content { padding: 20px 0 40px; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 0 12px; }
  .stat:nth-child(3n) { border-right: none; padding-right: 0; }
  .sa-panel { grid-template-columns: 1fr; }
  .panel-head, .findings { grid-template-columns: 1fr; gap: 16px; }
  .strat-row { grid-template-columns: 90px 1fr 100px; }
  .strat-row__arrow { display: none; }
  .theme-meta { grid-template-columns: repeat(2, 1fr); }
  .reg-controls { grid-template-columns: 1fr; }
}
@media print {
  body::before { display: none; }
  .tabs, .drawer, .scrim, .expl-sidebar { display: none; }
  .panel { display: block !important; page-break-before: always; }
  .expl-layout { grid-template-columns: 1fr; }
}

/* ========== UNSAVED INDICATOR + SAVE BUTTON ========== */
.unsaved-indicator {
  position: absolute; top: 56px; right: 90px;
  display: none; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: #fef2f2; color: var(--dx);
  border: 1px solid #fecaca;
  border-radius: 2px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 5;
}
.unsaved-indicator.is-on { display: inline-flex; }
.unsaved-indicator:hover { background: #fee2e2; }
.unsaved-indicator__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dx);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.save-status {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 4px;
}
.save-status.is-dirty { color: var(--dx); font-weight: 500; }
.save-status.is-clean { color: var(--str); }
.review-btn--save {
  background: var(--ink); color: white; border-color: var(--ink);
  font-weight: 600;
}
.review-btn--save:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.review-btn--save.is-dirty {
  background: var(--dx); border-color: var(--dx);
  box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.4);
  animation: pulse-save 2s ease-in-out infinite;
}
.review-btn--save.is-dirty:hover { background: #991b1b; border-color: #991b1b; }
@keyframes pulse-save {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0); }
}
.review-btn--add {
  background: var(--str); color: white; border-color: var(--str);
}
.review-btn--add:hover { background: #166534; border-color: #166534; }

/* Status banner */
.status-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 14px;
  border-radius: 2px;
  font-size: 13px;
  border: 1px solid transparent;
}
.status-banner__icon {
  flex-shrink: 0; width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.status-banner--info {
  background: var(--a2-soft); border-color: #bfdbfe; color: #1e3a8a;
}
.status-banner--info .status-banner__icon { background: var(--a2); color: white; }
.status-banner--warn {
  background: #fef2f2; border-color: #fecaca; color: #991b1b;
}
.status-banner--warn .status-banner__icon { background: var(--dx); color: white; }
.status-banner--ok {
  background: #dcfce7; border-color: #86efac; color: #166534;
}
.status-banner--ok .status-banner__icon { background: var(--str); color: white; }
.status-banner__text { flex: 1; }
.status-banner__text strong { font-weight: 600; }

/* Manual strategy pill */
.manual-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 9px; letter-spacing: 0.08em;
  font-family: var(--mono); font-weight: 500;
  text-transform: uppercase;
  background: #ecfdf5; color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 2px;
  vertical-align: middle;
}

/* Hidden strategy treatment (when "show hidden" is on) */
.strat-row.is-hidden {
  opacity: 0.5;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 8px,
    rgba(0,0,0,0.02) 8px, rgba(0,0,0,0.02) 16px
  );
}
.hidden-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 9px; letter-spacing: 0.08em;
  font-family: var(--mono); font-weight: 500;
  text-transform: uppercase;
  background: var(--cream-deep); color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  vertical-align: middle;
}

/* Add-strategy modal */
.modal-scrim {
  position: fixed; inset: 0;
  background: rgba(26, 35, 50, 0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal-scrim.is-on { display: flex; }
.modal {
  background: var(--paper);
  border-radius: 2px;
  width: 100%; max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(26, 35, 50, 0.3);
  padding: 32px 36px;
  position: relative;
}
.modal__title {
  font-family: var(--serif); font-size: 26px; font-weight: 360;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  letter-spacing: -0.01em; line-height: 1.15;
  margin: 0 0 6px;
}
.modal__sub {
  font-family: var(--serif); font-size: 14px; font-style: italic;
  color: var(--muted); margin: 0 0 22px;
}
.modal__close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--rule); background: white;
  cursor: pointer; font-size: 16px; line-height: 1;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.modal__close:hover { background: var(--ink); color: white; border-color: var(--ink); }
.modal__row { display: flex; gap: 12px; margin-bottom: 14px; }
.modal__row .editor-block { flex: 1; margin: 0; }
.modal__select {
  font-family: var(--sans); font-size: 14px;
  border: 1px solid var(--rule); background: white;
  padding: 9px 10px; border-radius: 2px;
  width: 100%; box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.modal__select:focus { border-color: var(--ink); }
.modal__hint {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.04em;
  margin-top: 4px;
}
.modal__error {
  font-family: var(--mono); font-size: 10px;
  color: var(--dx); letter-spacing: 0.04em;
  margin-top: 4px;
  font-weight: 500;
  min-height: 14px;
}
.modal__actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}

/* Drawer manage section */
.manage-section {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px dashed var(--rule);
}
.manage-section__label {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.danger-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Survey switcher (masthead) */
.survey-switcher__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.survey-switcher select {
  font: inherit; padding: 4px 8px; border: 1px solid var(--rule);
  border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer;
  max-width: 320px;
}
.survey-switcher button {
  font: inherit; padding: 4px 10px; border: 1px solid var(--rule);
  border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer;
  font-size: 12px;
}
.survey-switcher button:hover { background: var(--bg-soft, #f5f3ee); }

/* Quote linker (drawer edit mode) */
.qlink {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed var(--rule);
}
.qlink__label {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 8px;
}
.qlink__list {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.qlink__item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; background: #faf8f4; border: 1px solid var(--rule-soft);
  border-radius: 4px; font-size: 13px; line-height: 1.4;
}
.qlink__item-meta {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.05em;
  white-space: nowrap;
}
.qlink__item-text { flex: 1; color: var(--ink); }
.qlink__remove {
  font: inherit; cursor: pointer; background: transparent;
  border: 0; color: var(--muted); padding: 0 4px;
  font-size: 16px; line-height: 1;
}
.qlink__remove:hover { color: #b91c1c; }
.qlink__search {
  display: block; width: 100%; padding: 7px 10px;
  border: 1px solid var(--rule); border-radius: 4px;
  font: inherit; font-size: 13px; box-sizing: border-box;
  margin-bottom: 10px;
}
.qlink__results {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--rule-soft); border-radius: 4px;
  padding: 6px; background: #fff;
}
.qlink__result {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; font-size: 12px; line-height: 1.4;
  border-radius: 3px;
}
.qlink__result:hover { background: #faf8f4; }
.qlink__result-meta {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); white-space: nowrap;
}
.qlink__result-text { flex: 1; color: var(--ink); }
.qlink__add {
  font: inherit; cursor: pointer; background: #16a34a; color: #fff;
  border: 0; padding: 3px 9px; border-radius: 3px; font-size: 11px;
  font-weight: 500;
}
.qlink__add:hover { background: #15803d; }
.qlink__add:disabled {
  background: var(--rule-soft); color: var(--muted); cursor: default;
}
.qlink__hint {
  font-size: 11px; color: var(--muted); padding: 6px 8px;
  font-style: italic;
}
