/* =============================================================
   Case-Study Demo Template — shared styles
   "All-visible" variant: every section expanded by default,
   no accordions/tabs/hover-reveals, ~zero JS.

   SKIN: light editorial register (mirrors landing/styles.css).
   White paper, #1a1a1a ink, #e5e5e5 hairlines, Crimson Text
   display, Arial body, Courier mono, ultramarine #221fc3 for
   brand moments only.

   REBRAND: change the tokens in :root below (colors, fonts,
   radius) and the brand name in the sidebar of each .html file.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600&display=swap');

:root {
  /* Brand / theme tokens ---------------------------------- */
  --navy:        #1a1a1a;   /* primary brand ink            */
  --navy-soft:   #4f4f4f;   /* hover / secondary            */
  --accent:      #221fc3;   /* links, highlights            */
  --accent-dark: #1b18a0;   /* accent hover on light ground */
  --accent-bright: #3279fc; /* accent on dark panels only   */
  --success:     #16a34a;   /* "connected" / positive       */
  --warning:     #d97706;
  --danger:      #dc2626;

  --bg:          #ffffff;   /* page background              */
  --card:        #ffffff;   /* surfaces — white + hairline  */
  --tint:        #fafafa;   /* pale band / inset tint       */
  --ink:         #1a1a1a;   /* primary text                 */
  --ink-soft:    #4f4f4f;   /* secondary text              */
  --ink-faint:   #999999;   /* tertiary / labels           */
  --line:        #e5e5e5;   /* borders                     */
  --line-soft:   #f0f0f0;

  --sidebar-w:   264px;
  --topbar-h:    56px;
  --radius:      3px;
  --radius-sm:   3px;

  --serif: 'Crimson Text', Georgia, 'Times New Roman', serif;
  --sans:  Arial, Helvetica, sans-serif;
  --mono:  'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; text-underline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }

/* =============================================================
   App shell: sidebar + topbar + main
   ============================================================= */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 20;
}

.brand {
  min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}
.brand > span:last-child {
  display: flex; flex-direction: column; justify-content: center; min-width: 0;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 0;
  background: transparent; border: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-family: var(--serif); font-weight: 600; letter-spacing: .08em; color: var(--navy); font-size: 14px; line-height: 1; }
/* Stacked heavy wordmark (THE ИOETIC CORPORATION register) */
.brand-name.brand-stack {
  display: flex; flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700; font-size: 10.5px; line-height: .92;
  letter-spacing: -.01em;
}
.brand-name.brand-stack b { font-weight: 700; }
.brand-tag  { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-top: 2px; }

.nav { flex: 1; overflow-y: auto; padding: 18px 12px; }
.nav-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; padding: 0 12px; margin-bottom: 14px; }

.chapters { position: relative; }
.rail { position: absolute; left: 23px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 1px; }
.rail-fill { position: absolute; left: 23px; top: 6px; width: 2px; background: #221fc3; border-radius: 1px; }

.chapter {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink-soft); position: relative;
}
.chapter:hover { background: var(--line-soft); }
.chapter-ico {
  width: 28px; height: 28px; border-radius: var(--radius-sm); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--line-soft); color: var(--ink-soft);
  font-size: 15px;
}
.chapter-num { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.chapter-name { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.chapter.is-active { background: #1a1a1a; color: #fff; font-weight: 600; }
.chapter.is-active .chapter-ico { background: transparent; color: #fff; }
.chapter.is-muted { color: var(--ink-faint); }
.chapter.is-muted .chapter-ico { color: var(--ink-faint); }

.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line-soft); }
.sidebar-foot a { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); padding: 6px 4px; }
.sidebar-foot a:hover { color: var(--navy); }
.confidential { font-size: 10px; color: var(--ink-faint); margin-top: 8px; padding: 0 4px; }

.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  z-index: 15; font-size: 14px;
}
.crumb { color: var(--ink-faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.crumb strong { color: var(--navy); font-weight: 600; }
.crumb .sep { margin: 0 8px; color: var(--line); }
.topbar-spacer { flex: 1; }
.dots { display: flex; gap: 6px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dot.on { background: #221fc3; }
.dots-label { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-left: 4px; }

.main { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.container { max-width: 1080px; margin: 0 auto; padding: 40px 36px 80px; }

/* =============================================================
   Landing page
   ============================================================= */
.hero { max-width: 640px; padding-top: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 3px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
}
.badge .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

h1.display { font-family: var(--serif); color: var(--navy); font-size: 44px; line-height: 1.08; letter-spacing: 0; margin: 22px 0 14px; font-weight: 600; }
.lede { font-size: 18px; color: var(--ink-soft); margin: 0 0 14px; }
.statline { font-size: 14px; color: var(--ink-faint); margin: 0 0 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 3px;
  background: #1a1a1a; color: #fff; border: 1px solid transparent; font-weight: bold; font-size: 14px;
  letter-spacing: 0;
  transition: background .2s cubic-bezier(0.4,0,0.2,1), border-color .2s cubic-bezier(0.4,0,0.2,1);
}
.btn:hover { background: #000; border-color: #4f4f4f; }
.btn .icon { font-size: 16px; }

.index-head { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin: 46px 0 14px; }
.index-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.index-row:last-child { border-bottom: 1px solid var(--line-soft); }
.index-ico { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 15px; flex: none; }
.index-num { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); width: 20px; }
.index-name { font-weight: 600; color: var(--ink); }
.index-desc { color: var(--ink-soft); font-size: 13px; }

/* =============================================================
   Chapter layout
   ============================================================= */
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: bold; }
h2.chapter-title { font-family: var(--serif); color: var(--navy); font-size: 34px; line-height: 1.1; letter-spacing: 0; margin: 10px 0 14px; font-weight: 600; }
.context { font-size: 17px; color: var(--ink-soft); max-width: 720px; margin: 0 0 8px; }

.section { margin-top: 44px; }
.section-label { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 4px; }
.section-label .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
h3.section-title { font-family: var(--serif); color: var(--navy); font-size: 22px; margin: 2px 0 4px; font-weight: 600; letter-spacing: 0; }
.section-sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }

/* Cards / surfaces */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sys-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.sys-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sys-logo { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.connected { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--success); font-weight: 600; }
.connected .icon { font-size: 13px; }
.sys-name { font-weight: 600; }
.sys-meta { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-value { font-family: var(--mono); font-size: 30px; color: var(--navy); font-weight: 600; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }

/* Horizontal bar "heatmap" — values shown inline, no hover */
.bars { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr auto; align-items: center; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.bar-row:first-child { border-top: 0; }
.bar-name { font-size: 14px; font-weight: 600; }
.bar-track { display: block; height: 22px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0; }
.bar-right { text-align: right; white-space: nowrap; }
.bar-pct { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.bar-detail { font-size: 12px; color: var(--ink-faint); }

/* Opportunity dossiers — fully expanded (no accordion) */
.opps { display: flex; flex-direction: column; gap: 14px; }
.opp { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.opp-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; }
.opp-rank { font-family: var(--mono); font-weight: 600; font-size: 13px; color: #fff; background: var(--navy); border-radius: var(--radius-sm); padding: 5px 9px; }
.opp-name { font-weight: 600; font-size: 16px; }
.opp-auto { min-width: 150px; }
.opp-auto .lab { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.opp-auto .bar-track { height: 8px; margin-top: 5px; }
.opp-auto .bar-fill { background: var(--accent); }
.opp-quick { text-align: right; }
.opp-quick .v { font-family: var(--mono); font-weight: 600; }
.opp-quick .l { font-size: 11px; color: var(--ink-faint); }
.opp-pain { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 14px; }
.opp-pain b { color: var(--ink); font-weight: 600; }
.callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.callout { display: flex; align-items: center; gap: 10px; background: var(--tint); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.callout .icon { font-size: 18px; color: var(--accent); }
.callout .cv { font-family: var(--serif); font-weight: 600; color: var(--navy); font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.callout .cl { font-size: 11px; color: var(--ink-faint); }

/* Next-chapter footer */
.next { margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--line); }
.next a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.next a:hover { color: var(--accent-dark); }
.next a .icon { font-size: 16px; }
.next .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

/* =============================================================
   Responsive — POC-level (structure over polish)
   ============================================================= */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { left: 0; }
  .main { margin-left: 0; }
  .container { padding: 28px 20px 60px; }
  .bar-row { grid-template-columns: 130px 1fr auto; gap: 10px; }
  .opp-head { grid-template-columns: auto 1fr; }
  .opp-auto, .opp-quick { grid-column: span 2; text-align: left; }
  .callouts { grid-template-columns: 1fr; }
  h1.display { font-size: 34px; }
}

/* =============================================================
   CHAPTER 2–5 COMPONENTS (added for the full template)
   All "all-visible": no hidden panels, no tabs-as-toggles.
   ============================================================= */

/* Persona / segmented nav (cross-route navigation, not content-hiding) */
.tabbar { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 4px; margin-bottom: 26px; }
.tab { padding: 7px 16px; border-radius: 3px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tab:hover { color: var(--navy); }
.tab.is-active { background: #1a1a1a; color: #fff; }

/* Dark panel + metric grid (stat panels, ROI summary) — the
   "codeblock" moment: stays near-black on the light ground */
.panel-dark { background: #1a1a1a; color: #e5e5e5; border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 26px 28px; }
.panel-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #999999; font-weight: 600; margin-bottom: 18px; }
.panel-eyebrow .icon { font-size: 15px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.metric .m-val { font-family: var(--mono); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.metric .m-lab { font-size: 11px; color: #999999; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.panel-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid #333333; font-size: 13px; color: #999999; display: flex; align-items: center; gap: 8px; }
.panel-dark .m-val { color: var(--accent-bright); } /* #3279fc only on dark; never #221fc3 on dark */

/* Left-border callout cards (insights, alerts, unwritten rules, disruption) */
.lstack { display: flex; flex-direction: column; gap: 12px; }
.lcard { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink-faint); border-radius: var(--radius-sm); padding: 16px 18px; }
.lcard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lcard .icon { font-size: 16px; flex: none; }
.lcard-title { font-weight: 600; }
.lcard-body { color: var(--ink-soft); font-size: 14px; }
.lcard-meta { font-size: 12px; color: var(--ink-faint); margin-top: 8px; }
.lcard-impact { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.lcard-impact b { color: var(--ink); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 3px; background: var(--card); color: var(--ink-soft); border: 1px solid var(--line); }
.pill.hi { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
.pill.med { background: #fffbeb; color: var(--warning); border-color: var(--warning); }
.lc-blue { border-left-color: var(--accent); } .lc-blue .icon { color: var(--accent); }
.lc-green { border-left-color: var(--success); } .lc-green .icon { color: var(--success); }
.lc-purple { border-left-color: #999999; } .lc-purple .icon { color: #4f4f4f; }
.lc-amber { border-left-color: var(--warning); } .lc-amber .icon { color: var(--warning); }
.lc-red { border-left-color: var(--danger); } .lc-red .icon { color: var(--danger); }
.lc-slate { border-left-color: var(--ink-faint); } .lc-slate .icon { color: var(--ink-soft); }

/* Integration method cards */
.method { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.method + .method { margin-top: 12px; }
.method-head { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 6px; }
.method-head .icon { color: var(--accent); font-size: 18px; }
.method-desc { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 5px 11px; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* Extracted SOP rules (expanded, source always visible) */
.rule-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px; }
.rule { display: grid; grid-template-columns: 28px 1fr 128px; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.rule:first-child { border-top: 0; }
.rule-idx { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 1px; }
.rule-text { font-size: 14px; }
.rule-src { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.rule-conf { text-align: right; }
.rule-conf .p { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.rule-conf .bar-track { height: 6px; margin-top: 6px; }
.rule-conf .bar-fill { background: #221fc3; }

/* SOP document preview (rendered inline instead of behind a modal) */
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.doc-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--tint); }
.doc-conf { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--danger); font-weight: 600; }
.doc-ver { font-size: 12px; color: var(--ink-faint); }
.doc-body { padding: 20px; }
.doc-toc { columns: 2; font-size: 13px; color: var(--ink-soft); margin: 0 0 18px; padding: 0; list-style: none; }
.doc-toc li { padding: 3px 0; }
.doc-excerpt { border-left: 3px solid #d4d4d4; padding-left: 14px; margin: 14px 0; }
.doc-excerpt h5 { margin: 0 0 6px; font-size: 13px; }
.doc-excerpt p { margin: 4px 0; font-size: 13px; color: var(--ink-soft); }

/* Tables (agent config, agent performance, before/after) */
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.tbl th { text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid #b3b3b3; white-space: nowrap; }
table.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl .strong { font-weight: 600; }
.threshold { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; }
.threshold .icon { color: var(--ink-faint); font-size: 13px; }
.cell-bar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.cell-bar .bar-track { flex: 1; height: 8px; }
.mini-num { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.pos { color: var(--success); } .neg { color: var(--danger); } .warn { color: var(--warning); }
.curve { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; }
.curve .bar-track { width: 84px; height: 8px; }
.curve .bar-fill { background: #221fc3; }

/* Ops tracker + status checklist (COO) */
.tracker { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.tracker-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tracker-head .icon { color: var(--accent); font-size: 18px; }
.tracker-head .status-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--success); }
.tracker-head .status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.tracker-day { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.tracker-day .big { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.tracker-day .sub { color: var(--ink-faint); font-size: 13px; }
.task-list { margin-top: 16px; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.task .icon { font-size: 16px; color: var(--ink-faint); flex: none; }
.task .day { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.task.is-complete .task-name { text-decoration: line-through; color: var(--ink-faint); }
.task.is-complete > .icon { color: var(--success); }
.task.is-progress .task-name { font-weight: 600; }
.task.is-progress > .icon { color: var(--accent); }

/* Orchestrator node + sub-agents (Engine) */
.node { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.node-ico { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.node-title { font-weight: 600; }
.node-sub { font-size: 13px; color: var(--ink-soft); }
.node-spawn { margin: 6px 0 14px 20px; padding-left: 20px; border-left: 2px dashed var(--line); font-size: 12px; color: var(--ink-faint); display: flex; align-items: center; gap: 6px; height: 24px; }
.agent { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.agent + .agent { margin-top: 12px; }
.agent-head { display: flex; align-items: center; gap: 12px; }
.agent-status { width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.st-complete { background: #f0fdf4; color: var(--success); border-color: var(--success); }
.st-flagged { background: #fffbeb; color: var(--warning); border-color: var(--warning); }
.st-waiting { background: var(--card); color: var(--ink-faint); }
.agent-name { font-weight: 600; }
.agent-dur { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-left: auto; }
.conf { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line); }
.conf-green { background: #f0fdf4; color: var(--success); border-color: var(--success); }
.conf-amber { background: #fffbeb; color: var(--warning); border-color: var(--warning); }
.conf-red { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
.agent-desc { color: var(--ink-soft); font-size: 13px; margin: 10px 0 0; }
.agent-result { font-size: 14px; margin: 8px 0 0; }
.transparency { margin-top: 14px; padding: 14px 16px; background: var(--tint); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.transparency-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; font-size: 13px; }
.kv .k { color: var(--ink-faint); }
.kv .v { color: var(--ink); }
.opt-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.opt { display: grid; grid-template-columns: 70px 1fr 44px 44px; gap: 12px; align-items: center; font-size: 13px; }
.opt .code { font-family: var(--mono); font-weight: 600; }
.opt .opt-bar { height: 7px; }
.opt .bar-fill { background: var(--accent); }
.opt .pct { font-family: var(--mono); text-align: right; }

/* Inline SOP rule badge under a sub-agent */
.agent-rule { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; color: var(--ink-faint); }
.agent-rule .icon { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.agent-rule .mono { font-family: var(--mono); font-size: 12px; color: var(--navy); opacity: .7; }

/* Before/after feedback panels (Engine) */
.ba-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.ba-panel { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--line); }
.ba-planned { background: var(--card); border-color: var(--danger); }
.ba-corrected { background: var(--card); border-color: var(--success); }
.ba-lab { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 6px; }
.ba-planned .ba-lab { color: var(--danger); }
.ba-corrected .ba-lab { color: var(--success); }
.ba-code { font-family: var(--mono); font-weight: 600; }
.ba-desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.ba-arrow { color: var(--ink-faint); font-size: 20px; }
.ba-stats { display: flex; gap: 28px; margin-top: 18px; }
.ba-stats .m-val { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.ba-stats .m-lab { font-size: 12px; color: var(--ink-faint); }
.ba-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin-top: 14px; background: var(--tint); padding: 10px 14px; border-radius: var(--radius-sm); }
.ba-note .icon { color: var(--accent); }

/* Timeline (Engine change detection) */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 10px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); border: 2px solid var(--card); }
.tl-date { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.tl-event { font-weight: 600; margin-top: 2px; }
.tl-impact { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.tl-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--accent); }

/* Info card (ownership grid) */
.info-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.info-card > .icon { font-size: 22px; color: var(--navy); }
.info-card h4 { margin: 12px 0 6px; font-size: 16px; }
.info-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* Audit trail (all rows visible) */
.audit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.audit-search { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-faint); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.audit-row { display: grid; grid-template-columns: 150px 168px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.audit-row:last-child { border-bottom: 0; }
.audit-ts { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.audit-outcome { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 3px; border: 1px solid var(--line); white-space: nowrap; }
.out-green { background: #f0fdf4; color: var(--success); border-color: var(--success); }
.out-amber { background: #fffbeb; color: var(--warning); border-color: var(--warning); }
.out-blue { background: var(--tint); color: var(--ink); border-color: #999999; }

/* Accuracy chart */
.chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chart svg { width: 100%; height: auto; display: block; }

/* CTA */
.cta { text-align: center; padding: 44px 20px; }
.cta h3 { font-family: var(--serif); color: var(--navy); font-size: 26px; margin: 0 0 10px; font-weight: 600; letter-spacing: 0; }
.cta p { color: var(--ink-soft); max-width: 520px; margin: 0 auto 22px; }

/* Chapter-2–5 responsive */
@media (max-width: 860px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .ba-grid { grid-template-columns: 1fr; }
  .ba-arrow { transform: rotate(90deg); justify-self: center; }
  .rule { grid-template-columns: 24px 1fr; }
  .rule-conf { grid-column: 2; text-align: left; }
  .audit-row { grid-template-columns: 1fr; gap: 6px; }
  .kv { grid-template-columns: 1fr; }
  .doc-toc { columns: 1; }
  .opt { grid-template-columns: 60px 1fr 46px; }
}

/* Weekly bar chart (div-based, Coordinator) */
.vbars { display: flex; align-items: flex-end; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.vbar { flex: 1; text-align: center; }
.vbar .v { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.vbar .b { width: 100%; max-width: 60px; margin: 0 auto; background: #221fc3; border-radius: 2px 2px 0 0; }
.vbar .wk { font-size: 12px; color: var(--ink-faint); margin-top: 8px; }

/* Avatar (Director capacity dashboard) */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--line-soft); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }

/* 2-column grid (ownership) */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* Queue snapshot card (Coordinator) */
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.qcard + .qcard { margin-top: 12px; }
.qcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qcard-id { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.qcard-vendor { color: var(--ink-soft); font-size: 13px; }
.qcard-conf { margin-left: auto; }
.qcard-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.qcard-body .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; margin: 10px 0 3px; }
.qcard-sop { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); background: var(--tint); padding: 8px 10px; border-radius: var(--radius-sm); }
.qactions { display: flex; gap: 8px; margin-top: 12px; }
.qbtn { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 3px; border: 1px solid #999999; color: var(--ink); background: transparent; }

/* File card (Setup SOP source) */
.filecard { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.filecard .icon { font-size: 22px; color: var(--accent); flex: none; }
.filecard .fname { font-weight: 600; }
.filecard .fmeta { font-size: 13px; color: var(--ink-faint); }
.filecard .connected { margin-left: auto; }

/* ROI stat trend line */
.stat .trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 8px; }
.stat .trend.pos { color: var(--success); }
.stat .trend.neg { color: var(--danger); }
.stat .was { color: var(--ink-faint); text-decoration: line-through; }

/* =============================================================
   AUDIT-DELIVERABLE COMPONENTS (The Audit / Findings / Plan)
   ============================================================= */

/* Header status pill */
.status-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--success); }
.status-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* 4-week engagement timeline */
.weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.wk-head { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 600; margin-bottom: 10px; }
.session { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.session-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.session .avatar { width: 26px; height: 26px; font-size: 11px; }
.session-ico { width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--line-soft); color: var(--ink-faint); display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.session-date { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-left: auto; }
.session-title { font-weight: 600; font-size: 13px; }
.session-people { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.session-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { font-size: 10px; font-family: var(--mono); padding: 2px 7px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); }

/* People grid (team interviewed) */
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.person .p-name { font-weight: 600; font-size: 14px; }
.person .p-role { font-size: 12px; color: var(--ink-faint); }

/* Systems accessed */
.syslist { display: flex; flex-direction: column; }
.sysrow { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.sysrow:first-child { border-top: 0; }
.sys-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; }
.sd-auto { background: var(--success); } .sd-manual { background: var(--warning); } .sd-broken { background: var(--danger); }
.sys-nm { font-weight: 600; }
.sys-cat { font-size: 12px; color: var(--ink-faint); }
.sys-note { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.action-badge { font-size: 10px; font-weight: 600; color: var(--danger); background: #fef2f2; border: 1px solid var(--danger); padding: 2px 7px; border-radius: 3px; margin-left: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .d { width: 8px; height: 8px; border-radius: 50%; }

/* Time-allocation stacked bar (Findings) */
.stacked { display: flex; height: 40px; border-radius: var(--radius-sm); overflow: hidden; }
.stacked .seg { height: 100%; }
.stack-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; margin-top: 18px; }
.stack-legend .item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.stack-legend .sw { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.stack-legend .pct { font-family: var(--mono); font-weight: 600; margin-left: auto; }
.takeaway { margin-top: 18px; background: var(--tint); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--ink-soft); }
.takeaway b { color: var(--ink); }

/* Process maps — SOP vs reality */
.pmap { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.pmap + .pmap { margin-top: 10px; }
.pmap-accent { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.pmap-nm { font-weight: 600; min-width: 170px; }
.pmap-cmp { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.pmap-cmp .sop { color: var(--ink-faint); }
.pmap-cmp .real { font-weight: 600; }
.pmap-cmp .arrow { color: var(--ink-faint); }
.pmap-hand { margin-left: auto; font-size: 12px; color: var(--danger); font-weight: 600; }

/* Severity badge (risk register) */
.sev { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); }
.sev-critical { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
.sev-high { background: #fffbeb; color: var(--warning); border-color: var(--warning); }
.sev-medium { background: var(--tint); color: var(--ink); border-color: #999999; }

/* Automation opportunity map (Plan) */
.oppgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.oppgroup + .oppgroup { margin-top: 12px; }
.oppgroup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.opp-swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.oppgroup-nm { font-weight: 600; }
.oppgroup-cnt { font-size: 12px; color: var(--ink-faint); }
.oppgroup-val { margin-left: auto; font-family: var(--mono); font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.oppitem { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.oppitem .oi-nm { flex: 1; }
.oppitem .oi-val { font-family: var(--mono); font-weight: 600; }
.cplx { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); }
.cx-low { background: #f0fdf4; color: var(--success); border-color: var(--success); }
.cx-med { background: #fffbeb; color: var(--warning); border-color: var(--warning); }
.cx-high { background: #fef2f2; color: var(--danger); border-color: var(--danger); }

/* Gantt implementation timeline (Plan) */
.gantt { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow-x: auto; }
.gantt-grid { min-width: 620px; }
.gantt-head { display: grid; grid-template-columns: 180px repeat(4, 1fr); }
.gantt-head .mh { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; text-align: center; border-left: 1px solid var(--line-soft); padding: 4px 0 8px; }
.grow { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; padding: 4px 0; }
.grow:hover { background: var(--line-soft); border-radius: var(--radius-sm); }
.g-label { font-size: 13px; }
.g-track { position: relative; height: 16px; background: var(--line-soft); border-radius: 2px; }
.g-bar { position: absolute; top: 0; height: 16px; border-radius: 2px; }
.gantt-notes { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.gnote { font-size: 13px; color: var(--ink-soft); }
.gnote b { color: var(--navy); }

/* Value drivers (Projected Annual Value) */
.driver { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.driver:first-child { border-top: 0; }
.driver-top { display: flex; align-items: baseline; gap: 10px; }
.driver-nm { font-weight: 600; }
.driver-val { margin-left: auto; font-family: var(--mono); font-weight: 600; }
.driver-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.driver .bar-track { height: 8px; margin-top: 8px; }
.driver .bar-fill { background: var(--accent); }

/* Numbered next steps (Plan) */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; }
.step-num { font-family: var(--mono); font-weight: 600; color: var(--accent); font-size: 14px; width: 28px; flex: none; }
.step-nm { font-weight: 600; }
.step-desc { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* Audit responsive */
@media (max-width: 1024px) {
  .weeks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .weeks { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  .stack-legend { grid-template-columns: 1fr; }
  .pmap-hand { margin-left: 0; }
}

/* =============================================================
   EXPANDED DETAIL (all-visible: data that the source hides
   behind accordions is shown inline)
   ============================================================= */

/* Process maps rebuilt as cards: header + SOP steps + Reality stats + Gap */
.pmap { display: block; }
.pmap-head { display: flex; align-items: center; gap: 14px; }
.pmap-accent { align-self: auto; height: 22px; }
.pmap-nm { min-width: 0; }
.pmap-head .pmap-cmp { margin-left: auto; }
.pmap-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.pmap-col-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 600; margin-bottom: 8px; }
.sop-steps { list-style: none; padding: 0; margin: 0; }
.sop-steps li { font-size: 13px; color: var(--ink-soft); padding: 5px 0 5px 16px; position: relative; }
.sop-steps li::before { content: ""; position: absolute; left: 3px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); }
.sop-note { font-size: 11px; color: var(--ink-faint); margin-top: 8px; }
.reality-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.rstat .rv { font-family: var(--mono); font-weight: 600; color: var(--navy); font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.rstat .rl { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.reality-note { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; }
.gap-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.gap-list .pmap-col-label { color: var(--danger); }
.gap-list ul { margin: 0; padding-left: 18px; }
.gap-list li { font-size: 13px; color: var(--ink-soft); margin: 6px 0; line-height: 1.45; }
@media (max-width: 860px) { .pmap-body { grid-template-columns: 1fr; } }

/* Timeline rebuilt as stacked weeks with full session detail */
.tl-week-head { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--navy); font-weight: 600; margin: 24px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.session-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .session-grid { grid-template-columns: 1fr; } }
.session-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.dlabel { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; margin: 12px 0 4px; }
.dlabel:first-child { margin-top: 0; }
.dtext { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.dpeople { font-size: 12.5px; color: var(--ink); }
.session-finding { margin-top: 12px; background: var(--tint); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 12px; }
.session-finding .dlabel { color: var(--accent); margin-top: 0; }
.session-finding .dtext { color: var(--ink); }
