:root {
  --bg: #faf6f1;
  --card: rgba(255, 253, 250, .78);
  --card-solid: #fffdfa;
  --line: #f0e7dd;
  --line-2: #e6dacd;
  --ink: #1c1712;
  --text: #2a241e;
  --muted: #8c8278;
  --faint: #b5aa9f;
  --orange: #ef7a2e;
  --orange-2: #d9601a;
  --peach: #fde4cf;
  --peach-2: #fbd2b0;
  --teal: #3fb38b;
  --teal-2: #7ad8b4;
  --teal-soft: #e3f6ee;
  --red: #c9503f;
  --red-soft: #fbe7e2;
  --amber: #f2a23a;
  --amber-soft: #fdf0dc;
  --blue: #4c8fd6;
  --gap: 16px;
  --r: 22px;
  --sans: Outfit, ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --soft-shadow: 0 1px 2px rgba(60, 40, 20, .04), 0 10px 30px -18px rgba(120, 70, 30, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(253, 222, 196, .7), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(252, 214, 186, .55), transparent 60%),
    radial-gradient(600px 400px at 70% 10%, rgba(255, 240, 226, .9), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12.5px; color: var(--muted); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120, 80, 40, .14); border-radius: 8px; }

/* ── Header ─────────────────────────────────────────────── */
.top { height: 72px; padding: 0 32px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(160deg, #f68d45, var(--orange-2)); color: #fff;
  box-shadow: 0 8px 18px -6px rgba(217, 96, 26, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.logo svg { width: 19px; height: 19px; }
.brand-name { font-weight: 600; font-size: 19px; letter-spacing: -.01em; color: var(--ink); display: inline-flex; align-items: baseline; gap: 8px; }
.brand-name small { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--muted); }

.seg { position: relative; display: flex; padding: 5px; border-radius: 14px; background: rgba(236, 228, 219, .7); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 8px 20px; border-radius: 10px; font-size: 14.5px; color: var(--muted); transition: color .25s; }
.seg button.active { color: var(--ink); }
.seg-thumb { position: absolute; top: 5px; bottom: 5px; left: 0; border-radius: 10px; background: #e3d9cd; transition: transform .45s var(--spring), width .45s var(--spring); }

.top-right { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.live-ind { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--teal); margin-right: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse 2s infinite; }
.live-ind.off { color: var(--faint); }
.live-ind.off .live-dot { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 179, 139, .45); } 70% { box-shadow: 0 0 0 7px rgba(63, 179, 139, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 179, 139, 0); } }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  border: 0; background: rgba(236, 228, 219, .7); color: var(--ink); transition: background .2s, transform .15s;
}
.icon-btn:hover { background: #e3d9cd; }
.icon-btn:active { transform: scale(.95); }

.icon-btn svg { width: 18px; height: 18px; }
.badge-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px #f1e9e0; font-size: 0; }
.badge-dot:empty { display: none; }

/* ── Intro ──────────────────────────────────────────────── */
.page { height: calc(100vh - 72px); padding: 6px 32px 28px; display: flex; flex-direction: column; gap: 22px; }
.intro { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.intro h1 { margin: 0; font-size: 46px; font-weight: 500; letter-spacing: -.025em; line-height: 1.05; color: var(--ink); }
.intro p { margin: 8px 0 0; font-size: 16px; color: var(--muted); font-weight: 400; }
.intro-actions { display: flex; gap: 10px; }
.intro > div:first-child { min-width: 0; }
.soft-btn, .dark-btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 20px; border-radius: 14px;
  font-size: 15px; font-weight: 500; border: 0; transition: transform .2s var(--spring), background .2s, box-shadow .2s;
}
.soft-btn { background: rgba(236, 228, 219, .7); color: var(--ink); }
.soft-btn:hover { background: #e3d9cd; }
.dark-btn { background: var(--ink); color: #fff; box-shadow: 0 14px 28px -12px rgba(28, 23, 18, .6); }
.dark-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(28, 23, 18, .65); }
.dark-btn:disabled { cursor: progress; transform: none; opacity: .88; }
/* While the attack runs, the key icon becomes a spinner. */
.dark-btn.busy svg { visibility: hidden; position: relative; }
.dark-btn.busy { position: relative; }
.dark-btn.busy::before {
  content: ""; position: absolute; left: 21px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .7s linear infinite;
}
.soft-btn svg, .dark-btn svg { width: 18px; height: 18px; }
.pp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: blink 1.6s infinite; }
.phone-pill.on { cursor: default; }
.phone-pill.on .pp-dot { background: var(--teal); animation: pulse 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ── Grid ───────────────────────────────────────────────── */
.grid {
  flex: 1; min-height: 0;
  display: grid; gap: var(--gap);
  grid-template-columns: 264px 264px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.c-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.c-head h2 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.c-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.arrow { font-size: 18px; color: var(--ink); line-height: 1; }

/* KPI cards */
.kpi .kpi-big { flex: 1; display: flex; align-items: center; padding: 0 22px; font-size: 58px; font-weight: 300; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.hatch-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 22px; }
.hp-k { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hatch { position: relative; height: 54px; border-radius: 12px; background: rgba(236, 228, 219, .45); overflow: hidden; }
.hatch i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 12px;
  transition: width .9s var(--spring);
}
/* The count, so an empty bar reads as zero rather than as loading. */
.hatch-v { position: absolute; right: 12px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hatch.ok i { background: repeating-linear-gradient(135deg, var(--teal) 0 2px, rgba(122, 216, 180, .35) 2px 6px); box-shadow: 0 8px 16px -8px rgba(63, 179, 139, .6); }
.hatch.bad i { background: repeating-linear-gradient(135deg, var(--red) 0 2px, rgba(201, 80, 63, .25) 2px 6px); box-shadow: 0 8px 16px -8px rgba(201, 80, 63, .55); }
.hatch.warn i { background: repeating-linear-gradient(135deg, var(--amber) 0 2px, rgba(242, 162, 58, .28) 2px 6px); box-shadow: 0 8px 16px -8px rgba(242, 162, 58, .6); }
.c-foot { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 18px 22px 20px; font-size: 14.5px; color: var(--muted); }
.c-foot span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-foot b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.bump { animation: bump .55s var(--spring); }
@keyframes bump { 40% { transform: scale(1.12); } }

/* ── Map ────────────────────────────────────────────────── */
.map-card { grid-column: 3; grid-row: 1; }
.legend-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.legend-pill i { width: 18px; border-top: 2px dashed var(--orange); }
.map { position: relative; flex: 1; min-height: 0; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wire { stroke: #e2d6c9; stroke-width: 1.5; fill: none; }
.wire.check { stroke: var(--orange); stroke-dasharray: 3 6; stroke-linecap: round; animation: march 1s linear infinite; opacity: .8; }
/* You and your agent: a firm line, because it's yours. */
.wire.own { stroke: var(--orange); stroke-width: 2.2; stroke-linecap: round; opacity: .55; }
@keyframes march { to { stroke-dashoffset: -18; } }
.trail { fill: none; stroke-width: 3; stroke-linecap: round; opacity: .45; }
.packet { stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 3px 6px currentColor); }
.wire-label {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 12px; color: var(--muted);
  padding: 2px 10px; border-radius: 99px; background: var(--card-solid); border: 1px solid var(--line);
  white-space: nowrap; pointer-events: none;
}
.wire-label.check { color: var(--orange-2); border-color: var(--peach-2); background: #fff5ec; }
.wire-label.own { color: var(--ink); border-color: var(--peach-2); font-weight: 500; }

.node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -27px); display: flex; flex-direction: column; align-items: center; text-align: center; width: 150px; }
.node.top-label { transform: translate(-50%, calc(-100% + 36px)); }
.node-ic {
  position: relative; width: 54px; height: 54px; border-radius: 17px;
  display: grid; place-items: center;
  background: var(--card-solid); border: 1px solid var(--line-2);
  color: var(--c, var(--ink));
  box-shadow: 0 12px 24px -14px rgba(120, 70, 30, .45);
  transition: transform .4s var(--spring), box-shadow .4s, border-color .4s, background .4s;
}
.node-ic svg { width: 24px; height: 24px; }
.node-ic.agent { --c: var(--orange-2); }
.node-ic.shop { --c: #c2477a; }
.node-ic.pay { --c: var(--blue); }
.node-ic.moi {
  --c: #fff; width: 72px; height: 72px; border-radius: 22px; border: 0;
  background: linear-gradient(160deg, #f68d45, var(--orange-2));
  box-shadow: 0 0 0 8px rgba(239, 122, 46, .12), 0 20px 36px -14px rgba(217, 96, 26, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.node-ic.moi svg { width: 32px; height: 32px; }
.orbit { position: absolute; inset: -16px; border-radius: 50%; border: 1.5px dashed rgba(239, 122, 46, .35); animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.node-name { margin-top: 9px; font-weight: 500; font-size: 15px; color: var(--ink); }
.node.top-label .node-name { margin-top: 0; }
.node-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; transition: color .3s; }
.node.top-label .node-sub { margin-bottom: 18px; }
.node-sub.ok { color: var(--teal); }
.node-sub.bad { color: var(--red); }
.node-sub.live { color: var(--orange-2); }
.node.flash-ok .node-ic { border-color: var(--teal); box-shadow: 0 0 0 6px rgba(63, 179, 139, .16), 0 14px 26px -12px rgba(63, 179, 139, .7); transform: scale(1.08); }
.node.flash-bad .node-ic { border-color: var(--red); box-shadow: 0 0 0 6px rgba(201, 80, 63, .16), 0 14px 26px -12px rgba(201, 80, 63, .7); transform: scale(1.08); animation: shake .45s; }
.node.flash-moi .node-ic { box-shadow: 0 0 0 10px rgba(239, 122, 46, .25), 0 0 0 22px rgba(239, 122, 46, .1), 0 20px 36px -14px rgba(217, 96, 26, .7); transform: scale(1.06); }
.node.waiting .node-ic::after { content: ""; position: absolute; inset: -8px; border-radius: 22px; border: 2px solid var(--orange); animation: ring 1.4s var(--ease) infinite; }
@keyframes ring { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.35); } }
.node.intruder .node-ic { --c: var(--red); border-color: var(--red); background: var(--red-soft); }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -5px; } 40% { translate: 5px; } 60% { translate: -3px; } 80% { translate: 3px; } }

.verdict {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 8px; white-space: nowrap; animation: pop .45s var(--spring);
}
.node.top-label .verdict { bottom: auto; top: 50%; left: calc(100% + 22px); transform: translateY(-50%); animation: popSide .45s var(--spring); }
.verdict.ok { background: var(--teal); color: #fff; }
.verdict.bad { background: var(--red); color: #fff; }
.verdict.out { opacity: 0; transition: opacity .3s; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.7); } }
@keyframes popL { from { opacity: 0; transform: translate(8px, -50%) scale(.7); } }
@keyframes popSide { from { opacity: 0; transform: translate(-8px, -50%) scale(.7); } }

/* The moment: a dark tooltip, like a chart's highlighted value */
.moment {
  position: absolute; right: 22px; top: 6px; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 12px; border-radius: 14px;
  background: var(--ink); color: #fff;
  box-shadow: 0 24px 40px -16px rgba(28, 23, 18, .6);
  animation: momentIn .55s var(--spring);
}
.moment.out { animation: momentOut .35s var(--ease) forwards; }
@keyframes momentIn { from { opacity: 0; transform: translateY(10px) scale(.9); } }
@keyframes momentOut { to { opacity: 0; transform: scale(.94); } }
.m-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.ok > .m-ic { background: var(--teal); }
.bad > .m-ic { background: var(--red); }
.m-ic svg { width: 20px; height: 20px; }
.m-ic path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s var(--ease) .2s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
.m-k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.m-t { font-size: 22px; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; }
.m-s { font-size: 12.5px; color: rgba(255, 255, 255, .6); }

.market { flex: none; display: flex; gap: 8px; padding: 0 22px 18px; justify-content: center; overflow-x: auto; }
.market-btn { flex: none; white-space: nowrap; }
body.flow-2 .grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); }
body.flow-2 .map-card, body.flow-2 .feed-card { grid-column: 2; }
body.flow-2 .perm-card { grid-column: 1; }
body.flow-2 .kpi { display: none; }

/* ── Flow 2: the market ─────────────────────────────────── */
.market-card { display: none; grid-column: 1; grid-row: 1; }
body.flow-2 .market-card { display: flex; }
.mk-tools { display: flex; gap: 6px; flex: none; }
.mk-tool {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; white-space: nowrap;
  border: 1px solid var(--line-2); background: rgba(255, 252, 248, .8); font-size: 13px; color: var(--ink);
  transition: transform .2s var(--spring), background .2s, color .2s, border-color .2s;
}
.mk-tool svg { width: 15px; height: 15px; color: var(--amber); }
.mk-tool:hover { transform: translateY(-1px); background: #fff; }
.mk-tool.on { background: #fdecea; border-color: #f2b8ae; color: var(--red); }
.mk-tool.on svg { color: var(--red); }
.mk-tool.danger svg { color: var(--red); }
.mk-tool.icon { padding: 0 9px; }
.mk-tool.icon svg { color: var(--muted); }
.mk-tool:disabled { cursor: progress; opacity: .85; transform: none; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(28, 23, 18, .15); border-top-color: var(--orange); animation: spin .7s linear infinite; flex: none; }
.lst-pub .spin { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }

.listings { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.lst {
  position: relative; display: grid; grid-template-columns: 158px minmax(0, 1fr) 58px 92px 78px; grid-template-areas: "id slide spark price pub" "scam scam scam scam scam";
  align-items: center; column-gap: 14px; row-gap: 0; padding: 8px 10px 8px 14px; flex: none; border-radius: 14px; background: rgba(247, 240, 232, .55); border: 1px solid transparent;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.lst.dirty { background: #fff7ef; border-color: var(--peach-2); box-shadow: 0 10px 22px -16px rgba(217, 96, 26, .6); }
.lst.scam { background: #fff1ee; border-color: #f4c4ba; animation: shake .5s; }
.lst-id { grid-area: id; display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; min-width: 0; white-space: nowrap; }
.lst-id b { grid-column: 1 / -1; }
.lst-id b { font-size: 15px; font-weight: 500; color: var(--ink); }
.lst-id span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.lst-tag { justify-self: start; font-style: normal; font-size: 10.5px; padding: 0 6px; line-height: 16px; border-radius: 99px; background: rgba(236, 228, 219, .8); color: var(--muted); }
.lst-tag.ok { background: rgba(63, 179, 139, .14); color: #23855f; }
.spark { grid-area: spark; width: 58px; height: 22px; overflow: visible; }
.spark polyline { fill: none; stroke: #c7b8a8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: #c7b8a8; }
.spark.down polyline { stroke: var(--teal); } .spark.down circle { fill: var(--teal); }
.spark.up polyline { stroke: var(--red); } .spark.up circle { fill: var(--red); }
.lst-price { grid-area: price; text-align: right; }
.lst-price b { font-size: 19px; font-weight: 400; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; transition: color .2s; }
.lst.dirty .lst-price b { color: var(--orange-2); }
.lst-slide { grid-area: slide; position: relative; height: 34px; display: flex; align-items: flex-end; padding-bottom: 2px; }
.lst-slide input { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; position: relative; z-index: 1; }
.lst-slide input::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--orange) 0 var(--p), #e9ddd0 var(--p) 100%); }
.lst-slide input::-moz-range-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--orange) 0 var(--p), #e9ddd0 var(--p) 100%); }
.lst-slide input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: #fff; border: 2px solid var(--orange); box-shadow: 0 4px 10px -3px rgba(217, 96, 26, .6); transition: transform .2s var(--spring); }
.lst-slide input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--orange); }
.lst-slide input:active::-webkit-slider-thumb { transform: scale(1.25); }
.lst-mark { position: absolute; top: 14px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--teal); border-radius: 2px; z-index: 0; }
.lst-mark em { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 1px); font-style: normal; font-size: 10.5px; white-space: nowrap; color: #23855f; }
.lst-pub {
  grid-area: pub; height: 30px; border: 0; border-radius: 9px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink); color: #fff; transition: transform .2s var(--spring), opacity .2s, background .2s;
}
.lst-pub:disabled { background: rgba(236, 228, 219, .8); color: #b3a596; cursor: default; }
.lst-pub:not(:disabled):hover { transform: translateY(-1px); }
.lst-pub.busy { cursor: progress; background: var(--orange-2); color: #fff; }
.lst-scam { grid-area: scam; display: flex; align-items: flex-start; gap: 7px; margin-top: 6px; padding: 7px 10px; border-radius: 10px; background: rgba(201, 80, 63, .1); color: var(--red); font-size: 12.5px; line-height: 1.35; }
.lst-scam svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.lst-scam q { font-style: italic; }

/* ── Flow 2: the agent, thinking ────────────────────────── */
.think { display: none; flex: none; margin: 0 16px 14px; padding: 11px 14px 12px; border-radius: 14px; background: rgba(247, 240, 232, .65); border: 1px solid var(--line); }
body.flow-2 .think { display: block; }
.th-head { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14px; }
.th-head b { font-weight: 500; color: var(--ink); white-space: nowrap; }
.th-dot { width: 8px; height: 8px; border-radius: 50%; background: #c7b8a8; flex: none; }
.think[data-state=woke] .th-dot, .think[data-state=running] .th-dot { background: var(--orange); animation: pulse 1.2s infinite; }
.think[data-state=done] .th-dot { background: var(--teal); }
.think[data-state=blocked] .th-dot { background: var(--red); }
.think[data-state=blocked] .th-head b { color: var(--red); }
.th-notice { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-runs { flex: none; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--orange); color: #fff; }
.th-runs:empty { display: none; }
.th-steps { display: flex; gap: 5px; margin-top: 9px; }
.th-step { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 9px; font-size: 12px; color: #a39484; background: rgba(255, 252, 248, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .3s, color .3s; }
.th-step i { flex: none; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-style: normal; font-size: 10.5px; background: #ece4db; color: #a39484; }
.th-step i svg { width: 10px; height: 10px; }
.th-step.active { color: var(--orange-2); background: #fff3e8; }
.th-step.active i { background: var(--orange); color: #fff; animation: pulse 1.2s infinite; }
.th-step.ok { color: var(--ink); }
.th-step.ok i { background: var(--teal); color: #fff; }
.th-step.bad { color: var(--red); background: #fdecea; }
.th-step.bad i { background: var(--red); color: #fff; animation: shake .45s; }
.th-step.skip { opacity: .45; }

/* ── Flow 2: the score, in the feed's header ────────────── */
.score { display: none; gap: 6px; flex: none; }
body.flow-2 .score { display: inline-flex; }
body.flow-2 .tl-legend { display: none; }
.sc { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 99px; font-size: 13px; white-space: nowrap; }
.sc b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sc.bad { background: #fdecea; color: var(--red); }
.sc.warn { background: #fff3e2; color: #b56d10; }
body.flow-2 .node[data-node=you], body.flow-2 .node[data-node=moi] { top: 33% !important; }
body.flow-2 .node[data-node=agent], body.flow-2 .node[data-node=shop], body.flow-2 .node[data-node=pay] { top: 72% !important; }
body.flow-2 .map-card .c-head p { display: none; }
/* Flow 2's map is taller, so the permission card is denser. */
body.flow-2 .cred-slot { padding: 10px 22px 16px; }
body.flow-2 .cred { gap: 5px; }
body.flow-2 .cr-who { margin-bottom: 2px; }
body.flow-2 .cr-who .avatar, body.flow-2 .cr-who [class*="av"] { transform: scale(.88); }
body.flow-2 .row-bar { height: 31px; font-size: 14px; }
body.flow-2 .cr-btn { height: 38px; }
.market-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 11px; border-radius: 11px;
  border: 1px solid var(--peach-2); background: #fff5ec; font-size: 13.5px; color: var(--ink);
  transition: transform .2s var(--spring), background .2s;
}
.market-btn svg { width: 14px; height: 14px; color: var(--orange); }
.market-btn:hover { transform: translateY(-2px); background: var(--peach); }
.market-btn.firing { background: var(--orange); border-color: var(--orange); color: #fff; }
.market-btn.firing svg { color: #fff; }
.market-btn.reset { padding: 0 11px; background: transparent; border-color: var(--line-2); }
.market-btn.reset svg { color: var(--muted); }

/* ── Permission (the warm card) ─────────────────────────── */
.perm-card {
  grid-column: 1 / 3; grid-row: 2;
  background: linear-gradient(160deg, rgba(252, 215, 186, .9), rgba(251, 228, 208, .75) 60%, rgba(253, 240, 228, .8));
  border-color: rgba(246, 196, 158, .6);
}
.perm-card .c-head p { color: #a0785c; }
.more-btn { border: 0; background: rgba(255, 255, 255, .5); border-radius: 10px; padding: 6px 12px; font-size: 13px; color: var(--ink); }
.more-btn:hover { background: rgba(255, 255, 255, .8); }
.cred-slot { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 22px 20px; overflow-y: auto; }
.cred { position: relative; display: flex; flex-direction: column; gap: 6px; flex: 1; animation: credIn .6s var(--spring); }
@keyframes credIn { from { opacity: 0; transform: translateY(12px); } }
.cr-who { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.cr-who .w { flex: 1; min-width: 0; }
.cr-name { font-size: 17px; font-weight: 500; color: var(--ink); }
.cr-ctx { font-size: 13.5px; color: #a0785c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: 99px; }
.state-pill.live { background: var(--teal-soft); color: #1f8a63; }
.state-pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: pulse 2s infinite; }
.state-pill.revoked { background: var(--red-soft); color: var(--red); }
.state-pill.expired { background: rgba(255, 255, 255, .6); color: var(--muted); }

.row-bar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 36px; padding: 0 14px; border-radius: 11px; overflow: hidden; font-size: 14.5px; flex: none;
}
.row-bar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 100%); border-radius: 11px; background: rgba(255, 250, 245, .62); transition: width 1s linear; }
.row-bar > * { position: relative; }
.row-bar span { color: #8f6c52; }
.row-bar b { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.row-bar.time::before { background: linear-gradient(90deg, rgba(255, 255, 255, .85), rgba(255, 250, 245, .6)); }
.row-bar.time.low b { color: var(--red); }
.row-bar .rb-at { font-style: normal; font-weight: 400; color: #8f6c52; }
.row-bar.spent::before { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .9) 0 6px, rgba(255, 244, 232, .75) 6px 12px); transition: width .9s var(--spring); }
.row-bar.spent.full b { color: var(--red); }
.cr-actions { position: sticky; bottom: 0; z-index: 3; display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: auto; padding-top: 6px; }
.cr-btn { height: 42px; border-radius: 12px; border: 0; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; transition: background .2s, transform .2s var(--spring); }
.cr-btn svg { width: 16px; height: 16px; }
.cr-btn.light { background: rgba(255, 252, 248, .75); color: var(--ink); }
.cr-btn.light:hover { background: #fff; }
.cr-btn.dark { background: var(--ink); color: #fff; }
.cr-btn.dark:hover { transform: translateY(-1px); }
.cr-btn:disabled { opacity: .5; cursor: default; }
.av { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff; background: #a8a29e; }
.av.xl { width: 44px; height: 44px; border-radius: 13px; font-size: 18px; box-shadow: 0 8px 16px -8px rgba(120, 70, 30, .5); }
.av.sm { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
.av.interactive { background: linear-gradient(160deg, #f68d45, var(--orange-2)); }
.av.autonomous { background: linear-gradient(160deg, #5cc89f, #2b9a72); }
.av.rogue { background: var(--red); }

.cred.revoked > :not(.seal), .cred.expired > :not(.seal) { opacity: .45; filter: grayscale(.6); }
.seal {
  position: absolute; top: 46%; left: 50%; z-index: 2; transform: translate(-50%, -50%) rotate(-8deg);
  padding: 6px 20px; border-radius: 10px; border: 3px solid currentColor; color: var(--red);
  font-size: 30px; font-weight: 600; letter-spacing: .14em; background: rgba(255, 248, 242, .8);
  animation: stamp .5s var(--spring);
}
.seal.expired { color: var(--muted); }
.cred.shatter { animation: shake .5s; }
@keyframes stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.2); } }


.cred-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; color: #a0785c; font-size: 14.5px; }
.cred-empty .ei { width: 56px; height: 56px; margin-bottom: 10px; border-radius: 17px; display: grid; place-items: center; background: rgba(255, 252, 248, .75); color: var(--orange-2); animation: float 3s ease-in-out infinite; }
.cred-empty .ei svg { width: 24px; height: 24px; }
.cred-empty b { font-size: 18px; font-weight: 500; color: var(--ink); }
@keyframes float { 50% { transform: translateY(-5px); } }

/* ── Decisions ──────────────────────────────────────────── */
.feed-card { grid-column: 3; grid-row: 2; }
.tl-legend { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.tl-legend i { width: 16px; height: 5px; border-radius: 3px; margin-left: 8px; }
.tl-legend i.shop { background: var(--teal); }
.tl-legend i.pay { background: var(--blue); }
.feed { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.drow {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 150px 104px; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 13px; cursor: pointer;
  background: rgba(247, 240, 232, .55);
  transition: background .2s, transform .2s var(--spring);
}
.drow:hover { background: #f4ebe1; transform: translateX(2px); }
.drow.fresh { animation: rowIn .6s var(--spring); }
.drow.fresh.ok { box-shadow: inset 0 0 0 1.5px rgba(63, 179, 139, .5); }
.drow.fresh.bad { box-shadow: inset 0 0 0 1.5px rgba(201, 80, 63, .5); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.d-title { font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-title span { color: var(--muted); }
.chip { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.chip.ok { background: var(--teal-soft); color: #1f8a63; }
.chip.bad { background: var(--red-soft); color: var(--red); }
.strips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.strip { display: flex; gap: 3px; }
.strip i { flex: 1; height: 5px; border-radius: 3px; background: #ebe1d6; transition: background .25s; }
.strip.shop i.pass { background: var(--teal); }
.strip.pay i.pass { background: var(--blue); }
.strip i.fail { background: var(--red); }
.d-amt { text-align: right; font-size: 16px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.drow.bad .d-amt { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(201, 80, 63, .6); }
.feed-empty { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14.5px; }
.feed-empty svg { width: 20px; height: 20px; }

@keyframes fade { from { opacity: 0; } }

/* ── Drawer ─────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(60, 40, 20, .18); backdrop-filter: blur(4px); animation: fade .25s; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 21; width: min(580px, calc(100vw - 24px));
  background: var(--card-solid); border-radius: 26px; box-shadow: 0 40px 80px -20px rgba(80, 50, 20, .35);
  transform: translateX(110%); transition: transform .45s var(--ease);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 8px; }
.drawer-head h3 { margin: 2px 0 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 26px 28px; }
.sec { margin-top: 22px; }
.sec-k { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 104px 1fr; margin: 0; border-radius: 16px; overflow: hidden; background: rgba(247, 240, 232, .6); }
.kv dt, .kv dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid rgba(230, 218, 205, .6); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { word-break: break-all; color: var(--ink); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv a { color: var(--orange-2); }
.code, .json { margin: 0; padding: 16px; border-radius: 16px; background: var(--ink); font: 12px/1.7 var(--mono); color: #e7dfd6; overflow-x: auto; white-space: pre; }
.json { max-height: 380px; overflow: auto; }
.code .ln { display: block; padding: 0 8px; margin: 0 -8px; border-radius: 4px; }
.code .ln.hit-bad { background: rgba(201, 80, 63, .3); box-shadow: inset 2px 0 #f08672; }
.code .ln.hit-ok { background: rgba(63, 179, 139, .12); }
.k { color: #f6a56a; } .s, .js { color: #8fe0bd; } .c { color: #8c8278; } .jk { color: #f6c39a; } .jn { color: #f7d27c; }
.copy-btn { border: 0; background: rgba(236, 228, 219, .8); border-radius: 8px; padding: 3px 10px; font-size: 12.5px; color: var(--ink); }
.tag { display: inline-flex; font-size: 13px; padding: 2px 9px; border-radius: 8px; background: #fff; margin: 2px 4px 2px 0; }
.hero-verdict { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; margin-top: 6px; }
.hero-verdict.ok { background: var(--teal-soft); }
.hero-verdict.bad { background: var(--red-soft); }
.hero-verdict .m-ic { width: 44px; height: 44px; }
.hero-verdict b { display: block; font-size: 18px; font-weight: 500; color: var(--ink); }
.hero-verdict span { font-size: 14px; color: var(--muted); }
.legs-d { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.leg-d { border-radius: 16px; padding: 14px; background: rgba(247, 240, 232, .6); }
.leg-d h4 { margin: 0 0 12px; font-size: 15px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checks li { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.checks i { flex: none; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; }
.checks .pass i { background: var(--teal-soft); color: #1f8a63; }
.checks .fail { color: var(--red); }
.checks .fail i { background: var(--red); color: #fff; }
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: rgba(236, 228, 219, .7); margin: 6px 0 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 10px; font-size: 14px; color: var(--muted); }
.tabs button.active { background: #e3d9cd; color: var(--ink); }
.log-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.log-row.click { cursor: pointer; border-radius: 12px; }
.log-row.click:hover { background: rgba(247, 240, 232, .8); }
.l-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(236, 228, 219, .7); color: var(--muted); }
.l-ic svg { width: 16px; height: 16px; }
.l-ic.grant { background: var(--peach); color: var(--orange-2); }
.l-ic.revoke { background: var(--red-soft); color: var(--red); }
.l-ic.ok { background: var(--teal-soft); color: var(--teal); }
.l-ic.warn { background: var(--amber-soft); color: var(--amber); }
.l-t { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-time { font: 11.5px var(--mono); color: var(--faint); }
.log-empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ── Phone ──────────────────────────────────────────────── */
.phone { position: fixed; right: 40px; bottom: 36px; z-index: 30; animation: phoneIn .6s var(--spring); }
.phone.out { animation: phoneOut .45s var(--ease) forwards; }
@keyframes phoneIn { from { opacity: 0; transform: translateY(60px) rotate(4deg) scale(.92); } }
@keyframes phoneOut { to { opacity: 0; transform: translateY(60px) scale(.92); } }
.phone-body { width: 236px; height: 456px; padding: 9px; border-radius: 42px; background: #1c1712; position: relative; box-shadow: 0 0 0 1.5px #3b332b, 0 40px 80px -20px rgba(60, 35, 15, .55); }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 68px; height: 20px; border-radius: 12px; background: #000; z-index: 2; }
.phone-screen { position: relative; height: 100%; border-radius: 34px; padding: 52px 18px 18px; background: linear-gradient(180deg, #fff7ef, #fdeee0); display: flex; flex-direction: column; overflow: hidden; }
.ps-app { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.ps-logo { width: 18px; height: 18px; border-radius: 6px; background: linear-gradient(160deg, #f68d45, var(--orange-2)); }
.ps-kicker { margin-top: 26px; font-size: 12px; color: var(--orange-2); font-weight: 500; }
.ps-title { margin-top: 4px; font-size: 20px; font-weight: 500; line-height: 1.2; letter-spacing: -.015em; color: var(--ink); }
.ps-detail { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ps-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.ps-btn { display: grid; place-items: center; height: 44px; border-radius: 14px; font-size: 14.5px; font-weight: 500; position: relative; }
.ps-btn.no { background: rgba(236, 228, 219, .9); color: var(--ink); }
.ps-btn.yes { background: var(--ink); color: #fff; }
.tap { position: absolute; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); animation: tap 1.6s ease-out infinite; }
@keyframes tap { from { transform: scale(.5); opacity: 1; } to { transform: scale(2); opacity: 0; } }
.ps-result { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #fff7ef; font-size: 20px; font-weight: 500; color: var(--ink); }
.phone.approved .ps-result, .phone.rejected .ps-result, .phone.failed .ps-result { display: flex; animation: fade .3s; }
.ps-result .big-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 12px; color: #fff; animation: popin .5s var(--spring); }
.ps-result .big-ic svg { width: 34px; height: 34px; }
.phone.approved .big-ic { background: var(--teal); box-shadow: 0 16px 30px -10px rgba(63, 179, 139, .7); }
.phone.rejected .big-ic, .phone.failed .big-ic { background: var(--red); }
@keyframes popin { from { transform: scale(.3); opacity: 0; } }

/* ── QR ─────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(60, 40, 20, .2); backdrop-filter: blur(6px); animation: fade .25s; }
.modal-card { width: 340px; padding: 26px; border-radius: 26px; background: var(--card-solid); box-shadow: 0 40px 80px -20px rgba(80, 50, 20, .35); text-align: center; }
.modal-card h3 { margin: 0 0 16px; font-size: 22px; font-weight: 500; color: var(--ink); }
.qr-box { position: relative; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); overflow: hidden; margin-bottom: 16px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-scan { position: absolute; left: 0; right: 0; height: 44px; background: linear-gradient(180deg, transparent, rgba(239, 122, 46, .25)); border-bottom: 2px solid var(--orange); animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0% { top: -44px; } 100% { top: 100%; } }

/* ── Banner + toasts ────────────────────────────────────── */
.banner {
  position: fixed; top: 14px; left: 50%; z-index: 25; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 22px 8px 8px; border-radius: 18px;
  background: var(--ink); color: #fff; box-shadow: 0 24px 50px -16px rgba(28, 23, 18, .6);
  font-size: 15px; font-weight: 500; animation: island .6s var(--spring);
}
.banner .b-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.banner .b-ic svg { width: 19px; height: 19px; }
.banner.ok .b-ic { background: var(--orange); color: #fff; }
.banner.bad .b-ic { background: var(--red); color: #fff; }
.banner small { display: block; font-weight: 400; font-size: 13px; color: rgba(255, 255, 255, .6); }
@keyframes island { from { opacity: 0; transform: translateX(-50%) scale(.6, .4); } }
.toasts { position: fixed; left: 32px; top: 74px; z-index: 26; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: 14px;
  background: var(--ink); color: #fff; box-shadow: 0 16px 40px -12px rgba(28, 23, 18, .5); font-size: 14px;
  animation: toastIn .45s var(--spring), toastOut .4s var(--ease) 3.6s forwards;
}
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.toast.ok i { background: var(--teal-2); }
.toast.bad i { background: #f08672; }
.toast.moi i { background: var(--orange); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ── Smaller screens ────────────────────────────────────── */
@media (max-width: 1440px) {
  .grid { grid-template-columns: 240px 240px minmax(0, 1fr); }
  .drow { grid-template-columns: 26px minmax(0, 1fr) auto 120px 96px; }
}
@media (max-height: 900px) {
  .top { height: 64px; }
  .page { height: calc(100vh - 64px); gap: 16px; padding-bottom: 20px; }
  .intro h1 { font-size: 34px; }
  .av.xl { width: 38px; height: 38px; }
  .cr-who { margin-bottom: 2px; }
  .intro p { font-size: 15px; margin-top: 4px; }
  .soft-btn, .dark-btn { height: 44px; }
  .c-head { padding: 16px 20px 0; }
  .c-head h2 { font-size: 17.5px; }
  .c-head p { font-size: 13px; }
  .kpi .kpi-big { font-size: 46px; padding: 0 20px; }
  .hatch { height: 42px; }
  .hatch-pair { padding: 0 20px; }
  .c-foot { padding: 14px 20px 16px; }
  .row-bar { height: 31px; font-size: 13.5px; }
  .market { padding-bottom: 14px; }
  .perm-card .c-head p, .feed-card .c-head p { display: none; }
  .perm-card .c-head, .feed-card .c-head { align-items: center; }
  body.flow-2 .row-bar { height: 29px; }
  body.flow-2 .cr-btn { height: 36px; }
  .market-btn { height: 32px; font-size: 12.5px; }
  .cred-slot { padding: 10px 20px 16px; }
  .cr-btn { height: 38px; }
  body.flow-2 .market-card .c-head p { display: none; }
  body.flow-2 .lst { padding: 6px 10px 6px 12px; }
  body.flow-2 .lst-price b { font-size: 17px; }
  .think { margin: 0 14px 12px; padding: 9px 12px 10px; }
  body.flow-2 .node .node-sub { display: none; }
  body.flow-2 .node[data-node=you], body.flow-2 .node[data-node=moi] { top: 31% !important; }
  .th-steps { margin-top: 7px; }
}
/* Laptops with short screens (1280×720, 1366×768): everything still fits without scrolling. */
@media (min-width: 1101px) and (max-height: 820px) {
  .top { height: 58px; }
  .page { height: calc(100vh - 58px); padding-top: 0; padding-bottom: 16px; gap: 12px; }
  .intro h1 { font-size: 28px; }
  .intro p { font-size: 14px; margin-top: 2px; }
  .soft-btn, .dark-btn { height: 40px; font-size: 14px; padding: 0 16px; }
  .dark-btn.busy::before { left: 17px; }
  .map-card .c-head p { display: none; }
  .kpi .kpi-big { font-size: 40px; }
  .hatch { height: 34px; }
  .hp-k { margin-bottom: 6px; }
  .c-foot { padding: 10px 20px 14px; font-size: 13.5px; }
  .cred-slot, body.flow-2 .cred-slot { padding: 8px 20px 12px; }
  .cred, body.flow-2 .cred { gap: 4px; }
  .av.xl { width: 34px; height: 34px; font-size: 15px; border-radius: 11px; }
  .cr-name { font-size: 15.5px; }
  .cr-ctx { font-size: 12.5px; }
  .row-bar, body.flow-2 .row-bar { height: 27px; font-size: 13.5px; }
  .cr-btn, body.flow-2 .cr-btn { height: 34px; font-size: 13.5px; }
  .drow { padding: 7px 12px; }
  .feed { gap: 5px; padding-top: 10px; }
  body.flow-2 .grid { grid-template-rows: minmax(0, 1.12fr) minmax(0, 1fr); }
  .mk-tool { height: 30px; font-size: 12.5px; padding: 0 10px; }
  .think { margin: 0 12px 10px; padding: 8px 11px 9px; }
  .th-step { padding: 4px 6px; }
}
/* Too short even for that: the page scrolls rather than clip anything. */
@media (min-width: 1101px) and (max-height: 640px) {
  body { overflow: auto; }
  .page { height: auto; }
  .grid { grid-template-rows: 290px 290px; }
  body.flow-2 .grid { grid-template-rows: 330px 290px; }
}

/* Tablets: one scrolling page. */
@media (max-width: 1100px) {
  html, body { height: auto; }
  body { overflow-x: hidden; overflow-y: auto; }
  .top { padding: 0 24px; }
  .page { height: auto; padding: 4px 24px 28px; }
  .intro { flex-wrap: wrap; }
  .intro h1 { font-size: 36px; }
  .grid, body.flow-2 .grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .kpi { min-height: 250px; }
  .map-card, body.flow-2 .map-card { grid-column: 1 / -1; grid-row: auto; height: 440px; }
  body.flow-2 .map-card { height: 520px; }
  body.flow-2 .market-card { grid-column: 1 / -1; grid-row: auto; }
  .perm-card, body.flow-2 .perm-card { grid-column: 1; grid-row: auto; min-height: 360px; }
  .feed-card, body.flow-2 .feed-card { grid-column: 2; grid-row: auto; min-height: 360px; max-height: 560px; }
}
@media (max-width: 900px) {
  .perm-card, .feed-card, body.flow-2 .perm-card, body.flow-2 .feed-card { grid-column: 1 / -1; }
}

/* Phones */
@media (max-width: 760px) {
  .top { height: auto; padding: 12px 16px 6px; grid-template-columns: 1fr auto; grid-template-areas: "brand right" "seg seg"; row-gap: 12px; }
  .brand { grid-area: brand; }
  .top-right { grid-area: right; gap: 8px; }
  .seg { grid-area: seg; }
  .seg button { flex: 1; padding: 8px 10px; font-size: 14px; }
  .live-ind { font-size: 0; gap: 0; margin-right: 2px; }
  .page { padding: 6px 16px 24px; gap: 16px; }
  .intro { flex-direction: column; align-items: stretch; gap: 14px; }
  .intro h1 { font-size: 30px; }
  .intro p { font-size: 14.5px; }
  .intro-actions { flex-wrap: wrap; }
  .intro-actions > * { flex: 1 1 150px; justify-content: center; height: 44px; padding: 0 12px; font-size: 14px; }
  .grid, body.flow-2 .grid { gap: 12px; }
  .kpi { min-height: 0; }
  .kpi .c-head p, .kpi .arrow { display: none; }
  .kpi .c-head { padding: 14px 14px 0; }
  .kpi .c-head h2 { font-size: 15.5px; }
  .kpi .kpi-big { font-size: 38px; padding: 6px 14px; }
  .map-card .c-head p, .legend-pill { display: none; }
  .map-card { height: 330px; }
  .cr-name { font-size: 16px; }
  .drow .strips { width: 110px; }
  .hatch-pair { padding: 0 14px; gap: 8px; }
  .hp-k { font-size: 12px; }
  .hatch { height: 28px; }
  .c-foot { padding: 10px 14px 14px; font-size: 12.5px; gap: 8px; }
  .c-head { padding: 16px 16px 0; }
  body.flow-2 .map-card { height: 450px; }
  .cred-slot, body.flow-2 .cred-slot { padding: 10px 16px 16px; }
  .listings, .feed { padding: 10px 10px 12px; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .drawer-head { padding: 18px 18px 6px; }
  .drawer-head h3 { font-size: 22px; }
  .drawer-body { padding: 6px 18px 24px; }
  .legs-d { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 84px 1fr; }
  .phone { right: 8px; bottom: 8px; transform-origin: bottom right; scale: .72; }
  .toasts { left: 16px; right: 16px; top: auto; bottom: 16px; flex-direction: column-reverse; }
  .banner { width: calc(100vw - 24px); }
  .cp-row { grid-template-columns: 1fr auto; }
  .cp-row code { grid-column: 1 / -1; grid-row: 2; }
}

/* Each card adapts to its own width, so the same rules work in every layout. */
.card { container-type: inline-size; }
.market-card .c-head { flex-wrap: wrap; row-gap: 10px; }
.market-card .c-head > div:first-child { flex: 1 1 180px; }
.market-card .c-head h2 { white-space: nowrap; }
.market-card .mk-tools { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }
@container (max-width: 560px) {
  .lst { grid-template-columns: minmax(0, 1fr) auto 78px; grid-template-areas: "id price pub" "slide slide spark" "scam scam scam"; row-gap: 2px; }
  .spark { justify-self: end; }
  .lst-slide { height: 30px; }
  .lst-id { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 2px; }
  .lst-id b { flex-basis: 100%; }
  .lst-id span { overflow: visible; }
}
@container (max-width: 600px) {
  .th-steps { gap: 4px; }
  .th-step { gap: 4px; padding: 4px 5px; font-size: 11px; }
  .th-step i { width: 15px; height: 15px; font-size: 9.5px; }
}
@container (max-width: 720px) {
  .drow { grid-template-columns: 26px minmax(0, 1fr) auto 92px 88px; column-gap: 12px; }
}
@container (max-width: 560px) {
  .drow { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "av title amt" "av chip strips"; row-gap: 7px; column-gap: 12px; }
  .drow > .av { grid-area: av; align-self: start; margin-top: 1px; }
  .drow .d-title { grid-area: title; }
  .drow .chip { grid-area: chip; justify-self: start; }
  .drow .strips { grid-area: strips; width: 132px; justify-self: end; }
  .drow .d-amt { grid-area: amt; }
  .drow .d-title { white-space: normal; line-height: 1.3; }
  .feed-card .c-head { flex-wrap: wrap; row-gap: 8px; }
}
@container (max-width: 480px) {
  .th-head { flex-wrap: wrap; row-gap: 3px; }
  .th-notice { order: 5; flex-basis: 100%; }
  .th-steps { flex-wrap: wrap; }
  .th-step { flex: 1 1 78px; }
}
@container (max-width: 420px) {
  .cr-actions { grid-template-columns: 1fr; }
  .row-bar .rb-at { display: none; }
}

/* The map, when it's small. */
.map.short .node { transform: translate(-50%, -22px); }
.map.short .node.top-label { transform: translate(-50%, calc(-100% + 28px)); }
.map.short .node-ic { width: 44px; height: 44px; border-radius: 14px; }
.map.short .node-ic svg { width: 20px; height: 20px; }
.map.short .node-ic.moi { width: 56px; height: 56px; border-radius: 18px; }
.map.short .node-ic.moi svg { width: 26px; height: 26px; }
.map.short .orbit { inset: -12px; }
.map.short .node-name { margin-top: 5px; font-size: 14px; }
.map.short .node.top-label .node-name { margin-top: 0; }
.map.short .node.top-label .node-sub { margin-bottom: 12px; }
.map.tiny .node { transform: translate(-50%, -20px); }
.map.tiny .node.top-label { transform: translate(-50%, calc(-100% + 25px)); }
.map.tiny .node-ic { width: 40px; height: 40px; border-radius: 13px; }
.map.tiny .node-ic.moi { width: 50px; height: 50px; border-radius: 16px; }
.map.tiny .node-ic.moi svg { width: 23px; height: 23px; }
.map.tiny .orbit { inset: -9px; }
.map.tiny .node-name { margin-top: 3px; font-size: 13px; }
.map.tiny .node-sub { display: none; }
.map.tiny .node.top-label .node-name { margin-bottom: 4px; }
body.flow-2 .map.tiny .node[data-node=you], body.flow-2 .map.tiny .node[data-node=moi] { top: 30% !important; }
body.flow-2 .map.tiny .node[data-node=agent], body.flow-2 .map.tiny .node[data-node=shop], body.flow-2 .map.tiny .node[data-node=pay] { top: 74% !important; }
.map.narrow .node { width: 92px; }
.map.narrow .node-name { font-size: 13px; }
.map.narrow .node-sub { font-size: 11px; white-space: normal; line-height: 1.2; }
.map.narrow .verdict { font-size: 10px; padding: 3px 7px; }
.map.narrow .node[data-node=you], .map.narrow .node[data-node=agent] { left: 15% !important; }
.map.narrow .node[data-node=pay] { left: 85% !important; }
.map.narrow .moment { left: 10px; right: 10px; top: auto; bottom: 6px; padding: 9px 12px 9px 9px; }
.map.narrow .m-t { font-size: 17px; }
.map.narrow .m-ic { width: 32px; height: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.checks .ms { margin-left: auto; padding-left: 10px; font-style: normal; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Flow 2: Scout's Claude routine ─────────────────────── */
.mk-tool.routine svg { color: var(--orange); }
.mk-tool.routine .rt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: blink 1.6s infinite; }
.mk-tool.routine.on { background: rgba(63, 179, 139, .1); border-color: rgba(63, 179, 139, .35); }
.mk-tool.routine.on svg { color: #23855f; }
.mk-tool.routine.on .rt-dot { background: var(--teal); animation: pulse 2s infinite; }
.th-link { flex: none; font-size: 12.5px; color: var(--orange-2); text-decoration: none; padding: 2px 9px; border-radius: 99px; background: #fff3e8; }
.th-link:hover { background: var(--peach); }
.rt-note { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.rt-note b { color: var(--ink); font-weight: 500; }
.cp-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 11px; background: rgba(247, 240, 232, .65); font-size: 13px; }
.cp-row code { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-prompt { position: relative; border-radius: 12px; background: #1c1712; }
.cp-prompt pre { margin: 0; max-height: 170px; overflow: auto; padding: 40px 14px 12px; font: 11.5px/1.5 "JetBrains Mono", monospace; color: #f3e9de; white-space: pre-wrap; }
.cp-prompt .copy-btn { position: absolute; top: 8px; right: 8px; }
.rt-form { display: grid; gap: 10px; }
.rt-form label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.rt-form input { height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff; font: 13px "JetBrains Mono", monospace; color: var(--ink); }
.rt-form input:focus { outline: 2px solid var(--peach-2); border-color: var(--orange); }
.rt-form .cr-btn { justify-self: start; }
.rt-err { font-size: 13px; color: var(--red); }
.rt-ok { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(63, 179, 139, .1); margin-bottom: 14px; }
.rt-ok svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: #23855f; }
.rt-ok b { display: block; font-weight: 500; color: var(--ink); }
.rt-ok span { font-size: 13.5px; color: var(--muted); }
.rt-actions { display: flex; gap: 8px; margin-bottom: 10px; }

/* Wide monitors: the content stops growing and stays centred, like any app. */
@media (min-width: 1921px) {
  .top, .page { max-width: 1920px; margin: 0 auto; }
}

/* Touch screens: sliders and links big enough for a finger. */
@media (pointer: coarse) {
  .lst-slide { height: 38px; }
  .lst-slide input { height: 32px; }
  .lst-slide input::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9.5px; }
  .th-link { padding: 6px 11px; }
}

/* ── Agents: pick which one this tab shows ──────────────── */
.agents-bar { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 14px; }
.agent-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 6px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 252, 248, .7); font-size: 13.5px; color: var(--ink); white-space: nowrap; transition: background .2s, border-color .2s, transform .2s var(--spring); }
.agent-chip:hover { background: #fff; transform: translateY(-1px); }
.agent-chip.on { background: #fff; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239, 122, 46, .14); }
.agent-chip.retired { opacity: .55; }
.agent-chip i { font-style: normal; font-size: 11px; color: var(--muted); }
.agent-chip.add { padding: 0 12px 0 10px; color: var(--muted); border-style: dashed; background: transparent; }
.agent-chip.add svg { width: 15px; height: 15px; }
@media (min-width: 1101px) and (max-height: 820px) {
  .agent-chip { height: 32px; font-size: 13px; }
  /* Short laptop screens: the chips sit beside the title, so the cards below keep their height. */
  .intro > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: center; }
  .intro > div:first-child p { grid-column: 1 / -1; }
  .agents-bar { margin-top: 0; grid-row: 1; grid-column: 2; }
}
@media (max-width: 760px) {
  .agents-bar { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
}

/* ── Autonomous agent card: goal, setup, links ─────────── */
.agent-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 14px 22px 18px; }
.goal { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(247, 240, 232, .6); }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-text { font-size: 15px; color: var(--ink); line-height: 1.45; }
.goal-text b { font-weight: 600; }
.mini { height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.mini:hover { border-color: var(--orange); }
.setup { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.setup li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--ink); counter-increment: s; }
.setup li i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 600; background: #ece4db; color: var(--muted); }
.setup li i::before { content: counter(s); }
.setup li.done i { background: var(--teal); color: #fff; }
.setup li.done i::before { content: none; }
.setup li.done i svg { width: 13px; height: 13px; }
.setup li.done b { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-color: rgba(140, 130, 120, .4); }
.setup b { font-weight: 600; display: block; }
.setup span { display: block; font-size: 13px; color: var(--muted); }
.setup a { color: var(--orange-2); }
.setup q { color: var(--ink); }
.ac-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.ac-links .mk-tool { text-decoration: none; }
.ac-links .mk-tool svg { color: var(--muted); }
.app-link { font-size: 13px; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.app-link:hover { background: rgba(236, 228, 219, .7); color: var(--ink); }
@media (max-width: 1240px) { .app-link { display: none; } }

/* ── Sign in with your wallet ─────────────────────────── */
.signin { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 600px at 0% 0%, rgba(253, 222, 196, .8), transparent 60%), radial-gradient(800px 600px at 100% 100%, rgba(252, 214, 186, .65), transparent 60%), var(--bg); overflow-y: auto; }
.signin-card { width: min(420px, 100%); padding: 32px; border-radius: 28px; background: var(--card-solid); box-shadow: 0 40px 80px -30px rgba(80, 50, 20, .35); border: 1px solid var(--line); text-align: center; }
.logo.big { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 18px; }
.logo.big svg { width: 26px; height: 26px; }
.signin-card h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.si-sub { margin: 6px 0 22px; color: var(--muted); }
.si-qr { position: relative; width: 236px; margin: 0 auto 16px; padding: 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.si-qr img { display: block; width: 100%; height: auto; }
.si-steps { text-align: left; display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: var(--text); }
.si-steps li { display: flex; gap: 10px; align-items: flex-start; }
.si-steps b { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--peach); color: var(--orange-2); font-size: 12px; }
.si-wait { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 6px 0 16px; }
.si-wait .spin { width: 16px; height: 16px; }
.si-err { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 14px; text-align: left; }
.si-actions { display: grid; gap: 10px; }
.si-actions .dark-btn, .si-actions .soft-btn { justify-content: center; width: 100%; text-decoration: none; }
.si-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.si-mobile { display: none; }
@media (pointer: coarse) { .si-mobile { display: inline-flex; } }
