/* ============================================================
   How Aremo Works — sticky scrollytelling section
   Scoped under .hw- to avoid collisions with the rest of index.html
   ============================================================ */

.hw {
  --hw-lav: #8b5cf6;
  --hw-lav-soft: #ede9fe;
  --hw-lav-bg: #f5f3ff;
  --hw-lav-line: rgba(139, 92, 246, 0.28);
  --hw-orange: #f59e0b;
  --hw-orange-bg: rgba(245, 158, 11, 0.10);
  --hw-green: #10b981;
  --hw-green-bg: rgba(16, 185, 129, 0.10);
  --hw-crit: #ef4444;
  --hw-crit-bg: rgba(239, 68, 68, 0.08);
  --hw-grey: #6b7280;
  --hw-canvas: #f9fafb;
  padding: clamp(72px, 9vw, 120px) 0 clamp(64px, 8vw, 100px);
}

/* ---- two-column grid: 38 / 62 ---- */
.hw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
@media (min-width: 860px) {
  .hw-grid {
    grid-template-columns: 38fr 62fr;
    gap: clamp(36px, 4vw, 64px);
  }
}

/* ---- LEFT: heading + steps + close ---- */
.hw-left { min-width: 0; }
.hw-head { max-width: 44ch; }
.hw-head .eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hw-lav);
  margin-bottom: 18px;
}
.hw-head .sec-h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
}
.hw-head .sec-p {
  margin-top: 18px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-secondary);
  line-height: 1.55;
}

.hw-steps {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hw-step {
  position: relative;
  padding: 26px 0 26px 56px;
  border-top: 1px solid var(--border);
}
.hw-step:last-child { border-bottom: 1px solid var(--border); }
.hw-num {
  position: absolute;
  left: 0;
  top: 28px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hw-grey);
  transition: color 0.45s ease;
}
.hw-step.is-active .hw-num { color: var(--hw-lav); }
.hw-step-title {
  font-family: var(--sans);
  font-size: clamp(19px, 1.7vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--hw-grey);
  transition: color 0.45s ease;
}
.hw-step.is-active .hw-step-title { color: var(--text-primary); }
.hw-step-copy {
  margin-top: 9px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.hw-close {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.hw-close-line {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.hw-close-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---- RIGHT: sticky product frame ---- */
.hw-right { min-width: 0; }
@media (min-width: 860px) {
  .hw-right { position: sticky; top: 92px; }
}
.hw-frame {
  position: relative;
  height: min(74vh, 560px);
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 17, 21, 0.04), 0 24px 60px -36px rgba(15, 17, 21, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hw-glow {
  position: absolute;
  inset: -48px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(139, 92, 246, 0.20), transparent 62%);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.hw-frame.is-active .hw-glow { opacity: 1; transform: scale(1); }

/* browser chrome */
.hw-chrome {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfbfc;
  flex-shrink: 0;
}
.hw-dots { display: flex; gap: 6px; }
.hw-dots i {
  width: 11px; height: 11px; border-radius: 50%;
  background: #e4e4e7;
}
.hw-chrome-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--hw-grey);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hw-chrome-title .o {
  font-weight: 700;
  color: var(--text-primary);
}
.hw-los-tab {
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--hw-lav-soft);
  border: 1px solid var(--hw-lav-line);
  padding: 4px 10px;
  border-radius: 7px;
}
.hw-frame[data-scene="4"] .hw-los-tab { display: flex; }
.hw-frame[data-scene="4"] .hw-chrome-title { color: var(--hw-grey); }

/* stage holds the 4 scenes (desktop) */
.hw-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.hw-scene {
  position: relative;
  height: 100%;
  width: 100%;
}
/* desktop: scenes stacked, only active visible */
@media (min-width: 860px) {
  .hw-stage .hw-scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
  }
  .hw-stage .hw-scene.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  /* safety net: the scene matching the frame's data-scene is visible
     even before JS adds .is-active, so the frame is never blank */
  .hw-frame[data-scene="1"] .hw-scene[data-scene="1"],
  .hw-frame[data-scene="2"] .hw-scene[data-scene="2"],
  .hw-frame[data-scene="3"] .hw-scene[data-scene="3"],
  .hw-frame[data-scene="4"] .hw-scene[data-scene="4"] {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
/* mobile: scenes are moved out of .hw-stage by JS -> static, always visible */
.hw-scene-mobile {
  display: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,17,21,.04), 0 14px 30px -22px rgba(15,17,21,.18);
  overflow: hidden;
  margin: 14px 0 0;
}
@media (max-width: 859px) {
  .hw-scene-mobile { display: block; }
  .hw-frame { display: none; }
}

/* generic reveal-on-active */
.hw-anim {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.hw-scene.is-active .hw-anim,
.hw-scene-mobile.is-active .hw-anim { opacity: 1; transform: none; }

/* shared faux-UI atoms */
.hw-ui-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hw-grey);
}
.hw-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  white-space: nowrap;
}
.hw-chip.green { color: var(--hw-green); background: var(--hw-green-bg); border-color: transparent; }
.hw-chip.orange { color: #b45309; background: var(--hw-orange-bg); border-color: transparent; }
.hw-chip.lav { color: var(--hw-lav); background: var(--hw-lav-soft); border-color: transparent; }
.hw-chip.grey { color: var(--hw-grey); background: #f3f4f6; border-color: transparent; }
.hw-chip.crit { color: var(--hw-crit); background: var(--hw-crit-bg); border-color: transparent; }

/* ============================================================
   SCENE 1 — Connect
   ============================================================ */
/* ============================================================
   SCENE 1 — Read & Understand (document processing)
   ============================================================ */
.hw-ws {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px 14px;
  background: linear-gradient(180deg, #ffffff, #faf9fc);
}

/* minimal processing header — the only in-visual chrome */
.hw-ws-head { flex-shrink: 0; }
.hw-ws-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hw-ws-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  color: var(--hw-grey);
  margin-top: 3px;
}
.hw-ws-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hw-lav);
  flex-shrink: 0; position: relative;
}
.hw-ws-pulse::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: var(--hw-lav); opacity: .45;
  animation: hw-pulse 1.6s ease-out infinite;
}
@keyframes hw-pulse {
  0% { transform: scale(.6); opacity: .5; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* shared docs canvas — heterogeneous borrower artifacts, docs are the hero */
.hw-ws-docs {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.86fr 1.14fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.hw-ws-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
}

/* document page (real artifact) */
.hw-ws-page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.hw-ws-pgname {
  font-size: 8px;
  font-weight: 600;
  color: var(--hw-grey);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  padding: 0 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-ws-pg {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #fff;
  border: 1px solid #ececef;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 17, 21, 0.05), 0 10px 24px -18px rgba(15, 17, 21, 0.22);
  overflow: hidden;
}

/* soft lavender bloom behind the source Aremo is reading (one doc at a time) */
.hw-ws-bloom {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(130% 90% at 50% 38%, rgba(139, 92, 246, 0.12), transparent 68%);
  opacity: 0;
}
.hw-scene.is-active .hw-ws-bloom { animation: hw-ws-bloom 7.5s ease-in-out infinite; }
@keyframes hw-ws-bloom {
  0% { opacity: 0; } 8% { opacity: 1; } 26% { opacity: 1; } 32% { opacity: 0; } 100% { opacity: 0; }
}

/* lavender scan line moving through the doc */
.hw-ws-scan {
  position: absolute; left: 0; right: 0; height: 22px; top: -22px;
  z-index: 4; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.18), transparent);
  border-top: 1px solid rgba(139, 92, 246, 0.5);
}
.hw-scene.is-active .hw-ws-scan { animation: hw-ws-scan 7.5s ease-in-out infinite; }
@keyframes hw-ws-scan {
  0% { top: -22px; } 24% { top: 100%; } 100% { top: 100%; }
}

/* subtle lavender highlight on the evidence Aremo identifies */
.hw-ws-hl {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.36);
  border-radius: 3px;
  padding: 0 2px;
  opacity: 0;
}
.hw-scene.is-active .hw-ws-hl { animation: hw-ws-hl 7.5s ease-in-out infinite; }
@keyframes hw-ws-hl {
  0% { opacity: 0; } 10% { opacity: 1; } 28% { opacity: 1; } 32% { opacity: 0; } 100% { opacity: 0; }
}

/* ---- document 1: bank statement PDF (black & white) ---- */
.hw-ws-pg .stmt { height: 100%; display: flex; flex-direction: column; }
.hw-ws-pg .stmt .hd {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 9px; border-bottom: 1px solid #eef2ff;
}
.hw-ws-pg .stmt .hd b { font-size: 9px; color: #143b8c; font-weight: 700; }
.hw-ws-pg .stmt .hd span { font-size: 7px; color: var(--hw-grey); text-transform: uppercase; letter-spacing: 0.05em; }
.hw-ws-pg .stmt .acc { padding: 4px 9px; font-size: 7px; color: var(--hw-grey); border-bottom: 1px solid #f3f4f6; }
.hw-ws-pg .stmt .sum {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  padding: 5px 9px; background: #f9fafb; border-bottom: 1px solid #f3f4f6;
}
.hw-ws-pg .stmt .sum div { display: flex; flex-direction: column; }
.hw-ws-pg .stmt .sum span { font-size: 5.5px; color: var(--hw-grey); text-transform: uppercase; letter-spacing: 0.03em; }
.hw-ws-pg .stmt .sum b { font-size: 7.5px; font-weight: 600; color: #0f1115; }
.hw-ws-pg .stmt .bal {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 9px; border-bottom: 1px solid #f3f4f6;
}
.hw-ws-pg .stmt .bal span { font-size: 6px; color: var(--hw-grey); text-transform: uppercase; letter-spacing: 0.04em; }
.hw-ws-pg .stmt .bal b { font-size: 11px; color: #0f1115; }
/* fitted box around the ending balance — reveals only after the scan finishes */
.hw-ws-bal {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #f9fafb;
  opacity: 0;
}
.hw-scene.is-active .hw-ws-bal { animation: hw-bal-in .6s ease 1.9s forwards; }
@keyframes hw-bal-in {
  0% { opacity: 0; border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.12); }
  25% { opacity: 1; border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.12); }
  100% { opacity: 1; border-color: #d1d5db; background: #f9fafb; }
}

/* extracted source value: hidden until Aremo's scan finishes, then reveals with a lavender flash */
.hw-ws-reveal {
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 2px;
  opacity: 0;
}
.hw-scene.is-active .hw-ws-reveal { animation: hw-ws-reveal .9s ease forwards; }
@keyframes hw-ws-reveal {
  0% { opacity: 0; background: rgba(139,92,246,0.14); border-color: rgba(139,92,246,0.4); }
  18% { opacity: 1; background: rgba(139,92,246,0.14); border-color: rgba(139,92,246,0.4); }
  100% { opacity: 1; background: transparent; border-color: transparent; }
}
.hw-ws-pg .stmt .tx { padding: 0 9px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hw-ws-pg .stmt .tx .th {
  display: flex; justify-content: space-between; padding: 4px 0; flex: 0 0 auto;
  font-size: 6px; color: var(--hw-grey); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #f3f4f6;
}
.hw-ws-pg .stmt .tx .r {
  display: flex; justify-content: space-between; padding: 4px 0; flex: 1 1 auto;
  border-bottom: 1px solid #f5f5f5; font-size: 7.5px; align-items: center;
}
.hw-ws-pg .stmt .tx .r b { font-weight: 600; }
.hw-ws-pg .stmt .tx .r .pos,
.hw-ws-pg .stmt .tx .r .neg { color: #0f1115; }

/* ---- document 2: rent roll spreadsheet ---- */
.hw-ws-pg .sheet { height: 100%; display: flex; flex-direction: column; font-size: 7.5px; }
.hw-ws-pg .sheet .hr,
.hw-ws-pg .sheet .r {
  display: grid; grid-template-columns: 22px 1fr 26px 40px; gap: 5px;
  padding: 4px 8px; border-bottom: 1px solid #eef2f4; align-items: center;
}
.hw-ws-pg .sheet .hr {
  flex: 0 0 auto;
  background: #f3f4f6; font-weight: 700; color: #374151;
  font-size: 6.5px; text-transform: uppercase; letter-spacing: 0.03em;
}
.hw-ws-pg .sheet .r { flex: 1 1 auto; }
.hw-ws-pg .sheet .r span { color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-ws-pg .sheet .r span:nth-child(4) { font-weight: 600; text-align: right; }
.hw-ws-pg .sheet .r:nth-child(even) { background: #fafafa; }
.hw-ws-pg .sheet .r.tot {
  flex: 0 0 auto;
  background: #f4f5f7; font-weight: 700; border-top: 1px solid #e5e7eb; color: #111827;
}

/* ---- document 3: vendor invoice (looks like a scanned bill) ---- */
.hw-ws-pg .inv { height: 100%; display: flex; flex-direction: column; background: #fbfaf6; color: #111827; }
.hw-ws-pg .inv .inv-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 7px 9px 4px; }
.hw-ws-pg .inv .inv-brand { font-size: 7px; font-weight: 700; line-height: 1.15; color: #374151; }
.hw-ws-pg .inv .inv-title { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; color: #111827; }
.hw-ws-pg .inv .inv-meta { display: flex; flex-direction: column; gap: 2px; padding: 0 9px 5px; border-bottom: 1px solid #ece8de; }
.hw-ws-pg .inv .inv-meta div { display: flex; justify-content: space-between; font-size: 7px; }
.hw-ws-pg .inv .inv-meta span { color: #6b7280; }
.hw-ws-pg .inv .inv-meta b { font-weight: 600; }
.hw-ws-pg .inv .inv-bill { padding: 5px 9px; font-size: 7.5px; border-bottom: 1px solid #ece8de; }
.hw-ws-pg .inv .inv-bill span { display: block; font-size: 6px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1px; }
.hw-ws-pg .inv .inv-tbl { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 9px; }
.hw-ws-pg .inv .inv-th,
.hw-ws-pg .inv .inv-tr { display: grid; grid-template-columns: 1fr 16px 44px; gap: 5px; padding: 4px 0; border-bottom: 1px solid #f1ede3; font-size: 7px; align-items: center; }
.hw-ws-pg .inv .inv-th { flex: 0 0 auto; font-size: 6px; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7280; }
.hw-ws-pg .inv .inv-tr { flex: 1 1 auto; }
.hw-ws-pg .inv .inv-tr span:nth-child(2),
.hw-ws-pg .inv .inv-tr span:nth-child(3) { text-align: right; }
.hw-ws-pg .inv .inv-tot { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 9px; border-top: 1px solid #d6d2c8; background: #f4f1e9; }
.hw-ws-pg .inv .inv-tot span { font-size: 7px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.hw-ws-pg .inv .inv-tot b { font-size: 11px; font-weight: 700; }

/* ---- Aremo output: structured facts (secondary layer, separate from docs) ---- */
.hw-ws-out { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.hw-ws-fld {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 7px;
  font-size: 9.5px;
  opacity: 0; transform: translateY(4px);
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.hw-scene.is-active .hw-ws-fld { animation: hw-fld-in .5s ease forwards; }
@keyframes hw-fld-in { to { opacity: 1; transform: none; } }
.hw-ws-fld .ck { color: var(--hw-lav); font-weight: 700; font-size: 11px; flex-shrink: 0; }
.hw-ws-fld .k { font-size: 9.5px; font-weight: 500; color: #6b7280; white-space: nowrap; }
.hw-ws-fld .v { margin-left: auto; font-weight: 600; color: #111827; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .hw-ws-fld { opacity: 1; transform: none; animation: none; }
  .hw-ws-hl, .hw-ws-bloom { opacity: 1; animation: none; }
  .hw-ws-scan { animation: none; top: 45%; }
  .hw-ws-pulse::after { animation: none; opacity: 0; }
  .hw-ws-bal { opacity: 1; animation: none; border-color: #d1d5db; background: #f9fafb; }
  .hw-ws-reveal { opacity: 1; animation: none; }
}
@media (max-width: 859px) {
  .hw-ws-docs { grid-template-columns: 1fr; min-height: 0; }
}

/* ============================================================
   SCENE 2 — Build a living loan file (the graph)
   ============================================================ */
.hw-s2 {
  height: 100%;
  background:
    radial-gradient(rgba(15, 17, 21, 0.07) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--hw-canvas);
  position: relative;
  overflow: hidden;
}
.hw-s2-bar {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hw-s2-bar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hw-lav);
}
.hw-s2-bar .ttl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.hw-s2-bar .seg {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.hw-s2-bar .seg span {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 9px;
  color: var(--hw-grey);
}
.hw-s2-bar .seg span.on {
  background: #fff;
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border);
}
.hw-graph {
  position: absolute;
  inset: 44px 12px 12px;
}
.hw-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hw-edge {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.hw-edge.owner { stroke: #0f1115; stroke-width: 1.6; }
.hw-edge.grey { stroke: #9ca3af; stroke-width: 1.4; }
.hw-edge.guar { stroke: var(--hw-lav); stroke-width: 1.3; stroke-dasharray: 5 4; opacity: 0.55; }
.hw-edge.draw {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.hw-scene.is-active .hw-edge.draw,
.hw-scene-mobile.is-active .hw-edge.draw { stroke-dashoffset: 0; }
.hw-edge-lab {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--hw-grey);
  white-space: nowrap;
  z-index: 2;
}
.hw-edge-lab.lav { color: var(--hw-lav); border-color: var(--hw-lav-line); }

.hw-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 150px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 11px;
  box-shadow: 0 6px 18px -12px rgba(15, 17, 21, 0.22);
  z-index: 3;
}
.hw-node .nm { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.hw-node .meta { font-size: 9.5px; color: var(--hw-grey); margin-top: 3px; letter-spacing: 0.04em; }
.hw-node .stake { font-size: 11px; font-weight: 600; margin-top: 5px; }
.hw-node.borrower { border: 2px solid #0f1115; padding: 11px 12px; }
.hw-node.borrower .tag { color: var(--hw-green); }
.hw-node.facility { border-color: var(--hw-lav); border-width: 1.6px; }
.hw-node.facility .tag { color: var(--hw-lav); }
.hw-node.collateral { border-style: dashed; border-color: #9ca3af; }
.hw-node.collateral .tag { color: var(--hw-grey); }
.hw-node.disputed { border-color: var(--hw-orange); border-style: dashed; }
.hw-node .warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #b45309;
  background: var(--hw-orange-bg);
  padding: 2px 6px;
  border-radius: 5px;
}
.hw-node .tag {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hw-graph-doc {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 4;
}
.hw-reconcile {
  position: absolute;
  z-index: 5;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hw-green);
  background: #fff;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: 0 8px 20px -12px rgba(16, 185, 129, 0.4);
}

/* ============================================================
   SCENE 3 — Surface what needs attention
   ============================================================ */
.hw-s3 {
  height: 100%;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  overflow: auto;
}
.hw-s3-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hw-s3-head .ttl { font-size: 13px; font-weight: 600; }
.hw-s3-head .sub { font-size: 11px; color: var(--hw-grey); }
.hw-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.4s ease, background 0.4s ease;
}
.hw-row.top { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.hw-row .fname { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.hw-row .fval { font-size: 12.5px; color: var(--hw-grey); }
.hw-row.review { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.04); }
.hw-row.resolved { border-color: rgba(16, 185, 129, 0.4); background: var(--hw-green-bg); }
.hw-conflict {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.hw-conflict .lose { color: var(--hw-grey); text-decoration: line-through; }
.hw-conflict .win { font-weight: 600; color: var(--text-primary); }
.hw-conflict .vs { color: #cbd5e1; font-size: 11px; }
.hw-evidence {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--hw-grey);
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
}
.hw-evidence .pg {
  width: 16px; height: 20px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #d1d5db;
  flex-shrink: 0;
  position: relative;
}
.hw-evidence .pg::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px; top: 4px;
  height: 2px; background: #f59e0b;
  box-shadow: 0 4px 0 #fed7aa;
}
.hw-evidence b { color: var(--text-primary); font-weight: 600; }
.hw-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--text-primary);
  border-radius: 7px;
  padding: 6px 11px;
  cursor: default;
  border: none;
  transition: background 0.4s ease;
}
.hw-row.resolved .hw-act { background: var(--hw-green); }
.hw-row .check { display: none; }
.hw-row.resolved .hw-act .confirm { display: none; }
.hw-row.resolved .hw-act .check { display: inline; }
/* Scene 3: the review row resolves once the scene is active */
.hw-row.review .done { display: none; }
.hw-scene.is-active .hw-row.review,
.hw-scene-mobile.is-active .hw-row.review {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--hw-green-bg);
}
.hw-scene.is-active .hw-row.review .hw-act,
.hw-scene-mobile.is-active .hw-row.review .hw-act { background: var(--hw-green); }
.hw-scene.is-active .hw-row.review .hw-act .confirm,
.hw-scene-mobile.is-active .hw-row.review .hw-act .confirm { display: none; }
.hw-scene.is-active .hw-row.review .hw-act .check,
.hw-scene-mobile.is-active .hw-row.review .hw-act .check { display: inline; }
.hw-scene.is-active .hw-row.review .rest,
.hw-scene-mobile.is-active .hw-row.review .rest { display: none; }
.hw-scene.is-active .hw-row.review .done,
.hw-scene-mobile.is-active .hw-row.review .done { display: inline; }
.hw-scene.is-active .hw-row.review .status-chip,
.hw-scene-mobile.is-active .hw-row.review .status-chip {
  color: var(--hw-green);
  background: var(--hw-green-bg);
}

/* ============================================================
   SCENE 4 — Execute in LOS
   ============================================================ */
.hw-s4 {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
}
.hw-s4-ready {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.hw-s4-ready .o {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--text-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
}
.hw-s4-ready .meta b { font-size: 13px; font-weight: 600; display: block; }
.hw-s4-ready .meta span { font-size: 11px; color: var(--hw-grey); }
.hw-s4-go {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--text-primary);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: default;
}
.hw-los {
  flex: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.hw-los-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.hw-los-head .brand { font-weight: 700; }
.hw-los-head .sub { font-size: 10.5px; color: var(--hw-grey); font-weight: 500; }
.hw-los-fields {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 16px;
}
.hw-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hw-field .lbl { font-size: 10px; color: var(--hw-grey); }
.hw-field .box {
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.hw-field .box .fill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  background: #fff;
  clip-path: inset(0 100% 0 0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-scene.is-active .hw-field .box .fill,
.hw-scene-mobile.is-active .hw-field .box .fill { animation: hw-fill 5s infinite; }
@keyframes hw-fill {
  0% { clip-path: inset(0 100% 0 0); }
  55% { clip-path: inset(0 0 0 0); }
  92% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 100% 0 0); }
}
.hw-s4-prog {
  height: 5px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
}
.hw-s4-prog i { display: block; height: 100%; width: 0; background: var(--text-primary); }
.hw-scene.is-active .hw-s4-prog i,
.hw-scene-mobile.is-active .hw-s4-prog i { animation: hw-losprog 5s infinite; }
@keyframes hw-losprog { 0% { width: 0; } 80% { width: 100%; } 100% { width: 100%; } }
.hw-s4-done {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hw-green);
  background: var(--hw-green-bg);
  border: 1px solid #a7f3d0;
  border-radius: 9px;
  padding: 10px 13px;
  opacity: 0;
}
.hw-scene.is-active .hw-s4-done,
.hw-scene-mobile.is-active .hw-s4-done { animation: hw-done 5s infinite; }
@keyframes hw-done {
  0%, 72% { opacity: 0; transform: translateY(6px); }
  82%, 95% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(6px); }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .hw *, .hw *::before, .hw *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .hw-anim { opacity: 1; transform: none; }
  .hw-edge.draw { stroke-dashoffset: 0; }
  .hw-field .box .fill { clip-path: inset(0 0 0 0); }
  .hw-s4-prog i { width: 100%; }
  .hw-s4-done { opacity: 1; }
}
