/* Anvira Technologies — brand stylesheet */

:root {
  --ink:        #0A0D12;
  --ink-2:      #10151C;
  --ink-3:      #161C25;
  --line:       #232B37;
  --line-soft:  #1B222C;
  --paper:      #F6F4F0;
  --paper-dim:  #C9CFD8;
  --muted:      #8B95A4;
  --amber:      #E9A84C;
  --amber-dim:  #B8843C;
  --jade:       #5FCFA6;
  --max:        1180px;
  --r:          14px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* brand mark, reused as a masked shape throughout */
  --tri-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L98 96 H2 Z M50 32 L78 76 H22 Z' fill='%23000' fill-rule='evenodd'/%3E%3C/svg%3E");
  --tri-lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='68' viewBox='0 0 78 68'%3E%3Cpath d='M39 8 L70 60 H8 Z' fill='none' stroke='%23222A36' stroke-width='1'/%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- type ---------- */

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

h1.display { font-size: clamp(2.7rem, 6.2vw, 4.6rem); }
h2.display { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3.display { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 13px; height: 11px;
  flex: none;
  background: var(--amber);
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
}

.lede { font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: var(--paper-dim); line-height: 1.6; }
p { color: var(--paper-dim); }
strong { color: var(--paper); font-weight: 600; }

.accent { color: var(--amber); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line-soft); }

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

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--paper); }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-lockup { display: flex; flex-direction: column; gap: 5px; line-height: 1; }
.brand-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.014em;
  color: var(--paper);
}
.brand-sub {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-lg .brand-mark { width: 54px; height: 54px; }
.brand-lg .brand-name { font-size: 1.62rem; }
.brand-lg .brand-sub { font-size: 0.72rem; }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--paper-dim);
  transition: color .18s ease;
  position: relative;
}
.nav-links a:hover { color: var(--paper); }
.nav-links a.active { color: var(--paper); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -7px;
  height: 1px;
  background: var(--amber);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.88rem !important;
  color: var(--paper) !important;
  transition: border-color .2s ease, background .2s ease;
}
.nav-cta:hover { border-color: var(--amber-dim); background: rgba(233,168,76,.07); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  width: 40px; height: 38px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle span { display: block; width: 17px; height: 1.5px; background: var(--paper); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 17px; height: 1.5px; background: var(--paper);
  transition: transform .2s ease;
}
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after  { top:  5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .2s ease, border-color .2s ease;
  font-family: var(--sans);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--amber); color: #14100A; }
.btn-primary:hover { background: #F2B863; }
.btn-ghost { border-color: var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--muted); background: rgba(255,255,255,.03); }
.btn svg { flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

/* ---------- sections ---------- */

section { position: relative; }
.section { padding: 82px 0; }
.section-sm { padding: 56px 0; }
.section-tint { background: var(--ink-2); border-block: 1px solid var(--line-soft); }

.section-head {
  margin-bottom: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 14px 56px;
  align-items: end;
}
.section-head .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.section-head h2 { grid-column: 1; }
.section-head p { grid-column: 2; margin: 0 0 5px; }

/* ---------- hero ---------- */

.hero { padding: 72px 0 64px; position: relative; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0;
  background-image: var(--tri-lattice);
  background-size: 78px 68px;
  mask-image: radial-gradient(ellipse 78% 78% at 80% 26%, #000 4%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 78% 78% at 80% 26%, #000 4%, transparent 72%);
  opacity: .75;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  top: -220px; right: -180px;
  width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(233,168,76,.13), transparent 62%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { max-width: 17ch; }
.hero .lede { margin-top: 22px; }

.hero-split { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 54px; align-items: center; }
.hero-split .btn-row { margin-top: 30px; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--paper-dim);
  margin-bottom: 24px;
  background: rgba(255,255,255,.02);
}

/* watermark of the brand mark */
.watermark {
  position: absolute;
  pointer-events: none;
  background: var(--paper);
  opacity: .028;
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 3px rgba(95,207,166,.16); flex: none; }

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stat { padding: 24px 24px; border-right: 1px solid var(--line-soft); }
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  line-height: 1;
  color: var(--paper);
  letter-spacing: -0.02em;
}
.stat-num em { font-style: normal; color: var(--amber); }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 10px; line-height: 1.4; }

/* ---------- cards ---------- */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 26px 26px;
  transition: border-color .22s ease, transform .22s ease, background .22s ease;
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { margin: 0; font-size: 0.93rem; }
.card .num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--amber-dim);
  letter-spacing: .12em;
  display: block;
  margin-bottom: 16px;
}
.card .ticks { margin-top: 14px; }
.card .ticks li { font-size: 0.9rem; margin-bottom: 8px; }

/* mark echoed in the corner of a card */
.card-mark::after {
  content: "";
  position: absolute;
  right: -22px; bottom: -26px;
  width: 108px; height: 108px;
  background: var(--paper);
  opacity: .035;
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
  pointer-events: none;
}

.card-link { text-decoration: none; display: block; }
.card-link .more {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(233,168,76,.09);
  border: 1px solid rgba(233,168,76,.22);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.icon svg { width: 17px; height: 17px; stroke: var(--amber); fill: none; stroke-width: 1.5; }

/* ---------- lists ---------- */

.ticks { list-style: none; padding: 0; margin: 18px 0 0; }
.ticks li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 9px;
  color: var(--paper-dim);
  font-size: 0.94rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 11px; height: 9px;
  background: var(--amber);
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
}
.ticks-jade li::before { background: var(--jade); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ---------- case studies ---------- */

.case {
  border-top: 1px solid var(--line-soft);
  padding: 42px 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 44px;
}
.case:first-of-type { border-top: none; }
.case-aside .kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-aside h3 { margin: 14px 0 18px; }
.case-body h4 {
  font-size: 0.76rem;
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin: 20px 0 8px;
}
.case-body p { font-size: 0.95rem; }
.case-body h4:first-child { margin-top: 0; }
.case-body p { margin: 0; }

.outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 18px;
}
.outcome { background: var(--ink-2); padding: 20px 22px; }
.outcome b {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 8px;
}
.outcome span { font-size: 0.82rem; color: var(--muted); line-height: 1.4; display: block; }

/* ---------- steps ---------- */

.steps { counter-reset: s; display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.step { background: var(--ink-2); padding: 24px 28px; display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: start; }
.step::before {
  counter-increment: s;
  content: "0" counter(s);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--amber);
  padding-top: 3px;
}
.step h3 { font-size: 1.08rem; margin-bottom: 8px; }
.step p { margin: 0; font-size: 0.95rem; }

/* ---------- quote / principle ---------- */

.pull {
  border-left: 2px solid var(--amber);
  padding: 6px 0 6px 28px;
  margin: 0;
}
.pull p {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
  color: var(--paper);
  line-height: 1.34;
  margin: 0;
}
.pull cite { display: block; margin-top: 16px; font-style: normal; font-size: 0.86rem; color: var(--muted); }

/* ---------- split ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.split-narrow { grid-template-columns: 0.95fr 1.05fr; }
.split-right { grid-template-columns: 0.76fr 1.24fr; }
.split-top { align-items: start; }

/* ---------- objection and answer ---------- */

.risk {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.risk-item {
  background: var(--ink-2);
  padding: 26px 26px;
  position: relative;
}
.risk-q {
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--paper);
  line-height: 1.3;
  margin: 0 0 12px;
  padding-left: 22px;
  position: relative;
}
.risk-q::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 12px; height: 10px;
  background: var(--jade);
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
}
.risk-item p { margin: 0; font-size: 0.93rem; padding-left: 22px; }
.risk-item p + p { margin-top: 10px; }

/* ---------- diagram panel ---------- */

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 26px;
}
.panel-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}
.layer {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 15px 18px;
  margin-bottom: 9px;
  background: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 14px;
}
.layer:last-child { margin-bottom: 0; }
.layer-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink);
  background: var(--amber);
  border-radius: 4px;
  padding: 2px 7px;
  flex: none;
}
.layer-tag.cool { background: var(--jade); }
.layer-tag.grey { background: var(--muted); }
.layer p { margin: 0; font-size: 0.9rem; color: var(--paper-dim); }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px 46px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: center;
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -70px; bottom: -110px;
  width: 380px; height: 380px;
  background: var(--amber);
  opacity: .05;
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 2; }
.cta-band p { margin: 14px 0 0; }
.cta-band .btn-row { margin-top: 0; flex-direction: column; align-items: stretch; }
.cta-band .btn { justify-content: center; }

/* ---------- forms ---------- */

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.84rem; color: var(--paper-dim); }
.field input, .field textarea, .field select {
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--amber-dim);
}
.field textarea { min-height: 130px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: 0.82rem; color: var(--muted); margin: 4px 0 0; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 52px 0 28px;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.site-footer .watermark { left: -90px; bottom: -120px; width: 340px; height: 340px; opacity: .022; }
.site-footer .wrap { position: relative; z-index: 2; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 44px; }
.foot-grid h5 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  font-weight: 400;
}
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.foot-links a { text-decoration: none; font-size: 0.92rem; color: var(--paper-dim); transition: color .18s ease; }
.foot-links a:hover { color: var(--amber); }
.foot-about p { font-size: 0.92rem; margin: 16px 0 0; max-width: 38ch; }
.foot-bottom {
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
}
.foot-bottom a { text-decoration: none; color: var(--muted); }
.foot-bottom a:hover { color: var(--paper-dim); }

/* ---------- page hero ---------- */

.page-hero { padding: 58px 0 44px; border-bottom: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.page-hero .watermark { right: -60px; top: -70px; width: 300px; height: 300px; opacity: .035; }
.page-hero .hero-glow { top: -320px; right: -240px; width: 620px; height: 620px; }
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero .lede { max-width: 64ch; margin-top: 22px; }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split, .hero-split { grid-template-columns: 1fr; gap: 36px; }
  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .section-head h2, .section-head p { grid-column: 1; }
  .case { grid-template-columns: 1fr; gap: 22px; }
  .risk { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; gap: 26px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .section { padding: 72px 0; }
  .hero { padding: 72px 0 64px; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 88px; left: 0; right: 0;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 22px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 1rem; }
  .nav-links a.active::after { display: none; }
  .nav-cta { margin-top: 16px; justify-content: center; border-bottom: none !important; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .cta-band { padding: 34px 24px; grid-template-columns: 1fr; gap: 26px; }
  .hero-grid { opacity: .38; background-size: 58px 50px; }
  .panel-title span + span { display: none; }
  .risk-item { padding: 22px 20px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 1.22rem; }
  .brand-sub { font-size: 0.58rem; letter-spacing: 0.24em; }
  .brand-lg .brand-mark { width: 46px; height: 46px; }
  .brand-lg .brand-name { font-size: 1.4rem; }
  .step { grid-template-columns: 1fr; gap: 10px; }
  .btn-row .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   LIVE ELEMENTS — scroll reactive layer
   ============================================================ */

/* reading progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--jade), var(--amber));
  z-index: 100; pointer-events: none;
}

/* staggered reveal for groups */
.stagger > * { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1) { transition-delay: .02s }
.stagger.in > *:nth-child(2) { transition-delay: .10s }
.stagger.in > *:nth-child(3) { transition-delay: .18s }
.stagger.in > *:nth-child(4) { transition-delay: .26s }
.stagger.in > *:nth-child(5) { transition-delay: .34s }
.stagger.in > *:nth-child(6) { transition-delay: .42s }

/* pointer tracked glow */
.glow-card { position: relative; }
.glow-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(233,168,76,.09), transparent 62%);
  opacity: 0; transition: opacity .35s ease; pointer-events: none; z-index: 0;
}
.glow-card:hover::before { opacity: 1; }
.glow-card > * { position: relative; z-index: 1; }

/* counters */
.stat-num .count { font-variant-numeric: tabular-nums; }

/* ============================================================
   LIVE FLOW — the pipeline diagram
   ============================================================ */

.flow-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--ink-2);
  padding: 26px 24px 30px;
  position: relative;
  overflow: hidden;
}
.flow-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 26px;
}
.flow-legend { display: flex; gap: 14px; }
.flow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.flow-legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.lg-ai { background: var(--jade) }
.lg-hu { background: var(--amber) }
.lg-sy { background: var(--muted) }

.flow { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.flow-node { position: relative; display: grid; justify-items: center; gap: 10px; padding: 0 6px; }
.fn-rail { display: flex; align-items: center; width: 100%; }
.fn-line { flex: 1; height: 1px; background: var(--line); }
.flow-node:first-child .fn-line.l, .flow-node:last-child .fn-line.r { opacity: 0; }
.fn-dot {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: var(--ink-2); border: 1.5px solid var(--line);
  transition: background .45s ease, border-color .45s ease, box-shadow .45s ease, transform .45s ease;
}
.flow.in .fn-ai   .fn-dot { border-color: var(--jade);  background: var(--jade);  box-shadow: 0 0 0 4px rgba(95,207,166,.14); }
.flow.in .fn-human .fn-dot { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 4px rgba(233,168,76,.16); transform: scale(1.15); }
.flow.in .fn-sys  .fn-dot { border-color: var(--muted); background: var(--ink-3); }

.fn-tag {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: .14em;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); background: var(--ink-3);
}
.fn-ai .fn-tag    { color: var(--jade);  border-color: rgba(95,207,166,.35); }
.fn-human .fn-tag { color: var(--amber); border-color: rgba(233,168,76,.42); }

.fn-title { font-size: 0.92rem; color: var(--paper); text-align: center; line-height: 1.3; }
.fn-sub { font-size: 0.78rem; color: var(--muted); text-align: center; line-height: 1.4; }

.flow-node { opacity: .3; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.flow.in .flow-node { opacity: 1; transform: none; }
.flow.in .flow-node:nth-child(1) { transition-delay: .05s }
.flow.in .flow-node:nth-child(2) { transition-delay: .16s }
.flow.in .flow-node:nth-child(3) { transition-delay: .27s }
.flow.in .flow-node:nth-child(4) { transition-delay: .38s }
.flow.in .flow-node:nth-child(5) { transition-delay: .49s }
.flow.in .flow-node:nth-child(6) { transition-delay: .60s }
.flow.in .flow-node:nth-child(7) { transition-delay: .71s }
.flow.in .flow-node:nth-child(8) { transition-delay: .82s }

/* branch note under a flow */
.flow-note {
  margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line-soft);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.flow-branch { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.flow-branch b {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .1em;
  color: var(--ink); background: var(--jade); border-radius: 4px;
  padding: 3px 8px; text-align: center; white-space: nowrap; align-self: start;
}
.flow-branch.no b { background: var(--amber); }
.flow-branch p { margin: 0; font-size: 0.88rem; }

/* ============================================================
   ARTEFACT — what the system actually shows a person
   ============================================================ */

.mock {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink-3);
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
}
.mock-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: var(--ink-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.7rem; color: var(--muted);
  letter-spacing: .06em;
}
.mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; flex: none; }
.mock-bar b { font-weight: 400; margin-left: 8px; color: var(--paper-dim); }
.mock-body { padding: 16px 16px 18px; }

.mock-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 10px 2px; border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem; color: var(--paper-dim);
}
.mock-row:last-of-type { border-bottom: none; }
.mock-row b { color: var(--paper); font-weight: 500; font-variant-numeric: tabular-nums; }
.pill {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .08em;
  padding: 3px 8px; border-radius: 100px; text-transform: uppercase;
}
.pill.ok   { color: var(--jade);  background: rgba(95,207,166,.11); border: 1px solid rgba(95,207,166,.3) }
.pill.warn { color: var(--amber); background: rgba(233,168,76,.11); border: 1px solid rgba(233,168,76,.32) }
.pill.neu  { color: var(--muted); background: rgba(255,255,255,.03); border: 1px solid var(--line) }

.mock-alert {
  margin-top: 14px; padding: 13px 15px; border-radius: 9px;
  background: rgba(233,168,76,.07); border: 1px solid rgba(233,168,76,.26);
  font-size: 0.86rem; color: var(--paper-dim); line-height: 1.5;
}
.mock-alert strong { color: var(--amber); }
.mock-alert.jade { background: rgba(95,207,166,.06); border-color: rgba(95,207,166,.24); }
.mock-alert.jade strong { color: var(--jade); }

.mock-quote { font-size: 0.9rem; line-height: 1.6; color: var(--paper-dim); margin: 0; }
.mock-meta {
  margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.64rem; color: var(--muted); letter-spacing: .08em;
}
.mock-meta span { border: 1px solid var(--line-soft); border-radius: 5px; padding: 3px 8px; }

.mock-bars { display: grid; gap: 9px; margin-top: 4px; }
.mock-bar-row { display: grid; grid-template-columns: 128px 1fr 62px; gap: 12px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.meter { height: 7px; border-radius: 4px; background: var(--ink-2); border: 1px solid var(--line-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--jade); width: 0; transition: width 1.1s cubic-bezier(.2,.7,.3,1); }
.meter.amber span { background: var(--amber); }
.in .meter span { width: var(--w, 50%); }
.mock-bar-row b { color: var(--paper); font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; }

/* ============================================================
   PRACTICE EXPLORER — tabs
   ============================================================ */

.tabs-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px; margin-bottom: 26px;
}
.tab-btn {
  font-family: var(--sans); font-size: 0.9rem;
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: 9px 16px; border-radius: 100px; cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.tab-btn:hover { color: var(--paper); }
.tab-btn[aria-selected="true"] {
  color: var(--paper); background: var(--ink-2); border-color: var(--line);
}
.tab-btn[aria-selected="true"]::before {
  content: ""; display: inline-block; width: 10px; height: 8px; margin-right: 8px;
  background: var(--amber);
  -webkit-mask: var(--tri-mask) center / contain no-repeat;
  mask: var(--tri-mask) center / contain no-repeat;
}
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.tp-grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 36px; align-items: start; }
.tp-grid h3 { font-size: 1.32rem; margin-bottom: 14px; }
.tp-problem {
  border-left: 2px solid var(--amber);
  padding: 4px 0 4px 18px; margin-bottom: 22px;
}
.tp-problem span {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber); display: block; margin-bottom: 7px;
}
.tp-problem p { margin: 0; font-size: 0.96rem; }

/* ============================================================
   responsive for the live layer
   ============================================================ */

@media (max-width: 980px) {
  .tp-grid { grid-template-columns: 1fr; gap: 26px; }
  .flow-note { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .flow { grid-auto-flow: row; gap: 4px; }
  .flow-node {
    justify-items: start; text-align: left;
    border-left: 1px solid var(--line); padding: 0 0 20px 22px; gap: 6px;
  }
  .flow-node:last-child { border-left-color: transparent; }
  .fn-rail { position: absolute; left: -6.5px; top: 2px; width: 13px; }
  .fn-line { display: none; }
  .fn-title, .fn-sub { text-align: left; }
  .flow-wrap { padding: 22px 18px 24px; }
  .mock-bar-row { grid-template-columns: 92px 1fr 54px; font-size: 0.76rem; }
  .tabs-bar { gap: 4px; }
  .tab-btn { padding: 8px 12px; font-size: 0.84rem; }
}

/* ============================================================
   THE LAB — things on this page that actually run
   ============================================================ */

.lab {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.lab-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.22);
}
.lab-title {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--paper-dim);
  display: flex; align-items: center; gap: 10px;
}
.lab-title i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--jade);
  box-shadow: 0 0 0 3px rgba(95,207,166,.18); display: block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.lab-hint { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); letter-spacing: .08em; }

.lab-body { padding: 20px 22px 22px; }
.lab-split { display: grid; grid-template-columns: 0.86fr 1.14fr; gap: 26px; }

/* controls */
.ctrl { margin-bottom: 18px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 9px;
}
.ctrl-top label { font-size: 0.84rem; color: var(--paper-dim); }
.ctrl-val {
  font-family: var(--mono); font-size: 0.86rem; color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.ctrl-val.hot { color: var(--amber); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: grab; margin: 0;
}
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, var(--amber) var(--fill, 40%), var(--line) var(--fill, 40%));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 3px; background: var(--amber); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; border-radius: 50%; margin-top: -6.5px;
  background: var(--paper); border: 3px solid var(--ink-2);
  box-shadow: 0 0 0 1px var(--line), 0 3px 10px rgba(0,0,0,.5);
  transition: transform .15s ease;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--ink-2); box-shadow: 0 0 0 1px var(--line);
}
input[type="range"]:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.preset {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: .08em;
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 12px; border-radius: 100px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.preset:hover { color: var(--paper); border-color: var(--muted); background: rgba(255,255,255,.03); }

/* result ledger */
.ledger { border: 1px solid var(--line-soft); border-radius: 11px; overflow: hidden; }
.ledger-row {
  display: grid; grid-template-columns: 1fr auto 92px;
  gap: 12px; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem; color: var(--paper-dim); background: var(--ink-2);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row b { color: var(--paper); font-variant-numeric: tabular-nums; font-weight: 500; }
.ledger-row .pill { justify-self: end; text-align: center; }

/* verdict */
.verdict {
  margin-top: 16px; border-radius: 11px; padding: 16px 18px;
  border: 1px solid; transition: background .4s ease, border-color .4s ease;
}
.verdict.pass { background: rgba(95,207,166,.08); border-color: rgba(95,207,166,.34); }
.verdict.fail { background: rgba(233,168,76,.08); border-color: rgba(233,168,76,.38); }
.verdict-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 9px; }
.verdict-mark {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: .12em;
  padding: 4px 10px; border-radius: 5px; color: var(--ink); font-weight: 500;
}
.pass .verdict-mark { background: var(--jade); }
.fail .verdict-mark { background: var(--amber); }
.verdict-code { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); letter-spacing: .1em; }
.verdict p { margin: 0; font-size: 0.9rem; line-height: 1.55; }

.draft {
  margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px;
  padding: 14px 16px; background: rgba(0,0,0,.2);
}
.draft-label {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 9px;
  display: flex; justify-content: space-between; gap: 10px;
}
.draft pre {
  margin: 0; font-family: var(--mono); font-size: 0.78rem; line-height: 1.65;
  color: var(--paper-dim); white-space: pre-wrap; word-break: break-word;
}
.draft .sent { color: var(--jade); }

.audit {
  margin-top: 12px; font-family: var(--mono); font-size: 0.68rem;
  color: var(--muted); letter-spacing: .04em; line-height: 1.7;
}
.audit span { color: var(--jade); }

/* calculator output */
.calc-out { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.calc-cell { background: var(--ink-2); padding: 20px 20px; }
.calc-cell span { display: block; font-size: 0.78rem; color: var(--muted); line-height: 1.35; margin-bottom: 9px; }
.calc-cell b {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--paper); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.calc-cell.hi b { color: var(--jade); }
.calc-cell.warn b { color: var(--amber); }
/* a bold inside a calc value is emphasis, not another headline number */
.calc-cell b b, .calc-cell b strong { font-size: inherit; font-family: inherit;
  line-height: inherit; font-weight: 600; color: var(--paper); }
.calc-note { margin-top: 14px; font-size: 0.83rem; color: var(--muted); line-height: 1.55; }

.compare { display: grid; gap: 10px; margin-top: 18px; }
.compare-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.compare-bar { height: 24px; border-radius: 6px; background: var(--ink-3); border: 1px solid var(--line-soft); overflow: hidden; }
.compare-bar span { display: block; height: 100%; transition: width .5s cubic-bezier(.2,.7,.3,1); background: var(--line); }
.compare-row.now .compare-bar span { background: linear-gradient(90deg, rgba(233,168,76,.5), var(--amber)); }
.compare-row.after .compare-bar span { background: linear-gradient(90deg, rgba(95,207,166,.45), var(--jade)); }
.compare-row b { color: var(--paper); font-variant-numeric: tabular-nums; font-weight: 500; min-width: 74px; text-align: right; }

@media (max-width: 980px) {
  .lab-split { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 760px) {
  .lab-body { padding: 16px 16px 18px; }
  .calc-out { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: 1fr auto 80px; font-size: 0.8rem; }
  .compare-row { grid-template-columns: 64px 1fr auto; }
}

/* ---------- threads field ---------- */
.threads { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.threads-canvas { display: block; width: 100%; height: 100%; }
.hero .threads { mask-image: radial-gradient(ellipse 78% 96% at 74% 46%, #000 16%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 78% 96% at 74% 46%, #000 16%, transparent 76%); }
.cta-band .threads { mask-image: radial-gradient(ellipse 90% 120% at 70% 50%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 120% at 70% 50%, #000 10%, transparent 78%); opacity: .9; }
.page-hero .threads { mask-image: radial-gradient(ellipse 80% 110% at 78% 40%, #000 8%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 80% 110% at 78% 40%, #000 8%, transparent 76%); }

.section > .wrap, .section-sm > .wrap { position: relative; z-index: 2; }
.section > .threads, .section-sm > .threads { z-index: 0; }
.section-tint > .threads { mask-image: radial-gradient(ellipse 92% 110% at 30% 50%, #000 6%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 92% 110% at 30% 50%, #000 6%, transparent 74%); }
.section > .threads { mask-image: radial-gradient(ellipse 84% 110% at 76% 46%, #000 4%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 84% 110% at 76% 46%, #000 4%, transparent 70%); }

/* ============================================================
   FIVE DIFFERENT PICTURES, BECAUSE FIVE DIFFERENT PAINS
   ============================================================ */

.viz {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  overflow: hidden;
}
.viz-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--paper-dim);
}
.viz-head em { font-style: normal; color: var(--muted); letter-spacing: .06em; text-transform: none; font-size: 0.68rem; }
.viz-body { padding: 20px 20px 22px; }
.viz-ask {
  font-family: var(--serif); font-size: clamp(1.1rem, 1.9vw, 1.42rem);
  color: var(--paper); line-height: 1.3; margin: 0 0 18px;
}
.viz-out {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: 10px; overflow: hidden; margin-top: 18px;
}
.viz-out div { background: var(--ink-2); padding: 15px 16px; }
.viz-out > div > span:first-child { display: block; font-size: 0.74rem; color: var(--muted); margin-bottom: 7px; line-height: 1.35; }
.viz-out b span { display: inline; font: inherit; color: inherit; margin: 0; }
.viz-out b {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1;
  color: var(--jade); font-variant-numeric: tabular-nums;
}
.viz-out b.warn { color: var(--amber); }
.viz-note { margin: 14px 0 0; font-size: 0.84rem; color: var(--muted); line-height: 1.55; }

/* before / after switch */
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 100px; padding: 3px; gap: 3px; }
.switch button {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: .1em; text-transform: uppercase;
  background: none; border: none; color: var(--muted); padding: 7px 14px;
  border-radius: 100px; cursor: pointer; transition: background .25s, color .25s;
}
.switch button[aria-pressed="true"] { background: var(--amber); color: #14100A; }

/* ---------- 1. coverage grid, operations ---------- */
.covgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.cov {
  aspect-ratio: 2.4; border-radius: 5px; border: 1px solid var(--line-soft);
  background: var(--ink-3); position: relative;
  transition: background .5s ease, border-color .5s ease, transform .5s ease;
}
.cov.ok    { background: rgba(95,207,166,.5);  border-color: rgba(95,207,166,.65); }
.cov.stale { background: rgba(233,168,76,.42); border-color: rgba(233,168,76,.6); }
.cov.risk  { background: rgba(214,92,74,.55);  border-color: rgba(214,92,74,.7); }
.cov-key { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 0.78rem; color: var(--muted); }
.cov-key span { display: inline-flex; align-items: center; gap: 7px; }
.cov-key i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.k-ok { background: rgba(95,207,166,.55) } .k-stale { background: rgba(233,168,76,.5) } .k-risk { background: rgba(214,92,74,.6) }

/* ---------- 2. aging ladder, order to cash ---------- */
.ladder { display: grid; gap: 10px; }
.lad-row { display: grid; grid-template-columns: 92px 1fr 96px; gap: 12px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.lad-track { height: 26px; border-radius: 6px; background: var(--ink-3); border: 1px solid var(--line-soft); overflow: hidden; display: flex; }
.lad-fill { height: 100%; transition: width .55s cubic-bezier(.2,.7,.3,1); }
.lad-fill.coll { background: linear-gradient(90deg, rgba(95,207,166,.4), var(--jade)); }
.lad-fill.disp { background: repeating-linear-gradient(45deg, rgba(233,168,76,.5) 0 6px, rgba(233,168,76,.24) 6px 12px); }
.lad-row b { color: var(--paper); text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.lad-row.old b { color: var(--amber); }

/* ---------- 3. triage board, customer service ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lane {
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--ink-2);
  padding: 12px; min-height: 190px; transition: border-color .4s ease;
}
.lane h5 {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 11px; font-weight: 400;
  display: flex; justify-content: space-between; gap: 8px;
}
.lane.hot { border-color: rgba(214,92,74,.5); }
.tkt {
  border: 1px solid var(--line); border-radius: 7px; background: var(--ink-3);
  padding: 9px 10px; margin-bottom: 7px; font-size: 0.78rem; color: var(--paper-dim);
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  animation: tin .45s ease both;
}
@keyframes tin { from { opacity: 0; transform: translateY(7px) } to { opacity: 1; transform: none } }
.tkt em { font-style: normal; font-family: var(--mono); font-size: 0.62rem; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; flex: none; }
.sla-ok   { color: var(--jade);  background: rgba(95,207,166,.12) }
.sla-warn { color: var(--amber); background: rgba(233,168,76,.14) }
.sla-bad  { color: #E8836F;      background: rgba(214,92,74,.16) }

/* ---------- 4. variance bridge, FP&A ---------- */
.bridge { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; height: 210px; align-items: end; }
.br-col { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 9px; }
.br-stack { position: relative; height: 100%; }
.br-bar {
  position: absolute; left: 8%; right: 8%; border-radius: 4px;
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
}
.in .br-bar { transform: scaleY(1); }
.br-col:nth-child(2) .br-bar { transition-delay: .08s }
.br-col:nth-child(3) .br-bar { transition-delay: .16s }
.br-col:nth-child(4) .br-bar { transition-delay: .24s }
.br-col:nth-child(5) .br-bar { transition-delay: .32s }
.br-col:nth-child(6) .br-bar { transition-delay: .40s }
.br-col:nth-child(7) .br-bar { transition-delay: .48s }
.br-bar.base { background: linear-gradient(180deg, #46536A, #2C3646); }
.br-bar.up   { background: linear-gradient(180deg, var(--jade), rgba(95,207,166,.45)); }
.br-bar.down { background: linear-gradient(180deg, rgba(233,168,76,.5), var(--amber)); }
.br-bar.unex { background: repeating-linear-gradient(45deg, rgba(139,149,164,.55) 0 5px, rgba(139,149,164,.25) 5px 10px); }
.br-lab { text-align: center; font-size: 0.7rem; color: var(--muted); line-height: 1.3; }
.br-lab b { display: block; color: var(--paper); font-size: 0.78rem; font-variant-numeric: tabular-nums; font-weight: 500; margin-bottom: 3px; }

@media (max-width: 760px) {
  .covgrid { grid-template-columns: repeat(6, 1fr); }
  .board { grid-template-columns: 1fr; }
  .viz-out { grid-template-columns: 1fr; }
  .lad-row { grid-template-columns: 68px 1fr 76px; font-size: 0.74rem; }
  .bridge { height: 170px; gap: 4px; }
  .br-lab { font-size: 0.6rem; }
}

/* ---------- the job bar: buy and sell on one record ---------- */
.jobbar { margin: 6px 0 0; }
.jb-track {
  height: 58px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--ink-3); display: flex; overflow: hidden; position: relative;
}
.jb-seg { height: 100%; width: 0; transition: width .8s cubic-bezier(.2,.7,.3,1); position: relative; }
.in .jb-seg { width: var(--w); }
.jb-buy { background: linear-gradient(180deg, #3A465A, #28313F); }
.jb-margin { background: linear-gradient(180deg, var(--jade), rgba(95,207,166,.5)); }
.jb-eat {
  position: absolute; top: 0; bottom: 0; width: 0;
  background: repeating-linear-gradient(45deg, rgba(214,92,74,.85) 0 7px, rgba(214,92,74,.5) 7px 14px);
  transition: width .8s cubic-bezier(.2,.7,.3,1) .3s;
  border-left: 1px solid rgba(255,255,255,.25);
}
.in .jb-eat { width: var(--w); }
.jb-legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.jb-legend span { display: inline-flex; align-items: center; gap: 8px; }
.jb-legend i { width: 12px; height: 12px; border-radius: 3px; display: block; flex: none; }
.jb-legend b { color: var(--paper); font-variant-numeric: tabular-nums; font-weight: 500; }
.jb-k-buy { background: #3A465A } .jb-k-mar { background: var(--jade) }
.jb-k-eat { background: repeating-linear-gradient(45deg, rgba(214,92,74,.85) 0 4px, rgba(214,92,74,.5) 4px 8px) }
.jb-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.66rem; color: var(--muted); margin-top: 8px; }

/* ---------- control matrix ---------- */
.matrix { border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.mx-head, .mx-row {
  display: grid; grid-template-columns: 0.8fr 1.4fr 1.2fr; gap: 20px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
}
.mx-head {
  background: rgba(0,0,0,.24);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.mx-row:last-child { border-bottom: none; }
.mx-row:nth-child(even) { background: rgba(255,255,255,.012); }
.mx-row h4 { font-size: 0.94rem; color: var(--paper); font-weight: 500; }
.mx-row p { margin: 0; font-size: 0.89rem; }
.mx-row p.how { color: var(--muted); }
.mx-row p.how b { color: var(--jade); font-weight: 500; }

.qa { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.qa-item { background: var(--ink-2); padding: 20px 22px; }
.qa-item h4 { font-family: var(--mono); font-size: 0.78rem; letter-spacing: .04em; color: var(--amber); margin-bottom: 10px; font-weight: 400; }
.qa-item p { margin: 0; font-size: 0.92rem; }
.qa-item p + p { margin-top: 9px; }

/* prints as the document a buyer forwards internally */
@media print {
  .site-header, .site-footer, .threads, .hero-glow, .watermark,
  .scroll-progress, .btn-row, .cta-band, .preview-bar { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .section, .page-hero { padding: 12pt 0; }
  .wrap { max-width: none; padding: 0; }
  h1, h2, h3, h4, .display, strong, .mx-row h4 { color: #000 !important; }
  p, li, .lede, .mx-row p { color: #222 !important; }
  .matrix, .qa, .qa-item, .card, .panel { border-color: #bbb !important; background: #fff !important; }
  .mx-row, .mx-head { border-color: #ddd !important; background: #fff !important; }
  .eyebrow { color: #555 !important; }
  .eyebrow::before { background: #555 !important; }
  .mx-row p.how b { color: #000 !important; }
  .section-tint { background: #fff !important; }
  a[href^="/"]::after { content: " (anviratech.com" attr(href) ")"; font-size: 9pt; color: #666; }
}

@media (max-width: 860px) {
  .mx-head { display: none; }
  .mx-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- long form ---------- */
.prose { max-width: 68ch; }
.prose p { font-size: 1.05rem; line-height: 1.75; margin: 0 0 22px; }
.prose h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--paper); letter-spacing: -.02em; margin: 46px 0 16px; line-height: 1.15;
}
.prose h3 { font-size: 1.1rem; margin: 32px 0 12px; color: var(--paper); }
.prose ul { padding-left: 0; list-style: none; margin: 0 0 22px; }
.prose ul li { position: relative; padding-left: 24px; margin-bottom: 11px; color: var(--paper-dim); font-size: 1.02rem; line-height: 1.7; }
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: 10px; width: 11px; height: 9px;
  background: var(--amber);
  -webkit-mask: var(--tri-mask) center / contain no-repeat; mask: var(--tri-mask) center / contain no-repeat;
}
.prose strong { color: var(--paper); }
.prose a { color: var(--amber); text-decoration: none; border-bottom: 1px solid rgba(233,168,76,.35); }
.prose a:hover { border-bottom-color: var(--amber); }
.prose blockquote {
  margin: 34px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--jade);
}
.prose blockquote p {
  font-family: var(--serif); font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  color: var(--paper); line-height: 1.35; margin: 0;
}
.prose code {
  font-family: var(--mono); font-size: 0.86em; background: var(--ink-3);
  border: 1px solid var(--line-soft); border-radius: 5px; padding: 2px 6px; color: var(--jade);
}
.prose hr { border: none; border-top: 1px solid var(--line-soft); margin: 44px 0; }

.article-meta {
  display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin-top: 22px;
}
.article-grid { display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: start; }
.article-aside { position: sticky; top: 108px; }

.post-card {
  display: block; text-decoration: none; background: var(--ink-2);
  border: 1px solid var(--line-soft); border-radius: var(--r); padding: 28px;
  transition: border-color .22s ease, transform .22s ease;
}
.post-card:hover { border-color: var(--line); transform: translateY(-2px); }
.post-card .kicker {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber-dim); display: block; margin-bottom: 14px;
}
.post-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 12px; }
.post-card p { margin: 0; font-size: 0.94rem; }
.post-card .more { margin-top: 18px; font-size: 0.86rem; color: var(--amber); display: inline-flex; align-items: center; gap: 7px; }

/* keyboard users deserve to see where they are */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--amber); color: #14100A; padding: 12px 20px;
  border-radius: 0 0 10px 0; font-size: 0.9rem; text-decoration: none;
}
.skip:focus { left: 0; }

@media (max-width: 980px) {
  .article-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-aside { position: static; }
}

/* ============================================================
   SCORECARD — one solution, ten seconds
   ============================================================ */

.score {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  overflow: hidden;
  margin-bottom: 16px;
  transition: border-color .22s ease;
}
.score:hover { border-color: #2E394A; }

.score-top {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start;
  padding: 24px 26px 18px;
}
.score-tag {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber); display: block; margin-bottom: 12px;
}
.score-problem {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.25rem, 2.3vw, 1.72rem); line-height: 1.24;
  color: var(--paper); letter-spacing: -.015em; max-width: 30ch; margin: 0;
}
.score-basis {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: .08em;
  color: var(--muted); text-align: right; white-space: nowrap; padding-top: 4px;
}
.score-basis.real { color: var(--jade); }

.score-metrics {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 1px; background: var(--line-soft);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.metric { background: var(--ink-2); padding: 18px 26px 20px; }
.metric > span {
  display: block; font-size: 0.76rem; color: var(--muted);
  line-height: 1.3; margin-bottom: 12px; min-height: 2.1em;
}
.metric-val { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.metric-from {
  font-family: var(--serif); font-size: 1.42rem; color: var(--muted);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.metric-arrow { color: var(--line); font-size: 1rem; }
.metric-to {
  font-family: var(--serif); font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  color: var(--jade); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em;
}
.metric-to.plain { color: var(--paper); }
.metric-to.warn { color: var(--amber); }
.metric-note { font-size: 0.8rem; color: var(--paper-dim); line-height: 1.35; }
.delta {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .06em;
  color: var(--jade); background: rgba(95,207,166,.1);
  border: 1px solid rgba(95,207,166,.28); border-radius: 100px; padding: 3px 9px;
}

.score-change {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  padding: 18px 26px;
}
.score-change p { margin: 0; font-size: 0.95rem; }
.score-change p b { color: var(--jade); font-weight: 500; }

details.score-more { border-top: 1px solid var(--line-soft); }
details.score-more > summary {
  list-style: none; cursor: pointer; padding: 15px 26px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
  transition: color .2s ease, background .2s ease;
}
details.score-more > summary::-webkit-details-marker { display: none; }
details.score-more > summary:hover { color: var(--paper); background: rgba(255,255,255,.02); }
details.score-more > summary::before {
  content: ""; width: 11px; height: 9px; flex: none; background: var(--amber);
  -webkit-mask: var(--tri-mask) center / contain no-repeat; mask: var(--tri-mask) center / contain no-repeat;
  transform: rotate(90deg); transition: transform .25s ease;
}
details.score-more[open] > summary::before { transform: rotate(180deg); }
details.score-more[open] > summary { color: var(--paper); }
.score-detail { padding: 6px 26px 28px; }
.score-detail > * + * { margin-top: 22px; }
.score-detail .ticks { margin-top: 0; }
.score-detail h4 {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--amber-dim); margin-bottom: 10px;
}
.score-detail p { font-size: 0.95rem; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }

@media (max-width: 900px) {
  .score-metrics { grid-auto-flow: row; }
  .metric > span { min-height: 0; }
  .score-top { grid-template-columns: 1fr; gap: 10px; }
  .score-basis { text-align: left; }
  .score-change { grid-template-columns: 1fr; gap: 14px; }
  .detail-cols { grid-template-columns: 1fr; gap: 22px; }
  .score-top, .metric, .score-change, .score-detail, details.score-more > summary { padding-left: 20px; padding-right: 20px; }
}

/* ---------- tower index: five towers, five lines ---------- */
.towers { border-top: 1px solid var(--line-soft); }
.tower-row {
  display: grid; grid-template-columns: 190px 1fr 220px 24px;
  gap: 24px; align-items: center;
  padding: 22px 14px 22px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none; position: relative;
  transition: background .22s ease, padding-left .22s ease;
}
.tower-row:hover { background: rgba(255,255,255,.022); padding-left: 14px; }
.tower-row .t-name {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber);
}
.tower-row .t-problem {
  font-family: var(--serif); font-size: clamp(1.05rem, 1.7vw, 1.32rem);
  color: var(--paper); line-height: 1.28; letter-spacing: -.01em;
}
.tower-row .t-metric { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tower-row .t-metric b {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem;
  color: var(--jade); font-variant-numeric: tabular-nums; line-height: 1;
}
.tower-row .t-metric i {
  font-style: normal; font-family: var(--serif); font-size: 1.1rem; color: var(--muted);
}
.tower-row .t-metric span { font-size: 0.76rem; color: var(--muted); display: block; width: 100%; margin-top: 5px; }
.tower-row .t-go {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  transition: border-color .22s ease, color .22s ease, transform .22s ease;
}
.tower-row:hover .t-go { border-color: var(--amber); color: var(--amber); transform: translateX(3px); }

@media (max-width: 900px) {
  .tower-row { grid-template-columns: 1fr auto; gap: 10px 16px; padding: 20px 0; }
  .tower-row .t-name { grid-column: 1 / -1; }
  .tower-row .t-problem { grid-column: 1 / -1; }
  .tower-row .t-metric { grid-column: 1; }
  .tower-row .t-go { grid-column: 2; align-self: end; }
  .tower-row:hover { padding-left: 0; }
}

/* ============================================================
   DOCUMENT COMPARISON — two records side by side, the difference
   marked, and what it costs stated underneath. Built so a CFO
   understands the whole case in one look.
   ============================================================ */

.docdiff { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dd-side { background: var(--ink-2); }
.dd-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft); background: rgba(0,0,0,.24);
}
.dd-head b {
  display: block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--paper-dim); font-weight: 400;
}
.dd-head span { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 5px; }
.dd-body { padding: 6px 18px 14px; }
.dd-line {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.86rem; color: var(--muted);
}
.dd-line:last-child { border-bottom: none; }
.dd-line b { color: var(--paper-dim); font-variant-numeric: tabular-nums; font-weight: 400; }
.dd-line.bad  { background: rgba(214,92,74,.08);  margin: 0 -18px; padding: 9px 18px; }
.dd-line.good { background: rgba(95,207,166,.07);  margin: 0 -18px; padding: 9px 18px; }
.dd-line.hold { background: rgba(233,168,76,.07);  margin: 0 -18px; padding: 9px 18px; }
.dd-line.bad b  { color: #F0A091; font-weight: 600; }
.dd-line.good b { color: var(--jade); font-weight: 600; }
.dd-line.hold b { color: var(--amber); font-weight: 600; }
.dd-mark { width: 16px; text-align: center; font-family: var(--mono); font-size: 0.74rem; color: var(--line); }
.dd-line.bad .dd-mark  { color: #E8836F; }
.dd-line.good .dd-mark { color: var(--jade); }
.dd-line.hold .dd-mark { color: var(--amber); }
.dd-key {
  grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap;
  padding: 11px 20px; background: rgba(0,0,0,.18); border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: .08em; color: var(--muted);
}
.dd-key span { display: inline-flex; align-items: center; gap: 7px; }
.dd-key i { font-style: normal; }
.dd-key i.g { color: var(--jade) } .dd-key i.b { color: #E8836F } .dd-key i.h { color: var(--amber) }

.dd-verdict {
  grid-column: 1 / -1; background: var(--ink-3);
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
}
.dd-cost {
  font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--amber); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dd-cost small { display: block; font-family: var(--mono); font-size: 0.62rem; letter-spacing: .1em; color: var(--muted); margin-top: 7px; text-transform: uppercase; }
.dd-verdict p { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.dd-verdict p b { color: var(--jade); font-weight: 500; }
.dd-verdict p em { font-style: normal; font-family: var(--mono); font-size: 0.78rem; color: var(--amber); }

.dd-caption {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}

@media (max-width: 760px) {
  .docdiff { grid-template-columns: 1fr; }
  .dd-verdict { grid-template-columns: 1fr; gap: 12px; }
  .dd-line { font-size: 0.8rem; }
}

/* ============================================================
   LIVE DEMOS — everything runs in the visitor's browser.
   No account, no upload, no data leaves the page.
   ============================================================ */

.demo { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--ink-2), var(--ink-3)); overflow: hidden; margin-bottom: 22px; }
.demo-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding: 22px 26px 18px; border-bottom: 1px solid var(--line-soft); }
.demo-head .num { font-family: var(--mono); font-size: 0.66rem; letter-spacing: .16em; color: var(--amber); display: block; margin-bottom: 10px; }
.demo-head h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 2.2vw, 1.66rem); letter-spacing: -.015em; line-height: 1.2; }
.demo-head p { margin: 9px 0 0; font-size: 0.93rem; max-width: 62ch; }
.demo-badge { font-family: var(--mono); font-size: 0.6rem; letter-spacing: .1em; color: var(--jade); border: 1px solid rgba(95,207,166,.3); background: rgba(95,207,166,.08); border-radius: 100px; padding: 5px 11px; white-space: nowrap; }
.demo-body { padding: 22px 26px 26px; }
.demo-split { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 28px; align-items: start; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font-size: 0.82rem; font-family: var(--sans); background: var(--ink-3);
  border: 1px solid var(--line); color: var(--paper-dim); padding: 9px 14px;
  border-radius: 9px; cursor: pointer; text-align: left; transition: all .18s ease;
}
.seg button:hover { border-color: var(--muted); color: var(--paper); }
.seg button[aria-pressed="true"] { border-color: var(--amber); background: rgba(233,168,76,.1); color: var(--paper); }
.seg.stack { flex-direction: column; }
.seg.stack button { width: 100%; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.88rem; color: var(--paper-dim); }
.toggle-row:last-child { border-bottom: none; }
.tgl { position: relative; width: 42px; height: 23px; flex: none; background: var(--ink-3); border: 1px solid var(--line); border-radius: 100px; cursor: pointer; transition: background .22s ease, border-color .22s ease; padding: 0; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .22s ease, background .22s ease; }
.tgl[aria-pressed="true"] { background: rgba(95,207,166,.18); border-color: rgba(95,207,166,.5); }
.tgl[aria-pressed="true"]::after { transform: translateX(19px); background: var(--jade); }

.out-head { font-family: var(--mono); font-size: 0.64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.rank { display: grid; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--ink-2); font-size: 0.84rem; color: var(--paper-dim); transition: all .35s ease; }
.rank-row i { font-style: normal; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.rank-row b { color: var(--paper); font-variant-numeric: tabular-nums; font-weight: 500; }
.rank-row.top { border-color: rgba(95,207,166,.4); background: rgba(95,207,166,.06); }
.rank-row.out { opacity: .45; border-style: dashed; }
.rank-row .why { font-family: var(--mono); font-size: 0.62rem; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; }
.why.prom { color: #E8836F; background: rgba(214,92,74,.14) }
.why.disp { color: var(--amber); background: rgba(233,168,76,.12) }
.why.new  { color: var(--muted); background: rgba(255,255,255,.04) }

.narrative { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--ink-2); padding: 18px 20px; }
.narrative p { margin: 0 0 12px; font-size: 0.94rem; line-height: 1.65; }
.narrative p:last-child { margin-bottom: 0; }
.narrative b { color: var(--jade); font-weight: 500; }
.narrative .unex { color: var(--amber); }

.demo-foot { border-top: 1px solid var(--line-soft); padding: 14px 26px; display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.64rem; letter-spacing: .06em; color: var(--muted); }
.demo-foot b { color: var(--paper-dim); font-weight: 400; }

@media (max-width: 900px) {
  .demo-split { grid-template-columns: 1fr; gap: 22px; }
  .demo-head { grid-template-columns: 1fr; }
  .demo-body, .demo-head, .demo-foot { padding-left: 20px; padding-right: 20px; }
  .rank-row { grid-template-columns: 20px 1fr auto; gap: 8px; font-size: 0.78rem; }
  .rank-row .why { grid-column: 2 / -1; justify-self: start; }
}

/* ============================================================
   LIVE DEMOS — five different ways in
   Each demo below is deliberately a different interaction, so the
   page never reads as one control panel repeated five times.
   ============================================================ */

.demo-wide { display: block; }
/* grid and flex children default to min-width:auto, which lets one wide table
   push a whole column past the viewport. Nothing here needs that. */
.demo-split > *, .demo-wide > * { min-width: 0; }
.inv-scroll { overflow-x: auto; }

/* ---------- 02  edit the invoice ---------- */
.inv {
  background: #F3F1EC; color: #14181F; border-radius: 8px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.4); border: 1px solid rgba(0,0,0,.3);
}
.inv-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 14px 18px 10px; border-bottom: 1px solid rgba(0,0,0,.12);
}
.inv-top b { font-family: var(--mono); font-size: 0.82rem; letter-spacing: .06em; }
.inv-top span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: .12em; text-transform: uppercase; color: #9A5B12; }
.inv-meta {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 18px; font-size: 0.74rem; color: #5A626E; border-bottom: 1px solid rgba(0,0,0,.08);
}
.inv-tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.inv-tbl th {
  text-align: left; font-family: var(--mono); font-size: 0.62rem; letter-spacing: .12em;
  text-transform: uppercase; color: #6B7280; font-weight: 400; padding: 11px 18px 7px;
}
.inv-tbl th:nth-child(n+2), .inv-tbl td:nth-child(n+2) { text-align: right; }
.inv-tbl td { padding: 9px 18px; border-top: 1px solid rgba(0,0,0,.07); font-variant-numeric: tabular-nums; }
.inv-tbl tr.inv-total td { border-top: 2px solid rgba(0,0,0,.35); font-weight: 600; padding-top: 12px; padding-bottom: 14px; }
.inv-in {
  width: 86px; text-align: right; font: inherit; font-variant-numeric: tabular-nums;
  background: rgba(233,168,76,.16); border: none; border-bottom: 1px dashed #B4791F;
  color: #14181F; padding: 3px 6px; border-radius: 3px 3px 0 0;
}
.inv-in:hover { background: rgba(233,168,76,.26); }
.inv-in:focus { outline: 2px solid #B4791F; outline-offset: 1px; background: #fff; }
.inv-hint { margin: 0; padding: 10px 18px 14px; font-size: 0.72rem; color: #6B7280; line-height: 1.5; }
.inv-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.i-preset {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .08em; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 12px; border-radius: 100px; transition: color .2s, border-color .2s, background .2s;
}
.i-preset:hover { color: var(--paper); border-color: var(--muted); background: rgba(255,255,255,.03); }
.i-preset[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }

.clauses { display: grid; gap: 7px; }
.clause {
  display: grid; grid-template-columns: 44px 1fr 22px; gap: 12px; align-items: center;
  border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 13px;
  background: var(--ink-2); transition: border-color .3s, background .3s;
}
.clause-ref { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); letter-spacing: .06em; }
.clause-body b { display: block; font-size: 0.84rem; font-weight: 500; color: var(--paper); }
.clause-body span { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.clause-mark { text-align: center; font-size: 0.9rem; }
.clause.ok { border-color: rgba(95,207,166,.34); }
.clause.ok .clause-mark { color: var(--jade); }
.clause.bad { border-color: rgba(233,168,76,.45); background: rgba(233,168,76,.06); }
.clause.bad .clause-mark { color: var(--amber); }

.tl { display: grid; gap: 0; border-left: 1px solid var(--line); margin-left: 6px; padding-left: 0; }
.tl-step {
  display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center;
  padding: 9px 0 9px 14px; position: relative; font-size: 0.83rem; color: var(--paper-dim);
}
.tl-step::before {
  content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: var(--line); transform: translateY(-50%);
}
.tl-step.ok::before { background: var(--jade); }
.tl-step.bad::before { background: var(--amber); }
.tl-step i { font-family: var(--mono); font-size: 0.68rem; font-style: normal; color: var(--muted); letter-spacing: .08em; }
.tl-step.bad span { color: var(--paper); }

/* ---------- 03  run the week ---------- */
.week-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.week-top .w-day { font-family: var(--mono); font-size: 0.7rem; letter-spacing: .08em; color: var(--muted); }
.w-reset {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: .1em; text-decoration: underline;
  text-underline-offset: 3px; padding: 4px;
}
.w-reset:hover { color: var(--paper); }
.race { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.race-col { border: 1px solid var(--line-soft); border-radius: 12px; padding: 16px 18px 18px; background: var(--ink-2); }
.race-col[data-p="score"] { border-color: rgba(95,207,166,.28); }
.race-name { margin: 0; font-family: var(--mono); font-size: 0.7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); }
.race-sub { margin: 4px 0 14px; font-size: 0.76rem; color: var(--muted); line-height: 1.45; min-height: 2.2em; }
.race-track { height: 8px; border-radius: 100px; background: var(--ink-3); border: 1px solid var(--line-soft); overflow: hidden; }
.race-fill { display: block; height: 100%; width: 0; background: var(--line); transition: width .7s cubic-bezier(.2,.7,.3,1); }
.race-col[data-p="age"] .race-fill { background: linear-gradient(90deg, rgba(233,168,76,.45), var(--amber)); }
.race-col[data-p="score"] .race-fill { background: linear-gradient(90deg, rgba(95,207,166,.4), var(--jade)); }
.race-num {
  font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.1;
  margin-top: 10px; color: var(--paper); font-variant-numeric: tabular-nums;
}
.race-col[data-p="age"] .race-num { color: var(--amber); }
.race-col[data-p="score"] .race-num { color: var(--jade); }
.race-log { margin-top: 12px; display: grid; gap: 1px; }
.wk-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  padding: 6px 0; border-top: 1px solid var(--line-soft);
  animation: wkin .4s ease both;
}
@keyframes wkin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.wk-row i { font-style: normal; color: var(--paper-dim); }
.wk-row b { color: var(--paper); font-weight: 500; font-variant-numeric: tabular-nums; }
.w-out { margin-top: 22px; }

/* ---------- 04  write your own ---------- */
.w-text {
  width: 100%; min-height: 132px; resize: vertical;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 10px;
  color: var(--paper); font-family: var(--sans); font-size: 0.9rem; line-height: 1.6; padding: 14px 16px;
}
.w-text:focus { outline: none; border-color: var(--amber); }
.w-text::placeholder { color: var(--muted); }
.ex-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.w-ex {
  font-family: var(--mono); font-size: 0.63rem; letter-spacing: .08em; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 11px; border-radius: 100px; transition: color .2s, border-color .2s, background .2s;
}
.w-ex:hover { color: var(--paper); border-color: var(--muted); background: rgba(255,255,255,.03); }
.w-mark {
  border: 1px dashed var(--line); border-radius: 10px; padding: 13px 15px;
  font-size: 0.86rem; line-height: 1.7; color: var(--paper-dim); background: rgba(0,0,0,.2);
  min-height: 60px; word-break: break-word;
}
.w-empty { color: var(--muted); font-size: 0.82rem; }
.hl { background: none; padding: 1px 3px; border-radius: 3px; }
.hl.kw { background: rgba(233,168,76,.18); color: var(--amber); }
.hl.ent { background: rgba(95,207,166,.16); color: var(--jade); box-shadow: inset 0 -1px 0 rgba(95,207,166,.5); }
.conf { display: grid; grid-template-columns: 1fr 84px 42px; gap: 11px; align-items: center; padding: 6px 0; font-size: 0.8rem; color: var(--muted); }
.conf.top { color: var(--paper); }
.conf-track { height: 6px; border-radius: 100px; background: var(--ink-3); border: 1px solid var(--line-soft); overflow: hidden; }
.conf-track i { display: block; height: 100%; background: var(--line); transition: width .35s ease; }
.conf.top .conf-track i { background: var(--jade); }
.conf b { text-align: right; font-family: var(--mono); font-size: 0.72rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.ent-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.ent-chip {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: .04em;
  border: 1px solid rgba(95,207,166,.32); border-radius: 100px; padding: 5px 11px; color: var(--paper-dim);
}
.ent-chip i { font-style: normal; color: var(--jade); margin-right: 7px; }
.ent-chip.none { border-color: var(--line); color: var(--muted); }
.w-why { margin-top: 14px; font-size: 0.8rem; color: var(--muted); line-height: 1.6; }
.w-why b { color: var(--paper-dim); font-weight: 500; }
.w-why code { font-family: var(--mono); font-size: 0.72rem; background: rgba(233,168,76,.12); color: var(--amber); padding: 2px 6px; border-radius: 4px; }

/* ---------- 05  drill into the bridge ---------- */
.wf { margin-top: 4px; }
.wf svg { width: 100%; height: auto; display: block; }
.wf-bar { transition: opacity .25s, stroke .25s; }
.wf-bar.total { fill: var(--line); }
.wf-bar.up { fill: rgba(95,207,166,.62); }
.wf-bar.down { fill: rgba(233,168,76,.62); }
.wf-bar.unex { fill: rgba(233,168,76,.16); stroke: var(--amber); stroke-width: 1.4; stroke-dasharray: 4 3; }
.wf svg:hover .wf-bar.up, .wf svg:hover .wf-bar.down { opacity: .92; }
.wf-bar.on { stroke: var(--paper); stroke-width: 1.6; }
.wf-bar:focus-visible { outline: 2px solid var(--amber); }
.wf-link { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.wf-lab { fill: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-anchor: middle; }
.wf-val { fill: var(--paper-dim); font-family: var(--mono); font-size: 11px; text-anchor: middle; }
.wf-val.g { fill: var(--jade); }
.wf-val.a { fill: var(--amber); }
.wf-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.wf-axis { font-family: var(--mono); font-size: 0.64rem; letter-spacing: .08em; color: var(--muted); }
.wf-reset {
  background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: .1em; padding: 6px 12px; border-radius: 100px;
}
.wf-reset:hover { color: var(--paper); border-color: var(--muted); }
.wf-detail { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 18px; }
.wf-detail p { font-size: 0.9rem; line-height: 1.6; }
.wf-detail .unex-line { color: var(--amber); font-size: 0.84rem; }
.sub-head { font-family: var(--mono); font-size: 0.68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.sub-row { display: grid; grid-template-columns: 1fr 130px 74px; gap: 12px; align-items: center; padding: 7px 0; font-size: 0.85rem; color: var(--paper-dim); }
.sub-track { height: 7px; border-radius: 100px; background: var(--ink-3); border: 1px solid var(--line-soft); overflow: hidden; }
.sub-track i { display: block; height: 100%; }
.sub-track i.g { background: var(--jade); }
.sub-track i.a { background: var(--amber); }
.sub-row b { text-align: right; font-family: var(--mono); font-size: 0.78rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.sub-row b.g { color: var(--jade); }
.sub-row b.a { color: var(--amber); }

/* ---------- 06  coverage map ---------- */
.mtx { display: grid; gap: 5px; }
.mtx-row { display: grid; grid-template-columns: 168px repeat(5, 1fr) 52px; gap: 5px; align-items: center; }
.mtx-head span {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-align: center; padding-bottom: 2px;
}
.mtx-name { font-size: 0.8rem; color: var(--paper-dim); padding-right: 8px; }
.mtx-cov { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); text-align: center; }
.mtx-cell {
  aspect-ratio: 3.1; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line-soft); background: var(--ink-3); color: var(--muted);
  font-size: 0.8rem; transition: transform .2s, background .25s, border-color .25s, color .25s;
}
.mtx-cell.ok { background: rgba(95,207,166,.16); border-color: rgba(95,207,166,.36); color: var(--jade); }
.mtx-cell.gap { background: rgba(233,168,76,.09); border-color: rgba(233,168,76,.34); color: var(--amber); }
.mtx-cell:hover { transform: translateY(-2px); }
.mtx-cell.on { border-color: var(--paper); color: var(--paper); }
.mtx-out { margin-top: 20px; }
.mtx-q { font-family: var(--serif); font-size: clamp(1.05rem, 1.8vw, 1.32rem); color: var(--paper); line-height: 1.35; margin: 0 0 14px; }
.mtx-log { margin-top: 22px; }
.gap-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 0.83rem; color: var(--paper-dim);
}
.gap-row i { font-family: var(--mono); font-style: normal; font-size: 0.68rem; color: var(--amber); }
.gap-row b { font-family: var(--mono); font-size: 0.66rem; font-weight: 400; color: var(--muted); letter-spacing: .04em; }

@media (max-width: 900px) {
  .race { grid-template-columns: 1fr; }
  .mtx-row { grid-template-columns: 108px repeat(5, 1fr) 40px; }
  .mtx-name { font-size: 0.72rem; }
  .sub-row { grid-template-columns: 1fr 74px 66px; }
  .conf { grid-template-columns: 1fr 56px 40px; }
}
.wf-hit { fill: transparent; cursor: pointer; }
.wf-hit:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.wf-plan { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 5; opacity: .55; }
.wf-planlab { fill: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-anchor: end; }

@media (max-width: 620px) {
  .inv-tbl { font-size: 0.76rem; }
  .inv-tbl th, .inv-tbl td { padding: 8px 10px; }
  .inv-tbl th:first-child, .inv-tbl td:first-child { min-width: 96px; }
  .inv-in { width: 66px; padding: 3px 4px; }
  .inv-top, .inv-meta, .inv-hint { padding-left: 12px; padding-right: 12px; }
  .clause { grid-template-columns: 36px 1fr 20px; gap: 9px; padding: 9px 11px; }
  .tl-step { grid-template-columns: 40px 1fr; gap: 9px; font-size: 0.79rem; }
  .wk-row { grid-template-columns: 40px 1fr auto; font-size: 0.62rem; gap: 7px; }
  .mtx-row { grid-template-columns: 78px repeat(5, 1fr) 34px; gap: 4px; }
  .mtx-head span { font-size: 0.5rem; letter-spacing: .04em; }
  .mtx-name { font-size: 0.66rem; line-height: 1.25; }
  .mtx-cell { aspect-ratio: 1.9; font-size: 0.7rem; }
  .gap-row { grid-template-columns: 22px 1fr; }
  .gap-row b { grid-column: 2; }
  .ent-chip, .w-ex, .i-preset { font-size: 0.6rem; }
}
.mtx-log:empty { display: none; }
@media (max-width: 620px) {
  .mtx-head span { line-height: 1.15; word-break: break-word; }
}

/* ---------- 01  AP invoice queue ---------- */
.apq-list { display: grid; gap: 3px; }
.apq-row {
  display: grid; grid-template-columns: 58px 1fr 84px 82px 68px; gap: 10px; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line-soft); border-left: 2px solid var(--line);
  border-radius: 7px; padding: 9px 12px; color: var(--paper-dim);
  font-size: 0.8rem; transition: border-color .2s, background .2s, transform .2s;
}
.apq-row:hover { background: var(--ink-3); transform: translateX(2px); }
.apq-row.auto { border-left-color: rgba(95,207,166,.7); }
.apq-row.park { border-left-color: var(--amber); }
.apq-row.on { border-color: var(--paper); background: var(--ink-3); }
.apq-row i { font-family: var(--mono); font-style: normal; font-size: 0.72rem; color: var(--muted); }
.apq-sup { color: var(--paper); }
.apq-ch { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); letter-spacing: .04em; }
.apq-row b { text-align: right; font-weight: 500; color: var(--paper); font-variant-numeric: tabular-nums; }
.apq-row em {
  font-style: normal; text-align: right; font-family: var(--mono);
  font-size: 0.6rem; letter-spacing: .08em; text-transform: uppercase;
}
.apq-row.auto em { color: var(--jade); }
.apq-row.park em { color: var(--amber); }
.apq-detail { border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 20px 20px; background: var(--ink-2); }
.apq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.apq-id { font-family: var(--mono); font-size: 0.66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.apq-head h4 { margin: 4px 0 0; font-family: var(--serif); font-weight: 400; font-size: 1.32rem; color: var(--paper); }
.apq-badge {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: .1em; padding: 5px 10px;
  border-radius: 5px; color: var(--ink); flex-shrink: 0;
}
.apq-badge.auto { background: var(--jade); }
.apq-badge.park { background: var(--amber); }
.apq-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 9px; overflow: hidden; }
.apq-field { background: var(--ink-3); padding: 11px 13px; }
.apq-field span { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
.apq-field b { font-size: 0.88rem; font-weight: 500; color: var(--paper); font-variant-numeric: tabular-nums; }
.apq-field b.warn { color: var(--amber); }
.apq-rules { display: grid; gap: 4px; }
.apq-rule { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: baseline; font-size: 0.82rem; color: var(--paper-dim); }
.apq-rule span { font-size: 0.82rem; }
.apq-rule.ok span { color: var(--jade); }
.apq-rule.bad { color: var(--paper); }
.apq-rule.bad span { color: var(--amber); }

/* ---------- 02  order to cash pipeline ---------- */
.pipe { display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.pipe-node {
  flex: 1 1 0; min-width: 118px; cursor: pointer; text-align: left;
  background: var(--ink-2); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 13px 14px 14px; color: var(--paper-dim);
  transition: border-color .25s, background .25s, transform .2s;
}
.pipe-node:hover { transform: translateY(-2px); border-color: var(--muted); }
.pipe-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--jade); margin-bottom: 10px; transition: background .25s; }
.pipe-n { display: block; font-size: 0.88rem; color: var(--paper); font-weight: 500; }
.pipe-r { display: block; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); margin-top: 4px; letter-spacing: .03em; }
.pipe-node.broken { border-color: var(--amber); background: rgba(233,168,76,.08); }
.pipe-node.broken .pipe-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(233,168,76,.18); }
.pipe-node.broken .pipe-r { color: var(--amber); }
.pipe-node.hit { border-color: rgba(233,168,76,.4); border-style: dashed; }
.pipe-node.hit .pipe-dot { background: rgba(233,168,76,.5); }
.pipe-node.on { box-shadow: inset 0 0 0 1px var(--paper); }
.pipe-link { flex: 0 0 20px; align-self: center; height: 1px; background: var(--line); }
.pipe-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pipe-hint { font-family: var(--mono); font-size: 0.64rem; letter-spacing: .06em; color: var(--muted); }
.pipe-gate { margin-top: 14px; border: 1px solid rgba(95,207,166,.3); background: rgba(95,207,166,.06); border-radius: 10px; padding: 13px 15px; }
.pipe-gate-l { font-family: var(--mono); font-size: 0.62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--jade); }
.pipe-gate p { margin: 7px 0 0; font-size: 0.86rem; line-height: 1.55; color: var(--paper-dim); }
.mock-line { margin: 0 0 5px; font-family: var(--mono); font-size: 0.76rem; color: var(--paper-dim); line-height: 1.6; }
.mock-line:last-child { margin-bottom: 0; }

/* ---------- 04  the automation chain ---------- */
.chain { display: grid; gap: 3px; margin-bottom: 16px; }
.chain-step {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center;
  border-left: 2px solid var(--line); padding: 8px 0 8px 12px; font-size: 0.84rem; color: var(--paper-dim);
}
.chain-step i { font-family: var(--mono); font-style: normal; font-size: 0.64rem; color: var(--muted); }
.chain-step.ok { border-left-color: var(--jade); }
.chain-step.bad { border-left-color: var(--amber); color: var(--paper); }
.chain-step.hold { border-left-color: var(--muted); }
.cs-metrics { margin-top: 26px; border-top: 1px solid var(--line-soft); padding-top: 22px; }

/* ---------- 05  the one second read ---------- */
.bridge-head {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: 12px; overflow: hidden; margin-bottom: 22px;
}
.bh-stat { background: var(--ink-2); padding: 18px 20px 20px; }
.bh-stat b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1; color: var(--jade);
  font-variant-numeric: tabular-nums;
}
.bh-stat.warn b { color: var(--amber); }
.bh-stat span { display: block; margin-top: 10px; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

@media (max-width: 900px) {
  .apq-row { grid-template-columns: 52px 1fr 76px 60px; font-size: 0.74rem; }
  .apq-ch { display: none; }
  .bridge-head { grid-template-columns: 1fr; }
  .pipe-node { min-width: 132px; }
}
@media (max-width: 620px) {
  .apq-fields { grid-template-columns: 1fr; }
  .apq-detail { padding: 14px 15px 16px; }
}
.mock-flag { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.mock-line.bad { color: var(--amber); }
/* a clean chain has no artefact to show, so the verdict takes the full width */
.pipe-art:empty { display: none; }
.pipe-art:empty + .pipe-out { grid-column: 1 / -1; }
@media (max-width: 940px) {
  .pipe { flex-wrap: wrap; gap: 8px; overflow-x: visible; }
  .pipe-node { flex: 1 1 140px; }
  .pipe-link { display: none; }
}
.exec-line { max-width: 78ch; font-size: 0.94rem; line-height: 1.65; color: var(--paper-dim); margin: 0 0 20px; }
.exec-line strong { color: var(--paper); font-weight: 500; }
.race-cap { margin: 4px 0 0; font-family: var(--mono); font-size: 0.64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wk-row u { text-decoration: none; color: var(--amber); }
.bh-stat span strong { color: var(--paper-dim); font-weight: 500; }

/* ---------- 05  revenue attainment ---------- */
.av-scrub { max-width: 560px; margin-bottom: 8px; }
.av-scrub label { font-size: 0.88rem; color: var(--paper-dim); }
.av-scrub .av-wk { color: var(--amber); font-weight: 500; }
.av-chart { margin-top: 6px; }
.av-chart svg { width: 100%; height: auto; display: block; }
.avl-target { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 5; opacity: .6; }
.avl-tlab { fill: var(--muted); font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-anchor: end; }
.avl-wk { fill: var(--muted); font-family: var(--mono); font-size: 9px; text-anchor: middle; opacity: .7; }
.avl-plan { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-dasharray: 4 4; opacity: .75; }
.avl-act { fill: none; stroke: var(--jade); stroke-width: 2.2; stroke-linejoin: round; }
.avl-proj { stroke-width: 1.6; stroke-dasharray: 2 4; }
.avl-proj.a { stroke: var(--amber); }
.avl-proj.g { stroke: var(--jade); }
.avl-dotp { fill: var(--amber); opacity: .9; }
.avl-today { stroke: var(--paper); stroke-width: 1; opacity: .35; }
.avl-now { fill: var(--paper-dim); font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; text-anchor: middle; }
.avl-dot { fill: var(--paper); }
.av-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-family: var(--mono); font-size: 0.64rem; letter-spacing: .08em; color: var(--muted); }
.av-legend span { display: inline-flex; align-items: center; gap: 7px; }
.av-legend span::before { content: ""; width: 18px; height: 0; border-top: 2px solid; }
.lg-plan::before { border-color: var(--muted); border-top-style: dashed; }
.lg-act::before { border-color: var(--jade); }
.lg-proj::before { border-color: var(--amber); border-top-style: dotted; }
.av-rows { display: grid; gap: 2px; }
.av-row {
  display: grid; grid-template-columns: 110px 150px 1fr 52px; gap: 14px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 0.84rem;
}
.av-name { color: var(--paper); font-weight: 500; }
.av-track { position: relative; height: 8px; border-radius: 100px; background: var(--ink-3); border: 1px solid var(--line-soft); overflow: hidden; }
.av-track i { display: block; height: 100%; background: var(--line); }
.av-track i.g { background: var(--jade); }
.av-track i.a { background: var(--amber); }
.av-track em { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--paper); opacity: .5; }
.av-nums { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.av-pct { text-align: right; font-family: var(--mono); font-size: 0.8rem; font-weight: 400; color: var(--paper-dim); }
.av-pct.g { color: var(--jade); }
.av-pct.a { color: var(--amber); }
.av-note { grid-column: 2 / -1; margin: 2px 0 0; font-size: 0.76rem; color: var(--muted); line-height: 1.45; }
.av-note.warn { color: var(--amber); }
@media (max-width: 760px) {
  .av-row { grid-template-columns: 92px 1fr 44px; }
  .av-nums { grid-column: 1 / -1; order: 5; }
  .av-note { grid-column: 1 / -1; }
}
.avl-gap { fill: var(--amber); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-anchor: end; }
