/*
 * Copyright (c) 2026 Catena-X Automotive Network e.V.
 * Copyright (c) 2026 Contributors to the Eclipse Foundation
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Apache License, Version 2.0 which is available at
 * https://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * AI Disclosure: This file was entirely AI-generated.
 * The AI-generated portions are made available under CC0-1.0 and not subject
 * to the project's license. The human contributor has reviewed and verified
 * that the code is correct.
 *
 * SPDX-License-Identifier: Apache-2.0 AND CC0-1.0
 * Assisted-By: Claude Code (claude-opus-5-5)
 */

/* The Eclipse Tractus-X design tokens (dark theme). The design's typeface,
   Manrope, is not in this repository (see NOTICE.md), so the page ships no
   font files: it uses Manrope only where it is installed and the system's
   sans-serif otherwise. */

:root {
  --tx-orange: #FAA023;
  --tx-orange-400: #FBAC3F;
  --tx-orange-700: #ED8C05;
  --tx-gray: #1e1e1e;
  --tx-font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tx-radius-button: 8px;
  --tx-radius-card: 10px;
  --tx-button-padding: 14px 24px;
  --tx-bg: #000000;
  --tx-surface: #0e0e0e;
  --tx-surface-2: var(--tx-gray);
  --tx-text: #FFFFFF;
  --tx-text-muted: rgba(255, 255, 255, .72);
  --tx-border: rgba(255, 255, 255, .3);
  --tx-border-soft: rgba(255, 255, 255, .12);
  --tx-secondary: #232323;
  --tx-glow: 0 0 0 1px rgba(255, 255, 255, .06), 0 0 28px rgba(255, 255, 255, .07);
  color-scheme: dark;

  /* The two kinds of connector. Always shown with their name next to the
     colour: the pair is hard to tell apart for tritan colour vision. */
  --kind-go: #7E9A1F;
  --kind-edc: #9F7AEA;
  /* Bars are neutral; the phases differ by texture, not by hue. */
  --bar: rgba(255, 255, 255, .86);
  --bar-soft: rgba(255, 255, 255, .38);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html, body { margin: 0; min-height: 100%; background: var(--tx-bg); color: var(--tx-text); font-family: var(--tx-font); font-weight: 400; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h3 { font-size: 16px; font-weight: 700; margin-top: 4px; }
a { color: var(--tx-orange); text-decoration: none; }
:focus-visible { outline: 2px solid var(--tx-orange); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }

.tx-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: var(--tx-radius-button); padding: var(--tx-button-padding);
  font: 500 16px/1.2 var(--tx-font); cursor: pointer; transition: background-color .15s, color .15s; }
.tx-btn--primary { background: var(--tx-orange); color: #000; }
.tx-btn--primary:hover { background: var(--tx-orange-400); }
.tx-btn--primary:active { background: var(--tx-orange-700); }
.tx-btn--secondary { background: var(--tx-secondary); color: #fff; }
.tx-btn--secondary:hover { background: #2e2e2e; }
.tx-btn--ghost { background: transparent; color: var(--tx-text); box-shadow: inset 0 0 0 1px var(--tx-border); }
.tx-btn--ghost:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.tx-btn:disabled { opacity: .45; cursor: not-allowed; }
.tx-btn--primary:disabled:hover { background: var(--tx-orange); }
.tx-btn--secondary:disabled:hover { background: var(--tx-secondary); }
.tx-card { background: var(--tx-surface); border: 1px solid var(--tx-border); border-radius: var(--tx-radius-card); padding: 28px; }
.tx-chip { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--tx-border-soft);
  color: var(--tx-text-muted); font: 500 13px/1 var(--tx-font); }
.tx-bloom { background:
    radial-gradient(60% 80% at 82% 18%, rgba(250, 160, 35, .85) 0%, rgba(250, 160, 35, 0) 60%),
    radial-gradient(45% 70% at 12% 85%, rgba(175, 199, 45, .55) 0%, rgba(175, 199, 45, 0) 60%),
    radial-gradient(40% 50% at 35% 90%, rgba(195, 115, 4, .45) 0%, rgba(195, 115, 4, 0) 70%),
    #000; color: #fff; }
.tx-muted { color: var(--tx-text-muted); }
.tx-eyebrow { font: 700 12px/1 var(--tx-font); letter-spacing: .14em; text-transform: uppercase; color: var(--tx-text-muted); margin: 0 0 14px; }

/* --- page frame ------------------------------------------------------------ */

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--tx-border-soft); position: sticky; top: 0; background: rgba(0, 0, 0, .86); backdrop-filter: blur(8px); z-index: 2; }
.nav__brand { display: flex; align-items: center; gap: 16px; color: var(--tx-text); }
.nav__logo { height: 32px; width: auto; }
.nav__name { font-weight: 800; }
.nav__title { font-weight: 500; color: var(--tx-text-muted); padding-left: 16px; border-left: 1px solid var(--tx-border-soft); }
.mode::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tx-text-muted); }
.mode--live { color: var(--tx-text); }
.mode--live::before { background: var(--kind-go); box-shadow: 0 0 10px var(--kind-go); }

main { display: flex; flex-direction: column; gap: 72px; padding-bottom: 72px; }
.section { padding: 0 clamp(16px, 4vw, 48px); max-width: 1280px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.section__head { max-width: 760px; margin-bottom: 24px; }
.section__head h2 { font-size: clamp(26px, 3vw, 34px); }
.section__head p { margin: 0; }

.hero { padding: clamp(48px, 8vw, 104px) clamp(16px, 4vw, 48px); }
.hero__text { max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: clamp(34px, 5.4vw, 64px); max-width: 15ch; }
.hero .tx-eyebrow { color: rgba(255, 255, 255, .86); }
.hero__lead { max-width: 60ch; font-size: 18px; color: rgba(255, 255, 255, .86); margin: 0 0 32px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
/* The settings sit apart from the two buttons, so they read as settings of
   the race and not as more actions. */
.hero__settings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-left: 20px; border-left: 1px solid var(--tx-border); }
.field { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; cursor: pointer; }
/* One look for every select, whatever the browser: the native arrow is
   replaced by a chevron, the box is as tall as the buttons, the options
   are dark on every platform (color-scheme above), and a disabled select
   looks disabled together with its label. */
.select { position: relative; display: inline-flex; }
.select select { appearance: none; -webkit-appearance: none; min-height: 47px; min-width: 76px; padding: 0 40px 0 14px;
  font: 500 15px/1.2 var(--tx-font); color: var(--tx-text); background: var(--tx-secondary); border: 1px solid var(--tx-border);
  border-radius: var(--tx-radius-button); cursor: pointer; transition: border-color .15s, background-color .15s; }
.select select:hover { border-color: rgba(255, 255, 255, .6); background: #2e2e2e; }
.select select:focus-visible { outline: 2px solid var(--tx-orange); outline-offset: 2px; border-color: var(--tx-orange); }
.select option { color: var(--tx-text); background: var(--tx-gray); }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
  border-right: 2px solid var(--tx-text); border-bottom: 2px solid var(--tx-text); transform: rotate(45deg); }
.field:has(:disabled) { opacity: .45; cursor: not-allowed; }
.field:has(:disabled) select, .field:has(:disabled) input { cursor: not-allowed; }
.field--check input { width: 18px; height: 18px; margin: 0; accent-color: var(--tx-orange); cursor: pointer; }
.notice { margin: 24px 0 0; max-width: 70ch; padding: 12px 16px; border-radius: var(--tx-radius-button); background: rgba(0, 0, 0, .66); border: 1px solid var(--tx-border-soft); font-size: 15px; }

.footer { padding: 32px clamp(16px, 4vw, 48px) 48px; border-top: 1px solid var(--tx-border-soft); font-size: 14px; max-width: 1280px; margin: 0 auto; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 16px 0 0; font-size: 14px; color: var(--tx-text-muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch--go { background: var(--kind-go); }
.swatch--edc { background: var(--kind-edc); }
.swatch--trust { background: transparent; border: 1px solid var(--tx-border); }
.swatch--prov, .seg--prov { background: var(--tx-orange); }
.swatch--cat, .seg--cat { background: radial-gradient(circle, var(--bar) 1px, transparent 1.5px) 0 0 / 4px 4px; box-shadow: inset 0 0 0 1px var(--bar); }
.swatch--neg, .seg--neg { background: var(--bar); }
.swatch--trf, .seg--trf { background: repeating-linear-gradient(135deg, var(--bar) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--bar); }
.swatch--read, .seg--read { background: var(--bar-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot--go { background: var(--kind-go); }
.dot--edc { background: var(--kind-edc); }
.empty { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- the dataspace map ------------------------------------------------------ */

.map-card { padding: 20px; }
.map { width: 100%; height: auto; display: block; font-family: var(--tx-font); }
.bus { fill: none; stroke: var(--tx-border-soft); stroke-width: 2; }
.map__caption { fill: var(--tx-text-muted); font-size: 12px; font-weight: 500; }
.map__group { fill: var(--tx-text-muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.service rect { fill: var(--tx-surface-2); stroke: var(--tx-border); }
.service__label { fill: var(--tx-text); font-size: 16px; font-weight: 700; }
.service__sub { fill: var(--tx-text-muted); font-size: 12px; }
.node__box { fill: var(--tx-surface-2); stroke-width: 1.5; transition: opacity .3s; }
.node--go .node__box { stroke: var(--kind-go); }
.node--edc .node__box { stroke: var(--kind-edc); }
.node--go .node__stripe { fill: var(--kind-go); }
.node--edc .node__stripe { fill: var(--kind-edc); }
.node__label { fill: var(--tx-text); font-size: 17px; font-weight: 800; }
.node__kind { fill: var(--tx-text-muted); font-size: 12px; font-weight: 500; }
.node__bpn { fill: var(--tx-text-muted); font-size: 11px; font-family: var(--mono); }
.node__metrics { fill: var(--tx-text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.node__status { fill: var(--tx-text-muted); font-size: 11px; font-weight: 700; }
.node.is-ready .node__status { fill: var(--tx-text); }
.node.is-off, .node.is-stopped, .node.is-stopping { opacity: .55; }
.node.is-starting .node__status { animation: blink 1s steps(2) infinite; }
.link { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 2; transition: stroke .3s; }
.link.is-active { stroke: #fff; stroke-dasharray: 6 10; animation: flow .5s linear infinite; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)); }
.link.is-done { stroke: rgba(255, 255, 255, .7); }
.link__label rect { fill: #000; stroke: var(--tx-border); }
.link__label text { fill: var(--tx-text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes flow { to { stroke-dashoffset: -16; } }
@keyframes blink { 50% { opacity: .4; } }

/* --- the race ----------------------------------------------------------------- */

.verdict { font-size: clamp(20px, 2.4vw, 28px); font-weight: 500; margin: 0 0 24px; min-height: 1.4em; max-width: 60ch; }
.verdict strong { color: var(--tx-text); font-weight: 800; }
.lanes { display: grid; grid-template-columns: minmax(180px, 240px) 1fr minmax(120px, 150px); gap: 12px 0; }
.lane { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 20px 24px; transition: box-shadow .3s, border-color .3s; }
.lane.is-running { border-color: rgba(255, 255, 255, .6); box-shadow: var(--tx-glow); }
.lane.is-failed { border-color: rgba(255, 255, 255, .6); border-style: dashed; }
.lane__who { padding-right: 20px; }
.lane__names { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 800; font-size: 17px; flex-wrap: wrap; }
.lane__arrow { color: var(--tx-text-muted); font-weight: 500; }
.lane__kinds { margin: 4px 0 0; font-size: 13px; }
.lane__mid { min-width: 0; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; flex-wrap: wrap; }
.step { display: inline-flex; gap: 6px; align-items: baseline; font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--tx-border-soft); color: var(--tx-text-muted); }
.step.is-done { color: var(--tx-text); border-color: var(--tx-border); }
.step__time { font-variant-numeric: tabular-nums; font-weight: 700; }
.lane__track { position: relative; height: 22px; margin-right: 76px; }
.lane__bar { position: relative; display: flex; height: 100%; }
.lane__rows { display: grid; gap: 2px; }
/* One bar per flow; the bar is the button that chooses the flow. */
.flowrow { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; width: 100%; padding: 3px 0; background: none; border: 0; border-radius: 4px; color: var(--tx-text-muted); font: 600 12px/1 var(--tx-font); text-align: left; cursor: pointer; }
.flowrow:hover:not(:disabled) { color: var(--tx-text); }
.flowrow:disabled { cursor: default; opacity: .5; }
.flowrow:focus-visible { outline: 2px solid var(--tx-text); outline-offset: 1px; }
.flowrow[aria-pressed="true"] { color: var(--tx-orange); }
.flowrow__track { position: relative; display: block; height: 12px; margin-right: 76px; }
.flowrow .lane__value { color: var(--tx-text); }
.flowrow--median { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--tx-border-soft); border-radius: 0; font-weight: 800; }
.flowrow--median .flowrow__track { height: 20px; }
.seg { height: 100%; display: block; flex: none; }
.lane__bar .seg:first-child { border-radius: 3px 0 0 3px; }
.seg--prov:not([style*="width: 0%"]) { margin-right: 2px; }
.lane__value { position: absolute; top: 50%; transform: translate(8px, -50%); font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lane__time { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.lane__total { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lane.is-done .lane__total { color: var(--tx-text); }
.lane__sub { font-size: 12px; text-align: right; }
.lane__ratio { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--tx-orange); font-variant-numeric: tabular-nums; }
.lane__ratio:empty { display: none; }
.lanes__axis-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding: 0 25px; }
.lanes__axis { display: flex; justify-content: space-between; margin-right: 76px; font-size: 12px; color: var(--tx-text-muted); border-top: 1px solid var(--tx-border-soft); padding-top: 6px; font-variant-numeric: tabular-nums; }
.legend--phases { margin-top: 20px; }

/* --- bars: cold start, provisioning, memory ------------------------------------ */

.bars { display: flex; flex-direction: column; gap: 18px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 12px; align-items: center; }
.bar-row__label { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.3; }
.bar-row__label .dot { transform: translateY(1px); }
.bar-row__label .tx-muted { font-size: 12px; }
.bar-row__track { position: relative; height: 18px; margin-right: 76px; }
.bar-row__fill { height: 100%; background: var(--bar); border-radius: 3px; transition: width .4s ease-out; }
.bar-row.is-running .bar-row__fill { transition: none; background: repeating-linear-gradient(135deg, var(--bar) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--bar); }
.bar-row__value { position: absolute; top: 50%; transform: translate(8px, -50%); font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; transition: left .4s ease-out; }
.bar-row.is-running .bar-row__value { transition: none; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--tx-text-muted); border-top: 1px solid var(--tx-border-soft); padding-top: 6px;
  margin-left: calc(min(38%, 100%) + 12px); margin-right: 76px; font-variant-numeric: tabular-nums; }

/* --- resources ------------------------------------------------------------------ */

.resources { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.resources__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.resources__summary { display: flex; flex-direction: column; gap: 20px; }
.res-card { padding: 20px; }
.res-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 15px; flex-wrap: wrap; }
.res-card__head .tx-muted { font-size: 12px; }
.res-card__metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric__value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 36px; margin-top: 6px; }
.savings { grid-column: 1 / -1; padding: 20px; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--kind-go); }
.savings h3, .savings p { margin: 0; }
.savings p { max-width: 80ch; }
.savings__headline { font-size: 18px; }
.savings__headline strong { color: var(--kind-go); font-size: 22px; font-variant-numeric: tabular-nums; }
.savings__detail, .savings__note { font-size: 13px; }
.savings__inputs { display: flex; flex-wrap: wrap; gap: 16px; }
.savings__field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.savings__input { width: 130px; padding: 6px 8px; font: inherit; font-size: 14px; color: var(--tx-text); background: var(--tx-surface-2); border: 1px solid var(--tx-border); border-radius: 6px; }
.spark__line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.res-card--go .spark__line { stroke: var(--kind-go); }
.res-card--edc .spark__line { stroke: var(--kind-edc); }

/* --- the step-by-step exchange ------------------------------------------------------ */

/* Laid out like an API client (Bruno): the calls on the left, the chosen
   call on the right with its URL bar, its request and its response. The
   colours of methods and JSON only tell kinds of text apart; orange stays
   for what you can press. */

.walk { display: flex; flex-direction: column; gap: 20px; }
.walk__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.walk__status { margin: 0; min-height: 1.5em; color: var(--tx-text-muted); font-size: 15px; flex: 1 1 320px; }
.walk__optional { height: 22px; font-size: 12px; }
/* One test or view at a time. */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--tx-border); margin-bottom: 32px; }
.tabs__tab { padding: 12px 16px; color: var(--tx-text-muted); font: 600 15px/1 var(--tx-font); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs__tab:hover { color: var(--tx-text); }
.tabs__tab[aria-current="page"] { color: var(--tx-text); border-bottom-color: var(--tx-orange); }
.tabs__tab:focus-visible { outline: 2px solid var(--tx-text); outline-offset: -2px; }
.toggle { display: inline-flex; border: 1px solid var(--tx-border); border-radius: 8px; overflow: hidden; }
.toggle__option { padding: 9px 16px; background: transparent; color: var(--tx-text-muted); border: 0; font: 600 14px/1 var(--tx-font); cursor: pointer; }
.toggle__option + .toggle__option { border-left: 1px solid var(--tx-border); }
.toggle__option:hover { color: var(--tx-text); }
.toggle__option[aria-pressed="true"] { background: var(--tx-orange); color: #000; }
.toggle__option:focus-visible { outline: 2px solid var(--tx-text); outline-offset: -4px; }
.toggle__option:disabled { opacity: .45; cursor: not-allowed; }

.client { display: grid; grid-template-columns: 270px minmax(0, 1fr); background: var(--tx-surface); border: 1px solid var(--tx-border);
  border-radius: var(--tx-radius-card); overflow: hidden; }
.client__steps { background: #070707; border-right: 1px solid var(--tx-border-soft); padding: 14px 10px; }
.client__collection { margin: 2px 8px 10px; font: 700 12px/1 var(--tx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-text-muted); }
.client__steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.client__step { width: 100%; display: grid; grid-template-columns: 22px 52px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px;
  border: 0; border-radius: var(--tx-radius-button); background: transparent; color: var(--tx-text-muted); font: 500 14px/1.3 var(--tx-font);
  text-align: left; cursor: pointer; }
.client__step:hover { background: rgba(255, 255, 255, .06); color: var(--tx-text); }
.client__step[aria-current="true"] { background: var(--tx-secondary); color: var(--tx-text); box-shadow: inset 3px 0 0 var(--tx-orange); }
.client__num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--tx-border);
  font-size: 11px; font-weight: 800; }
.client__step.is-next .client__num { border-color: var(--tx-text); color: var(--tx-text); }
.client__step.is-done .client__num { background: var(--tx-text); border-color: var(--tx-text); color: #000; }
.client__optional { color: var(--tx-text-muted); font-weight: 400; }
.client__code { font: 600 12px/1 var(--mono); color: var(--tx-text-muted); }

.client__main { padding: 22px 24px 24px; min-width: 0; }
.client__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; }
.client__head h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 0; font-size: 18px; }
.client__actor { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--tx-text-muted); white-space: nowrap; margin-top: 4px; }
.client__why { grid-column: 1 / -1; margin: 0; font-size: 14px; }

.method { font: 700 12px/1 var(--mono); letter-spacing: .02em; }
.method--get { color: #8FD6A0; }
.method--post { color: #9FC5F8; }
.method--put { color: #7FD4D4; }
.method--delete { color: #F49A9A; }

.urlbar { display: flex; align-items: stretch; margin-top: 18px; background: #000; border: 1px solid var(--tx-border); border-radius: var(--tx-radius-button); overflow: hidden; }
.urlbar > .method { display: flex; align-items: center; padding: 0 16px; border-right: 1px solid var(--tx-border-soft); font-size: 13px; }
.urlbar__url { flex: 1; min-width: 0; align-self: center; padding: 12px 14px; font: 13.5px/1.45 var(--mono); overflow-wrap: anywhere; }
.urlbar__var { color: var(--tx-text-muted); font-style: italic; }
.urlbar__send { border-radius: 0; padding: 12px 28px; font-weight: 700; justify-content: center; }
.urlbar__hint { margin: 8px 0 0; min-height: 1.4em; font-size: 13px; color: var(--tx-text-muted); }

.client__panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.pane { display: flex; flex-direction: column; min-width: 0; background: #000; border: 1px solid var(--tx-border-soft); border-radius: var(--tx-radius-button); }
.pane__head { display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--tx-border-soft);
  font: 700 12px/1.2 var(--tx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-text-muted); }
.pane__meta { display: flex; align-items: center; gap: 12px; margin-left: auto; letter-spacing: 0; text-transform: none; font: 500 13px/1 var(--tx-font);
  font-variant-numeric: tabular-nums; color: var(--tx-text); }
.status-pill { padding: 4px 8px; border-radius: 4px; font: 700 12px/1 var(--mono); }
.status-pill.is-ok { color: #8FD6A0; background: rgba(143, 214, 160, .14); }
.status-pill.is-error { color: #F49A9A; background: rgba(244, 154, 154, .14); }
.pane__label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px 4px; font: 700 11px/1 var(--tx-font); letter-spacing: .08em;
  text-transform: uppercase; color: var(--tx-text-muted); }
.pane__type { padding: 2px 6px; border: 1px solid var(--tx-border-soft); border-radius: 4px; letter-spacing: 0; }
.headers { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; padding: 4px 14px 6px; font: 12.5px/1.5 var(--mono); }
.headers dt { color: #9FC5F8; }
.headers dd { margin: 0; overflow-wrap: anywhere; }
.headers--answer { padding-top: 10px; border-bottom: 1px solid var(--tx-border-soft); }
.pane__empty { margin: 0; padding: 4px 14px 14px; font-size: 14px; color: var(--tx-text-muted); }
.pane__empty--wait { flex: 1; display: grid; place-items: center; min-height: 160px; padding: 24px; text-align: center; }
.pane__note { margin: 0; padding: 0 14px 12px; font-size: 13px; color: var(--tx-text-muted); }
.pane__foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--tx-border-soft); }
.pane__foot .tx-btn { padding: 10px 16px; font-size: 14px; }

.code { margin: 0; max-height: 440px; overflow: auto; padding: 8px 14px 14px; font: 12.5px/1.6 var(--mono); color: rgba(255, 255, 255, .9);
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.json-key { color: #E6E6E6; }
.json-string { color: #A8D8A0; }
.json-number { color: #9FC5F8; }
.json-literal { color: #D7B5F0; }
.json-punct { color: rgba(255, 255, 255, .5); }

.walk__compare > p { font-size: 14px; margin: 0 0 18px; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.compare-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare__note { margin: 10px 0 0; font-size: 13px; color: var(--tx-text-muted); }
.compare + .compare { padding-left: 32px; border-left: 1px solid var(--tx-border-soft); }
.compare h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.compare__count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--tx-text); font-weight: 800; white-space: nowrap; }
.compare__role { margin: 10px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-text-muted); }
.compare__calls { margin: 0; padding-left: 26px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.compare__calls code { font-size: 12.5px; }

/* --- tables ------------------------------------------------------------------------ */

.table-card summary { cursor: pointer; list-style: none; }
.table-card summary::-webkit-details-marker { display: none; }
.table-card summary h2 { display: inline; font-size: 20px; }
.table-card summary::after { content: " +"; color: var(--tx-orange); font-weight: 800; font-size: 20px; }
.table-card[open] summary::after { content: " −"; }
.table { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: 14px; font-variant-numeric: tabular-nums; }
.table caption { text-align: left; font-weight: 700; margin-bottom: 8px; }
.table th, .table td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--tx-border-soft); }
.table thead th { color: var(--tx-text-muted); font-weight: 500; font-size: 12px; }
.table tbody th { font-weight: 500; }

/* --- smaller screens --------------------------------------------------------------- */

@media (max-width: 1080px) {
  .resources { grid-template-columns: 1fr; }
  .compare-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-grid--3 > .compare:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; padding-top: 22px; border-top: 1px solid var(--tx-border-soft); }
  .client__panes { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .client { grid-template-columns: 1fr; }
  .client__steps { border-right: 0; border-bottom: 1px solid var(--tx-border-soft); }
  .compare-grid { grid-template-columns: 1fr; }
  .compare + .compare { padding-left: 0; border-left: 0; padding-top: 22px; border-top: 1px solid var(--tx-border-soft); }
  .lanes { grid-template-columns: 1fr; }
  .lane { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .lane__time { flex-direction: row; align-items: baseline; justify-content: space-between; text-align: left; }
  .lanes__axis-row { grid-template-columns: 1fr; padding: 0 19px; }
  .lanes__axis-row > span { display: none; }
}
@media (max-width: 720px) {
  .nav__title { display: none; }
  .resources__cards { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .axis { margin-left: 0; }
  .tx-card { padding: 20px; }
  .map-card { padding: 12px; }
  .hero__actions .tx-btn { flex: 1 1 auto; justify-content: center; }
  .hero__settings { padding-left: 0; border-left: 0; width: 100%; }
  .walk__bar .tx-btn { flex: 1 1 100%; justify-content: center; }
  .client__main { padding: 18px 16px 20px; }
  .client__head { grid-template-columns: 1fr; }
  .urlbar { flex-wrap: wrap; }
  .urlbar > .method { padding: 12px 14px; }
  .urlbar__url { flex: 1 1 60%; }
  .urlbar__send { flex: 1 1 100%; border-top: 1px solid var(--tx-border-soft); }
}
@media (prefers-reduced-motion: reduce) {
  .link.is-active, .node.is-starting .node__status { animation: none; }
  .bar-row__fill, .bar-row__value { transition: none; }
}

/* --- the calls between the programs --------------------------------------- */

/* Keep in step with the colours in js/spaceparts.js. */
.dot--trust { background: #c3c9d1; }
.dot--store { background: #727a84; }
.dot--app { background: transparent; box-shadow: inset 0 0 0 2px var(--tx-text); }
.dot--unknown { background: transparent; box-shadow: inset 0 0 0 2px var(--tx-text-muted); }

.lanes__switch { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.lane__calls { grid-column: 1 / -1; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--tx-border-soft); }
.lanes.is-quiet .lane__calls { display: none; }
.lane__calls > summary { cursor: pointer; font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.lane__calls > summary .tx-muted { font-weight: 500; }
.lane__calls .calls { margin-top: 12px; max-height: 380px; overflow: auto; }

.calls { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 14px 28px; align-content: start; }
.calls__who { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.calls__api { font-weight: 500; color: var(--tx-text-muted); }
.calls__rows { list-style: none; margin: 0; padding: 0; }
.call { width: 100%; display: grid; grid-template-columns: 18px 46px minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; padding: 3px 6px;
  background: none; border: 0; border-radius: 6px; color: var(--tx-text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.call:hover, .call:focus-visible { background: rgba(255, 255, 255, .08); }
.call:focus-visible { outline: 2px solid var(--tx-orange); outline-offset: 1px; }
.call__mark { font-weight: 800; text-align: center; }
.call__mark.is-waiting { color: var(--tx-text-muted); }
.call__mark.is-failed { color: var(--tx-text); background: rgba(255, 255, 255, .22); border-radius: 4px; }
.call__method { font: 700 11px/1.6 var(--mono); color: var(--tx-text-muted); }
/* Wrapped, not cut: the end of a path is what tells two calls apart. */
.call__path { overflow-wrap: anywhere; }
.call__count, .call__time { font-variant-numeric: tabular-nums; color: var(--tx-text-muted); white-space: nowrap; }

.call-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--tx-text); padding: 24px; overflow: auto; }
.call-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.call-dialog__title { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 8px; font-size: 18px; overflow-wrap: anywhere; }
.call-dialog__facts { margin: 0 0 4px; }
.call-dialog__how { margin: 0 0 16px; font-size: 13px; }
.call-dialog__panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.call-dialog__pane h4 { display: flex; gap: 10px; align-items: baseline; margin: 0 0 6px; font-size: 13px; }
.call-dialog__pane h4 .tx-muted { font-weight: 500; }
.call-dialog__empty { margin: 0; padding: 12px 14px; border: 1px dashed var(--tx-border-soft); border-radius: 8px; font-size: 13px; line-height: 1.5; }
.call-dialog__pane .code { max-height: 46vh; background: #070707; border: 1px solid var(--tx-border-soft); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.call-dialog__foot { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 820px) { .call-dialog__panes { grid-template-columns: 1fr; } }

/* --- who calls whom: the dataspace view ------------------------------------ */

.space { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.space__bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.space__actions { display: flex; gap: 10px; }
.space__options { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.space__options .field--check { font-size: 14px; }
.space__note { margin: 10px 0 0; padding: 9px 12px; border-left: 2px solid var(--tx-orange); background: rgba(255, 255, 255, .04); border-radius: 0 6px 6px 0; font-size: 13px; }
.dot--data { background: var(--tx-orange); }
.space__plane { padding: 1px 6px; border-radius: 5px; background: rgba(5, 5, 5, .7); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.space__plane.is-dim { opacity: .3; }
.space__bar .toggle { flex-wrap: wrap; }
.space__chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 13px; font-size: 13.5px; }
.space__time { font-weight: 500; font-variant-numeric: tabular-nums; opacity: .8; }
.space__time.is-fastest { font-weight: 800; opacity: 1; }
.space__actions .tx-btn, .lanes__race { padding: 10px 16px; font-size: 14px; }
.space .notice { margin: 0; }
/* The scene takes the card's width: the dataspace is wide. The lists lie
   under it, and beside it in a full view that has the room. */
.space__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-height: 0; }
.space__scene { position: relative; height: 700px; border: 1px solid var(--tx-border-soft); border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #1b1d21 0%, #0c0d0f 55%, #050505 100%); }
.space__scene canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.space__scene canvas.is-over { cursor: pointer; }
.space__scene canvas.is-turning { cursor: grabbing; }
.space__scene canvas:focus-visible { outline: 2px solid var(--tx-orange); outline-offset: -2px; }
.space__missing { margin: 0; padding: 24px; }

/* The names and numbers over the scene (js/spacelabels.js places them). */
.space__labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.space__labels > * { position: absolute; left: 0; top: 0; white-space: nowrap; transition: opacity .18s; will-change: transform; }
.space__labels > .is-out { opacity: 0; }
.space__name { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 10px 5px 9px; border-radius: 8px;
  background: rgba(10, 11, 13, .78); border: 1px solid rgba(255, 255, 255, .13); backdrop-filter: blur(6px); line-height: 1.15; }
.space__name-title { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.space__name-title::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--of-kind, #4a4a4a); }
.space__name-sub { display: none; font-size: 10.5px; font-weight: 500; color: var(--tx-text-muted); }
.space__labels.is-roomy .space__name-sub, .space__name.is-lit .space__name-sub { display: block; }
.space__name.is-lit { border-color: rgba(255, 255, 255, .5); background: rgba(10, 11, 13, .92); }
.space__name.is-dim { opacity: .38; }
.space__name--go, .space__number--go { --of-kind: var(--kind-go); }
.space__name--edc, .space__number--edc { --of-kind: var(--kind-edc); }
.space__name--trust, .space__number--trust { --of-kind: #c3c9d1; }
.space__name--store, .space__number--store { --of-kind: #727a84; }
.space__name--app, .space__number--app { --of-kind: #ffffff; }
.space__number { padding: 2px 7px; border-radius: 999px; background: rgba(5, 5, 5, .86); border: 1px solid var(--of-kind, #4a4a4a);
  font-size: 11px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.space__number.is-lit { font-size: 12px; padding: 3px 9px; background: #000; }
.space__deck { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }

/* What lies on the scene's corners. */
.space__tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 1; }
.space__tool { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(10, 11, 13, .78);
  color: var(--tx-text); font: 600 15px/1 var(--tx-font); cursor: pointer; backdrop-filter: blur(6px); }
.space__tool--text { font-size: 12.5px; }
.space__tool:hover { border-color: rgba(255, 255, 255, .5); }
.space__legend { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0; padding: 7px 11px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(10, 11, 13, .7); backdrop-filter: blur(6px); font-size: 11.5px; color: var(--tx-text-muted); pointer-events: none; }
.space__legend li { display: inline-flex; align-items: center; gap: 6px; }
.space__legend .dot { width: 8px; height: 8px; }
.space__hint { position: absolute; right: 14px; bottom: 14px; margin: 0; font-size: 11.5px; color: rgba(255, 255, 255, .45); pointer-events: none; }

.space__side { columns: 2 380px; column-gap: 40px; }
.space__side.is-calls { columns: auto; }
.space__block { break-inside: avoid; }
.space__caption { position: absolute; top: 12px; left: 12px; z-index: 1; max-width: calc(100% - 280px); margin: 0; padding: 7px 11px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(10, 11, 13, .82); backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 600; pointer-events: none; }
.space__side h3 { margin: 0 0 8px; font-size: 16px; }
.space__block + .space__block, .space__side > p + .space__block { margin-top: 22px; }
.space__small { font-size: 12px; margin: 8px 0 0; }
.space__back { padding: 8px 14px; font-size: 14px; margin-bottom: 14px; }
.space__table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.space__table th, .space__table td { padding: 5px 6px; border-bottom: 1px solid var(--tx-border-soft); text-align: right; }
.space__table th[scope="row"] { text-align: left; font-weight: 500; color: var(--tx-text-muted); }
.space__table thead th { font-size: 11.5px; color: var(--tx-text-muted); white-space: nowrap; }
.space__table thead th:first-child { text-align: left; }
.space__sum th[scope="row"], .space__sum td { font-weight: 800; color: var(--tx-text); }
.space__links { list-style: none; margin: 0; padding: 0; }
.space__link { width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 6px; background: none; border: 0;
  border-radius: 6px; color: var(--tx-text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.space__link:hover, .space__link:focus-visible { background: rgba(255, 255, 255, .08); }
.space__link:focus-visible { outline: 2px solid var(--tx-orange); outline-offset: 1px; }
.space__count { font-variant-numeric: tabular-nums; font-weight: 700; }

/* The full view: the card over the whole window (js/fullview.js). */
.has-full-view { overflow: hidden; }
.space.is-full { position: fixed; inset: 0; z-index: 10; margin: 0; border: 0; border-radius: 0; padding: 16px 20px 20px; box-sizing: border-box;
  width: 100%; height: 100%; background: var(--tx-bg); }
.space.is-full { overflow: auto; }
.space.is-full .space__scene { height: 66vh; }
@media (min-width: 1500px) {
  .space.is-full { overflow: hidden; }
  .space.is-full .space__main { flex: 1; grid-template-columns: minmax(0, 1fr) 420px; }
  .space.is-full .space__scene { height: auto; min-height: 0; }
  .space.is-full .space__side { columns: auto; overflow: auto; min-height: 0; padding: 4px 8px 4px 4px; }
  .space.is-full .space__side .calls { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .space__scene { height: 440px; }
  .space__hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .space__labels > * { transition: none; } }
