/* Trakytt live demos. Uses only tokens from styles.css :root. */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.demo-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.demo-btn { height: 32px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.demo-btn .icon { width: 14px; height: 14px; }
.demo-btn:focus-visible, .seg button:focus-visible, .toast button:focus-visible, .q-reset:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
kbd {
  font: 600 10.5px/1 var(--font-mono); padding: 2px 5px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--graphite); box-shadow: 0 1px 0 var(--line);
}

/* 1. Receipt OCR */
.seg { display: inline-flex; background: var(--surface); padding: 3px; border-radius: var(--radius); gap: 2px; max-width: 100%; }
.seg button { border: 0; background: none; padding: 5px 9px; border-radius: var(--radius); font-size: 12px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.receipt-demo .receipt .scanline { animation: none; opacity: 0; top: 6%; }
.receipt-demo.scanning .receipt .scanline { opacity: 1; animation: demo-scan 1.2s ease-in-out 1 forwards; }
@keyframes demo-scan { 0% { top: 4%; } 100% { top: 94%; } }
.receipt-demo .receipt > div { line-height: 1.5; }
.receipt-demo .field { min-height: 30px; align-items: center; }
.receipt-demo .field b { min-height: 1.2em; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.receipt-demo .field.typing { background: var(--mint-soft); }
.receipt-demo .field.typing b::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--teal); animation: demo-blink .6s steps(1) infinite; }
.receipt-demo .field.pending b { color: transparent; position: relative; min-width: 56px; }
.receipt-demo .field.pending b::before {
  content: ""; position: absolute; inset: 3px 0; border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--line) 0 30%, var(--mint-soft) 50%, var(--line) 70% 100%); background-size: 200% 100%;
  animation: demo-shimmer 1.2s linear infinite;
}
.receipt-demo .conf-num { min-width: 34px; text-align: right; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
.receipt-demo .conf .bar i { transition: none; }
@keyframes demo-blink { 50% { opacity: 0; } }
@keyframes demo-shimmer { to { background-position: -200% 0; } }

/* 1b. Source document demo: receipt + extracted fields, validation, line-item table, totals */
.receipt-demo { padding: 18px; }
.rd-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 18px; align-items: start; }
.rd-top > * { min-width: 0; }
.receipt-demo .receipt { background: #FDF8EC; border-color: #EADFC4; font-size: 13px; color: var(--graphite-2); padding: 14px 16px; line-height: 1.5; }
.receipt-demo .receipt b { font-size: 16px; margin-bottom: 4px; }
.receipt-demo .rp-row { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.receipt-demo .rp-row:first-of-type { margin-top: 8px; padding-top: 6px; border-top: 1px solid #EFE4C9; }
.receipt-demo .rp-sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid #EFE4C9; }
.receipt-demo .rp-total { color: var(--ink); font-weight: 700; font-size: 15px; margin: 6px 0 2px; }
.receipt-demo .field { margin-bottom: 4px; }
.rd-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rd-check { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border-radius: var(--radius); font-size: 13px; font-weight: 600; text-align: center; }
.rd-check .icon { width: 15px; height: 15px; stroke-width: 3; flex: none; }
.rd-check.ok { background: var(--ok-bg); color: var(--ok-text); }
.rd-check.bad { background: var(--err-bg); color: var(--err-text); box-shadow: inset 0 0 0 1px rgba(220,38,38,.2); }
.mock .rd-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; background: var(--err-bg); color: var(--err-text); border-radius: var(--radius); padding: 8px 10px; font-size: 12.5px; font-weight: 600; }
.mock .rd-warn[hidden] { display: none; }
.rd-warn .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.mock .rd-h { font-size: 15px; font-weight: 600; color: var(--ink); margin: 16px 0 8px; }
.rd-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.rd-table th { background: var(--bg-soft); color: var(--graphite-2); font-weight: 600; font-size: 12px; text-align: left; padding: 8px 10px; }
.rd-table td { padding: 7px 10px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.rd-table :is(th, td):nth-child(2), .rd-table :is(th, td):nth-child(3), .rd-table :is(th, td):nth-child(n+6) { text-align: right; white-space: nowrap; }
.rd-acct { display: inline-block; background: var(--mint-soft); color: var(--mint-ink); padding: 2px 8px; border-radius: var(--radius-md); font-weight: 600; }
.rd-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 10px; align-items: start; }
.mock .rd-note { font-size: 12.5px; font-style: italic; color: var(--graphite-2); }
.rd-totals { display: grid; font-size: 13px; font-variant-numeric: tabular-nums; }
.rd-totals div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 12px; border-bottom: 1px solid var(--line-soft); }
.rd-totals div b { font-weight: 500; }
.rd-totals div:last-child { border: 0; margin-top: 2px; background: var(--mint-soft); border-radius: var(--radius-md); padding: 8px 12px; font-weight: 700; font-size: 14px; }
.rd-totals div:last-child b { font-weight: 700; }
.receipt-demo .conf { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.receipt-demo :is(.rd-checks, .rd-warn, .rd-table-wrap, .rd-foot) { transition: opacity .3s; }
.receipt-demo.res-pending :is(.rd-checks, .rd-warn, .rd-table-wrap, .rd-foot) { opacity: .25; }
.mock .illus, .tile .illus { margin-top: 10px; font-size: 11.5px; color: var(--muted); font-style: italic; }
@media (max-width: 760px) {
  .rd-top, .rd-foot { grid-template-columns: minmax(0, 1fr); }
  /* Line items become stacked cards: each cell carries its column name. */
  .rd-table-wrap { border: 0; overflow: visible; }
  .rd-table thead { display: none; }
  .rd-table, .rd-table tbody, .rd-table tr, .rd-table td { display: block; }
  .rd-table tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; margin-bottom: 8px; }
  .rd-table td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 3px 0; text-align: right !important; white-space: normal !important; }
  .rd-table td::before { content: attr(data-l); color: var(--muted); text-align: left; }
  .rd-table td:first-child { font-weight: 600; }
}

/* 2. Review queue */
.queue-demo { position: relative; outline: none; }
.queue-demo:focus-visible { box-shadow: var(--shadow), 0 0 0 2px var(--teal-bright); }
.queue-demo .queue-row { cursor: pointer; border-radius: var(--radius-md); padding-left: 6px; padding-right: 6px; transition: background .15s; }
.queue-demo .queue-row:hover { background: var(--bg-soft); }
.queue-demo .queue-row.sel { background: var(--mint-soft); }
.queue-demo .queue-row .who { min-width: 0; }
.queue-demo .chip { min-width: 62px; justify-content: center; white-space: nowrap; }
.chip.excl { background: var(--surface); color: var(--graphite); box-shadow: inset 0 0 0 1px var(--line); }
.queue-demo .chip.pop, .bas-sign .chip.pop { animation: demo-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes demo-pop { 0% { transform: scale(.6); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
.q-count { font-weight: 600; font-size: 12.5px; color: var(--teal); }
.q-reset { font-size: 12.5px; font-weight: 500; color: var(--info-text); text-decoration: underline; }
.q-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-actions .btn { flex: 1 1 auto; justify-content: center; }
.kbd-hint { margin-top: 8px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.kbd-hint > span { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.toast {
  position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--graphite); color: var(--bg); padding: 9px 12px; border-radius: var(--radius); font-size: 12.5px; box-shadow: var(--shadow-lg);
  animation: demo-toast .25s ease-out;
}
.toast[hidden] { display: none; }
.toast button { border: 0; background: none; color: var(--mint); font-weight: 600; text-decoration: underline; padding: 2px 4px; }
@keyframes demo-toast { from { transform: translateY(8px); opacity: 0; } }

/* 3b. BAS sign-off */
.mock .bs-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.bs-meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 10px; font-size: 13px; }
.bs-meta dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; align-self: center; }
.bs-meta dd { margin: 0; }
.mock .bs-source { display: flex; gap: 8px; align-items: center; background: var(--mint-soft); color: var(--mint-ink); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.bs-source .icon { width: 16px; height: 16px; flex: none; }
.bas-sign .demo-label { margin: 0 0 6px; font-size: 12px; }
.bs-rows { display: grid; font-size: 13px; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.bs-rows div { display: flex; justify-content: space-between; padding: 4px 10px; border-bottom: 1px solid var(--line-soft); }
.bs-rows b { font-weight: 500; }
.bs-rows .bs-net { border: 0; background: var(--mint-soft); color: var(--teal); border-radius: var(--radius-md); font-weight: 600; padding: 7px 10px; margin-top: 2px; }
.bs-rows .bs-net b { font-weight: 600; }
.bs-status { font-size: 12.5px; padding: 4px 10px; margin-bottom: 6px; }
.bs-status .icon { width: 14px; height: 14px; }
.sign-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sign-actions .btn { flex: 1 1 auto; justify-content: center; }
.sign-actions .btn:disabled { opacity: 1; background: var(--ok-bg); color: var(--ok-text); }

/* 4. How it works infographic: see the end of this file */

/* 5. Pricing estimator */
.estimator { max-width: 720px; margin: 28px auto 0; padding: 18px; }
.est-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; margin-bottom: 12px; }
.est-head h3 { font-size: 17px; font-weight: 600; }
.est-head span { color: var(--muted); font-size: 12.5px; }
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.estimator label { display: grid; gap: 8px; font-size: 13px; font-weight: 500; color: var(--graphite); }
.estimator output { float: right; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
.estimator input[type=range] { width: 100%; accent-color: var(--teal); margin: 0; }
.est-result { margin-top: 14px; font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.est-result .chip { font-size: 12.5px; padding: 3px 10px; }
.plans .plan { transition: scale .3s ease, outline-color .3s ease, box-shadow .3s ease; outline: 2px solid transparent; outline-offset: 3px; }
.plans .plan.plan-match { scale: 1.02; outline-color: var(--teal-bright); box-shadow: var(--shadow-lg); }

@media (max-width: 640px) {
  .est-grid { grid-template-columns: 1fr; gap: 14px; }
  .receipt-demo .demo-bar .btn { flex: 1 1 100%; }
  .plans .plan.plan-match { scale: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .queue-demo .chip.pop, .toast, .receipt-demo .field.pending b::before, .receipt-demo .field.typing b::after { animation: none; }
  .receipt-demo.scanning .receipt .scanline { animation: none; opacity: 0; }
  .plans .plan { transition: none; }
}

/* ---------- Critique #5: bigger, easier demo targets ---------- */
.seg button { min-height: 32px; padding: 6px 12px; }
.demo-btn { height: 36px; }
.demo-btn:focus-visible, .seg button:focus-visible, .toast button:focus-visible, .q-reset:focus-visible { outline-color: var(--teal); }
.queue-demo:focus-visible { box-shadow: var(--shadow), 0 0 0 2px var(--teal); }
@media (max-width: 480px) { .seg button { min-height: 40px; } }

/* ---------- Proposed journal tile (follows the scanned sample) ---------- */
.tile-ledger { align-items: start; }
.tile-ledger .tile-copy { display: flex; flex-direction: column; }
.j-kicker {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--mint-soft); color: var(--mint-ink);
}
.j-kicker .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.tile-ledger .sync-art { margin-top: 26px; justify-content: flex-start; }
.tile .sync-cap { margin-top: 10px; font-size: 12.5px; }
.journal .journal-head { gap: 8px; flex-wrap: wrap; }
.j-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.j-ids { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 8px; font-size: 12.5px; }
.j-ids div { display: flex; gap: 6px; }
.j-ids dt { color: var(--muted); }
.j-ids dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.journal [data-j-rows] .journal-row > span:first-child small { display: block; margin: 1px 0 0; font-size: 11px; color: var(--muted); font-weight: 400; }
.journal [data-j-rows], .journal [data-j-bal] { transition: opacity .3s; }
.journal.j-pending [data-j-rows], .journal.j-pending [data-j-bal] { opacity: .25; }
.mock .j-note { margin-top: 10px; font-size: 12.5px; color: var(--graphite-2); }

/* ---------- 4. How it works: six-stage infographic ---------- */
.hiw-head { margin-bottom: 44px; }
.hiw-head .eyebrow { margin-bottom: 22px; }
.hiw-head p { margin-top: 20px; }
.hiw { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.hiw-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.hiw-ctrl { display: flex; flex-wrap: wrap; gap: 8px; }
.hiw-ctrl .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.hiw-reduced .hiw-ctrl { display: none; }
.hiw-dest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 12.5px; color: var(--muted); }
.hiw .seg button:disabled { cursor: not-allowed; opacity: .6; }
.hiw-caption {
  margin: 12px 0 18px; min-height: 3.1em; font-size: 13.5px; color: var(--graphite-2); background: #fff;
  border: 1px solid var(--line); border-left: 3px solid var(--teal-bright); border-radius: var(--radius); padding: 8px 12px;
}

/* Grid. Phones/tablets: one column with the exception branch beside the main path. */
.hiw-grid {
  position: relative; display: grid; max-width: 760px; margin: 0 auto;
  grid-template-columns: 12px minmax(0, .7fr) minmax(0, 1.3fr) 12px;
  grid-template-rows: auto auto 30px auto auto auto auto auto auto auto auto 14px 30px auto auto;
}
.hiw-intro  { grid-row: 1; grid-column: 1 / -1; }
.hiw-cap    { grid-row: 2; grid-column: 1 / -1; }
.hiw-c[data-c="c1"] { grid-row: 3 / 5; grid-column: 2; }
.hiw-boundary { grid-row: 4 / 13; grid-column: 1 / -1; }
.hiw-bl     { grid-row: 4; grid-column: 3; }
.hiw-ext    { grid-row: 5; grid-column: 2 / 4; }
.hiw-c[data-c="c2"] { grid-row: 6; grid-column: 2; }
.hiw-val    { grid-row: 7; grid-column: 2 / 4; }
.hiw-c[data-c="c3"] { grid-row: 8; grid-column: 2; }
.hiw-br     { grid-row: 8; grid-column: 3; }
.hiw-rev    { grid-row: 9; grid-column: 2 / 4; }
.hiw-c[data-c="c4"] { grid-row: 10; grid-column: 2; }
.hiw-jnl    { grid-row: 11; grid-column: 2 / 4; }
.hiw-c[data-c="c5"] { grid-row: 12 / 14; grid-column: 2; }
.hiw-exp    { grid-row: 14; grid-column: 1 / -1; }
.hiw-foot   { grid-row: 15; grid-column: 1 / -1; }

/* Desktop: capture on top, stages 2-5 left to right inside the control layer, export below the journal. */
@media (min-width: 1100px) {
  .hiw-grid {
    max-width: none;
    grid-template-columns: 16px minmax(0, 1fr) 44px minmax(0, 1fr) 76px minmax(0, 1.15fr) 44px minmax(0, 1.45fr) 16px;
    grid-template-rows: auto 30px auto auto 1fr 18px 30px auto;
  }
  .hiw-cap    { grid-row: 1; grid-column: 2 / 5; }
  .hiw-intro  { grid-row: 1; grid-column: 6 / 9; align-self: center; padding-left: 8px; }
  .hiw-c[data-c="c1"] { grid-row: 2 / 4; grid-column: 2; }
  .hiw-boundary { grid-row: 3 / 7; grid-column: 1 / -1; }
  .hiw-bl     { grid-row: 3; grid-column: 4 / 9; }
  .hiw-ext    { grid-row: 4 / 6; grid-column: 2; }
  .hiw-c[data-c="c2"] { grid-row: 4; grid-column: 3; }
  .hiw-val    { grid-row: 4; grid-column: 4; }
  .hiw-c[data-c="c3"] { grid-row: 4; grid-column: 5; }
  .hiw-br     { grid-row: 5; grid-column: 4; }
  .hiw-rev    { grid-row: 4 / 6; grid-column: 6; }
  .hiw-c[data-c="c4"] { grid-row: 4; grid-column: 7; }
  .hiw-jnl    { grid-row: 4 / 6; grid-column: 8; }
  .hiw-c[data-c="c5"] { grid-row: 6 / 8; grid-column: 8; }
  .hiw-exp    { grid-row: 8; grid-column: 8; }
  .hiw-foot   { grid-row: 7 / 9; grid-column: 2 / 7; align-self: end; padding-right: 24px; }
}

/* Control-layer boundary (stages 2-5, exception branch, journal preview) */
.hiw-boundary { border: 2px dashed rgba(10, 92, 84, .45); border-radius: var(--radius-lg); background: rgba(204, 251, 241, .3); }
.hiw-bl {
  position: relative; z-index: 1; justify-self: center; align-self: center; margin: 12px 0;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--graphite); color: #fff; font-size: 12px; font-weight: 600; text-align: center;
}
.hiw-bl .icon { width: 14px; height: 14px; color: var(--mint); }

/* Stage cards */
.hiw-st {
  position: relative; z-index: 1; align-self: start; background: #fff; border: 1px solid var(--line);
  border-top: 3px solid var(--teal-bright); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px 12px 12px; font-size: 12.5px; outline: 3px solid transparent; outline-offset: 2px;
  transition: opacity .3s, background .3s, outline-color .3s, box-shadow .3s;
}
.hiw-st.bk { border-top-color: var(--graphite); }
.hiw-cap { border-top-color: #94A3B8; }
.hiw-res { border-top-color: var(--amber); }
.hiw-st[data-state="pending"] { opacity: .5; box-shadow: none; }
.hiw-st[data-state="done"] { background: #F6FEFC; }
.hiw-res[data-state="done"] { background: #FFFDF5; }
.hiw-st[data-state="active"] { outline-color: rgba(20, 184, 166, .45); box-shadow: var(--shadow-lg); }
.hiw-st.bk[data-state="active"] { outline-color: rgba(30, 41, 59, .35); }
.hiw-res[data-state="active"] { outline-color: rgba(245, 158, 11, .5); }
.hiw-sh {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; min-height: 40px; margin: 0 0 8px; padding: 2px 0 8px;
  border: 0; border-bottom: 1px solid var(--line-soft); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.hiw-sh-static { cursor: default; }
button.hiw-sh:hover .hiw-t { color: var(--teal); }
button.hiw-sh:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--radius-md); }
button.hiw-sh[aria-pressed="true"] .hiw-t { color: var(--teal); }
.hiw-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--graphite); color: #fff; font-size: 12px; font-weight: 700; transition: background .3s, color .3s;
}
.hiw-st[data-state="done"] .hiw-n { background: var(--teal); }
.hiw-st[data-state="active"] .hiw-n { background: var(--teal-bright); color: var(--ink); }
.hiw-st .hiw-n-x { background: var(--amber) !important; color: var(--ink) !important; }
.hiw-t { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.2; }
.hiw-role { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 5px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.hiw-role .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.hiw-role.sys { background: var(--ok-bg); color: var(--ok-text); }
.hiw-role.bk { background: var(--graphite); color: #fff; }

/* Stage content */
.hiw [data-r] { transition: opacity .35s ease, transform .35s ease; }
.hiw .hiw-hide { opacity: 0; transform: translateY(4px); }
.hiw-cap-body { display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1.1fr); align-items: center; gap: 6px; }
.hiw-chan, .hiw-lines, .hiw-checks, .hiw-alloc { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hiw-chan li { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; font-weight: 500; transition: background .3s, border-color .3s; }
.hiw-chan li.hot { border-color: var(--teal-bright); background: var(--mint-soft); }
.hiw-chan .icon, .hiw-src-t .icon { width: 15px; height: 15px; color: var(--teal); }
.hiw-feed { position: relative; height: 2px; background: var(--teal-bright); margin-right: 6px; }
.hiw-feed::after { content: ""; position: absolute; right: -7px; top: -5px; border: 6px solid transparent; border-left: 8px solid var(--teal-bright); border-right: 0; }
.hiw-src { border: 1px dashed var(--teal-bright); background: var(--bg-soft); border-radius: var(--radius); padding: 10px; }
.hiw-src-t { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.hiw-src-k { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.hiw-kv { margin: 0; display: grid; gap: 3px; }
.hiw-kv div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 6px; background: var(--bg-soft); border-radius: var(--radius-md); }
.hiw-kv dt { color: var(--muted); }
.hiw-kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.hiw-sub { margin: 8px 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hiw-lines li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.hiw-lines li:last-child { border-bottom: 0; }
.hiw-checks li, .hiw-checks li > span { display: flex; align-items: flex-start; gap: 6px; }
.hiw-checks .icon { width: 14px; height: 14px; margin-top: 2px; stroke-width: 3; color: var(--ok-text); }
.hiw-checks .w-warn { color: var(--warn-text); font-weight: 600; }
.hiw-checks .w-warn .icon { color: var(--warn-text); stroke-width: 2.4; }
.hiw .w-warn, .hiw .is-warn .w-ok { display: none !important; }
.hiw .is-warn .w-warn { display: flex !important; }
.hiw-pill { margin-top: 8px; }
.hiw-pill > span { align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.hiw-pill > .w-ok { display: inline-flex; }
.hiw .hiw-pill.is-warn > .w-warn { display: inline-flex !important; }
.hiw-pill .icon { width: 14px; height: 14px; }
.hiw-pill .w-ok { background: var(--ok-bg); color: var(--ok-text); }
.hiw-pill .w-warn { background: #FEF3C7; color: #92400E; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .55); }
.hiw-find, .hiw-dec { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border-radius: var(--radius-md); font-weight: 600; }
.hiw-find { background: #FEF3C7; color: #92400E; }
.hiw-dec { margin-top: 6px; background: var(--graphite); color: #fff; font-weight: 500; }
.hiw-dec b { font-weight: 700; color: var(--mint); }
.hiw-find .icon, .hiw-dec .icon { width: 14px; height: 14px; margin-top: 2px; }
.hiw-alloc li { display: grid; grid-template-columns: auto 14px minmax(0, 1fr); gap: 6px; align-items: center; }
.hiw-alloc .icon { width: 14px; height: 14px; color: var(--muted); }
.hiw-alloc b { justify-self: start; padding: 1px 6px; border-radius: var(--radius-md); background: var(--mint-soft); color: var(--mint-ink); font-weight: 600; }
.hiw-note { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.hiw-ok { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 8px; border-radius: var(--radius-md); background: var(--ok-bg); color: var(--ok-text); font-weight: 600; }
.hiw-ok .icon { width: 15px; height: 15px; }
.hiw-ids { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 4px; font-size: 11.5px; color: var(--muted); }
.hiw-ids b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hiw-j .journal-row { gap: 6px; padding: 4px 2px; font-size: 11.5px; }
.hiw-j .journal-cols { font-size: 10px; }
.hiw-bal { margin-top: 6px; }
.hiw-bal .chip .icon { width: 12px; height: 12px; stroke-width: 3; }
.hiw-jcap { margin-top: 6px; font-size: 11.5px; font-style: italic; color: var(--graphite-2); }
.hiw-ledgers { display: flex; align-items: flex-start; justify-content: center; gap: 4px; padding: 4px 0; }
.hiw-led { flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: opacity .3s; }
.hiw-led small { font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.hiw-led .sync-node { width: 50px; height: 50px; transition: box-shadow .3s; }
.hiw-led .sync-node img { width: 30px; height: 30px; }
.hiw-led.core { width: 64px; }
.hiw-led.core .sync-node { width: 58px; height: 58px; margin-top: -4px; }
.hiw-led.core .sync-node img { width: 38px; height: 38px; }
.hiw-led[data-hiw-led] { opacity: .6; }
.hiw-led.is-dest { opacity: 1; }
.hiw-led.is-dest .sync-node { box-shadow: 0 0 0 3px var(--teal-bright), var(--shadow); }
.hiw-led.is-dest small { color: var(--ok-text); font-weight: 600; }
.hiw-out {
  --cc: rgba(20, 184, 166, .5); position: relative; flex: 1 1 0; min-width: 16px; max-width: 44px; height: 2px; margin-top: 24px;
  background: repeating-linear-gradient(90deg, var(--cc) 0 5px, transparent 5px 9px);
}
.hiw-out::after { content: ""; position: absolute; top: -5px; border: 6px solid transparent; }
.hiw-out.l::after { left: -6px; border-right: 8px solid var(--cc); border-left: 0; }
.hiw-out.r::after { right: -6px; border-left: 8px solid var(--cc); border-right: 0; }
.hiw-out[data-state="on"], .hiw-out[data-state="run"] { --cc: var(--teal-bright); height: 3px; }
.hiw-lcap { margin-top: 8px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--graphite); }
.hiw-intro { padding: 0 2px 14px; }
.hiw-k { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hiw-intro-t { margin: 4px 0 10px; font-size: 14px; }
.hiw-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--graphite-2); }
.hiw-legend li { display: flex; align-items: center; gap: 6px; }
.hiw-swatch { width: 22px; border-top: 2px dashed var(--amber); }
.hiw-foot { padding-top: 14px; }
.hiw-foot .illus { margin-top: 8px; font-size: 11.5px; color: var(--muted); font-style: italic; }
.hiw-stmt {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--teal); border-radius: var(--radius); font-size: 15px; font-weight: 600; color: var(--ink);
}
.hiw-stmt .icon { color: var(--teal); }

/* Connectors: vertical by default; .flow connectors turn horizontal on desktop. */
.hiw-c {
  --cc: #CBD5E1; position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  min-width: 24px; min-height: 30px;
}
.hiw-c[data-c="c2"], .hiw-c[data-c="c4"] { min-height: 34px; }
.hiw-c[data-c="c3"] { min-height: 56px; }
.hiw-c::before { content: ""; position: absolute; left: calc(50% - 1px); width: 2px; top: 0; bottom: 7px; background: var(--cc); }
.hiw-c::after { content: ""; position: absolute; width: 0; height: 0; left: calc(50% - 6px); bottom: 0; border: 6px solid transparent; border-top: 8px solid var(--cc); border-bottom: 0; }
.hiw-c.up::before { top: 7px; bottom: 0; }
.hiw-c.up::after { top: 0; bottom: auto; border-top: 0; border-bottom: 8px solid var(--cc); }
.hiw-c[data-state="on"], .hiw-c[data-state="run"] { --cc: var(--teal-bright); }
.hiw-c.amber[data-state="on"], .hiw-c.amber[data-state="run"] { --cc: var(--amber); }
.hiw-c[data-state="run"]::before { background: repeating-linear-gradient(180deg, var(--cc) 0 6px, transparent 6px 10px); background-size: 2px 10px; animation: hiw-dash-v .4s linear infinite; }
.hiw-c.up[data-state="run"]::before { animation-direction: reverse; }
@keyframes hiw-dash-v { to { background-position: 0 10px; } }
@keyframes hiw-dash-h { to { background-position: 10px 0; } }
.hiw-cl {
  position: relative; z-index: 1; max-width: 100%; padding: 1px 7px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); font-size: 10.5px; font-weight: 600; line-height: 1.3; text-align: center; color: var(--muted);
}
.hiw-c[data-state="on"] .hiw-cl, .hiw-c[data-state="run"] .hiw-cl { color: var(--ok-text); border-color: rgba(20, 184, 166, .45); }
.hiw-c.amber .hiw-cl { color: var(--warn-text); border-color: rgba(245, 158, 11, .55); }
.hiw-br { position: relative; z-index: 1; display: grid; align-content: start; padding: 0 0 14px 8px; }
.hiw-brc { display: flex; }
.hiw-brc .hiw-c { flex: 1; min-height: 64px; }
@media (min-width: 1100px) {
  .hiw-br { padding: 0; }
  .hiw-c.flow { align-self: start; margin-top: 21px; min-height: 24px; }
  .hiw-c.flow::before { left: 6px; right: 13px; top: calc(50% - 1px); bottom: auto; width: auto; height: 2px; }
  .hiw-c.flow::after { left: auto; right: 6px; top: calc(50% - 6px); bottom: auto; border: 6px solid transparent; border-left: 8px solid var(--cc); border-right: 0; }
  .hiw-c.flow[data-state="run"]::before { background: repeating-linear-gradient(90deg, var(--cc) 0 6px, transparent 6px 10px); background-size: 10px 2px; animation-name: hiw-dash-h; }
  .hiw-c.flow .hiw-cl { position: absolute; top: calc(50% + 8px); left: 2px; right: 2px; }
}

/* Travelling document symbol */
.hiw-token {
  position: absolute; left: 0; top: 0; z-index: 5; width: 30px; height: 30px; border-radius: var(--radius-lg);
  display: grid; place-items: center; background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(10, 92, 84, .35);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.hiw-token.on { opacity: 1; }
.hiw-token .icon { width: 16px; height: 16px; }
.hiw[data-mode="paused"] .hiw-c[data-state="run"]::before { animation-play-state: paused; }

@media (max-width: 640px) {
  .hiw { padding: 14px; }
  .hiw-bar, .hiw-ctrl, .hiw-dest { width: 100%; }
  .hiw-ctrl .btn { flex: 1 1 auto; }
  .hiw-cap-body { grid-template-columns: minmax(0, 1fr); }
  .hiw-feed { height: 18px; width: 2px; margin: 0 auto 6px; }
  .hiw-feed::after { right: auto; left: -5px; top: auto; bottom: -7px; border: 6px solid transparent; border-top: 8px solid var(--teal-bright); border-bottom: 0; }
  .hiw-stmt { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hiw-ctrl { display: none; }
  .hiw .hiw-hide { opacity: 1; transform: none; }
}
