:root {
  color-scheme: light;
  --bg: #f5efe3; --panel: #fffdf8; --ink: #1f2328; --muted: #676b72; --line: #e6dcc8;
  --soft: #f8f5ee; --soft-2: #faf7f0; --row: #f1ebdd; --track: #eee6d6; --chip: #fff; --on-ink: #fff;
  --hl: #fff9db; --hl-line: #fcc419; --tag: #fff3bf; --tag-line: #ffe066;
  --warn: #fff4e6; --warn-line: #ffc078; --ok: #ebfbee; --ok-line: #b2f2bb; --think: #f3f0ff; --biz: #f1f8ff;
  --good: #2b8a3e; --bad: #c92a2a; --code: #212529; --code-ink: #e9ecef;
  --red: #d9480f; --red-soft: rgba(217, 72, 15, .22); --blue: #1864ab; --blue-soft: rgba(28, 126, 214, .30);
  --plains: #efe5cc; --forest: #d3e3b8; --mountain: #d9cfc2; --river: #c5e3f3; --grid: rgba(0, 0, 0, .06);
  --g-forest: #74a152; --g-mountain: #9c8f80; --g-river: #74b9dc; --fort-line: #3b3b3b; --neutral: #adb5bd;
  --agent: #6741d9; --n8n: #c2255c; --oracle: #0b7285; --chain: #2b8a3e; --game: #495057; --weather: #1c7ed6;
  --st-ok: #d3f9d8; --st-wait: #fff3bf; --st-wait-ink: #946800; --st-bad: #ffe3e3;
  --radius: 10px; --gap: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121417; --panel: #1b1e23; --ink: #e9e7e2; --muted: #9da3ab; --line: #2d3238;
    --soft: #22262c; --soft-2: #1f2328; --row: #262a31; --track: #2d3238; --chip: #22262c; --on-ink: #121417;
    --hl: #3a3218; --hl-line: #d4a72c; --tag: #3a3218; --tag-line: #6b5a1e;
    --warn: #3a2a17; --warn-line: #8a5a1e; --ok: #15301c; --ok-line: #2f6b3d; --think: #262238; --biz: #16243a;
    --good: #51cf66; --bad: #ff6b6b; --code: #0c0e11; --code-ink: #e9ecef;
    --red: #e8590c; --red-soft: rgba(247, 103, 7, .30); --blue: #3d8fd9; --blue-soft: rgba(77, 171, 247, .28);
    --plains: #34312a; --forest: #2b3a26; --mountain: #3b3631; --river: #1d3544; --grid: rgba(255, 255, 255, .05);
    --g-forest: #6f9a52; --g-mountain: #8f8374; --g-river: #4f94b8; --fort-line: #0c0e11; --neutral: #6c757d;
    --st-ok: #15301c; --st-wait: #3a3218; --st-wait-ink: #f2c94c; --st-bad: #3b1a1a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417; --panel: #1b1e23; --ink: #e9e7e2; --muted: #9da3ab; --line: #2d3238;
  --soft: #22262c; --soft-2: #1f2328; --row: #262a31; --track: #2d3238; --chip: #22262c; --on-ink: #121417;
  --hl: #3a3218; --hl-line: #d4a72c; --tag: #3a3218; --tag-line: #6b5a1e;
  --warn: #3a2a17; --warn-line: #8a5a1e; --ok: #15301c; --ok-line: #2f6b3d; --think: #262238; --biz: #16243a;
  --good: #51cf66; --bad: #ff6b6b; --code: #0c0e11; --code-ink: #e9ecef;
  --red: #e8590c; --red-soft: rgba(247, 103, 7, .30); --blue: #3d8fd9; --blue-soft: rgba(77, 171, 247, .28);
  --plains: #34312a; --forest: #2b3a26; --mountain: #3b3631; --river: #1d3544; --grid: rgba(255, 255, 255, .05);
  --g-forest: #6f9a52; --g-mountain: #8f8374; --g-river: #4f94b8; --fort-line: #0c0e11; --neutral: #6c757d;
  --st-ok: #15301c; --st-wait: #3a3218; --st-wait-ink: #f2c94c; --st-bad: #3b1a1a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
a { color: var(--blue); }
.muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }

.top { padding: 10px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; max-width: 1440px; margin: 0 auto; }
.top .counters { flex-basis: 100%; }
.brand { max-width: 470px; }
.brand h1 { font-size: 1.35rem; letter-spacing: -.01em; }
.thesis { margin: 2px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.35; }
#theme.icon { padding: 5px 9px; }
.status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { font: inherit; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
button.pill:enabled { cursor: pointer; background: var(--hl); border-color: var(--hl-line); font-weight: 600; }
button.pill:empty { display: none; }
.see-as { display: inline-flex; }
.see-as .btn { border-radius: 0; } .see-as .btn:first-child { border-radius: 8px 0 0 8px; } .see-as .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.see-as .btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
#site { font-weight: 600; }
.pill.live { border-color: var(--good); color: var(--good); }
.pill.down { border-color: var(--bad); color: var(--bad); }
.pill.tag { background: var(--tag); border-color: var(--tag-line); }
.pill.warn { background: var(--warn); border-color: var(--warn-line); }
.btn { font: inherit; font-size: .85rem; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); padding: 8px 18px; }
a.btn { text-decoration: none; display: inline-block; }
.counters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.counters div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; min-width: 110px; }
.counters dt { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.counters dd { margin: 0; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }

/* timeline: drag through the whole season; Live snaps back to real time */
.timeline { position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.timeline > div { max-width: 1280px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.timeline input[type="range"] { flex: 1 1 280px; min-width: 180px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.tl-label { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 16em; }
.tl-speed { display: inline-flex; gap: 4px; }
.tl-speed .btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
#tl-live.on { background: var(--good); border-color: var(--good); color: var(--on-ink); font-weight: 650; }

/* two views, one page: simple by default, the full dashboard under "Nerd view" */
:root:not([data-view="nerd"]) .nerd-only, :root[data-view="nerd"] .simple-only { display: none !important; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; }
.panel-head .hint { font-size: .8rem; margin-bottom: 10px; }

/* simple view: the tech on top, then the game, all on one screen on a laptop */
.simple { display: grid; gap: 12px; padding: 0 16px 16px; max-width: 1440px; margin: 0 auto; align-items: start;
  grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "map story score" "map story moments"; }
.simple .board { grid-area: map; } .narrator { grid-area: story; } .score { grid-area: score; } .moments { grid-area: moments; }
.simple .panel { padding: 12px; }
.simple { --map: clamp(320px, min(calc(100vh - var(--game-top, 240px) - 62px), 46vw), 760px); } /* tall screens: leave room for the story and score */
.simple .board svg { height: var(--map); width: auto; aspect-ratio: 1; }
.simple .legend { max-width: var(--map); margin-top: 6px; }
@media (max-width: 1180px) { .simple { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "map story" "map score" "moments moments"; } }
@media (max-width: 820px) {
  .simple { grid-template-columns: minmax(0, 1fr); grid-template-areas: "story" "map" "score" "moments"; }
  .simple .board svg { height: auto; width: 100%; } .simple .legend { max-width: none; }
}

.narrator { border-left: 5px solid var(--hl-line); }
.n-big { font-size: 1rem; margin: 0 0 8px; }
.n-big strong { display: block; font-size: 1.2rem; margin-bottom: 2px; }
.n-when { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.n-lines { margin: 0; font-size: .95rem; }
.n-quote { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--think); }
.n-quote p { margin: 0; font-style: italic; overflow-wrap: anywhere; }
.n-quote cite { display: block; margin-top: 2px; font-size: .78rem; font-style: normal; color: var(--muted); }
.n-next { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.n-next:empty { display: none; }

/* ask a general */
.ask { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.ask h3 { font-size: .95rem; margin-right: 4px; }
.ask-who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-who .btn { font-size: .8rem; padding: 3px 10px; }
.ask-who .btn[aria-pressed="true"] { background: var(--agent); border-color: var(--agent); color: #fff; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--think); color: var(--ink); cursor: pointer; }
.chip:hover, .chip:focus-visible { border-color: var(--agent); }
.ask-row { display: flex; gap: 6px; }
.ask-row input { flex: 1; min-width: 0; font: inherit; font-size: .9rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.ask-row .btn.primary { padding: 6px 16px; }
.ask-row .btn:disabled { opacity: .6; cursor: wait; }
.ask-out { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--think); font-size: .92rem; overflow-wrap: anywhere; }
.ask-out small { display: block; margin-top: 4px; font-size: .75rem; color: var(--muted); }

/* the free plan and book a meeting: always one click away on the right edge (floating pills on phones) */
.cta-rail { position: fixed; right: 0; top: 50%; z-index: 6; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.cta { writing-mode: vertical-rl; rotate: 180deg; padding: 14px 8px; border: 0; border-radius: 0 10px 10px 0; font: inherit; font-weight: 700; font-size: .88rem;
  color: #fff; text-decoration: none; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); background: var(--agent); }
.cta.plan-open { background: linear-gradient(180deg, #e8590c, #c2255c); }
.cta:hover, .cta:focus-visible { padding-left: 12px; }
.cta[hidden] { display: none; }
@media (min-width: 821px) and (max-width: 1540px) { body { padding-right: 38px; } }
@media (max-width: 820px) {
  .cta-rail { top: auto; bottom: 12px; right: 12px; transform: none; flex-direction: row; }
  .cta { writing-mode: horizontal-tb; rotate: none; border-radius: 999px; padding: 9px 14px; font-size: .85rem; white-space: nowrap; }
  .cta .long { display: none; }
}

/* the plan dialog */
#plan { width: min(760px, calc(100vw - 32px)); }
#plan h2 { font-size: 1.3rem; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0 40px 6px 0; }
#plan > p { margin: 0 0 12px; }
.plan-x { position: absolute; top: 14px; right: 14px; }
.plan-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.plan-picks .chip { font-size: .9rem; padding: 5px 12px; }
#plan-text { width: 100%; font: inherit; font-size: .95rem; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); resize: vertical; }
.plan-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.plan-row .btn:disabled { opacity: .6; cursor: wait; }
#plan-out:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan-result h3 { font-size: 1.1rem; margin-bottom: 4px; }
.plan-result > p { margin: 8px 0; }
.plan-steps { margin: 10px 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: step; }
.plan-steps li { padding: 10px 12px 10px 44px; border-radius: var(--radius); background: var(--soft); position: relative; counter-increment: step; }
.plan-steps li::before { content: counter(step); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.plan-steps p { margin: 4px 0 0; font-size: .92rem; }
.plan-steps .lbl { display: inline-block; min-width: 5.6em; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.plan-tech { display: flex; flex-wrap: wrap; gap: 4px; }
.tchip { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--c, var(--game)); }
.plan-care { padding: 8px 10px; border-radius: 8px; background: var(--ok); border: 1px solid var(--ok-line); font-size: .9rem; }
.plan-cta { margin: 14px 0 6px; position: sticky; bottom: -22px; padding: 10px 0; background: var(--panel); } /* the call to action stays in view while the plan scrolls */
.plan-note { padding: 10px 12px; border-radius: 8px; background: var(--warn); border: 1px solid var(--warn-line); }

.tug { display: flex; gap: 4px; height: 22px; }
.tug i { flex: 1; border-radius: 5px; background: var(--neutral); }
.tug i.o-red { background: var(--red); } .tug i.o-blue { background: var(--blue); }
.tug-legend { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 2px; font-size: .92rem; }
.tug-legend .red, .side.red h3 { color: var(--red); } .tug-legend .blue, .side.blue h3 { color: var(--blue); }
.goal { font-size: .8rem; margin: 0 0 8px; }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.side { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; border-top: 4px solid; }
.side.red { border-top-color: var(--red); } .side.blue { border-top-color: var(--blue); }
.side h3 { font-size: 1rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.side > p { margin: 2px 0 6px; font-size: .78rem; }
.to-move { font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--hl); border: 1px solid var(--hl-line); color: var(--ink); }
.side dl { margin: 0; display: grid; gap: 4px; }
.side dl > div { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.side dt { font-size: .75rem; color: var(--muted); min-width: 4.2em; }
.side dd { margin: 0; flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.side .low { color: var(--bad); font-size: .75rem; text-transform: uppercase; }
.side .up { color: var(--good); } .side .down { color: var(--bad); }
.side .bar { display: block; }

/* the tech strip: six pieces of tech, what each does, and what each just did. The current step lights up. */
.tech { max-width: 1440px; margin: 0 auto 10px; padding: 0 16px; }
#flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
#flow li { position: relative; display: grid; align-content: start; gap: 0; padding: 6px 9px; border-radius: var(--radius); border: 1px solid var(--line); border-top: 4px solid var(--c); background: var(--panel); transition: background .3s, box-shadow .3s; min-width: 0; }
#flow li:not(:last-child)::after { content: '›'; position: absolute; right: -9px; top: 10px; font-weight: 800; color: var(--muted); }
#flow li.now { background: var(--hl); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl-line) 35%, transparent); }
#flow .head { display: flex; gap: 6px; align-items: center; }
#flow .ic { font-size: 1.1rem; line-height: 1; }
#flow b { font-size: .92rem; }
#flow .tech { font-size: .72rem; font-weight: 700; color: var(--c); }
#flow .does, #flow .for-you { font-size: .76rem; color: var(--muted); line-height: 1.3; }
:root:not([data-lens="biz"]) #flow .for-you, :root[data-lens="biz"] #flow .does { display: none; }
:root[data-lens="biz"] #flow .for-you { color: var(--ink); }
#flow .now-txt { font-size: .8rem; margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.st-event { --c: var(--game); } .st-n8n { --c: var(--n8n); } .st-agent { --c: var(--agent); } .st-chain { --c: var(--chain); } .st-oracle { --c: var(--oracle); } .st-weather { --c: var(--weather); }
@media (max-width: 1100px) { #flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } #flow li::after { display: none; } }
@media (max-width: 560px) { #flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } #flow .does, #flow .for-you { display: none !important; } }

#moments { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#moments button { font: inherit; font-size: .88rem; width: 100%; display: flex; gap: 8px; align-items: baseline; text-align: left; padding: 5px 8px; border-radius: 8px; border: 1px solid transparent; background: var(--soft); color: var(--ink); cursor: pointer; }
#moments button:hover, #moments button:focus-visible { border-color: var(--muted); }
#moments .when { flex: none; min-width: 5.2em; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
#moments .more { grid-column: 1 / -1; font-size: .85rem; }

.grid { display: grid; gap: var(--gap); padding: 0 16px 16px; max-width: 1280px; margin: 0 auto; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.pipeline, .kingdoms, .proof { grid-column: 1 / -1; }
@media (max-width: 820px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* map */
.board svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.t { stroke: var(--grid); stroke-width: 1; }
.t-plains, .t-fort, .t-capital { fill: var(--plains); }
.t-forest { fill: var(--forest); } .t-mountain { fill: var(--mountain); } .t-river { fill: var(--river); }
.g-forest { fill: var(--g-forest); } .g-mountain { fill: var(--g-mountain); } .g-river { fill: none; stroke: var(--g-river); stroke-width: 2; }
.own-red { fill: var(--red-soft); } .own-blue { fill: var(--blue-soft); }
.fort { stroke: var(--fort-line); stroke-width: 1.5; }
.fort.o-red { fill: var(--red); } .fort.o-blue { fill: var(--blue); } .fort.o-none { fill: var(--neutral); }
.garrison { font-size: 10px; text-anchor: middle; fill: var(--ink); font-weight: 600; }
.army { transition: transform .45s ease; }
.army circle.body { stroke: #fff; stroke-width: 3; }
.army.red circle.body { fill: var(--red); } .army.blue circle.body { fill: var(--blue); }
.army text { fill: #fff; font-size: 12px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.army .ring { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; }
.burst { animation: burst 1.1s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes burst { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.6); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .78rem; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--line); }
.stale-note { display: none; margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--warn); border: 1px solid var(--warn-line); font-size: .85rem; }
.stale .stale-note { display: block; }
.stale .board svg, .stale .score, .stale .kingdoms { opacity: .35; filter: grayscale(.7); }
.sh-name { font-size: 8.5px; font-weight: 700; text-anchor: middle; fill: var(--ink); stroke: var(--plains); stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
/* weather overlays: one per region of the map */
.wx { pointer-events: auto; }
.wx-clear { fill: transparent; }
.wx-rain { fill: url(#p-rain); } .wx-tint-rain { fill: rgba(28, 126, 214, .10); }
.wx-snow { fill: url(#p-snow); } .wx-tint-snow { fill: rgba(255, 255, 255, .28); } .wx-dot { fill: #fff; opacity: .9; }
.wx-wind { fill: url(#p-wind); }
.wx-line { stroke: #1c7ed6; stroke-width: 1.3; opacity: .45; }
.wx-storm { fill: rgba(40, 44, 80, .30); }
.wx-fog { fill: rgba(210, 214, 220, .55); }
.wx-heat { fill: rgba(255, 212, 59, .28); } /* yellow, so it isn't mistaken for Emberreach's land */
.wx-cold { fill: url(#p-cold); } .wx-frost { stroke: #74c0fc; stroke-width: 1; opacity: .55; } /* frost hatching, not Frostmere's blue */
.wx-edge { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 5; opacity: .6; pointer-events: none; }
.wx-label { font-size: 11px; font-weight: 700; fill: var(--ink); stroke: var(--plains); stroke-width: 3.5px; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.sw-weather { background: repeating-linear-gradient(110deg, rgba(28, 126, 214, .35) 0 2px, transparent 2px 5px); }
.sw-castle { background: var(--neutral); border-color: var(--fort-line); }
.sw-army { background: var(--red); border-radius: 50%; border-color: #fff; }
.sw-red { background: var(--red-soft); } .sw-blue { background: var(--blue-soft); } .sw-forest { background: var(--forest); } .sw-mountain { background: var(--mountain); } .sw-river { background: var(--river); }

/* theater */
.theater-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.who { font-weight: 650; margin: 0 0 8px; }
.theater-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.theater-log li { padding: 6px 10px; border-radius: 8px; background: var(--soft); font-size: .92rem; overflow-wrap: anywhere; }
.theater-log .thought { font-style: italic; background: var(--think); }
.theater-log .call { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .83rem; background: var(--code); color: var(--code-ink); }
.theater-log .result { color: var(--muted); font-size: .85rem; }
.theater-log .decision { background: var(--ok); border: 1px solid var(--ok-line); font-weight: 600; }
.theater-log .fallback { background: var(--warn); border: 1px solid var(--warn-line); }

/* pipeline */
#pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#pipeline li { position: relative; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--soft-2); opacity: .55; transition: opacity .3s, background .3s; min-width: 0; }
#pipeline li b { display: block; font-size: .9rem; }
#pipeline li span { display: block; font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pipeline li:not(:last-child)::after { content: '›'; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); }
#pipeline li.done { opacity: 1; }
#pipeline li.now { opacity: 1; background: var(--hl); border-color: var(--hl-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl-line) 25%, transparent); }
@media (max-width: 600px) { #pipeline { grid-template-columns: minmax(0, 1fr); } #pipeline li::after { display: none; } }

/* log */
.log-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: inherit; font-size: .75rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.events { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; font-size: .86rem; }
.events li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 6px; border-bottom: 1px solid var(--row); cursor: pointer; }
.events li:hover, .events li.sel { background: var(--hl); }
.events time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.events .sum { overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; color: #fff; white-space: nowrap; }
.badge svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.b-agent { background: var(--agent); } .b-n8n { background: var(--n8n); } .b-oracle { background: var(--oracle); } .b-chain { background: var(--chain); } .b-game { background: var(--game); } .b-weather { background: var(--weather); }

/* lens */
.lens-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.lens-head strong { overflow-wrap: anywhere; }
.lens dl { margin: 0; display: grid; gap: 10px; }
.lens dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lens dd { margin: 2px 0 0; font-size: 1rem; }
.lens .biz { background: var(--biz); border-left: 3px solid var(--blue); padding: 8px 10px; border-radius: 4px; }

/* kingdoms */
.kingdoms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 700px) { .kingdoms { grid-template-columns: minmax(0, 1fr); } }
.kcard { border-radius: var(--radius); padding: 12px; border: 1px solid var(--line); border-top: 5px solid; }
.kcard.red { border-top-color: var(--red); } .kcard.blue { border-top-color: var(--blue); }
.kcard h3 { font-size: 1.1rem; }
.kcard .sub { color: var(--muted); font-size: .85rem; margin: 2px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stat { font-size: .8rem; color: var(--muted); }
.stat b { display: block; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--track); position: relative; overflow: hidden; margin-top: 4px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: #40c057; border-radius: 4px; }
.bar.low i { background: #fa5252; }
.bar em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--muted); }
.market { font-size: .85rem; background: var(--soft); padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; }
.journal { font-size: .88rem; margin: 0; padding-left: 18px; }
.journal li { margin: 3px 0; overflow-wrap: anywhere; }

/* proof */
.proof-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
.proof-head p { margin: 0 0 10px; font-size: .85rem; overflow-wrap: anywhere; }
.proofs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.proofs li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 8px 10px; border-radius: 8px; background: var(--soft); font-size: .9rem; }
.proofs .lbl { font-weight: 600; flex: 1 1 220px; }
.st { font-size: .72rem; font-weight: 700; text-transform: uppercase; padding: 1px 7px; border-radius: 5px; background: var(--track); }
.st-confirmed { background: var(--st-ok); color: var(--good); } .st-sent, .st-queued { background: var(--st-wait); color: var(--st-wait-ink); } .st-failed { background: var(--st-bad); color: var(--bad); }

.foot { max-width: 1280px; margin: 0 auto; padding: 8px 16px 32px; font-size: .9rem; }

/* intro + results */
dialog { border: none; border-radius: 14px; padding: 22px; max-width: min(880px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(20, 20, 20, .55); }
.cast { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.cast article { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--soft); }
.cast h3 { font-size: 1rem; display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.cast p { margin: 0 0 8px; font-size: .9rem; }
.biz { color: var(--blue); }
.results { position: fixed; inset: 0; background: rgba(20, 20, 20, .55); display: grid; place-items: center; padding: 16px; z-index: 5; }
.results[hidden] { display: none; }
.results .card { background: var(--panel); color: var(--ink); border-radius: 14px; padding: 24px; max-width: 520px; width: 100%; text-align: center; }
.results h2 { font-size: 1.5rem; color: var(--ink); text-transform: none; letter-spacing: 0; }

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