/* Gravitee: black and warm white, the fire-to-sunlight gradient for what matters, emerald for what Gravitee holds */
:root {
  color-scheme: light;
  --fire: #ff171a;
  --orange: #ff6900;
  --sunlight: #ff8b00;
  --brand-gradient: linear-gradient(90deg, #ff171a 0%, #ff8b00 60%, #ffb800 100%);
  --bg: #ffffff;
  --panel: #f8f5f2;
  --panel-2: #f1ece8;
  --stage: #fbf7f4;
  --ink: #1a1414;
  --ink-2: #5c4b48;
  --ink-3: #94817a;
  --line: #e7ddd8;
  --line-2: #cdc4c1;
  --accent: #ff4511;
  --accent-ink: #c60017;
  --accent-bg: #ffe9e0;
  --bad: #dd1d1f;
  --bad-bg: #ffe5e3;
  --ok: #138a4a;
  --ok-bg: #e2f6ea;
  --held: #b86200;
  --held-bg: #fff0d9;
  --blocked: #80004d;
  --blocked-bg: #f7e3ee;
  --gv: #138a4a;
  --gv-bg: #e6f6ec;
  --gv-band: rgba(19, 138, 74, .06);
  --shadow: 0 1px 2px rgba(35, 14, 14, .05), 0 8px 24px rgba(35, 14, 14, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: var(--sans);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #121010;
  --panel-2: #1d1919;
  --stage: #0a0808;
  --ink: #faf1ec;
  --ink-2: #cdc4c1;
  --ink-3: #94817a;
  --line: #2a2222;
  --line-2: #4d3b3a;
  --accent-ink: #ff8b4a;
  --accent-bg: #2f120a;
  --bad: #ff5250;
  --bad-bg: #331012;
  --ok: #52de79;
  --ok-bg: #0f2a18;
  --held: #ffb340;
  --held-bg: #33220a;
  --blocked: #e070b0;
  --blocked-bg: #2e0f22;
  --gv: #52de79;
  --gv-bg: #0d2316;
  --gv-band: rgba(82, 222, 121, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--brand-gradient); opacity: .7; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; color: var(--ink); }
.brand-logo { display: block; width: 104px; height: 25px; }
.brand-name { padding-left: 14px; border-left: 1px solid var(--line-2); font: 700 17px/1 var(--display); letter-spacing: -.01em; }
.top-ctas { display: flex; align-items: center; gap: 6px; flex: none; }
.step-nav + .top-ctas { margin-left: 8px; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.crumbs svg { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.crumb { color: var(--ink-2); text-decoration: none; }
a.crumb:hover { color: var(--ink); }
.crumb.current { color: var(--ink); font-weight: 650; }
.step-nav { display: flex; gap: 4px; margin-left: auto; min-width: 0; }
.step-link.prev svg { transform: rotate(180deg); }

main { padding: 18px 24px 24px; }

/* Buttons */
.button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; white-space: nowrap; font-size: 13.5px; text-decoration: none; }
.button:hover { border-color: var(--ink-3); }
.button svg { width: 15px; height: 15px; }
.button.primary { background: var(--brand-gradient); border-color: transparent; color: #fff; font-weight: 650; }
.button.primary:hover { filter: brightness(1.08) saturate(1.05); }
.button:focus-visible, .segmented button:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--sunlight); outline-offset: 2px; }
.button.primary svg { stroke: #fff; }
.button.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.button.quiet:hover { background: var(--panel-2); color: var(--ink); }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-button:hover { background: var(--panel-2); color: var(--ink); }

.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; height: 32px; padding: 0 16px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.segmented button.on { background: var(--panel); color: var(--ink); font-weight: 650; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented button { display: inline-flex; align-items: center; gap: 8px; }
.segmented button i { width: 14px; height: 3px; border-radius: 2px; background: var(--line-2); }
.segmented button.without i { background: color-mix(in srgb, var(--bad) 45%, var(--line-2)); }
.segmented button.with i { background: color-mix(in srgb, var(--gv) 45%, var(--line-2)); }
.segmented button.on.without { color: var(--bad); }
.segmented button.on.without i { background: var(--bad); }
.segmented button.on.with { color: var(--gv); }
.segmented button.on.with i { background: var(--gv); }
.player { display: inline-flex; align-items: center; gap: 8px; }
.player .button.primary { min-width: 124px; justify-content: center; }
.button:disabled { opacity: .55; cursor: default; filter: none; }
.button kbd { margin-left: 4px; padding: 0 5px; border-radius: 4px; font: 600 11px var(--sans); line-height: 16px; background: rgba(255, 255, 255, .22); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.held { background: var(--held-bg); color: var(--held); }
.pill.blocked { background: var(--blocked-bg); color: var(--blocked); }
.pill.info, .pill.neutral { background: var(--panel-2); color: var(--ink-2); }

/* Home: the year as a clock, the incident picked on it, then every incident */

/* Shared with the incident pages */
.logo { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.logo img { width: 34px; height: 34px; object-fit: contain; }
.pattern-label { font-weight: 650; color: var(--ink); }
.risk-note { color: var(--ink-3); }
.dmg-value { font: 800 46px/1 var(--display); letter-spacing: -.03em; color: var(--bad); font-variant-numeric: tabular-nums; }
.dmg-label { margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.sources { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); }
.sources a { color: var(--ink-2); }
.sources a:hover { color: var(--ink); }

.home { max-width: 1320px; margin: 0 auto; padding: 0 16px 24px; }
.year-intro { grid-area: intro; }
.year-intro h1 { margin: 0; font: 800 clamp(30px, 3.2vw, 44px)/1.05 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.year-intro p { margin: 12px 0 0; max-width: 56ch; font-size: 16px; color: var(--ink-2); }

/* The first screen: the clock on the left, the page's heading and the clock's notes beside it, so the whole clock fits a laptop screen */
.year { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "clock intro" "clock side";
  gap: 28px 56px; align-items: start; padding: 8px 0 0; }
.clock { position: relative; grid-area: clock; width: 100%; max-width: 560px; aspect-ratio: 1; min-width: 300px; }
.clock svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; stroke: none; }
.clock-month { font: 800 11px var(--sans); letter-spacing: .08em; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.clock-month.hot { fill: #fff; }
.clock-month.none { fill: var(--ink-3); }
.clock-today { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 3 4; }
.clock-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; padding: 3px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.clock-dot::before { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; }
.clock-dot::before { background: var(--ink-2); }
.clock-dot.sel::before { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sunlight); }
.clock-dot.dim { opacity: .15; pointer-events: none; }
.clock-tip { display: none; position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); white-space: nowrap; padding: 5px 9px; border-radius: 7px;
  font-size: 12px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 3; }
.clock-dot:hover .clock-tip, .clock-dot:focus-visible .clock-tip { display: block; }
.clock-dot:hover, .clock-dot:focus-visible { z-index: 4; }
.clock-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.clock-center b { font: 800 clamp(48px, 7vw, 76px)/.9 var(--display); letter-spacing: -.04em; }
.clock-center span { max-width: 150px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }

.year-side { grid-area: side; display: flex; flex-direction: column; gap: 22px; }
.year-side .year-caption h2 { font-size: 17px; letter-spacing: 0; }
.year-side .year-caption p { margin-top: 4px; font-size: 14px; }
.year-side .year-caption p + p { margin-top: 10px; color: var(--ink); }
.year-caption b { font-weight: 800; font-variant-numeric: tabular-nums; }
.year-caption b.hl { color: var(--accent-ink); }
@media (max-width: 1020px) {
  .year { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "intro" "clock" "side"; padding-top: 24px; }
}
.year-side h2, .list-head h2 { margin: 0; font: 800 32px/1.1 var(--display); letter-spacing: -.02em; }
.year-side p { margin: 8px 0 0; max-width: 52ch; font-size: 15px; color: var(--ink-2); }
/* The report's one number, then the sectors against it */
.stat { margin: 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.stat-head { display: flex; align-items: flex-end; gap: 16px; }
.stat-head b { flex: none; font: 800 clamp(64px, 7vw, 96px)/.8 var(--display); letter-spacing: -.05em; color: var(--accent); }
.year-side .stat-head p { margin: 0; max-width: 30ch; font-size: 15px; line-height: 1.35; color: var(--ink); text-wrap: pretty; }
.stat-label { margin: 0 0 -6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.stat-sectors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(80px, 1fr) 3ch; gap: 7px 12px; align-items: center; max-width: 440px; font-size: 13px; }
.stat-sectors li { display: contents; }
.stat-sectors span { color: var(--ink-2); }
.stat-sectors i { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ink-3) var(--v), var(--panel-2) var(--v)); }
.stat-sectors .over i { background: linear-gradient(90deg, var(--accent) var(--v), var(--panel-2) var(--v)); }
.stat-sectors i::after { content: ""; position: absolute; left: var(--all); top: -4px; bottom: -4px; border-left: 1.5px dashed var(--ink); }
.stat-sectors b { font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.stat-sectors .over b, .stat-sectors .over span { color: var(--ink); }
.stat figcaption { font-size: 12px; color: var(--ink-3); }
.stat figcaption a { color: var(--ink-2); }
.clock-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12px; color: var(--ink-3); }
.clock-legend li { display: flex; align-items: center; gap: 8px; }
.clock-legend i { width: 8px; height: 8px; border-radius: 50%; }
.clock-legend i.heat { width: 60px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(255, 132, 1, .2), #ff0c0b); }

/* The five incident patterns of the State of AI Agent Security report, as boxes under the clock that filter it and the list */
.patterns { padding-top: 32px; }
.patterns-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px 48px; align-items: start; }
.patterns-head h2 { margin: 0; font: 800 32px/1.1 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.patterns-head p { margin: 0; max-width: 78ch; font-size: 15px; color: var(--ink-2); }
.patterns-head a { color: var(--ink); font-weight: 650; }
.pattern-boxes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.pattern-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px 18px 14px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--bg); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.pattern-box:hover { border-color: var(--ink-3); background: var(--panel); }
.pb-figure { display: flex; flex-direction: column; gap: 8px; }
.pb-count { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.pb-count b { margin-right: 3px; font: 800 44px/1 var(--display); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pb-dots { display: flex; gap: 4px; }
.pb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); }
.pb-name { margin-top: 4px; font-size: 15px; font-weight: 800; line-height: 1.25; }
.pb-what { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.pb-survey { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.pattern-box.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pattern-box.on .pb-count, .pattern-box.on .pb-count b { color: var(--bg); }
.pattern-box.on .pb-dots i { background: var(--line-2); }   /* the clock's lit dots are grey too */
.pattern-box.on .pb-what, .pattern-box.on .pb-survey { color: var(--line-2); }
.pattern-box.on .pb-survey { border-top-color: color-mix(in srgb, var(--bg) 22%, transparent); }
.pattern-status { margin: 12px 0 0; text-align: right; color: var(--ink-3); }
.pattern-all { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 1100px) { .patterns-head { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) {
  .pattern-boxes { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pattern-box { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; padding: 14px 16px; }
  .pb-figure { grid-row: span 3; }
  .pb-count { display: flex; flex-direction: column; gap: 2px; }
  .pb-dots { flex-wrap: wrap; }
  .pb-name { margin-top: 0; }
  .pb-survey { border-top: 0; padding-top: 2px; }
  .pattern-status { text-align: left; }
}

/* One colour per incident pattern (violet, blue, magenta, green, gold), kept clear of the clock's heat ramp and the brand orange.
   --pc is the pattern's colour on the page; --pc-inv is the same pattern on the inverted fill of a selected box. */
:root { --p-scope: #6250d6; --p-scope-inv: #7b6ce6; --p-data-out: #3d8fd6; --p-data-out-inv: #5aa8ec; --p-exposed: #d55181; --p-exposed-inv: #e05c94; --p-health: #276b00; --p-health-inv: #3f9d1a; --p-wrong-output: #b08500; --p-wrong-output-inv: #e0ad1f; }
:root[data-theme="dark"] { --p-scope: #7b6ce6; --p-scope-inv: #6250d6; --p-data-out: #5aa8ec; --p-data-out-inv: #3d8fd6; --p-exposed: #e05c94; --p-exposed-inv: #d55181; --p-health: #3f9d1a; --p-health-inv: #276b00; --p-wrong-output: #e0ad1f; --p-wrong-output-inv: #b08500; }
.p-scope { --pc: var(--p-scope); --pc-inv: var(--p-scope-inv); }
.p-data-out { --pc: var(--p-data-out); --pc-inv: var(--p-data-out-inv); }
.p-exposed { --pc: var(--p-exposed); --pc-inv: var(--p-exposed-inv); }
.p-health { --pc: var(--p-health); --pc-inv: var(--p-health-inv); }
.p-wrong-output { --pc: var(--p-wrong-output); --pc-inv: var(--p-wrong-output-inv); }
.clock-dot[class*=" p-"]::before { background: var(--pc); }
.pat { display: inline-flex; align-items: center; gap: 6px; }
.pat::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }
.pattern-box { box-shadow: inset 0 4px 0 var(--pc); }
.pattern-box:hover { border-color: var(--pc); }
.pattern-box .pb-dots i { background: var(--pc); }
.pattern-box.on { box-shadow: inset 0 4px 0 var(--pc-inv); }
.pattern-box.on .pb-dots i { background: var(--pc-inv); }

.picked { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 24px; padding: 20px 24px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.picked-what { flex: 1 1 320px; min-width: 0; }
.picked-what small { color: var(--ink-3); font-size: 12px; }
.picked-what h3 { margin: 2px 0; font: 800 26px/1.1 var(--display); letter-spacing: -.01em; }
.picked-what p { margin: 0; color: var(--ink-2); }
.picked-what p b { color: var(--bad); }
.big-button { height: 44px; padding: 0 20px; font-size: 14px; }

.incidents-list { padding-top: 64px; }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.list-head > span { color: var(--ink-3); }
.chip-clear { margin-left: auto; height: 34px; padding: 0 12px; border: 1px solid var(--sunlight); border-radius: 999px; background: none; cursor: pointer; }
.inc-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 160px; gap: 24px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.inc-row:not(.inc-row-head):hover { background: color-mix(in srgb, var(--sunlight) 6%, transparent); }
.inc-row-head { padding: 10px 16px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.row-what a { display: block; font-size: 15px; font-weight: 700; text-decoration: none; }
.row-what a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-what small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.row-cost { font: 800 22px/1 var(--display); letter-spacing: -.02em; color: var(--bad); font-variant-numeric: tabular-nums; }
.row-go { justify-self: end; }
.row-go .button { border-radius: 999px; }
@media (max-width: 900px) {
  .inc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .inc-row-head { display: none; }
  .row-go { grid-column: 1 / -1; justify-self: start; }
  .row-go:empty { display: none; }
}

/* Incident head */
.inc-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 12px; min-height: 58px; }
.inc-heading { min-width: 0; flex: 1; position: relative; }
.inc-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inc-title .logo.small { width: 34px; height: 34px; border-radius: 10px; margin-right: -4px; }
.inc-title .logo.small img { width: 21px; height: 21px; }
.inc-title h1 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
.inc-headline { margin-top: 3px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-meta { color: var(--ink-3); font-size: 13px; }
.inc-tags { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.story-who { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.story-button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: 12.5px; cursor: pointer; }
.story-button svg { width: 14px; height: 14px; }
.story-button:hover, .story-button[aria-expanded="true"] { border-color: var(--ink-3); color: var(--ink); }
.story-pop { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(720px, 90vw); padding: 14px 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.story-pop p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.6; }
.impact { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; flex: none; max-width: 62%; }
.metric { min-width: 0; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.metric .label { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.25; }
.metric.bad .value { color: var(--bad); }
.metric.ok .value { color: var(--ok); }
.metric.held .value { color: var(--held); }
.metric.empty { color: var(--ink-3); font-size: 13px; display: flex; align-items: center; border-style: dashed; min-height: 58px; }

.story-strip { padding: 8px 16px; margin-bottom: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.story-strip summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; }
.story-strip summary::-webkit-details-marker { display: none; }
.story-strip summary svg { width: 13px; height: 13px; transition: transform .15s; }
.story-strip[open] summary svg { transform: rotate(90deg); }
.story-body { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; margin-top: 6px; }
.story-strip p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 1200px; }
.story-strip .label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); }

.waitbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--held-bg); border-top: 1px solid color-mix(in srgb, var(--held) 35%, transparent); }
.waitbar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--held); flex: none; animation: pulse 1.2s infinite; }
.waitbar .text { flex: 1; font-size: 13.5px; }
.errorbar { padding: 10px 16px; background: var(--bad-bg); color: var(--bad); font-size: 13.5px; border-top: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
@keyframes pulse { 50% { opacity: .35; } }

/* Workspace: the stage, and the replay log beside it */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 16px var(--log-w, 400px); align-items: start; }
.workspace.solo { grid-template-columns: minmax(0, 1fr); }
.workspace.solo .recorder, .workspace.solo .log-handle { display: none; }
/* The edge between the stage and the log: a grip that shows on hover, and the log follows it */
.log-handle { align-self: stretch; position: relative; cursor: col-resize; touch-action: none; }
.log-handle::after { content: ""; position: absolute; left: 6px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--line-2); transition: background .15s, height .15s; }
.log-handle:hover::after, .log-handle:focus-visible::after, .log-handle.dragging::after { background: var(--accent); height: 72px; margin-top: -36px; }
.log-handle:focus-visible { outline: none; }
@media (max-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .log-handle { display: none; }
  .recorder { height: 460px; min-height: 240px; max-height: 80vh; resize: vertical; }
}

.stage-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar-right { display: flex; align-items: center; gap: 12px; }
.stage-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stage-legend i { width: 22px; height: 3px; border-radius: 2px; display: inline-block; }
.stage-legend i.without { background: var(--bad); }
.stage-legend i.with { background: var(--gv); }
.stage-box { position: relative; overflow: hidden; background: var(--stage);
  background-image: radial-gradient(color-mix(in srgb, var(--ink-3) 22%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.stage { position: relative; }

/* Lanes */
.lanes { position: absolute; inset: 0; pointer-events: none; }
.lane-title { position: absolute; height: 20px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-title.gravitee { color: var(--gv); }
.band { position: absolute; border-radius: 18px; border: 1.5px dashed var(--line-2); transition: background .35s, border-color .35s; }
.stage[data-mode="with"] .band { background: var(--gv-band); border-color: color-mix(in srgb, var(--gv) 45%, transparent); border-style: solid; }

/* Edges, their labels and packets */
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edges path.edge { fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 4 5; transition: stroke .3s, opacity .3s; }
.edges path.edge.lit { stroke-width: 3; stroke-dasharray: 10 7; animation: flow .7s linear infinite; }
.edges path.edge.lit.without { stroke: var(--bad); }
.edges path.edge.lit.with { stroke: var(--gv); }
.edges path.edge.hiddenmode { opacity: 0; }
.edges circle.packet { stroke: var(--panel); stroke-width: 2; }
@keyframes flow { to { stroke-dashoffset: -34; } }
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.edge-label { position: absolute; transform: translate(-50%, calc(-100% - 5px)) scale(.9); transform-origin: center bottom; padding: 2px 8px; border-radius: 9px; font-size: 11px; font-weight: 650; text-align: center; line-height: 1.3; width: max-content;
  background: var(--panel); border: 1.5px solid var(--bad); color: var(--bad); opacity: 0; transition: opacity .25s, transform .25s; box-shadow: var(--shadow); }
.edge-label.with { border-color: var(--gv); color: var(--gv); }
.edge-label.on { opacity: 1; transform: translate(-50%, calc(-100% - 5px)) scale(1); }
.edge-label.side { transform: translate(-100%, -50%) scale(.9); text-align: right; transform-origin: right center; white-space: nowrap; }
.edge-label.side.on { transform: translate(-100%, -50%) scale(1); }

/* Blocks */
.block { position: absolute; display: flex; flex-direction: column; background: var(--panel); border: 1.5px solid var(--line-2);
  border-radius: 14px; z-index: 2; box-shadow: var(--shadow);
  transition: opacity .35s, border-color .3s, box-shadow .3s, transform .35s; }   /* not its place or size: lanes and edges move at once, so must blocks */
.block-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; min-width: 0; }
.block-names { min-width: 0; }
.block-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--panel-2); color: var(--ink-2); flex: none; }
.block-icon svg { width: 17px; height: 17px; }
.block-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.block-sub { color: var(--ink-3); font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-body { flex: 1; min-height: 0; padding: 0 12px 10px; font-size: 12.5px; overflow: hidden; display: flex; flex-direction: column; }
.block-body > .chat, .block-body > .term, .block-body > .list { flex: 1 1 auto; min-height: 0; }
.block.kind-agent .block-icon { background: var(--accent-bg); color: var(--accent-ink); }
.block.kind-attacker { border-color: color-mix(in srgb, var(--bad) 50%, var(--line-2)); }
.block.kind-attacker .block-icon { background: var(--bad-bg); color: var(--bad); }
.block.kind-gravitee { border-color: var(--gv); background: var(--gv-bg); }
.block.kind-gravitee .block-icon { background: var(--panel); color: var(--gv); }
.block.kind-gravitee .block-title { color: var(--gv); }
.block.off { opacity: .28; border-style: dashed; background: var(--panel); box-shadow: none; transform: scale(.97); }
.block.off .block-title { color: var(--ink-3); }
.block.off .pointers, .block.off .block-body { display: none; }
.band-off { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; color: var(--ink-3); opacity: 0; transition: opacity .3s; }
.stage[data-mode="without"] .band-off { opacity: 1; }
.block.hot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), var(--shadow); }
.block.kind-gravitee.hot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gv) 28%, transparent), var(--shadow); }
.block.stopped { border-color: var(--ink-3); }
.inspect { position: absolute; top: -11px; right: 12px; display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 5px 0 8px; border-radius: 999px;
  border: 1px solid var(--gv); background: var(--panel); color: var(--gv); font-size: 11.5px; font-weight: 650; cursor: pointer; box-shadow: var(--shadow); z-index: 3; }
.inspect svg { width: 13px; height: 13px; }
.inspect .count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gv); color: var(--panel); font-size: 10.5px; }
.inspect:hover { background: var(--gv); color: #fff; }
.inspect:hover .count { background: #fff; color: var(--gv); }
.block.off .inspect { display: none; }
.inspector { position: fixed; z-index: 50; width: 290px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.24); }
.inspector-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.inspector-head .block-icon { color: var(--gv); }
.inspector-head .icon-button { margin-left: auto; }
.inspector-title { font-weight: 700; color: var(--gv); }
.inspector-section { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 8px 6px 4px; }
.inspector-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; text-decoration: none; font-size: 13px; }
.inspector-row svg { width: 15px; height: 15px; color: var(--gv); flex: none; }
.inspector-row span { flex: 1; }
.inspector-row code { font: 11px var(--mono); color: var(--ink-3); }
.inspector-row:hover { background: var(--gv-bg); }
.brandpill { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #0866ff1a; color: #0866ff; font-size: 11px; font-weight: 700; }

.pointers { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 9px 9px; border-top: 1px solid color-mix(in srgb, var(--gv) 25%, transparent); flex: none; }
.pointer { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--gv) 40%, transparent);
  background: var(--panel); color: var(--gv); font-size: 11px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pointer svg { width: 11px; height: 11px; }
.pointer:hover { background: var(--gv); color: #fff; }
.pointer.config { border-style: dashed; }

/* Block views */
.chat { display: flex; flex-direction: column; gap: 6px; height: 100%; overflow: hidden; justify-content: flex-end; }
.chat > .muted:only-child { margin: auto; }

.term-lines { max-height: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; }
.bubble { max-width: 90%; padding: 7px 10px; border-radius: 12px; font-size: 12.5px; line-height: 1.38; overflow-wrap: anywhere; }
.bubble.her { align-self: flex-end; background: #0866ff; color: #fff; border-bottom-right-radius: 4px; }
.bubble.agent { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.bubble.urgent { background: var(--bad); color: #fff; font-weight: 650; }
.bubble.gravitee { align-self: stretch; max-width: none; background: var(--gv-bg); color: var(--ink); border: 1px solid var(--gv); }
.bubble.attacker { background: var(--bad-bg); color: var(--bad); }
.term { height: 100%; padding: 9px 11px; border-radius: 9px; background: #141416; color: #d6d6dc; font: 11.5px/1.5 var(--mono); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; }
.term .line { white-space: pre-wrap; overflow-wrap: anywhere; }
.term .line.bad { color: #ff8a8d; }
.term .line.ok { color: #6fe0bf; }
.term .line.dim { color: #8b8b95; }
.gauge { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin: 4px 0 10px; }
.gauge > i { display: block; height: 100%; background: var(--accent); transition: width .15s; }
.gauge.full > i { background: var(--bad); }
.kv { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); margin: 4px 0; }
.kv b { color: var(--ink); font-variant-numeric: tabular-nums; }
.kv.bad b { color: var(--bad); }
.kv.ok b { color: var(--ok); }
.big { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 2px 0 10px; }
.big.bad { color: var(--bad); }
.big small { font-size: 12.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.rule { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 650; }
.rule.kept { background: var(--ok-bg); color: var(--ok); }
.rule.lost { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.doing { min-height: 22px; margin-top: 8px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 3px 9px; border-radius: 7px; background: var(--panel-2); font-size: 12px; line-height: 1.55; }
.block.kind-gravitee .fact { background: var(--panel); border: 1px solid color-mix(in srgb, var(--gv) 18%, var(--line)); }
.fact dt { color: var(--ink-3); white-space: nowrap; flex: none; }
.fact dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact.ok dd { color: var(--ok); }
.fact.bad dd { color: var(--bad); }
.fact.held dd { color: var(--held); }
.checks { display: flex; flex-direction: column; gap: 4px; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 9px; line-height: 1.5; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); transition: border-color .25s, color .25s; }
.check i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; transition: background .25s, box-shadow .25s; }
.check.active { border-color: var(--gv); color: var(--ink); font-weight: 650; }
.check.active i { background: var(--gv); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gv) 25%, transparent); }
.tools { margin-top: 8px; color: var(--ink-3); font: 11px/1.45 var(--mono); }
.list { display: flex; flex-direction: column; justify-content: flex-start; gap: 5px; overflow: hidden; }
.list .row { padding: 3px 8px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.list .row.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); color: var(--bad); }
.list .row.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); color: var(--ok); }
.list .row.held { border-color: color-mix(in srgb, var(--held) 45%, var(--line)); color: var(--held); }
.muted { color: var(--ink-3); }

/* Caption: the step being played, under the stage */
.caption { border-bottom: 1px solid var(--line); padding: 10px 16px; height: 92px; display: flex; align-items: center; overflow: hidden; }
.caption-idle { color: var(--ink-3); font-size: 14px; }
.caption-step { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding-left: 12px; border-left: 3px solid var(--line-2); }
.caption-step.tone-bad { border-left-color: var(--bad); }
.caption-step.tone-ok { border-left-color: var(--ok); }
.caption-step.tone-held { border-left-color: var(--held); }
.caption-step.tone-blocked { border-left-color: var(--blocked); }
.caption-step.idle.without { border-left-color: var(--bad); }
.caption-step.idle.with { border-left-color: var(--gv); }
.caption-step.idle .caption-n { color: var(--ink-3); }
.caption-n { flex: none; min-width: 64px; color: var(--ink-3); font-size: 12px; font-weight: 600; padding-top: 3px; }
.caption-title { font-size: 16px; font-weight: 700; letter-spacing: -0.005em; }
.caption-actor { margin-left: 10px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.caption-text { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.caption-words { flex: 1; min-width: 0; }
.caption.waiting { background: var(--held-bg); }
.caption-wait { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--held); }
.caption-wait .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--held); flex: none; animation: pulse 1.2s infinite; }
.caption-actions { display: flex; align-items: center; gap: 8px; flex: none; align-self: center; }
.caption-hint { flex: none; align-self: center; max-width: 30ch; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.caption.done { background: var(--panel); }
.caption-step.end { align-items: center; border-left-color: var(--sunlight); }
.end-results { flex: 1; display: flex; gap: 32px; min-width: 0; }
.end-result { display: flex; flex-direction: column; }
.end-result small { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.end-result.without small, .end-result.without b { color: var(--bad); }
.end-result.with small, .end-result.with b { color: var(--gv); }
.end-result b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.end-result span { font-size: 12px; color: var(--ink-3); }

/* Recorder */
.recorder { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; box-shadow: var(--shadow); }
.recorder-body { flex: 1; min-height: 0; }
.recorder-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.recorder-head b { font-size: 13.5px; }
.recorder-body { overflow-y: auto; padding: 8px 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--ink-3); padding: 18px 8px; font-size: 13px; }
.step { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 0 10px 10px 0; padding: 9px 11px; }
.step.current { background: var(--panel-2); }
.step.tone-bad { border-left-color: var(--bad); }
.step.tone-ok { border-left-color: var(--ok); }
.step.tone-held { border-left-color: var(--held); }
.step.tone-blocked { border-left-color: var(--blocked); }
.step-head { display: flex; align-items: baseline; gap: 8px; }
.step-n { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.step-title { font-weight: 650; font-size: 13.5px; line-height: 1.3; flex: 1; }
.step-actor { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.step-text { color: var(--ink-2); font-size: 12.5px; margin: 3px 0 0; }
.items { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.note { font-size: 12.5px; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.note.bad { border-left-color: var(--bad); color: var(--bad); }
.note.ok { border-left-color: var(--ok); color: var(--ok); }
details.call { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
details.call summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 5px 8px; cursor: pointer; list-style: none; font-size: 12px; }
details.call summary::-webkit-details-marker { display: none; }
.call-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-line .via { margin-left: 8px; padding: 0 6px; border-radius: 5px; background: var(--panel-2); color: var(--ink-3); font-family: var(--sans); font-size: 11px; }
.status { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 5px; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.blocked { background: var(--blocked-bg); color: var(--blocked); }
.status.held { background: var(--held-bg); color: var(--held); }
.ms { color: var(--ink-3); font: 11px var(--mono); }
.call-body { padding: 0 8px 8px; display: grid; gap: 6px; }
.call-line { font: 11.5px var(--mono); color: var(--ink-2); word-break: break-all; }
.call-section { font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--ink-3); margin-top: 2px; }
pre.code { margin: 0; padding: 8px; border-radius: 6px; background: var(--panel-2); font: 11px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.claims { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font: 11.5px var(--mono); padding: 7px 9px; border-radius: 7px; background: var(--gv-bg); margin: 0; }
.claims dt { color: var(--ink-3); }
.claims dd { margin: 0; color: var(--ink); word-break: break-all; }
.claims-label { font-size: 11.5px; font-weight: 650; color: var(--gv); }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 92vw); z-index: 40; background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: start; justify-content: space-between; padding: 16px 18px 10px; }
.drawer-kicker { color: var(--gv); font-size: 12px; font-weight: 700; }
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-file { font: 12px var(--mono); color: var(--ink-3); }
.drawer-body { flex: 1; margin: 0 18px 18px; padding: 14px; overflow: auto; border-radius: 10px; background: var(--panel-2); font: 12px/1.55 var(--mono); white-space: pre-wrap; }

@media (prefers-reduced-motion: reduce) {
  .edges path.edge.lit { animation: none; }
  .waitbar .dot { animation: none; }
  .block { transition: none; }
}

/* A narrow frame, as the Lab UI's beside its guide */
@media (max-width: 900px) {
  main { padding: 12px 14px; }
  .top { padding: 8px 14px; gap: 14px; }
  .step-link { padding: 0 8px; }
  .inc-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .impact { justify-content: flex-start; }
  .metric { min-width: 0; flex: 1 1 140px; }
  .bar-right .stage-legend { display: none; }
  .caption-step { flex-wrap: wrap; }
  .caption-actions { width: 100%; }
}

/* Footer: what to do next, and where the stories come from */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin: 32px 24px 0; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--ink-2); }
.foot-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; flex: 1 1 420px; }
.foot-cta strong { font: 800 24px/1.15 var(--display); letter-spacing: -.015em; color: var(--ink); }
.foot-links { display: flex; gap: 18px; font-size: 13.5px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--ink-3); max-width: 80ch; }

@media (max-width: 760px) {
  .top { gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
  .brand-name, .top-ctas .button:not(.primary) { display: none; }
  .crumbs { order: 3; flex-basis: 100%; padding-left: 0; border-left: 0; overflow: hidden; text-overflow: ellipsis; }
  .step-nav { display: none; }
  .top-ctas { margin-left: auto; }
  main { padding: 14px 16px 20px; }
  .foot { margin: 24px 16px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.brand-logo { stroke: none; }

.big { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
@media (max-width: 760px) {
  .inc-tags { flex-wrap: wrap; white-space: normal; gap: 8px; }
  /* ponytail: the stage keeps its 1240px design width and scales down; a phone gets a nudge, not a second layout */
  .stage-box::before { content: "The replay is drawn for a wide screen: turn your phone or open it on a laptop."; display: block; padding: 8px 12px;
    font-size: 12.5px; color: var(--ink-2); background: var(--panel-2); border-bottom: 1px solid var(--line); }
}

/* An incident on its own page: the story, readable without the app */
.story-page { max-width: 1080px; margin: 28px auto 0; padding: 0 24px; }
.story-page h1, .story-page > h2 { margin: 0; font: 800 clamp(34px, 4.4vw, 56px)/1.02 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.story-page h3 { margin: 32px 0 10px; font: 800 22px/1.15 var(--display); letter-spacing: -.01em; }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 14px 0 0; color: var(--ink-2); font-size: 13.5px; }
.story-lead { margin: 16px 0 0; max-width: 60ch; font-size: 20px; line-height: 1.45; font-weight: 600; text-wrap: pretty; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 24px; }
.story-text p, .story-page > p { max-width: 68ch; font-size: 16px; line-height: 1.65; color: var(--ink); }
.story-text ol, .story-sources { padding-left: 20px; line-height: 1.6; max-width: 72ch; }
.story-text li { margin-bottom: 8px; }
.story-side { padding: 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); align-self: start; }
.story-side dl { margin: 0; font-size: 13.5px; }
.story-side dt:first-child { margin-top: 0; }
.story-damage { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 28px 0 0; }
.story-damage .dmg-value { overflow-wrap: anywhere; font-size: clamp(40px, 7vw, 88px); line-height: .9; letter-spacing: -.045em; }
.story-damage span:last-child { max-width: 32ch; font-size: 17px; color: var(--ink-2); }
.story-side dt { margin-top: 12px; color: var(--ink-3); font-weight: 600; }
.story-side dd { margin: 2px 0 0; }
.story-sources a { color: var(--accent-ink); }
.story-page .button { margin-top: 16px; }
main:empty { display: none; }
@media (max-width: 760px) { .story-page { padding: 0 16px; } .story-grid { grid-template-columns: 1fr; gap: 20px; } }

/* A story page: every incident down the side, the story beside it */
.story-layout { display: flex; gap: 40px; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.story-layout .story-page { flex: 1; min-width: 0; margin-left: 0; padding: 0; }
.story-rail { flex: none; width: 260px; padding-top: 32px; position: sticky; top: 64px; align-self: flex-start; max-height: calc(100vh - 80px); overflow: auto; }
.rail-home { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.rail-home::before { content: "\2190  "; }
.story-rail ol { list-style: none; margin: 0; padding: 0; }
.story-rail li a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.story-rail li a:hover { background: var(--panel); color: var(--ink); }
.story-rail li a[aria-current] { background: var(--panel); color: var(--ink); font-weight: 700; box-shadow: inset 2px 0 0 var(--sunlight); }
.story-rail li span { flex: none; width: 38px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .story-layout { display: block; padding: 0; } .story-rail { display: none; } .story-layout .story-page { padding: 0 24px; margin: 28px auto 0; } }

/* Where Gravitee would help, on the incidents where it honestly would */
.gv-help { margin-top: 28px; padding: 2px 22px 8px; border-radius: 14px; background: var(--gv-bg); border: 1px solid color-mix(in srgb, var(--gv) 28%, transparent); max-width: 76ch; }
.gv-help h3 { margin-top: 18px; color: var(--gv); }
.gv-help p { font-size: 16px; line-height: 1.65; color: var(--ink); }
.foot-note a { color: inherit; }

/* Top bar of an incident between phone and wide desktop: the title truncates, the neighbours keep only their arrows */
.crumbs { overflow: hidden; }
.crumb.current { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.step-link span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1280px) { .step-link span { display: none; } .step-link { padding: 0 9px; } }
