/* ============================================================
   Refund Harness — Portfolio surface
   Engineering-lab vernacular. Design tokens, then sections.
   ============================================================ */

@import url('https://rsms.me/inter/inter.css');
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Surfaces */
  --surface:        #F5F7F8;       /* drafting-table white */
  --paper:          #FAFAF8;       /* panel surface, slightly warmer */
  --grid:           #E1E5E8;       /* hairline grid */
  --grid-strong:    #C7CDD3;       /* major axis line */
  --rule:           #DDE2E6;       /* section separator */

  /* Ink */
  --ink:            #0F1822;       /* primary text, near-black w/ navy hint */
  --ink-2:          #4A5563;       /* secondary */
  --ink-3:          #8A95A0;       /* tertiary, captions */

  /* Accents — chosen from plotting vernacular */
  --blueprint:      #1F4F7A;       /* drafting blue, structural emphasis */
  --terra:          #B83A2C;       /* terra rossa, deltas + errors + "what was broken" */
  --evergreen:      #2E5C3A;       /* deep forest, "what's now working" */
  --amber:          #C28A1C;       /* attention without alarm */

  /* Type */
  --font-display:   'Inter Tight', 'Söhne', system-ui, sans-serif;
  --font-body:      'Inter', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Rhythm */
  --gutter:         clamp(20px, 4vw, 48px);
  --section-pad:    clamp(64px, 8vw, 112px);
}

/* ---------- Reset & base ---------- */

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

html, body {
  margin: 0;
  background:
    /* graph-paper background */
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

a {
  color: var(--blueprint);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 100ms ease;
}
a:hover { color: var(--terra); }

/* ---------- Layout ---------- */

.shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 247, 248, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--rule);
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 17px;
}

.topbar__brand a { border: 0; color: var(--ink); }

.brand-mark {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
}

.topbar__links {
  display: flex; gap: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.topbar__links a {
  color: var(--ink-2);
  border: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.topbar__links a:hover { color: var(--ink); }

/* ---------- Section scaffolding ---------- */

section { padding: var(--section-pad) 0; border-bottom: 1px solid var(--rule); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--ink-3);
}

.section-head { margin-bottom: 56px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 16px 0;
}
.section-head p {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 96px);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terra);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.hero__eyebrow span.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 0 rgba(184, 58, 44, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(184, 58, 44, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(184, 58, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(184, 58, 44, 0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 9vw, 124px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 24px 0;
  max-width: 18ch;
}

.hero h1 .accent { color: var(--terra); }
.hero h1 .underline {
  display: inline-block;
  position: relative;
  padding: 0 4px;
}
.hero h1 .underline::after {
  content: '';
  position: absolute;
  inset: auto 0 6px 0;
  height: 12px;
  background: rgba(46, 92, 58, 0.18);
  z-index: -1;
}

.hero__sub {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink-2);
  max-width: 64ch;
  line-height: 1.5;
  margin: 0 0 48px 0;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  border-top: 1px solid var(--ink);
  padding-top: 32px;
  margin-top: 64px;
}

.metric { border-left: 1px solid var(--grid); padding: 0 0 0 20px; }
.metric:first-child { border-left: 0; padding-left: 0; }
.metric__value {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.metric__value.delta { color: var(--terra); }
.metric__value.delta-pos { color: var(--evergreen); }
.metric__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 8px;
}

/* ---------- Trajectory plot (the signature) ---------- */

.plot {
  background: var(--paper);
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  padding: 32px;
  position: relative;
}
.plot__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.plot__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.plot__legend {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  gap: 24px;
}
.plot__legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  width: 14px; height: 3px;
  background: var(--blueprint);
  display: inline-block;
}
.swatch.dashed {
  height: 0;
  border-top: 1px dashed var(--terra);
}

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

/* ---------- Adversarial categories ---------- */

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.cat {
  border: 1px solid var(--grid-strong);
  background: var(--paper);
  padding: 28px 28px 24px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}

.cat__id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blueprint);
  margin-bottom: 4px;
}
.cat__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 4px 0;
}
.cat__desc {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0 0 24px 0;
  line-height: 1.4;
}
.cat__bar { position: relative; height: 8px; background: var(--grid); border-radius: 1px; overflow: hidden; }
.cat__bar-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--blueprint); }
.cat__bar-fill.v1 { background: var(--terra); opacity: 0.45; height: 100%; }
.cat__row {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  font-size: 13px;
  margin-top: 8px;
}
.cat__row.muted { color: var(--ink-3); }
.cat__delta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--evergreen);
}

/* ---------- Evidence cases ---------- */

.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.case {
  border: 1px solid var(--grid-strong);
  background: var(--paper);
  padding: 24px;
  border-radius: 4px;
  position: relative;
}
.case__id {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.case__quote {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 20px 0;
  position: relative;
  padding-left: 16px;
  border-left: 2px solid var(--ink);
}
.case__line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--grid);
}
.case__line:last-of-type { border-bottom: 0; }
.case__line-label { color: var(--ink-3); }
.case__line-val { color: var(--ink); font-weight: 500; }
.case__line-val.was { color: var(--terra); text-decoration: line-through; opacity: 0.7; }
.case__line-val.now { color: var(--evergreen); }
.case__amount {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--terra);
  margin-top: 16px;
  display: block;
}
.case__amount-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }

/* ---------- Architecture stack ---------- */

.layers {
  display: grid;
  gap: 1px;
  background: var(--grid-strong);
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  overflow: hidden;
}

.layer {
  background: var(--paper);
  padding: 20px 28px;
  display: grid;
  grid-template-columns: 80px 1fr 220px;
  align-items: center;
  gap: 32px;
}
.layer__id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  color: var(--blueprint);
}
.layer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.layer__role {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
}

@media (max-width: 720px) {
  .layer { grid-template-columns: 56px 1fr; gap: 16px; padding: 16px 18px; }
  .layer__role { display: none; }
}

/* ---------- Try-it embed ---------- */

.tryit {
  background: var(--ink);
  color: var(--surface);
  position: relative;
}
.tryit__inner {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 2.1fr);
  gap: 56px;
  align-items: start;
}
.tryit .eyebrow { color: rgba(245, 247, 248, 0.55); }
.tryit .eyebrow::before { background: rgba(245, 247, 248, 0.55); }
.tryit h2 { color: var(--surface); font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 16px 0; }
.tryit__sub { color: rgba(245, 247, 248, 0.7); max-width: 48ch; margin-bottom: 24px; }

.tryit__prompts {
  margin-top: 32px;
  display: grid;
  gap: 12px;
}
.tryit__prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(245, 247, 248, 0.85);
  background: rgba(245, 247, 248, 0.05);
  border: 1px solid rgba(245, 247, 248, 0.15);
  padding: 12px 16px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 80ms ease;
}
.tryit__prompt:hover { background: rgba(245, 247, 248, 0.1); }
.tryit__prompt strong { display: block; font-family: var(--font-display); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terra); font-weight: 700; margin-bottom: 4px; }

.tryit__frame-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 247, 248, 0.55);
  border: 1px solid rgba(245, 247, 248, 0.18);
  border-radius: 999px;
}

/* ─── §5 layout: scenario bar above, then 2-col (ticket + chat) ─── */
.section-head--inverse h2 { color: var(--surface) !important; }
.section-head--inverse .eyebrow { color: rgba(245,247,248,0.55); }
.section-head--inverse .eyebrow::before { background: rgba(245,247,248,0.55); }

/* ─── Free customer/order picker (top of §5) ─── */
.rh-chat__picker-bar {
  margin: 8px 0 14px;
  padding: 16px 18px;
  background: rgba(245, 247, 248, 0.07);
  border: 1px solid rgba(245, 247, 248, 0.14);
  border-radius: 4px;
}
.rh-chat__picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.rh-chat__picker-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rh-chat__picker-field > span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 247, 248, 0.6);
}
.rh-chat__picker-field select {
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid rgba(245, 247, 248, 0.2);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.rh-chat__picker-field select:focus {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px rgba(245, 247, 248, 0.18);
}
.rh-chat__picker-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 720px) {
  .rh-chat__picker { grid-template-columns: 1fr; }
}

.rh-chat__scenarios-bar {
  margin: 18px 0 22px;
  padding: 16px 18px;
  background: rgba(245, 247, 248, 0.04);
  border: 1px solid rgba(245, 247, 248, 0.12);
  border-radius: 4px;
}
.rh-chat__scenarios-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.rh-chat__scenarios-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(245,247,248,0.6);
  text-transform: uppercase;
}
.rh-chat__scenarios-head .hint {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: rgba(245,247,248,0.55);
  font-style: italic;
}
.rh-chat__scenarios { display: flex; flex-wrap: wrap; gap: 8px; }
.rh-chat__chip {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(245, 247, 248, 0.2);
  color: rgba(245, 247, 248, 0.85);
  cursor: pointer;
  transition: all 0.15s ease;
}
.rh-chat__chip:hover {
  border-color: rgba(245, 247, 248, 0.6);
  color: var(--surface);
  background: rgba(245, 247, 248, 0.06);
}
.rh-chat__chip--active {
  background: var(--surface);
  border-color: var(--surface);
  color: var(--ink);
}
.rh-chat__chip--active:hover {
  background: var(--surface);
  color: var(--ink);
}

/* 2-col grid: ticket | chat */
.rh-tryit-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 2.3fr);
  gap: 24px;
  align-items: stretch;
}

/* CRM "Customer ticket" panel */
.rh-ticket {
  background: var(--paper);
  border-radius: 4px;
  padding: 18px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 540px;
}
.rh-ticket__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--grid);
}
.rh-ticket__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blueprint);
}
.rh-ticket__reset {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: transparent;
  border: 1px solid var(--grid);
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rh-ticket__reset:hover {
  border-color: var(--blueprint);
  color: var(--blueprint);
}
.rh-ticket__placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 30px 16px;
}
.rh-ticket__placeholder em {
  font-style: italic;
  font-size: 14px;
  color: var(--ink-2);
}
.rh-ticket__placeholder p { margin: 8px 0 0; font-size: 12px; }
.rh-ticket__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.rh-ticket__block {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 3px;
}
.rh-ticket__block--expect {
  border-color: var(--blueprint);
  border-left-width: 3px;
}
.rh-ticket__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.rh-ticket__id {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--blueprint);
  letter-spacing: 0.04em;
}
.rh-ticket__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}
.rh-ticket__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-2);
  margin-top: 6px;
  line-height: 1.5;
}
.rh-ticket__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.rh-ticket__flags .flag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
}
.rh-ticket__flags .flag--terra { background: rgba(184, 58, 44, 0.1); color: var(--terra); border: 1px solid var(--terra); }
.rh-ticket__flags .flag--ok { background: rgba(46, 92, 58, 0.1); color: var(--evergreen); border: 1px solid var(--evergreen); }
.rh-ticket__expect {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink);
  font-style: italic;
  line-height: 1.5;
}
.rh-ticket__convid {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--grid);
}

@media (max-width: 920px) {
  .rh-tryit-grid { grid-template-columns: 1fr; }
}

/* Hint under bot bubble after escalation */
.rh-chat__hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  font-style: italic;
  margin: 8px 0 0 6px;
  padding: 6px 10px;
  background: rgba(31, 79, 122, 0.06);
  border-left: 2px solid var(--blueprint);
  border-radius: 2px;
}

/* ─── Inline chat surface (replaces the iframe) ─── */
.rh-chat {
  background: var(--paper);
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rh-chat__status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #F0F4F8;
  border: 1px solid var(--grid);
  border-left: 3px solid var(--blueprint);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink);
  min-height: 22px;
}
.rh-chat__status:empty { display: none; }
.rh-chat__status .eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blueprint);
}
.rh-chat__status .label { font-weight: 700; color: var(--ink); }
.rh-chat__status code {
  background: #FFFFFF;
  border: 1px solid var(--grid);
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blueprint);
}
.rh-chat__status .expect {
  flex-basis: 100%;
  font-size: 11.5px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 2px;
}

.rh-chat__messages {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 3px;
  padding: 18px 18px 14px;
  min-height: 380px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rh-chat__placeholder {
  color: var(--ink-3);
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 60px 24px;
  line-height: 1.5;
}
.rh-chat__placeholder code {
  background: var(--paper);
  border: 1px solid var(--grid);
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  font-style: normal;
}
.rh-chat__row { display: flex; }
.rh-chat__row--user { justify-content: flex-end; }
.rh-chat__row--bot { justify-content: flex-start; }
.rh-chat__bubble {
  max-width: 84%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.rh-chat__bubble--user {
  background: var(--blueprint);
  color: #FAFAF8;
  border-radius: 12px 12px 2px 12px;
}
.rh-chat__bubble--bot {
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid var(--grid);
  border-radius: 12px 12px 12px 2px;
}
.rh-chat__bubble--error {
  border-color: var(--terra);
  color: var(--terra);
}
.rh-chat__bubble-text { white-space: pre-wrap; }
.rh-chat__chip-decision {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 8px;
  background: #FAFAF8;
  border: 1px solid;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.rh-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.rh-chat__typing > span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--blueprint);
  animation: rh-dot-bounce 1.2s infinite both;
}
.rh-chat__typing > span:nth-child(2) { animation-delay: 0.18s; }
.rh-chat__typing > span:nth-child(3) { animation-delay: 0.36s; }
.rh-chat__typing em { font-style: italic; }
@keyframes rh-dot-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.rh-chat__form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.rh-chat__input {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #FFFFFF;
  border: 1px solid var(--grid);
  border-radius: 3px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rh-chat__input:focus {
  border-color: var(--blueprint);
  box-shadow: 0 0 0 2px rgba(31, 79, 122, 0.18);
}
.rh-chat__input::placeholder { color: var(--ink-3); font-style: italic; }
.rh-chat__send {
  background: var(--blueprint);
  color: #FFFFFF;
  border: 0;
  border-radius: 3px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.rh-chat__send:hover { background: var(--ink); }
.rh-chat__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.rh-chat__send svg { transform: translateX(-1px); }

/* (scenario/chip styles for §5 are defined higher up — on the dark background.
   Removed duplicate light-version that was conflicting.) */

/* ---------- Artifacts grid ---------- */

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

.artifact {
  display: block;
  padding: 24px;
  border: 1px solid var(--grid-strong);
  background: var(--paper);
  border-radius: 4px;
  color: var(--ink);
  position: relative;
  text-decoration: none;
  border-bottom: 1px solid var(--grid-strong);  /* override the global a underline */
  transition: border-color 100ms ease, transform 120ms ease;
}
.artifact:hover {
  border-color: var(--ink);
  transform: translate(-1px, -1px);
}
.artifact--accent {
  border-color: var(--blueprint);
  border-left: 3px solid var(--blueprint);
  background: linear-gradient(135deg, rgba(31, 79, 122, 0.04), var(--paper) 60%);
}
.artifact--accent .artifact__id { color: var(--blueprint); }
.artifact--accent:hover {
  border-color: var(--blueprint);
  border-left-color: var(--blueprint);
  box-shadow: 0 6px 24px -12px rgba(31, 79, 122, 0.35);
}
.artifact__id {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.artifact__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 8px 0;
}
.artifact__desc { font-size: 13px; color: var(--ink-2); margin: 0; }

/* ---------- Refund Rules (§4c) ---------- */
section#rules { background: var(--surface); padding-top: 88px; padding-bottom: 24px; }

.rules-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  padding: 12px 18px;
  background: var(--paper);
  border: 1px solid var(--grid);
  border-left: 3px solid var(--blueprint);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  margin: 24px 0 28px;
}
.rules-meta strong {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin-right: 6px;
}
.rules-meta code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--blueprint);
}
.rules-status {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(46, 92, 58, 0.12);
  color: var(--evergreen);
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rules-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.rules-section {
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rules-section__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(31, 79, 122, 0.04), rgba(31, 79, 122, 0));
  border-bottom: 1px solid var(--grid);
}
.rules-section__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--blueprint);
  letter-spacing: 0.06em;
}
.rules-section__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.rules-section__count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rules-section__clauses {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.rules-clause {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--grid);
}
.rules-clause:first-child { border-top: 0; }
.rules-clause__id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--blueprint);
  letter-spacing: 0.04em;
  align-self: start;
  padding-top: 1px;
}
.rules-clause__text {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.rules-clause__text code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface);
  padding: 1px 4px;
  border-radius: 2px;
  color: var(--ink-2);
}

.rules-cheatsheet {
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: 4px;
  overflow: hidden;
}
.rules-cheatsheet__head {
  padding: 12px 18px;
  background: var(--ink);
  color: var(--surface);
}
.rules-cheatsheet__head .eyebrow {
  color: rgba(245, 247, 248, 0.7);
  position: relative;
  padding-left: 0;
}
.rules-cheatsheet__head .eyebrow::before { display: none; }

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13px;
}
.rules-table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  border-bottom: 1px solid var(--grid);
}
.rules-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--grid);
  color: var(--ink);
  vertical-align: top;
}
.rules-table tr:last-child td { border-bottom: 0; }
.rules-table code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blueprint);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 2px;
}
.rules-action {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rules-action--approve  { background: rgba(46, 92, 58, 0.12);  color: var(--evergreen); border: 1px solid var(--evergreen); }
.rules-action--partial  { background: rgba(176, 122, 28, 0.12); color: #B07A1C;          border: 1px solid #B07A1C; }
.rules-action--deny     { background: rgba(184, 58, 44, 0.12); color: var(--terra);     border: 1px solid var(--terra); }
.rules-action--escalate { background: rgba(31, 79, 122, 0.10); color: var(--blueprint); border: 1px solid var(--blueprint); }
.rules-action--neutral  { background: var(--surface);            color: var(--ink-2);     border: 1px solid var(--grid); }

@media (max-width: 720px) {
  .rules-sections { grid-template-columns: 1fr; }
  .rules-clause { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Architecture SVG ---------- */
.arch-svg-wrap {
  margin: 36px 0 18px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: 3px;
}
.arch-svg-wrap svg { width: 100%; height: auto; display: block; }
.arch-caption {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-2);
  margin: 6px 0 28px;
  max-width: 820px;
  line-height: 1.55;
}
.arch-caption em { font-style: italic; color: var(--blueprint); font-weight: 600; }

/* ---------- Contact ---------- */

.topbar__cta {
  background: var(--blueprint);
  color: #FFFFFF !important;
  padding: 6px 12px;
  border: 1px solid var(--blueprint);
  border-radius: 2px;
  letter-spacing: 0.08em;
}
.topbar__cta:hover { background: var(--ink); border-color: var(--ink); }

.topbar__github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--grid);
  border-radius: 2px;
  color: var(--ink-2) !important;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.topbar__github:hover { border-color: var(--ink); color: var(--ink) !important; }
.topbar__github svg { display: block; }

section.contact {
  padding: 64px 0 24px;
  border-top: 1px solid var(--grid);
  background: var(--paper);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.contact-card {
  display: block;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 2px;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.contact-card:hover {
  transform: translateY(-2px);
  border-color: var(--blueprint);
  box-shadow: 0 6px 22px -10px rgba(31, 79, 122, 0.35);
}
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--blueprint);
}
.contact-card__value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 6px 0 4px;
  word-break: break-all;
}
.contact-card__hint {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- Footer ---------- */

footer.foot {
  padding: 36px 0 56px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--grid);
}
footer.foot a { color: var(--ink-2); border: 0; text-decoration: none; }
footer.foot a:hover { color: var(--blueprint); }

/* ---------- Accessibility / motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow span.pulse { animation: none; }
  * { transition: none !important; }
}

:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: 2px; }
