/* /how-it-works/: the walkthrough explorer, a full-screen tool on the frame. Four panels: situations, the stage
   (isometric map or timeline), details, and the hub record. Twilight throughout; everything is scoped to .explorer. */
.explorer{
  --surface:#1f1b3c;--raised:#2a2550;--raised-2:#352f63;
  --ink:#ece9ff;--ink-2:#aaa5d2;--ink-3:#9893c4;
  --rail:rgba(236,233,255,.12);
  --ok:#6fdba6;--warn:#f6bd7a;--bad:#ff9c84;--live:#b3abff;
  background:var(--frame);color:var(--ink-2);padding:clamp(10px,1.1vw,16px) clamp(14px,1.8vw,28px) clamp(16px,2vw,24px);font-size:14.5px;line-height:1.5
}
@media (prefers-color-scheme:dark){.explorer{--surface:#15132a;--raised:#201d3d;--raised-2:#2b2752;--ink-2:#9e99c6}}
.explorer:fullscreen{overflow:auto}
.explorer :focus-visible{outline:2px solid var(--live);outline-offset:2px}
.explorer button{font-family:var(--sans)}
.explorer .mono{font-family:var(--mono);font-feature-settings:normal}
.explorer [data-tone="ok"]{--tone:var(--ok)}.explorer [data-tone="warn"]{--tone:var(--warn)}.explorer [data-tone="bad"]{--tone:var(--bad)}.explorer [data-tone="live"]{--tone:var(--live)}.explorer [data-tone="ink"]{--tone:var(--ink)}.explorer [data-tone="muted"]{--tone:var(--ink-3)}
.ex-steps,.ex-legend,.ex-reports{margin:0;padding:0;list-style:none}

.ex-app{display:grid;gap:14px;max-width:1720px;margin-inline:auto}
.ex-bar{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:10px 32px;padding:6px 4px 4px}
.ex-bar h1{color:var(--ink);font-size:clamp(1.6rem,2.4vw,2.1rem);font-weight:300;line-height:1.1;letter-spacing:-.025em}
.ex-lede{margin-top:6px;max-width:70ch;font-size:15px}
.ex-tools{display:flex;align-items:center;gap:14px}
.ex-keys{color:var(--ink-3);font-size:12.5px;white-space:nowrap}
.ex-keys kbd{display:inline-block;min-width:22px;margin:0 3px 0 10px;padding:1px 6px;border-radius:6px;background:var(--raised);color:var(--ink-2);font:500 11.5px/1.6 var(--sans);text-align:center}
.ex-keys kbd+kbd{margin-left:0}
.ex-tool,.ex-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;padding:0;border:0;border-radius:50%;background:var(--raised);color:var(--ink);cursor:pointer;transition:background-color .2s ease,transform .3s var(--ease)}
.ex-tool svg,.ex-icon svg{width:18px;height:18px}
.ex-tool:hover,.ex-icon:hover,.ex-speed:hover,.ex-step:hover,.ex-chip-btn:hover{background:var(--raised-2)}
.ex-tool:active,.ex-icon:active,.ex-speed:active,.ex-step:active{transform:scale(.95)}

.ex-panel{min-width:0;border-radius:20px;background:var(--surface)}
.ex-panel-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;min-height:38px}
.ex-panel-title{color:var(--ink);font-size:14px;font-weight:600;line-height:1.3;letter-spacing:0}

/* Situations: each opens to its numbered steps (the order is the story). */
.ex-side{padding:18px 14px 14px}
.ex-side>.ex-panel-title{padding:0 6px 12px}
.ex-scenarios{display:grid;gap:4px}
.ex-scenario{border-radius:14px;padding:10px 10px 12px}
.ex-scenario h3{color:var(--ink);font-size:15px;font-weight:600;line-height:1.35;letter-spacing:-.01em}
.ex-summary{margin-top:4px;color:var(--ink-3);font-size:13px;line-height:1.5}
.ex-steps{display:grid;margin-top:12px}
.ex-steps li{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;padding-block:7px}
.ex-n{display:grid;place-items:center;width:22px;height:22px;margin-top:1px;border-radius:50%;box-shadow:inset 0 0 0 1.5px rgba(179,171,255,.4);color:var(--live);font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums;transition:background-color .3s ease,color .3s ease,box-shadow .3s ease}
.ex-steps h4{margin:0;color:var(--ink-2);font-size:13.5px;font-weight:500;line-height:1.75;letter-spacing:0}
.ex-step-body{display:grid;gap:6px;margin-top:2px;font-size:13px;line-height:1.55}
.ex-note{color:var(--ink-3);font-size:13px;line-height:1.5}
.ex-s-btn,.ex-step-btn{display:block;width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}
.ex-s-btn{position:relative;padding-right:26px}
.ex-s-btn::after{content:"";position:absolute;right:4px;top:50%;width:8px;height:8px;margin-top:-6px;border:solid currentColor;border-width:0 1.75px 1.75px 0;opacity:.6;rotate:-45deg;transition:rotate .3s var(--ease)}
.ex-s-btn[aria-expanded="true"]::after{rotate:45deg}
.ex-step-btn:hover,.ex-s-btn:hover{color:#fff}
.explorer[data-on] .ex-scenario{transition:background-color .2s ease}
.explorer[data-on] .ex-scenario:not([data-open]):hover{background:rgba(255,255,255,.04)}
.explorer[data-on] .ex-scenario[data-open]{background:var(--raised)}
.explorer[data-on] .ex-scenario:not([data-open]) :is(.ex-steps,.ex-summary),.explorer[data-on] .ex-step-body{display:none}
.ex-steps li[aria-current] h4{color:var(--ink);font-weight:600}
.ex-steps li[aria-current] .ex-n{background:var(--frame-brand);box-shadow:none;color:#fff}
.ex-steps li[data-done] .ex-n{box-shadow:none;color:transparent;background:rgba(179,171,255,.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3abff' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/13px no-repeat}

/* The stage: the map (drawings joined by the lines their reports take) or the timeline. */
.ex-stage{position:relative;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;background:var(--surface) radial-gradient(120% 90% at 50% 46%,rgba(109,92,224,.2),transparent 62%)}
.ex-views{position:absolute;z-index:3;top:14px;left:14px;display:flex;gap:2px;padding:3px;border-radius:999px;background:var(--frame)}
.ex-views [role="tab"]{display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:0 13px;border:0;border-radius:999px;background:none;color:var(--ink-2);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .2s ease,color .2s ease}
.ex-views svg{width:15px;height:15px}
.ex-views [role="tab"]:hover{color:var(--ink)}
.ex-views [aria-selected="true"]{background:var(--frame-brand);color:#fff}
.ex-cap{position:absolute;z-index:3;right:18px;top:22px;margin:0;color:var(--ink-3);font-size:12px}
/* The drawings size from the stage's height (cqh), so a short window still shows both rows. */
.ex-stage{min-height:clamp(330px,52svh,520px)}
.ex-map{position:relative;min-height:330px;container-type:size}
.ex-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;fill:none}
.ex-rail{stroke:rgba(236,233,255,.22);stroke-width:1.5;stroke-dasharray:5 7;stroke-linecap:round}
.ex-rail.hot{stroke:var(--tone);animation:ex-flow .5s linear infinite}
@keyframes ex-flow{to{stroke-dashoffset:-12}}
.ex-node{position:absolute;left:calc(var(--x) * 1%);display:grid;justify-items:center;gap:1px;width:max-content;max-width:30%;padding:6px 8px;border:0;border-radius:14px;background:none;color:var(--ink-2);text-align:center;translate:-50% -50%;cursor:pointer;transition:opacity .5s ease,background-color .2s ease}
.ex-node:hover,.ex-node[data-picked]{background:rgba(236,233,255,.06)}
.ex-node[data-idle]{opacity:.38}
.ex-art{width:min(clamp(64px,6.2vw,94px),21cqh);height:auto;margin-bottom:2px;overflow:visible;stroke:var(--live);stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round;transition:filter .3s ease,translate .5s var(--ease)}
.ex-hub .ex-art{width:min(clamp(84px,8.2vw,124px),28cqh)}
.ex-art .f-t{fill:#3a3373}.ex-art .f-l{fill:#231f47}.ex-art .f-r{fill:#2d2859}
.ex-art .f-s{fill:#17142e}.ex-art .f-d{fill:none}.ex-art .f-dot{fill:var(--live);stroke:none}
.ex-node[data-hit] .ex-art{stroke:var(--hit);filter:drop-shadow(0 10px 18px color-mix(in srgb,var(--hit) 45%,transparent));translate:0 -4px}
.ex-node[data-hit] .f-dot{fill:var(--hit)}
.ex-node[data-hit="ink"]{--hit:var(--ink)}.ex-node[data-hit="ok"]{--hit:var(--ok)}.ex-node[data-hit="warn"]{--hit:var(--warn)}.ex-node[data-hit="bad"]{--hit:var(--bad)}.ex-node[data-hit="live"]{--hit:var(--live)}
.ex-name{color:var(--ink);font-size:15px;font-weight:600;line-height:1.3;letter-spacing:-.01em}
.ex-branch{color:var(--ink-3);font-size:11.5px;line-height:1.4}
.ex-status{display:inline-flex;align-items:baseline;gap:7px;margin-top:3px;color:var(--tone);font-size:12.5px;font-weight:500;line-height:1.35}
.ex-status::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:currentColor}
.ex-status.pop{animation:ex-pop .5s var(--ease)}
@keyframes ex-pop{from{opacity:.2;transform:translateY(4px)}to{opacity:1;transform:none}}
.ex-packet{position:absolute;z-index:2;left:0;top:0;display:flex;align-items:center;gap:6px;margin:-11px 0 0 -11px;color:var(--tone);pointer-events:none;will-change:translate}
.ex-packet i{width:12px;height:12px;margin:5px;border-radius:50%;background:currentColor;box-shadow:0 0 0 6px color-mix(in srgb,currentColor 22%,transparent)}
.ex-packet b{padding:2px 9px;border-radius:999px;background:var(--frame);color:var(--tone);font-size:11.5px;font-weight:600;line-height:1.5;white-space:nowrap}

/* The timeline shares the stage's height: every report has a row, and the rows split what room there is. */
.ex-seq{display:flex;flex-direction:column;min-height:calc(var(--rows,7) * 30px + 44px);margin-top:58px;padding:0 18px 14px}
.ex-seq[hidden]{display:none}
.ex-seq-head{display:flex;padding-block:4px 6px}
.ex-seq-head span{flex:1;min-width:0;padding-inline:3px;color:var(--ink);font-size:13.5px;font-weight:600;line-height:1.2;text-align:center}
.ex-seq-body{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}
.ex-life{position:absolute;top:0;bottom:0;width:0;border-left:1.5px dashed rgba(236,233,255,.16)}
.ex-seq-empty{position:absolute;inset:0;display:grid;place-items:center;margin:0;color:var(--ink-3);text-align:center}
.ex-seq-row{position:relative;flex:1 1 0;min-height:22px;max-height:46px;border-radius:8px;color:var(--tone)}
.ex-seq-row.later{visibility:hidden}
.ex-seq-row[aria-current]{background:rgba(109,92,224,.16)}
.ex-seq-row.now .ex-arrow{animation:ex-draw .5s var(--ease)}
.ex-seq-n{position:absolute;left:0;top:50%;display:grid;place-items:center;width:18px;height:18px;margin-top:-9px;border-radius:50%;background:var(--raised-2);color:var(--ink-2);font-size:11px;font-weight:600;font-variant-numeric:tabular-nums}
.ex-arrow{position:absolute;bottom:4px;height:0;border-top:1.75px solid currentColor}
.ex-arrow::after{content:"";position:absolute;top:-5.5px;width:9px;height:9px;border:solid currentColor;border-width:1.75px 1.75px 0 0}
.ex-arrow[data-dir="r"]::after{right:1px;rotate:45deg}
.ex-arrow[data-dir="l"]::after{left:1px;rotate:-135deg}
.ex-arrow.self{bottom:0;width:9px;height:9px;margin-left:-5px;border:0;border-radius:50%;background:currentColor}
.ex-arrow.self::after{display:none}
.ex-seq-label{position:absolute;bottom:9px;left:clamp(24%,calc(var(--lx) * 1%),76%);max-width:48%;padding:0 6px;border-radius:6px;background:var(--surface);color:var(--ink-2);font-size:11.5px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;translate:-50% 0}
.ex-seq-label b{color:var(--tone);font-weight:600}
@keyframes ex-draw{from{clip-path:inset(-8px 100% -8px 0)}to{clip-path:inset(-8px 0)}}

/* Details: the situation, the current step, or whatever was picked on the stage. */
.ex-detail{display:grid;align-content:start;gap:8px;padding:16px 18px 18px}
.ex-detail-body{display:grid;align-content:start;gap:12px}
.ex-detail h3{color:var(--ink);font-size:clamp(1.25rem,1.6vw,1.5rem);font-weight:400;line-height:1.2;letter-spacing:-.02em;text-wrap:balance}
.ex-eyebrow{color:var(--live);font-size:12.5px;font-weight:600;font-variant-numeric:tabular-nums}
.ex-text{color:var(--ink-2);font-size:14.5px;line-height:1.6}
.ex-kv{display:grid;grid-template-columns:minmax(84px,auto) minmax(0,1fr);margin:2px 0 0}
.ex-kv dt,.ex-kv dd{margin:0;padding-block:9px;border-top:1px solid var(--rail);font-size:13px;line-height:1.45}
.ex-kv dt{padding-right:14px;color:var(--ink-3);font-weight:600}
.ex-kv dd{color:var(--ink);overflow-wrap:anywhere}
.ex-sub{margin-top:4px;color:var(--ink-3);font-size:12.5px;font-weight:600}
.ex-reports{display:grid;gap:8px}
.ex-reports li{display:grid;grid-template-columns:auto minmax(0,1fr);gap:1px 10px;padding:9px 12px;border-radius:12px;background:var(--raised)}
.ex-reports .ex-route{color:var(--ink-3);font-size:12.5px}
.ex-reports .ex-info{grid-column:1/-1;color:var(--ink);font-size:13.5px}
.ex-kind{display:inline-flex;align-items:center;gap:6px;color:var(--tone);font-size:12.5px;font-weight:600;white-space:nowrap}
.ex-kind::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.ex-chip-btn,.ex-speed,.ex-step{min-height:38px;padding:0 15px;border:0;border-radius:999px;background:var(--raised);color:var(--ink);font-size:13.5px;font-weight:600;cursor:pointer;transition:background-color .2s ease,transform .3s var(--ease)}
.ex-chip-btn{min-height:30px;margin-left:auto;padding:0 12px;font-size:12.5px}

/* The hub record: every report, in order, as it lands. */
.ex-log{display:grid;align-content:start;gap:8px;padding:14px 18px 12px}
.ex-legend{display:flex;flex-wrap:wrap;gap:4px 16px}
.ex-legend li{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2);font-size:12.5px}
.ex-legend li::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--tone)}
.ex-controls{display:flex;align-items:center;gap:8px;margin-left:auto}
.ex-speed{min-width:52px;padding:0 12px;font-variant-numeric:tabular-nums}
.ex-play{--hub-brand:var(--frame-brand);--hub-brand-ink:#5947cc;--hub-on-brand:#fff;--bs-btn-padding-y:6px;--bs-btn-padding-x:18px;--bs-btn-font-size:14px;min-width:112px;min-height:38px}
.ex-play svg{width:16px;height:16px}
.ex-play .i-pause,.ex-play[data-playing] .i-play{display:none}
.ex-play[data-playing] .i-pause{display:inline}
.ex-icon:disabled,.ex-step:disabled{opacity:.4;cursor:default;background:var(--raised)}
.ex-table-wrap{min-height:calc(var(--rows,6) * 29px + 30px);overflow-x:auto;scrollbar-color:#4b4672 transparent}
.ex-table{width:100%;border-collapse:collapse;font-size:13px;line-height:1.4;font-variant-numeric:tabular-nums}
.ex-table th{position:sticky;top:0;z-index:1;padding:6px 14px 6px 0;background:var(--surface);color:var(--ink-3);font-size:12px;font-weight:600;text-align:left;white-space:nowrap}
.ex-table td{padding:4px 14px 4px 0;border-top:1px solid var(--rail);color:var(--ink-2);white-space:nowrap}
.ex-table td.ex-info{width:99%;color:var(--ink);white-space:normal}
.ex-table td:first-child,.ex-table th:first-child{padding-left:8px}
.ex-table tbody tr{cursor:pointer;transition:background-color .2s ease}
.ex-table tbody tr:hover{background:rgba(236,233,255,.05)}
.ex-table tr[aria-current]{background:rgba(109,92,224,.2)}
.ex-table tr:focus-visible{outline-offset:-2px}
.ex-no{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:color-mix(in srgb,var(--tone) 20%,transparent);color:var(--tone);font-size:11.5px;font-weight:600}
.ex-empty{padding:18px 8px;color:var(--ink-3);font-size:13.5px}

/* Wide: situations left, stage over the record, details right. Panels take the height their content needs. */
@media (min-width:1180px){
  .explorer[data-on] .ex-app{grid-template-columns:minmax(250px,292px) minmax(0,1fr) minmax(280px,340px);grid-template-rows:auto auto auto;grid-template-areas:"bar bar bar" "side stage detail" "side log detail"}
  /* The stage takes what the window has left after the record, so stage and record are seen together. */
  .explorer[data-on] .ex-stage{min-height:clamp(300px,calc(100svh - 214px - var(--rows,7) * 29px - 104px),540px)}
  .explorer[data-on] :is(.ex-map,.ex-seq){min-height:0}
  .ex-bar>div:first-child{display:flex;flex:1 1 0;flex-wrap:wrap;align-items:baseline;gap:4px 22px;min-width:0}
  .ex-bar{flex-wrap:nowrap;align-items:center}
  .ex-bar .ex-lede{margin-top:0}
  .ex-bar{padding-block:2px 0}
  .explorer[data-on] .ex-bar{grid-area:bar}
  .explorer[data-on] .ex-side{grid-area:side}
  .explorer[data-on] .ex-stage{grid-area:stage}
  .explorer[data-on] .ex-detail{grid-area:detail}
  .explorer[data-on] .ex-log{grid-area:log}
}
/* Narrower: situations become a row of pills; stage, then details beside the record. */
@media (max-width:1179.98px){
  .explorer[data-on] .ex-side{padding:0;background:none}
  .explorer[data-on] .ex-side>.ex-panel-title{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .explorer[data-on] .ex-scenarios{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
  .explorer[data-on] .ex-scenario{flex:none;padding:0;border-radius:999px;background:var(--surface)}
  .explorer[data-on] .ex-scenario :is(.ex-steps,.ex-summary){display:none}
  .explorer[data-on] .ex-s-btn{min-height:40px;padding:0 16px;font-size:14px;white-space:nowrap}
  .explorer[data-on] .ex-s-btn::after{display:none}
  .explorer[data-on] .ex-scenario[data-open]{background:var(--frame-brand)}
  .explorer[data-on] .ex-scenario[data-open] h3{color:#fff}
  .ex-keys{display:none}
}
@media (min-width:860px) and (max-width:1179.98px){
  .explorer[data-on] .ex-app{grid-template-columns:minmax(280px,340px) minmax(0,1fr)}
  .explorer[data-on] :is(.ex-bar,.ex-side,.ex-stage){grid-column:1/-1}
  .explorer:not([data-on]) .ex-scenarios{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .ex-map{min-height:470px}
  .ex-node{left:clamp(19%,calc(var(--x) * 1%),81%);max-width:36%;padding:4px}
  .ex-status{display:block;text-wrap:balance}
  .ex-status::before{display:inline-block;margin-right:6px}
  .ex-art{width:62px}.ex-hub .ex-art{width:82px}
  .ex-name{font-size:13px}.ex-status{font-size:11.5px}.ex-branch{display:none}
  .ex-cap{top:auto;right:12px;bottom:8px;font-size:11px}
  .ex-legend{display:none}
  .ex-controls{margin-left:0;flex:1;justify-content:space-between}
  .ex-play{flex:1;min-width:0}
  .ex-col-time{display:none}
  .ex-log{padding-inline:14px}
  .ex-table{table-layout:fixed;font-size:12.5px}
  .ex-table td,.ex-table th{padding-right:8px;white-space:normal;overflow-wrap:anywhere}
  .ex-table td.ex-info{width:auto}
  .ex-table th:nth-child(1){width:34px}
  .ex-table th:nth-child(3),.ex-table th:nth-child(4){width:21%}
  .ex-table th:nth-child(5){width:58px}
  .ex-table td:first-child,.ex-table th:first-child{padding-left:2px}
  .ex-table .ex-kind{white-space:nowrap}
  .ex-seq{padding:0 8px 30px}
  .ex-seq-label{left:clamp(31%,calc(var(--lx) * 1%),69%);max-width:62%}
  .ex-seq-head span{font-size:11.5px}
}
/* A short window drops the lede so the record keeps its place on screen. */
@media (min-width:1180px) and (max-height:860px){.ex-bar .ex-lede{display:none}}
@media (prefers-reduced-motion:no-preference){
  .ex-table tr.fresh{animation:ex-row .7s var(--ease)}
}
/* A new row arrives lit and settles; it is readable from its first frame. */
@keyframes ex-row{from{background:rgba(109,92,224,.55)}}
@media (prefers-reduced-motion:reduce){
  .ex-status.pop,.ex-rail.hot,.ex-seq-row.now .ex-arrow{animation:none}
  .ex-art,.ex-node{transition:none}
}
