/* The colours follow the time-aware layer picture this page animates: blue layers and units, orange claims.
   Light since 7.11.2026 evening (the owner): the video is watched on phones in a bright hall, and a dark page
   with small grey text read worst there. The values take Elisa's own look, measured from elisa.fi's
   stylesheets on 7.11.2026: its blue for structure and actions, its orange for the claims, its greys, and Jost
   for headings. --copper keeps its name from the first picture (copper bars) and is now that orange; text on it
   is dark. The four status colours carry white text. Jost is served from this folder (web/fonts, SIL Open Font
   License 1.1, the licence beside it), so the page still loads nothing from outside. */
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/jost-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #efeff1;
  --panel: #ffffff;
  --panel-raised: #f6f6f7;
  --navy: #064aac;
  --line: #d2d2d6;
  --copper: #ff6400;
  --copper-bright: #ff8800;
  --accent: #005fed;
  --accent-dark: #064aac;
  --text: #171c43;
  --muted: #70707a;
  --faint: #8d8d95;
  --propose: #008253;
  --check: #a8690f;
  --unknown: #5b7a96;
  --disputed: #e0022a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --head: "Jost", var(--sans);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  display: grid;
  grid-template-rows: auto auto clamp(160px, 18vh, 220px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.42 var(--sans);
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; flex-direction: column; line-height: 1.1; min-width: 150px; }
.brand strong { font: 600 19px var(--head); letter-spacing: 0; color: var(--accent); }
.brand span { color: var(--muted); font-size: 12px; }

#scenes { display: flex; gap: 4px; flex: 1; min-width: 0; }

#scenes button {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: 500 12.5px/1.15 var(--sans);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
#scenes button b { display: block; color: var(--faint); font: 11px var(--mono); }
#scenes button:hover { color: var(--text); border-color: var(--faint); }
#scenes button[aria-current="step"] {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}
#scenes button[aria-current="step"] b { color: #cfe0ff; }

.clock { font: 600 19px var(--mono); white-space: nowrap; color: var(--accent); }
.clock span { color: var(--muted); font: 400 12px var(--sans); }

/* The story: what this scene shows, in plain words, and where to look */

#story {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 0 2px;
}
.story-main { flex: 1; min-width: 0; }
#story h1 {
  margin: 0 0 1px;
  font: 600 23px/1.2 var(--head);
  letter-spacing: 0;
}
#story-text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.38;
  color: #2c3845;
  max-width: 1100px;
}
#story-look {
  margin: 0 0 2px;
  flex: 0 0 auto;
  max-width: 300px;
  text-align: right;
  color: var(--accent);
  font: 600 13px/1.35 var(--sans);
}
#story-look:empty { display: none; }
#story-look::before { content: "Look at "; color: var(--muted); font-weight: 400; }

.panel {
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(27, 36, 48, .06);
  transition: opacity .35s, border-color .35s;
}
.panel.dim { opacity: .45; }
.panel.lit { border-color: var(--copper-bright); box-shadow: 0 0 0 1px var(--copper-bright); }

h2 {
  margin: 0 0 6px;
  font: 700 12px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
h2 small {
  margin-left: 6px;
  font: 400 12px var(--sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

/* The time axis */

#timeline { padding: 0; overflow: hidden; }
#timeline-svg { display: block; width: 100%; height: 100%; }

.t-band { fill: #deedff; opacity: .55; }
.t-layer { fill: var(--text); font: 700 11.5px var(--mono); letter-spacing: .03em; }
.t-sublayer { fill: var(--muted); font: 11px var(--sans); }
.t-tick { fill: var(--muted); font: 11px var(--mono); }
.t-grid { stroke: var(--line); stroke-width: 1; }

.t-event { fill: var(--copper-bright); stroke: var(--panel); stroke-width: .5; transition: opacity .3s; }
.t-event.future { fill: none; stroke: var(--faint); stroke-width: 1; }
.t-event-label { fill: var(--text); font: 11.5px var(--sans); }
.t-event-label.future { fill: var(--faint); }

.t-source { stroke: none; cursor: pointer; }
.t-source.teams { fill: var(--unknown); }
.t-source.email { fill: var(--check); }
.t-source.future { fill: none; stroke: var(--faint); }
.t-source.elisa { stroke: var(--copper-bright); stroke-width: 2; }

.t-bar { fill: var(--copper); transition: opacity .3s; cursor: pointer; }
.t-bar.ended { fill: #ffce85; }
.t-bar.waiting { fill: none; stroke: var(--copper-bright); stroke-dasharray: 4 3; }
.t-bar-open { stroke: var(--copper-bright); stroke-width: 2; stroke-dasharray: 3 5; }
.t-bar-unknown { stroke: var(--copper-bright); stroke-width: 2; stroke-dasharray: 2 3; }
.t-bar-label { fill: var(--text); font: 600 11.5px var(--sans); pointer-events: none; }
.t-bar-selected { stroke: var(--text); stroke-width: 1.5; }

#t-line { transition: transform .55s cubic-bezier(.3, .7, .2, 1); }
.t-now { stroke: var(--accent); stroke-width: 2; }
.t-now-bg { fill: var(--panel); }
.t-now-label { fill: var(--accent); font: 700 12px var(--mono); }

/* The three middle panels */

main {
  display: grid;
  grid-template-columns: 310px minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

#sources, #claims, #graph { padding: 8px 10px; overflow: auto; }
#graph { display: flex; flex-direction: column; overflow: hidden; }
#graph-svg { flex: 1; min-height: 0; width: 100%; }

.proof { display: flex; gap: 6px; margin-bottom: 6px; }
.proof div {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  background: var(--panel-raised);
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.15;
  color: var(--muted);
}
.proof b { font: 700 24px/1 var(--mono); color: var(--propose); }

#source-list { list-style: none; margin: 0; padding: 0; }
#source-list li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 2px 4px;
  border-radius: 3px;
  font: 12.5px/1.45 var(--sans);
  cursor: pointer;
}
#source-list li:hover { background: var(--panel-raised); }
#source-list li.future { color: var(--faint); }
#source-list .channel { width: 14px; font: 700 11px var(--mono); color: var(--unknown); }
#source-list .email .channel { color: var(--check); }
#source-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#source-list .note { color: var(--muted); white-space: nowrap; font-size: 11.5px; }
#source-list .elisa .name { color: var(--accent); }
#source-list .future .note { color: var(--faint); }

.metrics { margin-bottom: 6px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.metrics p { margin: 0 0 2px; }
.metrics b { color: var(--text); font-family: var(--mono); font-weight: 600; }

/* Claims */

.claim {
  margin-bottom: 7px;
  padding: 7px 9px;
  background: var(--panel-raised);
  border: 1px solid transparent;
  border-left: 3px solid var(--copper);
  border-radius: 4px;
  cursor: pointer;
  animation: arrive .45s ease-out;
}
.claim.selected { border-color: var(--copper-bright); }
.claim.used { border-left-color: var(--propose); }
.claim.waiting { border-left-style: dashed; }
.claim.superseded { opacity: .62; }
.claim p { margin: 0 0 4px; }
.claim .meta { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12.5px; color: var(--muted); }
.claim .meta b { color: var(--text); font-weight: 600; }
.claim .evidence { display: none; margin-top: 6px; }
.claim.selected .evidence { display: block; }

@keyframes arrive { from { opacity: 0; transform: translateY(5px); } }

.chip {
  padding: 0 5px;
  border-radius: 3px;
  font: 700 11px/1.6 var(--mono);
  color: #fff;
  background: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.active { background: var(--propose); }
.chip.disputed, .chip.not_applicable { background: var(--disputed); }
.chip.recheck, .chip.order_unknown, .chip.waiting { background: var(--check); }
.chip.superseded { background: var(--muted); }

/* The evidence, from the template: one row per line, the label apart from what it says */

ul.evidence {
  list-style: none;
  margin: 0;
  padding: 5px 8px;
  background: var(--panel);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: #2c3845;
}
ul.evidence li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px;
  padding: 1px 0;
}
ul.evidence li + li { border-top: 1px solid var(--line); }
ul.evidence b { color: var(--muted); font: 700 10.5px/1.6 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
ul.evidence .dot { color: var(--faint); margin: 0 5px; }
ul.evidence q { color: var(--text); quotes: "\201C" "\201D"; }

/* The graph */

.g-edge { fill: none; stroke: var(--line); stroke-width: 1.3; }
.g-edge.about { stroke: var(--copper); stroke-width: 1.6; }
.g-edge.applies { stroke: var(--propose); stroke-width: 2; }
.g-edge.supersedes { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 5 4; }
.g-edge.conflicts { stroke: var(--disputed); stroke-width: 2.2; }
.g-edge.lit { stroke-width: 3; }
.g-edge-label { fill: var(--muted); font: 11px var(--sans); }
.g-column { fill: var(--faint); font: 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.g-node rect { fill: var(--panel-raised); stroke: var(--line); stroke-width: 1.2; }
.g-node text { fill: var(--text); font: 12px var(--sans); text-anchor: middle; dominant-baseline: central; }
.g-node.node text { font-family: var(--mono); fill: #fff; }
.g-node.node rect { fill: var(--navy); stroke: var(--accent); }
.g-node.claim rect { fill: var(--copper); stroke: var(--copper-bright); cursor: pointer; }
.g-node.claim text { font-weight: 600; fill: var(--text); }
.g-node.claim.waiting rect { fill: none; stroke-dasharray: 4 3; }
.g-node.claim.waiting text { fill: var(--text); }
.g-node.claim.superseded rect { fill: #ffe3ba; stroke: #ffce85; }
.g-node.claim.superseded text { fill: var(--muted); }
.g-node.claim.lit rect { stroke: var(--text); stroke-width: 2.4; }
.g-node.unit-lit rect { stroke: var(--propose); stroke-width: 2.4; }
.g-node.claim { animation: fade .5s ease-out; }
@keyframes fade { from { opacity: 0; } }

/* The agent */

#agent {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 14px;
  padding: 8px 10px;
}

#ask { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
#ask > label { display: block; font-size: 12px; color: var(--muted); }
#ask select, #ask input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 5px 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: 13.5px var(--mono);
}
#ask select:focus, #ask input:focus, button:focus-visible { outline: 2px solid var(--copper-bright); outline-offset: 1px; }
#ask fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 12.5px; }
#ask legend { float: left; margin-right: 8px; padding: 0; font-size: 12px; color: var(--muted); }
#ask .gap { margin-left: 4px; }
#ask button[type="submit"] {
  padding: 6px;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  border-radius: 4px;
  color: #fff;
  font: 700 14px var(--sans);
  cursor: pointer;
}
#ask button[type="submit"]:hover { background: var(--accent-dark); }

.presets { display: flex; flex-wrap: wrap; gap: 4px; }
.presets button {
  padding: 3px 7px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: 12px var(--sans);
  cursor: pointer;
}
.presets button:hover { border-color: var(--accent); }

.answer { min-height: 0; overflow: auto; }
.answer .empty { color: var(--muted); }

.tier {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 4px;
  font: 800 19px/1.35 var(--mono);
  letter-spacing: .02em;
  color: #fff;
  animation: arrive .35s ease-out;
}
.tier.propose { background: var(--propose); }
.tier.check_first { background: var(--check); }
.tier.unknown { background: var(--unknown); }
.tier.learned { background: var(--copper-bright); color: var(--text); }
.tier.acted { background: var(--propose); }
.draft { margin: 8px 0 10px; padding: 10px 14px; border: 1px dashed var(--copper); border-radius: 6px; max-width: 900px; }
.draft-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.draft-head b { color: var(--accent); font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.draft p { margin: 0; font-size: 16px; line-height: 1.35; }

.answer-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.answer-head .match { font-size: 13px; color: var(--muted); }
.answer-head .match b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.next { margin: 2px 0 6px; font-size: 21px; line-height: 1.28; letter-spacing: -0.01em; font-weight: 600; }
.answer dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0 0 8px; font-size: 14px; }
.answer dt { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.answer dd { margin: 0; }
.answer dd.no { color: var(--disputed); font-weight: 600; }
.answer dd.read { color: var(--propose); }
.answer dl.log { grid-template-columns: 170px minmax(0, 1fr); gap: 8px 12px; margin: 12px 0; font-size: 20px; line-height: 1.3; }
.answer dl.log dt { font-size: 14px; padding-top: 4px; }

.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 8px; }
.side { min-width: 0; padding: 6px 8px; background: var(--panel-raised); border-radius: 4px; }
.side-head { font-size: 13px; line-height: 1.35; }
.side-head .chip { margin-right: 5px; }
.side .note { margin: 4px 0 0; font-size: 12.5px; color: var(--check); }
.side ul.evidence { margin-top: 5px; }

/* The overlay */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(27, 36, 48, .5);
  animation: fade .2s ease-out;
}
.overlay[hidden] { display: none; }

#overlay-card {
  position: relative;
  width: min(880px, 90vw);
  max-height: 86vh;
  overflow: auto;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--copper-bright);
  border-radius: 8px;
}
#overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
}
#overlay-card h3 { margin: 0 0 2px; font: 600 21px var(--head); }
#overlay-card .sub { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
#overlay-card .sub code { font: 11.5px var(--mono); }
.message { margin-bottom: 8px; }
.message .who { font: 12.5px var(--mono); color: var(--muted); }
.message .who b { color: var(--accent); font-weight: 600; }
.message .body { white-space: pre-wrap; font-size: 16px; }
.limits { margin: 0 0 14px; padding: 0; list-style: none; }
.limits li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 18px; line-height: 1.32; }
.limits li:last-child { border: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 14.5px; color: var(--muted); }
.two b { color: var(--text); display: block; margin-bottom: 2px; }

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