@font-face {
  font-family: "Familjen Grotesk";
  src: url("fonts/familjen-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --sky: #d8e0dc;
  --panel: #f7f9f6;
  --panel-raised: #e6ece6;
  --field: #ffffff;
  --hair: #c3cdc5;
  /* The faint dotted line beside the panel arrow and under the chain arrow. */
  --strip-line: #d6ddd8;
  --control-line: #6b7d74;
  --text: #14241f;
  --dim: #4d5f57;
  --accent: #0f5c4d;
  --accent-hover: #0b4a3e;
  --on-accent: #ffffff;
  --request: #e8590c;
  --response: #0f7b5a;
  --danger: #b3261e;
  --console: #12211c;
  --console-text: #dfe9e3;
  --console-dim: #9db3aa;
  --console-in: #ffb27a;
  --console-out: #8fe3b5;
  --display: "Familjen Grotesk", "Segoe UI", sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", sans-serif;
  --rail-height: clamp(190px, 30dvh, 306px);
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

button, input, select, textarea { font-size: 14px; }

/* For the keyboard: out of sight until it has focus. */
/* The button that skips the first view, under the text in the model box's top left corner, until the page has arrived. */
.skip-intro {
  position: relative; margin-top: 14px; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  background: var(--panel); color: var(--text); border: 1px solid var(--control-line); border-radius: 18px; cursor: pointer;
  font: 600 15px/1 var(--display); white-space: nowrap;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
}

.skip-intro[hidden] { display: none; }

.skip-intro:hover { background: var(--panel-raised); }

.skip-intro:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-intro svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 20;
  padding: 10px 14px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 2px;
  font: 600 16px var(--display);
}

/* Heard by a screen reader, not seen. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The flow is known before the first paint, see the top of index.html. */
html[data-shown-flow="page"] [data-flows]:not([data-flows~="page"]),
html[data-shown-flow="api"] [data-flows]:not([data-flows~="api"]),
html[data-shown-flow="ai"] [data-flows]:not([data-flows~="ai"]),
html[data-shown-flow="benchmark"] [data-flows]:not([data-flows~="benchmark"]) { display: none; }

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

/* The same for the page: a tab with less in it must not widen the stage, or the house zooms. */
html { scrollbar-gutter: stable; }

body {
  background: var(--sky);
  color: var(--text);
  font: 400 16px/1.45 var(--body);
  scrollbar-color: var(--hair) transparent;
}

/* Smooth scrolling (js/smooth-scroll.js): Lenis's own rules, except its "body { height: auto }", since the stage
   is laid out against a body as tall as the window. A box Lenis leaves alone keeps its scroll to itself. */
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-lenis-prevent-wheel], .lenis [data-lenis-prevent-touch] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2 { font-family: var(--display); font-weight: 600; margin: 0; }

h2 { font-size: 22px; line-height: 1.1; letter-spacing: 0.01em; margin-bottom: 10px; }

.page {
  display: grid;
  --side-width: clamp(400px, 36vw, 520px);
  grid-template-columns: minmax(0, 1fr) var(--side-width);
  grid-template-rows: auto minmax(0, 1fr) var(--rail-height);
  /* The next section's heading shows below the fold, so that a reader sees there is more. */
  height: calc(100dvh - 40px);
}

@media (min-width: 1101px) {
  /* The panel keeps its width and slides out past the edge, so that its text does not wrap on the way. */
  .page { overflow-x: clip; transition: grid-template-columns 400ms ease-in-out, grid-template-rows 400ms ease-in-out; }

  /* A strip of the panel stays in view, and holds the arrow that brings it back. */
  .page.side-closed { grid-template-columns: minmax(0, 1fr) 32px; }

  .page .side { width: var(--side-width); }

  /* A low window has little room for the panel. The first examples stay, and the rest are one click away. */
  @media (max-height: 800px) {
    .prompt-examples:not(.all) button:nth-child(n+4) { display: none; }

    .prompt-examples.all + button.more-examples { display: none; }

    button.more-examples { display: block; width: 100%; height: 38px; margin-top: 8px; background: transparent; color: var(--accent); border: 1px solid var(--control-line); border-radius: 2px; cursor: pointer; font: 600 16px var(--display); }
  }
}

/* ---- 3D stage ---- */

.stage { position: relative; min-height: 0; overflow: hidden; }

/* A sideways drag turns the house. A swipe up or down scrolls the page, and two fingers zoom it. */
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y pinch-zoom; }

/* The house fades in when it has been drawn, instead of popping up. */
#scene { opacity: 0; transition: opacity 500ms ease-out; }

#scene.shown { opacity: 1; }

.intro { position: absolute; top: 40px; left: 32px; max-width: min(340px, 40%); pointer-events: none; }

/* The search and the room grid over the model. They give way when the house opens, unless they are in use. */
.stage > .rooms-panel {
  position: absolute; top: 16px; right: 16px; width: min(340px, 46%); margin: 0; padding: 8px;
  background: rgb(247 249 246 / 0.6); border: 1px solid var(--hair); border-radius: 2px;
  transition: opacity 240ms ease-out;
}

.stage > .rooms-panel > h2, .stage > .rooms-panel > .fine { display: none; }

.stage > .rooms-panel > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.stage > .rooms-panel input[type="search"] { height: 34px; margin: 6px 0 8px; }

.stage > .rooms-panel .search-result { min-height: 0; margin: 0 0 6px; color: var(--text); }

.stage > .rooms-panel .search-result:empty { display: none; }

.side .room-tabs { margin-bottom: 8px; }

#rooms-energy .room-cell .trend { display: none; }

/* One view at a time, chosen by the tabs, also with the side panel rolled in: two plans side by side left the house too
   little room. The tabs follow the house: open shows energy, closed shows temperature (main.js). */
.view-title { display: none; margin: 0 0 6px; font: 600 14px/1.2 var(--display); }

.rooms-panel[data-view="temperature"] .room-view-energy, .rooms-panel[data-view="energy"] .room-view-temperature { display: none; }

/* Holds its line in both views, so that the panel keeps its height. */
.energy-legend { margin: 4px 0 0; min-height: 15px; color: var(--text); font-size: 12px; line-height: 15px; visibility: hidden; }

.rooms-panel[data-view="energy"] .energy-legend { visibility: visible; }

/* A search keeps the house open, and must stay within reach to be cleared. With the side panel rolled in, the plan stays,
   and the opened house keeps clear of it. */
.page:not(.side-closed) #scene[data-open="1"] ~ .rooms-panel:not(:hover):not(:focus-within):not(:has(input:not(:placeholder-shown))) { opacity: 0; pointer-events: none; }

/* Over the model the height is what the window has room for above the weather. The plan is squeezed north to south, and keeps its shape. */
.stage > .rooms-panel { --plan-height: clamp(46px, calc((100dvh - 624px) / 3), 118px); }

@media (max-height: 800px) {
  .stage > .rooms-panel { --plan-height: clamp(46px, calc((100dvh - 580px) / 3), 118px); }
}

.intro h1 { font-size: clamp(38px, 4vw, 58px); line-height: 1; letter-spacing: -0.02em; }

.intro p { margin: 12px 0 0; color: var(--text); font-size: 16px; }

/* Every flow's text is laid out, the other flows' unseen and out of the way, so that the house can keep clear of the tallest
   one (house-view.js) and does not grow and shrink between the tabs. Beats the rule that takes other flows' parts away. */
.intro-flows { display: flow-root; position: relative; }

.page .stage .intro-flows > [data-flows] { display: flow-root; position: absolute; top: 0; left: 0; right: 0; visibility: hidden; }

html[data-shown-flow="page"] .page .stage .intro-flows > [data-flows~="page"],
html[data-shown-flow="api"] .page .stage .intro-flows > [data-flows~="api"],
html[data-shown-flow="ai"] .page .stage .intro-flows > [data-flows~="ai"],
html[data-shown-flow="benchmark"] .page .stage .intro-flows > [data-flows~="benchmark"] { position: static; visibility: visible; }

.stage-note.bad { color: var(--danger); }

/* ---- Side panel ---- */

.side {
  grid-row: 2; grid-column: 2;
  background: var(--panel);
  border-left: 1px solid var(--hair);
  overflow-y: auto;
  /* The scroll bar's room is kept also when a flow is short enough to need none, so that nothing moves between the tabs. */
  scrollbar-gutter: stable;
  min-height: 0;
  padding: 22px 22px 28px;
  display: flex; flex-direction: column; gap: 28px;
}

.fine { margin: 10px 0 0; color: var(--dim); font-size: 14px; }

.rooms { display: grid; gap: 6px; }

.floor-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 3px; }

.floor-cells { position: relative; height: var(--plan-height); }

/* The employees on the plans: small dots that glide from room to room as the day goes, never in the way of a click. */
.plan-people { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.plan-dot { position: absolute; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #1d3f7a; opacity: 0.7; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.5); transition: left 0.7s ease, top 0.7s ease, opacity 0.4s; }

.plan-dot.away { opacity: 0; }

.floor-shape { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--hair); }

.floor-row > span { color: var(--dim); font: 600 16px var(--display); align-self: center; }

/* The panel over the house lets the picture through, so its floor numbers need the darkest text. */
.stage > .rooms-panel .floor-row > span { color: var(--text); }

/* Placed by the floor plan, see room-panel.js. The thin line between rooms is their walls. */
.room-cell {
  appearance: none; position: absolute; box-sizing: border-box; border: 1px solid var(--panel); border-radius: 0;
  padding: 0; cursor: pointer; container-type: size;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #0c1512;
  font: 600 12px/1 var(--display);
  font-variant-numeric: tabular-nums;
  transition: filter 120ms ease-out, opacity 120ms ease-out;
}

.room-cell:hover { filter: brightness(1.15); }

.room-cell[aria-pressed="true"] { border-color: var(--request); outline: 2px solid var(--request); }

.room-cell:focus-visible { outline-color: var(--text); }

.room-cell { overflow: hidden; background: var(--panel-raised); }

/* Each room shows what it has room for: the temperature in most, and only its colour in the smallest. */
.room-cell > span { flex: 1; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.room-cell .value { display: flex; align-items: center; justify-content: center; gap: 1px; }

.room-cell .trend { display: none; }

@container (min-width: 36px) { .room-cell .trend { display: block; } }

@container (max-height: 11px), (max-width: 22px) { .room-cell .value { display: none; } }

.room-cell b { font-weight: 600; }

.trend { width: 7px; height: 7px; flex: none; }

[data-trend="rising"] .trend { fill: #0b7a3b; }

[data-trend="falling"] .trend { fill: #c81e1e; }

[data-trend="steady"] .trend { fill: #c99700; transform: rotate(90deg); }

[data-trend="falling"] .trend { transform: rotate(180deg); }

.room-cell.dimmed { opacity: 0.18; }

input[type="search"], input[type="text"] {
  width: 100%; height: 38px; margin: 4px 0 0; padding: 0 10px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px;
  font: 400 16px var(--body);
}

input[type="search"]::placeholder, input[type="text"]::placeholder { color: var(--dim); }

.search-result { min-height: 20px; margin: 4px 0 6px; color: var(--dim); font-size: 14px; }

.prompt-row { display: flex; gap: 8px; margin-top: 4px; }

.prompt-row input { flex: 1; min-width: 0; margin: 0; }

.prompt-row button[type="submit"] { width: auto; height: 38px; padding: 0 16px; }

.connect a { color: var(--accent); text-underline-offset: 2px; }

.control-room { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }

.control-room strong { font-weight: 600; }

.control-room span { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

label { display: block; color: var(--dim); font-size: 14px; }

.control-row { display: flex; gap: 14px; align-items: center; margin: 4px 0 14px; }

output { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; min-width: 76px; text-align: right; }

input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); height: 24px; margin: 0; }

button[type="submit"] {
  width: 100%; height: 44px; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  font: 600 18px/1 var(--display); letter-spacing: 0.01em;
  transition: background 120ms ease-out;
}

button[type="submit"]:hover:not(:disabled) { background: var(--accent-hover); }

button[type="submit"]:disabled { background: var(--panel-raised); color: var(--dim); cursor: not-allowed; }

.fine.bad { color: var(--danger); }

/* The answer to what was just asked. It stands right under the control. */
#control-message { margin: -16px 0 0; padding: 10px 12px; background: #dcefe6; color: var(--text); border-left: 3px solid var(--accent); border-radius: 2px; font-size: 16px; font-weight: 500; }

#control-message.bad { background: #fbe9e7; color: var(--danger); border-left-color: var(--danger); }

/* The API flow's answer in words, under Skicka anrop, in the same box as the AI-agent flow's answer. */
.tool-message { margin: 12px 0 0; padding: 10px 12px; background: #dcefe6; color: var(--text); border-left: 3px solid var(--accent); border-radius: 2px; }

.tool-message[hidden] { display: none; }

.tool-message.bad { background: #fbe9e7; color: var(--danger); border-left-color: var(--danger); }

.tool-message p { margin: 0; font-size: 16px; font-weight: 500; }

.tool-message dl { margin: 8px 0 0; font-size: 14px; }

.tool-message dl:empty { display: none; }

.tool-message dl div { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; }

.tool-message dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 480px; overflow-y: auto; scrollbar-width: thin; }

.log summary { cursor: pointer; }

.log summary span { display: block; }

.log summary .log-title { display: inline; }

.log-title { font-weight: 600; overflow-wrap: anywhere; }

.log-result { font-size: 14px; }

.log-result[hidden] { display: none; }

.log-caller.failed { color: var(--danger); }

.log-caller { color: var(--dim); font-size: 14px; }

.log-steps { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }

.log-steps li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 6px; padding: 2px 0; color: var(--dim); }

.log-steps svg { width: 12px; height: 12px; align-self: center; }

.log-steps .in svg { color: var(--request); }

.log-steps .out svg { color: var(--response); }

.log-steps .failed, .log-steps .failed svg { color: var(--danger); }

.log-steps time { font-variant-numeric: tabular-nums; }

.connect summary { cursor: pointer; font: 600 18px/1.2 var(--display); }

/* What opens under a summary starts 8 px below it, as under a heading. */
.side details > summary + * { margin-top: 8px; }

.connect p { color: var(--dim); font-size: 14px; }

/* The guide for each app: a heading with a small mark saying whether we have tested it. */
.connect-guide h3 { margin: 20px 0 4px; }
.connect-guide h3:first-child { margin-top: 0; }
.connect-guide p { margin: 0 0 8px; }
.connect-guide .tested, .connect-guide .untested {
  margin-left: 6px; padding: 1px 6px; vertical-align: 2px;
  font: 600 11px/1.4 var(--body); letter-spacing: 0.02em; border: 1px solid currentColor;
}
.connect-guide .tested { color: var(--accent); }
.connect-guide .untested { color: var(--dim); }

.connect pre {
  margin: 0; padding: 12px; overflow-x: auto;
  background: var(--console); color: var(--console-text); border: 1px solid var(--console);
  font: 13px/1.5 Consolas, "Cascadia Mono", monospace;
}

/* ---- The chain ---- */

.rail {
  grid-column: 1 / -1; grid-row: 3;
  position: relative;
  background: var(--panel);
  border-top: 1px solid var(--hair);
}

.stations {
  list-style: none; margin: 0; padding: 0; height: 100%;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
}

.stations li {
  position: relative;
  display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; min-width: 0; min-height: 0;
  padding: 30px 10px 10px 32px;
  transition: background 220ms ease-out;
}

/* The line a call travels on. */
.stations li::before {
  content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 1px; background: var(--hair);
}

.stations li:first-child::before { left: 32px; }

/* The line ends where the console below it ends. */
.stations li:last-child::before { right: 10px; }

/* The stop on the line. */
.stations li::after {
  content: ""; position: absolute; top: 10px; left: 32px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--panel); border: 1px solid var(--dim);
  transition: background 220ms ease-out, border-color 220ms ease-out;
}

.stations li.lit-in { background: rgb(232 89 12 / 0.12); }

.stations li.lit-in::after { background: var(--request); border-color: var(--request); }

.stations li.lit-out { background: rgb(15 123 90 / 0.12); }

.stations li.lit-out::after { background: var(--response); border-color: var(--response); }

.stations b { display: block; font: 600 22px/1.1 var(--display); }

.stations span { display: block; color: var(--dim); font-size: 14px; line-height: 1.3; hyphens: auto; }

.stations em {
  position: absolute; top: 28px; right: 14px;
  font: 600 18px/1.2 var(--display); font-style: normal; font-variant-numeric: tabular-nums;
  color: var(--dim);
}

.packet {
  position: absolute; top: 9px; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--request);
  opacity: 0;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), background 160ms linear, opacity 160ms linear;
}

.packet.back { background: var(--response); }

.packet.on { opacity: 1; }

/* ---- One console under each step ---- */

.console {
  flex: 1; min-height: 0;
  margin-top: 8px; padding: 8px;
  overflow-y: auto;
  background: var(--console);
  color: var(--console-text);
  border: 1px solid var(--console);
  border-radius: 2px;
  font: 12px/1.45 Consolas, "Cascadia Mono", monospace;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

/* Quiet until the first call, so that empty boxes do not outweigh the house. */
.console:empty { background: transparent; border: 1px dashed var(--hair); }

.console:empty::before { content: attr(data-hint); color: var(--dim); }

.console .in { color: var(--console-in); }

.console .out { color: var(--console-out); }

.console .note { color: var(--console-dim); }

.console .note:not(:first-child) { margin-top: 6px; }

/* ---- The menu ---- */

.flows {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  padding: 8px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--hair);
}

.flows button {
  height: 38px; padding: 0 20px;
  background: transparent; color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px; cursor: pointer;
  font: 600 18px/1 var(--display);
  transition: background 120ms ease-out;
}

.flow-choice { display: flex; align-items: center; gap: 4px; }

/* The bottom of the logo is the baseline of its letters, so "demo" stands on the same line as "newsec". */
.brand {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 22px; line-height: 1; white-space: nowrap;
}

.brand img { display: block; height: 30px; width: auto; }

.flows h2 { margin: 0 12px 0 0; font-size: 18px; }

.flows button:hover { background: var(--panel-raised); }

.flows button:active { transform: translateY(1px) scale(0.98); }

.flows button[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* The flows are tabs, not buttons: plain text, grey until chosen, and the chosen one dark with a green line under it. */
.flows .flow-choice button {
  border: 0; border-radius: 0; background: transparent; color: var(--dim);
  box-shadow: inset 0 -2px 0 transparent;
  transition: color 120ms ease-out, box-shadow 120ms ease-out;
}

.flows .flow-choice button:hover { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--hair); }

.flows .flow-choice button:active { transform: none; }

.flows .flow-choice button[aria-current] { background: transparent; color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

.new-version {
  position: fixed; top: 62px; right: 16px; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px); padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 2px;
  box-shadow: 0 4px 16px rgb(20 36 31 / 0.2);
  font-size: 14px;
}

.flows .new-version button { background: var(--request); border-color: var(--request); color: #1a0a00; }

.flows .new-version button:hover { background: #f26a1f; }

.flows-end { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 16px; }

.flows .reset {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px;
}

.reset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- API tool ---- */

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.presets button {
  height: 34px; padding: 0 10px;
  background: var(--panel-raised); color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px; cursor: pointer;
  font: 400 14px var(--body);
}

.presets button:hover { border-color: var(--dim); }

.api-calls-intro { margin: 0 0 10px; color: var(--dim); font-size: 14px; }

/* One row per call: the button, and what the call does. */
.api-calls { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px 12px; }

.api-calls p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.3; }

.prompt-extra .fine { margin-top: 0; }

/* The buttons grow to fill their row, so that no row ends in empty space. */
.prompt-examples { margin: 10px 0 0; }

.prompt-examples button { flex: 1 1 auto; }

.more-examples { display: none; }

.tool-row { display: flex; gap: 6px; margin-top: 4px; }

.tool-row select {
  height: 38px; padding: 0 6px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px;
  font: 600 14px var(--body);
}

.tool-row input { flex: 1; min-width: 0; margin: 0; font: 14px Consolas, "Cascadia Mono", monospace; }

#tool-url { margin: 6px 0 10px; overflow-wrap: anywhere; }

#tool-body {
  display: block; width: 100%; margin: 4px 0 12px; padding: 8px 10px; resize: vertical;
  background: var(--field); color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px;
  font: 14px/1.4 Consolas, "Cascadia Mono", monospace;
}

.tool-answer { margin-top: 12px; }

.tool-answer strong { font-weight: 600; font-variant-numeric: tabular-nums; }

.tool-answer strong.bad { color: var(--danger); }

.tool-answer pre, .agent pre {
  margin: 6px 0 0; padding: 10px; overflow: auto;
  background: var(--console); color: var(--console-text); border: 1px solid var(--console);
  font: 13px/1.45 Consolas, "Cascadia Mono", monospace;
}

.tool-answer pre { max-height: 240px; }

/* ---- Connect an agent ---- */

/* Looks like code on a page, which people know they can copy. A click selects all of it. */
.code-box { position: relative; }

.code-box .copy-icon { position: absolute; top: 6px; right: 22px; z-index: 1; }

.agent pre.agent-prompt {
  max-height: 220px; margin: 0; padding: 12px 64px 12px 12px;
  background: var(--panel-raised); color: var(--text); border: 1px solid var(--hair); border-radius: 2px;
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: all;
}

/* Tabs inside a part of the side panel, like the flows at the top: plain text, and a green line under the chosen one. */
.side-tabs { display: flex; gap: 2px; margin: 0 0 8px; border-bottom: 1px solid var(--hair); }

.side-tabs button {
  appearance: none; margin: 0 0 -1px; height: 32px; padding: 0 12px; cursor: pointer; white-space: nowrap;
  border: 0; border-radius: 0; background: transparent; color: var(--dim);
  box-shadow: inset 0 -2px 0 transparent;
  font: 600 15px/1 var(--display);
  transition: color 120ms ease-out, box-shadow 120ms ease-out;
}

.side-tabs button:hover { color: var(--text); box-shadow: inset 0 -2px 0 var(--hair); }

.side-tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

.side-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The benchmark prompt is long and is copied whole, so its box shows only the start. */
.agent pre#benchmark-prompt { max-height: 160px; }

.benchmark .agent-asks li + li { margin-top: 3px; }

.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.heading-row h2 { margin: 0; }

.copy-icon {
  flex: none; width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 2px; cursor: pointer;
  transition: background 90ms ease-out;
}

.copy-icon:hover { background: var(--accent-hover); }

.copy-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.copy-icon .copied-glyph { display: none; }

.copy-icon.copied .copy-glyph { display: none; }

.copy-icon.copied .copied-glyph { display: block; }

.copy-box {
  display: block; width: 100%; min-height: 36px; margin-top: 6px;
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 2px; cursor: pointer;
  font: 600 16px/1.2 var(--display);
  transition: background 90ms ease-out;
}

.copy-box:hover { background: var(--accent-hover); }

.agent .connect { margin-top: 12px; }

.side p.level { margin: 0 0 4px; color: var(--accent); font: 600 13px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }

.agent-asks-title { margin: 16px 0 6px; font: 600 16px var(--display); }

.agent-asks { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }

.agent-asks li + li { margin-top: 4px; }

.agent p { margin: 0 0 8px; font-size: 14px; }

.agent code { font: 13px Consolas, "Cascadia Mono", monospace; overflow-wrap: anywhere; }

/* Every heading in the side panel: 16 px above and 8 px to what it heads. */
.agent h3 { margin: 16px 0 8px; font: 600 18px/1.2 var(--display); }

.agent ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }

.agent .fine { margin-top: 10px; font-size: 14px; }

#control-message:empty { display: none; }

.local-note {
  position: absolute; top: 4px; right: 12px; z-index: 1; margin: 0;
  padding: 2px 8px; background: var(--panel-raised); font-size: 13px;
}

.local-note a { color: var(--accent); }

/* ---- A new flow fades in, controls and the log first, chain after. Keep the times in step with flow-menu.js. ---- */

.side > [data-flows], .side > .log-section, .stations, .packet { transition: opacity 250ms ease-out; }

.page[data-reveal="out"] .side > [data-flows],
.page[data-reveal="out"] .side > .log-section,
.page[data-reveal="out"] .stations,
.page[data-reveal="out"] .packet,
.page[data-reveal="controls"] .stations,
.page[data-reveal="controls"] .packet {
  opacity: 0;
  transition: opacity 100ms ease-out;
}

/* ---- The room grid has its own panel, apart from the controls below it ---- */

.rooms-panel {
  --plan-height: 210px;
  margin: 0 -22px;
  padding: 18px 22px;
  background: var(--panel-raised);
  border-block: 1px solid var(--hair);
}

/* Lies on the panel's left edge, open or closed. The whole strip is the button. */
.side-toggle {
  grid-row: 2; grid-column: 2; z-index: 1;
  display: flex; align-items: center; justify-content: center; width: 32px; padding: 0;
  background: transparent; color: var(--text); border: 0; border-left: 1px solid var(--hair); cursor: pointer;
  position: relative;
}

/* A faint line of 1 px dots between the strip and the panel, one every 7 px, so the strip reads as a handle of its own. */
.side-toggle::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; pointer-events: none;
  background: linear-gradient(to bottom, var(--strip-line) 0 1px, transparent 1px) left top / 1px 7px repeat-y;
}

.page.side-closed .side-toggle { background: var(--panel); }

.side-toggle:hover, .page.side-closed .side-toggle:hover { background: var(--panel-raised); color: var(--accent); }

.side-toggle svg { width: 12px; height: 40px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(180deg); }

.page.side-closed .side-toggle svg { transform: none; }

@media (max-width: 1100px) {
  .side-toggle { display: none; }
}

/* ---- Weather ---- */

/* The sky behind this text is dark at night. */
.stage .intro h1, .stage .intro p { transition: color 300ms ease-out; }

.stage.dark .intro h1, .stage.dark .intro p { color: #eef3ef; }

/* The padding is a zone around the controls. It covers the model, so the pointer on the way to a button does not open the house. */
.weather {
  position: absolute; right: 16px; bottom: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  margin: -1em; padding: 1em;
}

.weather p {
  margin: 0; padding: 4px 10px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 2px;
  color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums;
}

/* Holds its place until the first climate arrives. */
.weather p:empty { visibility: hidden; min-height: 32px; }

.weather div { display: flex; gap: 4px; }

.weather button {
  height: 34px; padding: 0 12px; white-space: nowrap;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px; cursor: pointer;
  font: 600 18px/1 var(--display);
  transition: background 90ms ease-out, color 90ms ease-out, transform 90ms ease-out;
}

.weather button { display: inline-flex; align-items: center; gap: 6px; }

.weather button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.weather button:hover { background: var(--panel-raised); }

.weather button:active { transform: translateY(1px) scale(0.97); }

.weather button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---- Azure logs, below the first screen ---- */

.azure-logs { box-sizing: content-box; max-width: 1000px; margin: 0 auto; padding: 48px 32px 64px; }

.azure-logs h2 { font-size: 32px; margin-bottom: 8px; }

.azure-logs > p { margin: 0 0 20px; }

.agent-demo-note { color: var(--dim); font-size: 14px; }

.azure-logs > p.agent-demo-note { margin-top: 8px; }

.day-model { margin: 0 0 8px; padding-left: 20px; }

.day-model li + li { margin-top: 6px; }

.page-end { max-width: 1000px; margin: 0 auto; padding: 0 32px 32px; color: var(--dim); font-size: 14px; }

.page-end p { margin: 0; }

.azure-logs figure { margin: 0; }

.azure-logs img { display: block; width: 100%; height: auto; border: 1px solid var(--hair); border-radius: 2px; background: #fff; }

.azure-logs figure + figure { margin-top: 32px; }

.touch-hint { display: none; }

.azure-logs figcaption { margin-top: 12px; color: var(--dim); font-size: 14px; }

.azure-logs + .azure-logs { padding-top: 0; }

/* ---- How the MCP server is built ---- */

/* A diagram keeps a readable size on a phone, and scrolls sideways inside its own box. */
.diagram { overflow-x: auto; padding: 16px; background: var(--panel); border: 1px solid var(--hair); border-radius: 2px; scrollbar-width: thin; }

.diagram svg { display: block; width: 100%; min-width: 780px; height: auto; }

.diagram .box { fill: var(--panel); stroke: var(--dim); }

.diagram .box.group { fill: var(--panel-raised); stroke: var(--accent); stroke-width: 1.5; }

.diagram .box.inner { fill: var(--field); stroke: var(--hair); }

.diagram .box-title { fill: var(--text); font: 600 16px var(--display); }

.diagram .box-text { fill: var(--dim); font: 400 14px var(--body); }

.diagram .flow { stroke-width: 1.5; }

.diagram .flow.in { stroke: var(--request); }

.diagram .flow.out { stroke: var(--response); }

.diagram .flow.quiet { stroke: var(--dim); stroke-dasharray: 5 4; }

.diagram .flow-text { fill: var(--text); font: 400 14px var(--body); }

.diagram .on-line { paint-order: stroke; stroke: var(--panel); stroke-width: 5px; }

.diagram .lifeline { stroke: var(--hair); stroke-dasharray: 3 4; }

.mcp-tools { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }

.mcp-tools th { padding: 0 12px 8px 0; color: var(--dim); font-weight: 500; text-align: left; }

.mcp-tools td { padding: 8px 12px 8px 0; border-top: 1px solid var(--hair); vertical-align: top; }

.mcp-tools code { font: 13px Consolas, "Cascadia Mono", monospace; white-space: nowrap; }

.touch-only { display: none; }

/* There is no pointer to hold over the house on a touch screen. */
@media (hover: none) {
  .pointer-only, .hover-only { display: none; }

  .touch-only { display: block; }

  .touch-hint { display: inline; }
}

/* ---- Narrow windows ---- */

@media (max-width: 1100px) {
  :root { --rail-height: auto; }

  .page { display: flex; flex-direction: column; height: auto; }

  /* The strip below lies over the bottom of the window. A message scrolled into view must stop above it. */
  #control-message, #tool-answer, #tool-error { scroll-margin-bottom: 56px; }

  /* Återställ clears the house for everyone, so it stands alone on the logo's row, apart from the menu. */
  .flows { padding: 8px 16px; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }

  .flow-choice { grid-column: 1 / -1; grid-row: 2; }

  .flows-end { grid-column: 2; grid-row: 1; gap: 12px; }

  /* All examples are a long way to the chain below them. */
  .prompt-examples:not(.all) button:nth-child(n+4) { display: none; }

  .prompt-examples.all + .more-examples { display: none; }

  .more-examples { display: block; width: 100%; height: 38px; margin-top: 8px; background: transparent; color: var(--accent); border: 1px solid var(--control-line); border-radius: 2px; cursor: pointer; font: 600 16px var(--display); }

  /* Shows the chain while a call runs, wherever on the page the reader is. */
  .chain-strip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--console); color: var(--console-text); font: 600 14px var(--display); }

  .chain-strip i { width: 10px; height: 10px; border: 1px solid var(--console-dim); border-radius: 50%; }

  .chain-strip i.lit-in { background: var(--console-in); border-color: var(--console-in); }

  .chain-strip i.lit-out { background: var(--console-out); border-color: var(--console-out); }

  .chain-strip span { margin-left: 8px; }

  .new-version { top: auto; bottom: 16px; }

  .flows h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  .flow-choice button { flex: 1; padding: 0 6px; }

  .flows .reset { padding: 0 12px; font-size: 16px; }

  /* The control comes right after the model, so that the first screen shows both, and the chain right after it. */
  .stage { height: 60svh; min-height: 360px; order: 1; }

  .side { display: contents; }

  .side > * { order: 2; padding: 18px 16px; background: var(--panel); }

  .rail { order: 3; }

  .local-note { position: static; padding: 6px 16px; }

  .side > .rooms-panel { order: 4; margin: 0; padding: 16px; background: var(--panel-raised); }

  .side > .connect, .side > .agent, .side > .log-section { order: 5; }

  #control-message { margin: 0; padding: 12px 16px; }

  #control-message:not(:empty) { font-size: 16px; }

  .intro { top: 16px; left: 16px; right: 16px; max-width: none; }

  .intro h1 { font-size: 42px; }

  .intro p { font-size: 14px; margin-top: 6px; }

  /* The chain runs downwards when it no longer fits across. */
  .stations { display: block; padding: 8px 0; height: auto; }

  .stations li { display: block; padding: 6px 16px 12px 44px; }

  .stations li::before { top: 0; bottom: 0; left: 21px; right: auto; width: 1px; height: auto; }

  .stations li:first-child::before { left: 21px; top: 14px; }

  .stations li:last-child::before { right: auto; bottom: calc(100% - 14px); }

  .stations li::after { top: 10px; left: 16px; }

  .stations em { top: 8px; right: 16px; }

  .stations span { min-height: 0; }

  .console { height: 150px; }

  .packet { top: 0; left: 0; }
}

@media (max-width: 600px) {
  .console { height: 96px; }
}

/* A short laptop window: the text takes less height, and the house gets the rest. */
@media (min-width: 1101px) and (max-height: 760px) {
  .intro { top: 14px; max-width: min(400px, 46%); }

  .intro p { margin-top: 4px; font-size: 14px; }

}

/* ---- A finger needs more room than a mouse ---- */

@media (pointer: coarse) {
  .flows button, .weather button, .presets button, .prompt-row button[type="submit"],
  input[type="search"], input[type="text"], .tool-row select { height: 44px; }

  .copy-icon { width: 44px; height: 44px; }

  .copy-box { min-height: 44px; }

  .more-examples { height: 44px; }

  input[type="range"] { height: 44px; }

  .weather div, .flow-choice { gap: 8px; }

  .presets { gap: 8px; }

  .floor-row { gap: 5px; }

  .connect summary, .log summary { padding-block: 10px; }

  .connect a { display: inline-block; padding-block: 12px; }

  /* A field under 16 px makes an iPhone zoom in on it. */
  .tool-row select, .tool-row input, #tool-body { font-size: 16px; }
}

/* ---- The connection note at the top, and the weather along the bottom: buttons to the left, the climate to the right ---- */

/* Beside the weather buttons, a little apart from them, at their size. */
.stage-top { position: static; display: flex; align-items: center; gap: 8px; margin: 0 auto 0 16px; white-space: nowrap; }

.weather .stage-top { order: -1; }



.flows [data-flow="benchmark"] { display: inline-flex; align-items: center; gap: 6px; }

/* A gold cup, on the light button and on the green one. */
.flows [data-flow="benchmark"] svg { width: 18px; height: 18px; flex: none; fill: #f2c230; stroke: #a87a00; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }

.benchmark .agent-asks { padding-left: 20px; }

.agent-asks-title + .agent-asks { margin-top: 8px; }

/* The benchmark status sits in the model box, under its text: what the agent is doing, and the replay button. */
.intro .benchmark-session { margin: 10px 0 0; color: var(--dim); font-size: 14px; }

.intro .benchmark-session button { pointer-events: auto; }

.benchmark-session strong { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }

.small-button { margin-left: 8px; padding: 2px 8px; font-size: 13px; }

/* The final's replay takes the place of the text over the house. */
.intro.replaying > p, .intro.replaying > h1, .intro.replaying > .intro-flows { display: none; }

.replay-box {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 2px;
  color: var(--text); font-size: 13px; line-height: 18px;
}

.replay-box[hidden] { display: none; }
/* Says once that the agent has started, in the trophy's gold. */
.intro .benchmark-toast {
  margin: 0 0 8px; padding: 6px 10px; width: fit-content;
  background: #f6e3a1; border: 1px solid #c99a16; border-radius: 2px; color: #3d2d00; font-size: 14px; font-weight: 600;
}

.intro .benchmark-toast[hidden] { display: none; }

.benchmark-toast.shown { animation: toast-in 5s ease-out both; }

@keyframes toast-in {
  0% { opacity: 0; transform: translateY(-6px); }
  8%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

.replay-box dl { margin: 2px 0; }

.replay-box dl div { display: flex; justify-content: space-between; gap: 12px; }

.replay-box dt { color: var(--dim); }

.replay-box dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.replay-label { color: var(--dim); }

.benchmark .scores { width: 100%; min-width: 0; font-size: 14px; font-variant-numeric: tabular-nums; border-collapse: separate; border-spacing: 0; }

/* One line per row. A long name or model ends in an ellipsis, and hovering the row shows all of it. */
.benchmark .scores th, .benchmark .scores td { padding-block: 6px; padding-inline: 4px 8px; white-space: nowrap; }

.benchmark .scores thead th { padding-block: 0 6px; }

.benchmark .scores td:nth-child(3) { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* The names show first, then swing away to the left and leave a sliver, so the model gets the room. The slide is right-aligned
   and clips on the left: as it narrows, the name moves out to the left. Pointing at the sliver, focusing the heading, or a tap
   (names-open) swings them back. The column follows the slide's width as it changes. */
.benchmark .scores .name-slide { display: inline-flex; justify-content: flex-end; max-width: 8.5em; overflow: hidden; vertical-align: bottom; transition: max-width 520ms cubic-bezier(0.22, 1, 0.36, 1), mask-position 520ms ease; mask-image: linear-gradient(90deg, transparent, #000 0.9em); mask-size: 200% 100%; mask-position: 100% 0; }

.benchmark .scores .name-slide > span { display: block; flex: none; max-width: 8.5em; overflow: hidden; text-overflow: ellipsis; }

/* On a touch screen a hover sticks where the finger was, so only a tap brings the names back there. */
@media (hover: hover) {
  .benchmark .scores.names-tucked:not(.names-open):not(:has(td:nth-child(2):hover, th:nth-child(2):hover, th:nth-child(2):focus-visible)) .name-slide { max-width: 0.8em; mask-position: 0 0; }
}

@media (hover: none) {
  .benchmark .scores.names-tucked:not(.names-open):not(:has(th:nth-child(2):focus-visible)) .name-slide { max-width: 0.8em; mask-position: 0 0; }
}

.benchmark .scores td:nth-child(2), .benchmark .scores th:nth-child(2) { cursor: default; }

/* On a phone the numbers take less room, so the name and the model show more. */
@media (max-width: 600px) {
  .benchmark .scores { font-size: 13px; }

  .benchmark .scores th, .benchmark .scores td { padding-inline: 2px 5px; }
}

.benchmark .scores .pinned td { background: var(--panel-raised); font-weight: 600; }

/* The list has a tab of its own and shows every row. */
.benchmark .scores-box { padding: 4px 6px; }

/* A new row rises into place and glows gold, like the trophy, before it settles. */
.benchmark .scores tr.arrived td { animation: row-arrives 2.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes row-arrives {
  0% { opacity: 0; transform: translateY(18px) scale(0.96); background-color: #f6e3a1; }
  25% { opacity: 1; transform: translateY(0) scale(1.03); background-color: #f6e3a1; }
  40% { transform: scale(1); }
  100% { background-color: transparent; }
}

.benchmark .scores .pinned svg { display: block; width: 14px; min-width: 0; max-width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.benchmark .scores td:nth-child(4), .benchmark .scores td:nth-child(5), .benchmark .scores th:nth-child(4), .benchmark .scores th:nth-child(5) { text-align: right; white-space: nowrap; }

/* A lamp before the text: grey while it connects, green and lit when live, and red when the contact is lost. */
.stage-note { display: flex; align-items: center; gap: 6px; }

.stage-note::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #98a29d; transition: background 200ms ease-out, box-shadow 200ms ease-out; }

.stage-note.live::before { background: #22c55e; box-shadow: 0 0 6px 1px rgb(34 197 94 / 0.7); }

.stage-note.bad::before { background: #dc2626; box-shadow: 0 0 6px 1px rgb(220 38 38 / 0.7); }

.weather {
  left: 16px; right: 16px; margin: 0; padding: 0;
  flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 12px;
  pointer-events: none;
}

/* The state of the house, one row per value. */
.climate-box {
  /* The value column has a fixed width, so that the box keeps its size and the house does not move when a value changes. */
  display: grid; grid-template-columns: auto 12ch; column-gap: 10px;
  margin: 0; padding: 3px 8px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 2px;
  color: var(--text); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums;
}

.weather .climate-box div { display: contents; }

.climate-box dt { display: flex; align-items: center; gap: 5px; min-width: 5em; color: var(--dim); }

.climate-box dd { margin: 0; font-weight: 600; white-space: nowrap; }

.climate-box svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.weather .climate-note { position: absolute; right: 0; bottom: calc(100% + 4px); color: var(--danger); }

/* A low window has no room for six rows: two columns of three. */
@media (max-height: 800px) {
  .climate-box { grid-template-columns: auto 12ch auto 12ch; }
}

.weather > * { pointer-events: auto; }

.weather > div { order: -1; }

@media (min-width: 601px) and (max-height: 760px) {
  .stage > .intro { top: 34px; }
}

/* Four weather buttons do not fit on one row on a phone. */
@media (max-width: 600px) {
  .stage-top { margin: 0; }

  .flows .flow-choice button { padding: 0 2px; font-size: 15px; white-space: nowrap; }

  .flows [data-flow="benchmark"] { justify-content: center; gap: 3px; }

  .weather { flex-direction: column; align-items: stretch; gap: 6px; }

  .climate-box { grid-template-columns: auto 1fr auto 1fr; }

  .weather > div { order: 0; display: grid; grid-template-columns: 1fr 1fr; }

  .weather button { justify-content: center; }

}

/* ---- Side panel rhythm ----
   One spacing scale for every flow: 4 between a level and its heading, 8 under a subheading, 12 between the blocks of a
   section, 24 above a subheading, and 32 between sections. Text keeps one line height. The margins of the blocks are
   cleared here, and each gap is set once, on the block below it. */
.side { gap: 32px; }

.side section:not(.rooms-panel) > *,
.side .prompt-extra > *,
.side .side-tab-panel > *,
.side section:not(.rooms-panel) > .heading-row { margin: 0; }

.side section:not(.rooms-panel) > * + *,
.side .prompt-extra > * + *,
.side .side-tab-panel > * + * { margin-top: 12px; }

.side section:not(.rooms-panel) > h3,
.side .side-tab-panel > h3,
.side .side-tab-panel > .asks-head { margin-top: 24px; }

.side section:not(.rooms-panel) > h3,
.side .side-tab-panel > h3,
.side .asks-head > h3 { font: 600 16px/1.25 var(--display); }

.side section:not(.rooms-panel) > h3 + *,
.side .side-tab-panel > h3 + *,
.side .side-tab-panel > .asks-head + * { margin-top: 8px; }

.side section:not(.rooms-panel) > p.level + h2,
.side section:not(.rooms-panel) > p.level + .heading-row { margin-top: 4px; }

.side p, .side li { line-height: 1.5; }

.side .agent-asks li + li { margin-top: 6px; }

@media (min-width: 1101px) {
  /* These belong to the section above them, but sit beside it in the markup. */
  .side > .prompt-extra, .side > #control-message, .side > details.connect { margin-top: -20px; }
}

.side .log:empty { display: none; }

/* ---- First view ----
   The house alone at first. Then the page builds up in reading order while the house turns: the text over the model, the
   panel as the stage narrows, the weather controls, the plans, the menu, and last the chain as the stage gets lower.
   Inside each part the elements follow one another with small delays: main.js gives each one its --arrive-delay, and steps
   data-arrived as the house turns. Without it, as when a script fails, everything arrives after a few seconds. */
@media (min-width: 1101px) {
  :root:not([data-arrived~="settled"]) .page {
    transition: grid-template-columns 1.6s cubic-bezier(0.65, 0, 0.35, 1), grid-template-rows 1.6s cubic-bezier(0.65, 0, 0.35, 1), height 1.6s cubic-bezier(0.65, 0, 0.35, 1);
  }

  /* The menu bar stays from the start with only the logo. The panel's column and the chain's row grow when they come. */
  :root:not([data-arrived~="side"]) .page { grid-template-columns: minmax(0, 1fr) 0px; }

  :root:not([data-arrived~="chain"]) .page { grid-template-rows: auto minmax(0, 1fr) 0px; height: 100dvh; }

  :root:not([data-arrived~="side"]) .page, :root:not([data-arrived~="chain"]) .page { animation: arrive-layout 0s 12s forwards; }

  /* Until its part has come, each element is unseen and a little low. The same lists are in main.js. */
  :root:not([data-arrived~="intro"]) :is(.intro > p, .intro-flows),
  :root:not([data-arrived~="side"]) :is(.side-toggle, .side > section:not(.rooms-panel) > *, .side > :not(section)),
  :root:not([data-arrived~="stage"]) :is([data-weather], .stage-top, .climate-panel),
  :root:not([data-arrived~="plans"]) :is(.rooms-panel, .room-tabs, #room-search, #rooms .floor-row),
  :root:not([data-arrived~="menu"]) :is(.flow-choice > *, .flows-end),
  :root:not([data-arrived~="chain"]) :is(.rail > .local-note, .rail > .chain-tabs, .rail-toggle, .stations > li) {
    opacity: 0;
    transform: translateY(10px);
    animation: arrive-anyway 0s 12s forwards;
  }

  /* Then it fades in and rises after its own delay, with a soft stop. */
  :root[data-arrived]:not([data-arrived~="settled"]) :is(
    .intro > p, .intro-flows, .side-toggle, .side > section:not(.rooms-panel) > *, .side > :not(section), [data-weather], .stage-top, .climate-panel,
    .rooms-panel, .room-tabs, #room-search, #rooms .floor-row, .flow-choice > *, .flows-end,
    .rail > .local-note, .rail > .chain-tabs, .rail-toggle, .stations > li
  ) {
    transition: opacity 0.5s ease-out var(--arrive-delay, 0ms), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--arrive-delay, 0ms);
  }

  /* The chain slides up as the stage gets lower, and the line through its stations draws from left to right. */
  :root:not([data-arrived~="chain"]) .rail { opacity: 0; transform: translateY(60px); animation: arrive-anyway 0s 12s forwards; }

  :root[data-arrived]:not([data-arrived~="settled"]) .rail { transition: opacity 1.2s ease-out, transform 1.6s cubic-bezier(0.16, 1, 0.3, 1); }

  :root:not([data-arrived~="chain"]) .stations > li::before { transform: scaleX(0); }

  :root[data-arrived]:not([data-arrived~="settled"]) .stations > li::before { transform-origin: left; transition: transform 0.3s ease-out var(--arrive-delay, 0ms); }
}

@keyframes arrive-anyway {
  to { opacity: 1; transform: none; }
}

@keyframes arrive-layout {
  to { grid-template-columns: minmax(0, 1fr) var(--side-width); grid-template-rows: auto minmax(0, 1fr) var(--rail-height); height: calc(100dvh - 40px); }
}


/* ---- The chain as a sequence diagram ----
   A second view of the same calls: one box per part on top, a dashed lifeline under each, and one arrow per step, orange
   on the way in and green on the way back, as in the diagram of a call further down the page. */
/* The tabs have a row of their own at the top left, so that the chain's line starts below them. */
.chain-tabs { position: absolute; top: 12px; left: 32px; z-index: 2; display: flex; gap: 6px; }

.rail { padding-top: 48px; }

@media (min-width: 1101px) {
  .rail .packet { top: 57px; }
}

.rail .local-note { top: 14px; right: 12px; }

.sequence { display: none; }

.rail[data-view="sequence"] .sequence {
  position: absolute; inset: 52px 0 0; display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: 0 16px 12px;
}

.rail[data-view="sequence"] .stations, .rail[data-view="sequence"] .packet { visibility: hidden; }

.sequence-head { display: grid; gap: 0; }

.sequence-head span {
  margin: 0 auto; padding: 6px 12px; max-width: calc(100% - 16px);
  background: var(--panel-raised); border: 1px solid var(--dim); border-radius: 2px;
  font: 600 15px var(--display); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Dashed lifelines, one in the middle of each lane. */
.sequence-body {
  position: relative; overflow-y: auto; padding: 8px 0 16px;
  background-repeat: no-repeat; background-attachment: local; opacity: 0.999;
  scrollbar-width: thin;
}

.sequence-row { position: relative; height: 34px; }

.sequence-row[hidden] { display: none; }

.sequence-arrow { position: absolute; bottom: 8px; height: 2px; background: var(--request); }

.sequence-row.out .sequence-arrow { background: var(--response); }

.sequence-row.failed .sequence-arrow { background: var(--danger); }

/* The arrow's head, at the end it points to. */
.sequence-arrow::after {
  content: ""; position: absolute; top: -5px; right: -1px;
  border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  color: var(--request);
}

.sequence-row.out .sequence-arrow::after { color: var(--response); }

.sequence-row.failed .sequence-arrow::after { color: var(--danger); }

.sequence-arrow.left::after { right: auto; left: -1px; border-left: 0; border-right: 9px solid currentColor; }

.sequence-arrow span {
  position: absolute; bottom: 4px; left: 0; right: 0;
  font-size: 14px; line-height: 18px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sequence-call {
  margin: 10px 0 2px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; text-align: left;
}

@media (max-width: 1100px) {
  .rail[data-view="sequence"] { min-height: 420px; }

  .sequence-head span { padding: 4px 6px; font-size: 13px; }

  .sequence-arrow span { font-size: 12px; }
}

.sequence-body { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px); }

/* The plans' tabs and the chain's tabs look like the flow buttons at the top: the chosen one green with white text. */
.room-tabs { display: flex; gap: 4px; }

.room-tabs button, .chain-tabs button {
  appearance: none; margin: 0; height: 28px; padding: 0 12px; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--text);
  border: 1px solid var(--control-line); border-radius: 2px;
  font: 600 14px/1 var(--display);
  transition: background 120ms ease-out;
}

.room-tabs button:hover, .chain-tabs button:hover { background: var(--panel-raised); }

.room-tabs button[aria-selected="true"], .chain-tabs button[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}

/* The chain's two views are tabs like the flows at the top: plain text, and a green line under the chosen one. */
.chain-tabs { gap: 2px; }

.chain-tabs button {
  padding: 0 10px; border: 0; border-radius: 0; background: transparent; color: var(--dim);
  box-shadow: inset 0 -2px 0 transparent;
  transition: color 120ms ease-out, box-shadow 120ms ease-out;
}

.chain-tabs button:hover { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--hair); }

.chain-tabs button[aria-selected="true"] { background: transparent; color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

/* The house's switch takes the weather buttons' size and look. A right click in the model does the same as the switch. */
.house-key {
  height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--panel); color: var(--text); border: 1px solid var(--control-line); border-radius: 2px;
  font: 600 18px/1 var(--display);
}

.house-key:hover { background: var(--panel-raised); }

/* The info box holds the link's lamp on its first line, over the values. */
.weather .climate-panel {
  padding: 5px 8px 3px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 2px;
}

.weather .climate-panel .climate-box { padding: 0; background: none; border: 0; }

.weather .climate-panel .stage-note {
  margin: 0 0 3px; padding: 0; background: none; border: 0;
  color: var(--text); font-size: 12px; line-height: 16px; font-weight: 600;
}

/* The info box stays at the right end of the row, and keeps its lamp line above the values. */
.weather > .climate-panel { order: 1; display: block; margin-left: auto; }

@media (max-width: 600px) {
  .weather > .climate-panel { order: 0; margin-left: 0; }

  /* On a phone the house's button comes after the weather buttons. */
  .weather > .stage-top { order: 2; }
}

/* The chain's arrow sits in the middle of the tab row. Rolled in, only that row stays. */
.rail-toggle {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; justify-content: center; width: 72px; height: 32px; padding: 0;
  background: transparent; color: var(--text); border: 0; border-radius: 2px; cursor: pointer;
}

.rail-toggle:hover { background: var(--panel-raised); color: var(--accent); }

.rail-toggle svg { width: 72px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.page.rail-closed .rail-toggle svg { transform: rotate(180deg); }

@media (min-width: 1101px) {
  .page.rail-closed { grid-template-rows: auto minmax(0, 1fr) 52px; }

  .page.rail-closed .rail { overflow: hidden; padding-top: 32px; }

}

@media (max-width: 1100px) {
  .rail-toggle { display: none; }
}

/* The panel's text keeps clear of the wider arrow strip on its left edge. */
@media (min-width: 1101px) {
  .side { padding-left: 40px; }
}

/* On a wide screen the chain's arrow is a strip over its whole top edge, as the panel's arrow is on its left edge.
   The tabs, the note and the chain move down below it. */
@media (min-width: 1101px) {
  .rail-toggle {
    top: 0; left: 0; right: 0; width: auto; height: 32px; transform: none;
    border-radius: 0;
  }

  .rail-toggle::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
    background: linear-gradient(to right, var(--strip-line) 0 1px, transparent 1px) left top / 7px 1px repeat-x;
  }

  .page.rail-closed .rail-toggle { background: var(--panel); }

  .page.rail-closed .rail-toggle:hover { background: var(--panel-raised); }

  .rail { padding-top: 80px; }

  .chain-tabs { top: 44px; }

  .rail .local-note { top: 46px; }

  .rail .packet { top: 89px; }

  .rail[data-view="sequence"] .sequence { inset: 84px 0 0; }

  .page.rail-closed { grid-template-rows: auto minmax(0, 1fr) 33px; }
}

/* "Expandera huset" is a switch: a track with a knob that slides to the right and turns green when the house is open. */
.house-key .switch {
  position: relative; flex: none; width: 34px; height: 18px; border-radius: 9px;
  background: var(--control-line); transition: background 160ms ease-out;
}

.house-key .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 160ms ease-out;
}

.house-key[aria-checked="true"] .switch { background: var(--accent); }

.house-key[aria-checked="true"] .switch::after { transform: translateX(16px); }

/* Swedish hyphenation for running text (the page is lang="sv"). Short words stay whole. Code, addresses and keys never break with a hyphen. */
p, li, dd, td, figcaption, blockquote, .fine {
  -webkit-hyphens: auto; hyphens: auto;
  hyphenate-limit-chars: 8 3 3;
}

code, pre, kbd, samp, input, textarea, a[href^="http"] { -webkit-hyphens: manual; hyphens: manual; }

/* ---- The benchmark and the RL agent, at the bottom of the page ---- */
.azure-logs h3 { margin: 36px 0 10px; font: 600 22px/1.2 var(--display); }

.azure-logs h3 + p { margin-top: 0; }

.lessons { display: grid; gap: 14px; margin: 0 0 8px; }

.lessons div { padding: 12px 0 0; border-top: 1px solid var(--hair); }

.lessons dt { margin-bottom: 4px; font: 600 17px/1.3 var(--display); }

.lessons dd { margin: 0; }

.model-details { margin-top: 28px; }

.model-details summary { cursor: pointer; font: 600 17px/1.3 var(--display); }

.model-details .day-model { margin-top: 12px; }

/* ---- The hand-over from agent to server to API ---- */
.hand-over { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0 8px; padding: 0; list-style: none; counter-reset: hand; }

.hand-over li { padding: 14px 16px 12px; background: var(--panel); border: 1px solid var(--hair); border-radius: 2px; }

.hand-over h4 { margin: 0; font: 600 17px/1.3 var(--display); }

.hand-over-question { margin: 2px 0 10px; color: var(--dim); font-size: 14px; }

.hand-over dl { margin: 0; font-size: 14px; }

.hand-over dl div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; padding: 8px 0; border-top: 1px solid var(--hair); }

.hand-over dt { color: var(--dim); font-weight: 500; }

.hand-over dd { margin: 0; overflow-wrap: anywhere; hyphens: manual; }

.hand-over code { font: 13px Consolas, "Cascadia Mono", monospace; }

@media (max-width: 760px) {
  .hand-over { grid-template-columns: 1fr; }
}

/* The forecast: three icons in a row, one per day, with the whole forecast as a tooltip. */
.climate-box .forecast { display: flex; align-items: center; gap: 6px; min-height: 16px; }

.climate-box .forecast svg { width: 15px; height: 15px; stroke-width: 1.4; color: var(--text); }

/* The RL section: room after its list. */
.rl-agent ul.day-model { margin-bottom: 12px; }


/* An (i) after the heading, away from the prompt so that nobody takes it for the prompt. Pressing it shows a short note over the steps, and pressing again hides it. */
.asks-head { position: relative; display: flex; align-items: center; gap: 6px; margin: 16px 0 8px; }

.asks-head .agent-asks-title { margin: 0; }

.asks-head details.info { display: block; }

.asks-head details.info summary { display: inline-flex; align-items: center; justify-content: center; vertical-align: -6px; width: 24px; height: 24px; color: var(--dim); cursor: pointer; list-style: none; }

.asks-head details.info summary::-webkit-details-marker { display: none; }

.asks-head details.info summary:hover, .asks-head details.info[open] summary { color: var(--accent); }

.asks-head details.info summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 50%; }

.asks-head details.info svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

.asks-head details.info p { position: absolute; top: 100%; left: 0; right: 0; z-index: 3; margin: 2px 0 0; box-shadow: 0 4px 12px rgb(0 0 0 / 0.12); padding: 8px 10px; color: var(--dim); font-size: 14px; background: var(--panel-raised); border-left: 2px solid var(--accent); }

/* The list of tools: about five rows, and the rest in its own box to scroll, with the column names kept on top. */
.tools-scroll { max-height: 270px; overflow-y: auto; padding-top: 0; }

.tools-scroll thead th { position: sticky; top: 0; z-index: 1; padding-top: 16px; background: var(--panel); }

/* The RL section's chart: power hour by hour. Colours checked for colour blindness; each line also has its name at its end. */
.chart-figure { margin-top: 20px; }
/* Says at once what a chart shows and in which unit; the caption under it explains. */
.chart-heading { margin: 0 0 12px; color: var(--text); font: 600 17px/1.3 var(--display); }
/* Inside a box that scrolls sideways on a phone, the heading stays in view. */
.diagram .chart-heading { position: sticky; left: 0; }

/* How the repository grew: four key figures, then a stacked area chart (scripts/repo-history.mjs). */
.repo-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 0; }
.repo-stats > div { background: var(--panel); border: 1px solid var(--hair); border-radius: 4px; padding: 14px 16px; }
.repo-stats dt { color: var(--dim); font-size: 14px; }
.repo-stats dd { margin: 4px 0 0; }
.repo-stats strong { display: block; font: 600 30px/1.15 var(--display); font-variant-numeric: tabular-nums; color: var(--text); }
.repo-stats span { display: block; color: var(--dim); font-size: 13px; margin-top: 2px; }
@media (max-width: 760px) { .repo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.repo-history .area { stroke: var(--panel); stroke-width: 1.5; stroke-linejoin: round; }
.repo-history .leader { stroke: var(--dim); stroke-width: 1; }
.repo-history .milestone { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
.repo-history .milestone-label { fill: var(--text); font: 600 12px var(--body); }

.diagram.chart svg { min-width: 640px; }

.power-chart .grid { stroke: var(--hair); stroke-width: 1; }

.power-chart .axis { fill: var(--dim); font: 400 12px var(--body); }

.power-chart .night { fill: var(--console); opacity: 0.05; }

.power-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.power-chart .start { stroke: #c2551f; }

.power-chart .dot.start { fill: #c2551f; }

.power-chart .llm { stroke: #2f6fb8; }

.power-chart .dot.llm { fill: #2f6fb8; }

.power-chart .rl { stroke: #0f7b5a; }

.power-chart .dot.rl { fill: #0f7b5a; }

.power-chart .dot { stroke: var(--panel); stroke-width: 2; }

.power-chart .end-label { fill: var(--text); font: 600 13px var(--body); }

.power-chart .end-value { fill: var(--dim); font: 400 12px var(--body); }

.power-chart .hit { fill: transparent; }

.power-chart .hit:hover { fill: var(--console); fill-opacity: 0.06; }

.power-chart .legend text { fill: var(--text); font: 400 12px var(--body); }

.power-chart .mcp { stroke: #0f7b5a; }

.power-chart .dot.mcp { fill: #0f7b5a; }

.power-chart .api { stroke: #c2551f; }

.power-chart .dot.api { fill: #c2551f; }

/* Two runs side by side: the label column, then one column each. */
.mcp-tools.compare { min-width: 560px; }

.mcp-tools.compare td:first-child { width: 26%; color: var(--dim); }

.mcp-tools.compare td { width: 37%; }

/* The box by the pointer over a chart hour. */
.chart-tip {
  position: fixed; z-index: 50; max-width: 320px; padding: 8px 10px; pointer-events: none;
  background: var(--console); color: var(--console-text); border-radius: 2px;
  font: 400 13px/1.4 var(--body); box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
  /* A tip can hold a short list, one line per item (the repo chart's days). */
  white-space: pre-line;
}

/* The RL section: its parts as a diagram, and its learning curve. */
.rl-parts-figure { margin: 8px 0 20px; }

.power-chart .panel-title { fill: var(--text); font: 600 14px var(--body); }

.power-chart .target { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 4 4; }

/* The benchmark runs: one blue, darker for more effort. The effort is also written beside each bar. */
.bench-runs .bar.e-low { fill: #5a8fcb; }

.bench-runs .bar.e-medium { fill: #3a74b5; }

.bench-runs .bar.e-high { fill: #1f5a99; }

.bench-runs .bar.e-max { fill: #123c69; }

.bench-runs .hit:hover { fill-opacity: 0.05; }

/* Varför MCP?: a line between the two dots of a pair, and every run thin under the two paths' means. */
.ab-dots .pair { stroke: var(--hair); stroke-width: 2; }

.ab-dots .pair.mean { stroke: var(--dim); }

.ab-lines .line.thin { stroke-width: 1; opacity: 0.28; }

.ab-lines .line.mean { stroke-width: 3; }

/* The runs' cost so far: the same blues by effort as the bars, and the house as it starts dashed. */
.bench-lines .line.e-low { stroke: #5a8fcb; }

.bench-lines .line.e-medium { stroke: #3a74b5; }

.bench-lines .line.e-high { stroke: #1f5a99; }

.bench-lines .line.e-max { stroke: #123c69; }

.bench-lines .dot.e-low { fill: #5a8fcb; }

.bench-lines .dot.e-medium { fill: #3a74b5; }

.bench-lines .dot.e-high { fill: #1f5a99; }

.bench-lines .dot.e-max { fill: #123c69; }

.bench-lines .line.base { stroke: var(--dim); stroke-width: 1.5; stroke-dasharray: 4 4; }

.bench-lines .end-label { fill: var(--text); font-weight: 600; }

/* A halo keeps the values readable where the dashed line runs behind them. */
.bench-runs .end-value { paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; }

/* ---- The text at the bottom: a list of its parts on the left, kept in view while reading ---- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1000px); justify-content: center; gap: 32px; padding: 0 32px; }

.docs .azure-logs { margin: 0; padding-left: 0; padding-right: 0; }

.docs-toc { position: sticky; top: 24px; align-self: start; max-height: calc(100dvh - 48px); overflow-y: auto; padding-top: 52px; font-size: 14px; scrollbar-width: thin; }

.docs-toc-title { margin: 0 0 8px; color: var(--dim); font: 600 12px var(--body); letter-spacing: 0.06em; text-transform: uppercase; }

.docs-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--hair); }

.docs-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--dim); text-decoration: none; line-height: 1.35; }

.docs-toc .toc-part a { margin-top: 10px; color: var(--text); font-weight: 600; }

.docs-toc .toc-part:first-child a { margin-top: 0; }

.docs-toc .toc-sub a { padding-left: 22px; }

.docs-toc a:hover { color: var(--accent); }

.docs-toc a[aria-current] { color: var(--accent); border-left-color: var(--accent); }

/* Too narrow for two columns: the list goes away and the text takes the width, as before. */
@media (max-width: 1100px) {
  .docs { display: block; padding: 0; }

  .docs-toc { display: none; }

  .docs .azure-logs { margin: 0 auto; padding-left: 32px; padding-right: 32px; }
}

/* A second line in a comparison cell: the run's calls, errors and token cost. */
.mcp-tools .cell-note { color: var(--dim); font-size: 13px; }

.mcp-tools.compare tr.total td { border-top: 2px solid var(--hair); }

/* The gateways' checks in a row, and the answer a stopped call gets. */
.gateway-steps svg { min-width: 700px; }

/* A darker orange than the arrows: text needs 4.5:1 against the panel (#e8590c gave 3.4:1). */
.gateway-steps .stop-code { fill: #b34100; font: 600 16px var(--display); }

.mcp-tools.compare tr.group th { padding: 18px 0 6px; color: var(--text); font: 600 14px var(--body); text-align: left; }

/* ---- Motion in the docs (js/docs-motion.js) ---- */

/* Each line of a docs heading rises out of its own mask. The mask reaches below the line by 0.2em, and gives it back with a
   negative margin, so that g, j, p and y are never cut while the layout stays the same. */
.rise-line { display: block; overflow: hidden; padding-bottom: 0.2em; margin-bottom: -0.2em; }

.rise-line > span { display: inline-block; transition: transform 1100ms cubic-bezier(0.25, 1, 0.5, 1); transition-delay: calc(var(--line, 0) * 120ms); }

[data-rise="waiting"] .rise-line > span { transform: translateY(110%); }

/* How far down the page: a thin line along the top edge. */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* ---- Swedish or English (js/i18n.js) ---- */

/* The flags in the top bar. The chosen language's flag is full colour, the other one faded until hovered. */
.lang-choice { display: flex; align-items: center; gap: 6px; }

.lang-choice button {
  display: grid; place-items: center; width: 34px; height: 26px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 3px; cursor: pointer;
}

.lang-choice svg { height: 14px; width: auto; display: block; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); opacity: 0.45; filter: saturate(0.4); transition: opacity 0.2s, filter 0.2s; }

.lang-choice button:hover svg, .lang-choice button:focus-visible svg, .lang-choice button[aria-pressed="true"] svg { opacity: 1; filter: none; }

.lang-choice button[aria-pressed="true"] { border-color: var(--hair); }

/* English waits until the page is in English. Should the script never come, the page shows anyway after two seconds. */
[data-translating] body { visibility: hidden; animation: show-anyway 0s 2s forwards; }

@keyframes show-anyway { to { visibility: visible; } }
