/* Incident explorer — styled after the EPFL web theme (wp-theme-2018) used on epfl.ch/labs/mints:
   white ground, #212121 ink, grey hairlines, EPFL red (#ff0000) for link underlines, active markers
   and primary buttons, square corners (2px), no drop shadows on the page itself.
   Tokens first; every component is styled through them. */
:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --surface-3: #e6e6e6;
  --ink: #212121;
  --ink-2: #495057;
  --muted: #707070;
  --grid: #e6e6e6;
  --axis: #c1c1c1;
  --border: #d5d5d5;
  --border-strong: #8e8e8e;
  --accent: #ff0000;
  --accent-hover: #b51f1f;
  --accent-ink: #ffffff;
  --accent-text: #d40000;
  --accent-wash: rgba(255, 0, 0, .06);
  --active-bg: #e6e6e6;
  --focus: #ff0000;
  /* status: always with an icon and a label */
  --good: #0ca30c; --good-text: #006300; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  /* categorical, fixed order: EPFL red, Léman, amber, blue, Groseille (validated: adjacent CVD >= 15.3 light) */
  --s1: #ff0000; --s2: #00a79f; --s3: #e8a10e; --s4: #4a90e2; --s5: #b51f1f; --s6: #008300; --s7: #6250d6; --s8: #e87ba4;
  --other: #a8a8a8;
  --nostate: #d5d5d5;
  /* sequential red, low -> high (map, matrices); ordinal red (binned columns) */
  --seq-0: #f0f0f0; --seq-1: #ff9999; --seq-2: #ff5c5c; --seq-3: #e81515; --seq-4: #ad0c0c; --seq-5: #660909;
  --ord-1: #ff9999; --ord-2: #ff6b6b; --ord-3: #ff3333; --ord-4: #e00000; --ord-5: #b30000; --ord-6: #8a0707; --ord-7: #5e0606;
  /* highlight marks in the source views */
  --hl-value: rgba(250, 178, 25, .45); --hl-value-edge: rgba(201, 133, 0, .9);
  --hl-quote: rgba(0, 167, 159, .18); --hl-quote-edge: #00a79f;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23212121' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
  --sans: SuisseIntl, "Suisse Int'l", Arial, Helvetica, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --r: 2px;
  --chrome: 96px; /* header + breadcrumb */
  --zoom: 1;
}
/* The whole page is drawn at 80%, as with the browser zoomed out to 80% (browser zoom still works on top).
   With CSS zoom, 100vh is counted in unzoomed pixels, so full-height panels divide it by --zoom; the
   scripts convert mouse and rectangle coordinates with IX.zoomF(). Browsers without CSS zoom stay at 100%. */
@supports (zoom: 0.8) { :root { --zoom: 0.8; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121212; --surface: #1b1b1b; --surface-2: #242424; --surface-3: #2e2e2e;
    --ink: #f2f2f2; --ink-2: #c8c8c8; --muted: #9a9a9a; --grid: #2c2c2c; --axis: #555555;
    --border: #363636; --border-strong: #6e6e6e;
    --accent: #ff0000; --accent-hover: #d40000; --accent-ink: #ffffff; --accent-text: #ff5c5c;
    --accent-wash: rgba(255, 60, 60, .10); --active-bg: #2e2e2e; --focus: #ff5c5c;
    --good-text: #2fbf2f;
    --s1: #ff0000; --s2: #00a79f; --s3: #b88000; --s4: #4a90e2; --s5: #c62f2f; --s6: #008300; --s7: #9085e9; --s8: #d55181;
    --other: #7a7a7a; --nostate: #3d3d3d;
    --seq-0: #262626; --seq-1: #a31a1a; --seq-2: #d11f1f; --seq-3: #ff4747; --seq-4: #ff8080; --seq-5: #ffbdbd;
    --ord-1: #a31a1a; --ord-2: #c41f1f; --ord-3: #e62626; --ord-4: #ff4d4d; --ord-5: #ff7a7a; --ord-6: #ffa3a3; --ord-7: #ffcccc;
    --hl-value: rgba(250, 178, 25, .38); --hl-quote: rgba(0, 167, 159, .28); --hl-quote-edge: #2cc4bb;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23f2f2f2' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121212; --surface: #1b1b1b; --surface-2: #242424; --surface-3: #2e2e2e;
  --ink: #f2f2f2; --ink-2: #c8c8c8; --muted: #9a9a9a; --grid: #2c2c2c; --axis: #555555;
  --border: #363636; --border-strong: #6e6e6e;
  --accent: #ff0000; --accent-hover: #d40000; --accent-ink: #ffffff; --accent-text: #ff5c5c;
  --accent-wash: rgba(255, 60, 60, .10); --active-bg: #2e2e2e; --focus: #ff5c5c;
  --good-text: #2fbf2f;
  --s1: #ff0000; --s2: #00a79f; --s3: #b88000; --s4: #4a90e2; --s5: #c62f2f; --s6: #008300; --s7: #9085e9; --s8: #d55181;
  --other: #7a7a7a; --nostate: #3d3d3d;
  --seq-0: #262626; --seq-1: #a31a1a; --seq-2: #d11f1f; --seq-3: #ff4747; --seq-4: #ff8080; --seq-5: #ffbdbd;
  --ord-1: #a31a1a; --ord-2: #c41f1f; --ord-3: #e62626; --ord-4: #ff4d4d; --ord-5: #ff7a7a; --ord-6: #ffa3a3; --ord-7: #ffcccc;
  --hl-value: rgba(250, 178, 25, .38); --hl-quote: rgba(0, 167, 159, .28); --hl-quote-edge: #2cc4bb;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23f2f2f2' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 14px/1.5 var(--sans);
  display: flex; flex-direction: column; min-height: calc(100vh / var(--zoom));
  zoom: var(--zoom);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* EPFL "link-pretty": ink-coloured text, red underline that turns ink on hover */
a {
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 1px; text-underline-offset: .18em;
}
a:hover { text-decoration-color: var(--ink); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ controls */
.btn {
  font: inherit; font-weight: 700; font-size: 13px; color: var(--ink);
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--r);
  padding: 6px 14px; cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .2s ease-in-out;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* text button: looks like an EPFL link */
.btn.ghost {
  background: transparent; border-color: transparent; color: var(--ink); font-weight: 400; padding: 4px 6px;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em;
}
.btn.ghost:hover { background: transparent; text-decoration-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
select, input[type="text"], input[type="search"], input[type="month"], input:not([type]) {
  font: inherit; font-size: 13px; color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 0; padding: 5px 10px; min-width: 0;
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 26px; cursor: pointer;
  background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 9px center; background-size: 8px 10px;
}
select:hover, input:hover { border-color: var(--ink-2); }
/* segmented control: joined buttons; the pressed one gets the EPFL active treatment (grey + red edge) */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); }
.seg button {
  font: inherit; font-size: 13px; color: var(--ink); background: transparent;
  border: 0; border-right: 1px solid var(--border); padding: 5px 12px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--active-bg); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.seg.small button { font-size: 12px; padding: 3px 9px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.toggle input, .radios input, .check input { margin: 0; accent-color: var(--accent); }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 1px; }
.sw-value { background: var(--hl-value); box-shadow: 0 0 0 1px var(--hl-value-edge); }
.sw-quote { background: var(--hl-quote); border-bottom: 2px solid var(--hl-quote-edge); }
/* EPFL tag (the STI / IEM boxes of the breadcrumb) */
.tag {
  display: inline-block; padding: .35em .6em; line-height: 1; font-size: 12px; font-weight: 400;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r);
  white-space: nowrap;
}
/* red square bullets, as in EPFL content lists */
ul.bullets { list-style: none; margin: 0; padding: 0 0 0 16px; }
ul.bullets li { position: relative; margin: 0 0 6px; }
ul.bullets li::before { content: ""; position: absolute; left: -15px; top: .62em; width: 5px; height: 5px; background: var(--accent); }

/* ------------------------------------------------------------------ header + breadcrumb */
.topbar {
  display: flex; align-items: center; gap: 36px; padding: 0 24px; height: 60px; flex: none;
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 14px; height: 14px; background: var(--accent); flex: none; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.005em; white-space: nowrap; }
.tabs { display: flex; gap: 8px; height: 100%; }
.tabs button {
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: none; border: 0; cursor: pointer;
  padding: 0 8px; box-shadow: inset 0 -3px 0 transparent; transition: box-shadow .2s ease-in-out;
}
.tabs button:hover { box-shadow: inset 0 -3px 0 var(--border); }
.tabs button[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--accent); }
/* the theme switch sits where the EPFL language switch sits: red text, top right */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; min-width: 0; }
.access-tag { font-weight: 700; color: var(--ink); }
.lang {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--accent-text); white-space: nowrap;
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
}
.lang:hover { text-decoration: underline; text-underline-offset: .18em; }
.crumbs { flex: none; padding: 0 24px; background: var(--surface); }
.crumbs ol {
  list-style: none; margin: 0; padding: 4px 0 8px; min-height: 36px; display: flex; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--ink-2);
}
.crumbs li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.crumbs li + li::before { content: "/"; color: var(--muted); margin: 0 9px; }
.crumbs [aria-current] { color: var(--ink); }

main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view { flex: 1; min-height: 0; }

/* ------------------------------------------------------------------ inspector */
.view-inspect { display: flex; flex-direction: column; padding: 14px 24px 18px; gap: 10px; height: calc(100vh / var(--zoom) - var(--chrome)); }
.urlbar { display: flex; gap: 8px; }
.urlbar input { flex: 1; font-size: 14px; padding: 8px 12px; font-family: var(--mono); }
.event-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--ink-2); min-height: 22px; }
.event-strip .ev-key { font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 1px 6px; }
.event-strip .ev-name { color: var(--ink); font-weight: 700; }
.event-strip .sources { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.src-chip {
  font: inherit; font-size: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r); padding: 1px 8px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.src-chip:hover { background: var(--surface-2); }
.src-chip[aria-pressed="true"] { color: var(--ink); background: var(--active-bg); box-shadow: inset 0 -2px 0 var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: var(--r); padding: 1px 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--ink); }

.split {
  flex: 1; min-height: 0; display: grid; grid-template-columns: var(--left, 54%) 12px minmax(0, 1fr);
}
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.pane-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.bar-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pane-right .pane-bar select { flex: 1 1 0; min-width: 110px; max-width: 290px; text-overflow: ellipsis; }
.pane-right .pane-bar .btn { flex: none; }
.link-out { margin-left: auto; font-size: 13px; white-space: nowrap; }
.pane-note { font-size: 12.5px; color: var(--ink-2); padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.pane-note:empty { display: none; }
.pane-note b { color: var(--ink); font-weight: 700; }
.pane-note .warn { color: var(--ink); }
.pane-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.pane-body iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.empty { color: var(--muted); padding: 40px 24px; text-align: center; }
.pane-left { position: relative; }
.ix-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; max-width: 90%;
  background: var(--ink); color: var(--surface); font-size: 12.5px; padding: 7px 12px; border-radius: var(--r);
}
table.cmp tr.active td { background: var(--active-bg); }
table.cmp tr.active td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.gutter { cursor: col-resize; position: relative; }
.gutter::after { content: ""; position: absolute; top: 50%; left: 5px; width: 2px; height: 44px; margin-top: -22px; background: var(--axis); }
.gutter:hover::after, .gutter:focus-visible::after { background: var(--accent); }
.split.dragging iframe { pointer-events: none; }

.textbox {
  font: 15px/1.65 var(--sans); color: var(--ink); white-space: pre-wrap; word-break: break-word;
  padding: 18px 24px 40px; max-width: 80ch;
}
.textbox .cut { display: block; margin: 18px 0; padding: 6px 10px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-left: 3px solid var(--accent); }
.shotbox { position: relative; }
.shotbox img { display: block; width: 100%; height: auto; }
.shotbox .box { position: absolute; border: 3px solid var(--accent); border-radius: 1px; pointer-events: none; }
.shotbox .loading { padding: 40px 24px; color: var(--ink-2); text-align: center; }

/* highlight marks inside the text view (the page frame injects its own copy) */
mark.webui-hl { color: inherit; border-radius: 1px; cursor: help; padding: 0; }
mark.webui-hl.k-value { background: var(--hl-value); box-shadow: 0 0 0 1px var(--hl-value-edge); }
mark.webui-hl.k-quote { background: var(--hl-quote); border-bottom: 2px solid var(--hl-quote-edge); }
mark.webui-hl.k-value.k-quote { background: var(--hl-value); border-bottom: 2px solid var(--hl-quote-edge); }
mark.webui-hl.on { box-shadow: 0 0 0 3px var(--accent); }

/* right pane */
.score { padding: 11px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.score:empty { display: none; }
.score .headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score .big { font-size: 26px; font-weight: 700; line-height: 1.1; }
.score .of { color: var(--ink-2); font-size: 13px; }
.score .bar { display: flex; height: 8px; gap: 2px; }
.score .bar span { border-radius: 1px; }
.score .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.score .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 1px; margin-right: 5px; vertical-align: -1px; }
.subbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border); }

.json { font: 12.5px/1.6 var(--mono); padding: 10px 0 30px; color: var(--ink-2); }
.jl {
  padding: 1px 12px 1px calc(12px + var(--d, 0) * 2ch + 2ch); text-indent: -2ch;
  white-space: pre-wrap; word-break: break-word; border-left: 3px solid transparent;
}
.jl .k { color: var(--ink); }
.jl.scored .k { font-weight: 700; }
.jl .s { color: var(--ink-2); }
.jl .n { color: var(--muted); font-style: italic; }
.jl .num { color: var(--ink); }
.jl.ellipsis { color: var(--muted); }
.jl[data-field] { cursor: pointer; }
.jl[data-field]:hover { background: var(--surface-2); }
.jl.active { background: var(--active-bg); border-left-color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; text-indent: 0; font: 700 11px/1.6 var(--sans);
  border-radius: var(--r); padding: 0 6px; margin-left: 8px; vertical-align: 1px; white-space: nowrap;
  border: 1px solid transparent;
}
.chip .ic { font-weight: 700; }
.v-good { color: var(--good-text); background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.v-good-soft { color: var(--good-text); background: transparent; border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.v-bad { color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, transparent); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.v-miss { color: var(--ink-2); background: var(--surface-2); border-color: var(--border-strong); }
.v-over { color: color-mix(in srgb, var(--serious) 65%, var(--ink)); background: color-mix(in srgb, var(--serious) 12%, transparent); border-color: color-mix(in srgb, var(--serious) 50%, transparent); }
.ev { color: var(--ink-2); background: var(--surface); border-color: var(--border); font-weight: 400; }
.ev.found { color: var(--ink); border-color: var(--border-strong); }
.ev .dot { width: 8px; height: 8px; border-radius: 1px; display: inline-block; }
.ev .dot.value { background: var(--hl-value); box-shadow: 0 0 0 1px var(--hl-value-edge); }
.ev .dot.quote { background: var(--hl-quote); border-bottom: 2px solid var(--hl-quote-edge); }

/* tables: EPFL .table — white cells, 3px grey rule under the header */
table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.cmp th, table.cmp td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.cmp th { font-size: 12px; color: var(--ink); font-weight: 700; position: sticky; top: 0; background: var(--surface); z-index: 1; box-shadow: inset 0 -3px 0 var(--border); border-bottom: 0; }
table.cmp th:nth-child(1) { width: 27%; } table.cmp th:nth-child(2), table.cmp th:nth-child(3) { width: 22%; }
table.cmp td.val { font-family: var(--mono); font-size: 12.5px; overflow-wrap: break-word; }
table.dt td.nowrap { white-space: nowrap; }
table.dt td { overflow-wrap: break-word; }
table.cmp td.blank { color: var(--muted); font-style: italic; font-family: var(--sans); }
table.cmp tr[data-field] { cursor: pointer; }
table.cmp tr[data-field]:hover td { background: var(--surface-2); }
table.cmp .unscored { color: var(--muted); font-size: 11px; display: block; }

.runpanel { border-top: 1px solid var(--border); background: var(--surface-2); padding: 9px 12px; font-size: 13px; max-height: 40%; overflow: auto; }
.runpanel .rp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.runpanel .rp-head b { color: var(--ink); }
.runpanel pre { font: 11.5px/1.45 var(--mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; max-height: 180px; overflow: auto; background: var(--surface); padding: 8px; border-radius: 0; border: 1px solid var(--border); }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.status .ic { width: 8px; height: 8px; border-radius: 1px; display: inline-block; background: var(--muted); }
.status.running .ic { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.status.done .ic { background: var(--good); }
.status.failed .ic, .status.cancelled .ic, .status.interrupted .ic { background: var(--critical); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .status.running .ic { animation: none; }
  .btn, .tabs button { transition: none; }
}

/* dialogs */
.dialog { border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 24px 26px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(0, 0, 0, .22); }
.dialog.wide { width: min(980px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(33, 33, 33, .45); }
.dialog h2 { font-size: 22px; font-weight: 700; margin: 0 0 6px; line-height: 1.2; }
.dlg-url { font: 12px var(--mono); color: var(--ink-2); word-break: break-all; margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: 110px 1fr; gap: 12px 14px; align-items: center; }
.form-grid .label, .form-grid > label { font-size: 13px; color: var(--ink); font-weight: 700; }
.radios { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.radios label { display: inline-flex; gap: 7px; align-items: center; }
.check { font-size: 13px; display: inline-flex; gap: 7px; align-items: center; }
.dlg-note { font-size: 12.5px; color: var(--ink-2); margin: 16px 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#browseSearch { width: 100%; margin-bottom: 10px; font-size: 14px; padding: 8px 12px; }
.browse-list { max-height: 60vh; overflow: auto; border-top: 3px solid var(--border); }
.browse-row { display: grid; grid-template-columns: 80px 92px 36px 1fr; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; align-items: baseline; }
.browse-row:hover, .browse-row:focus-visible { background: var(--surface-2); }
.browse-row .k { font: 12px var(--mono); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.browse-row .u { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-row .d { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* tooltip (charts and marks) */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 320px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14); padding: 8px 10px; font-size: 12.5px;
}
.tooltip .tt-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row .key { width: 12px; height: 3px; border-radius: 1px; flex: none; }
.tooltip .tt-row .v { font-weight: 700; color: var(--ink); min-width: 2.5ch; font-variant-numeric: tabular-nums; }
.tooltip .tt-row .l { color: var(--ink-2); }

/* ------------------------------------------------------------------ admin */
.view-admin { overflow: auto; height: calc(100vh / var(--zoom) - var(--chrome)); }
.admin-wrap { max-width: 760px; padding: 30px 24px 64px; margin: 0 auto; font-size: 16px; line-height: 1.55; }
.admin-wrap h1 { font-size: 44px; font-weight: 700; line-height: 1.1; margin: 0 0 22px; letter-spacing: -.01em; }
.admin-wrap .lead { font-size: 18px; margin: 0 0 14px; }
.admin-wrap p { margin: 0 0 12px; max-width: 65ch; }
.admin-wrap .muted { color: var(--muted); font-size: 14px; }
.admin-wrap pre.cmd { font: 14px var(--mono); background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; margin: 4px 0 14px; overflow-x: auto; }
.admin-form { margin-top: 22px; display: flex; flex-direction: column; gap: 6px; }
.admin-form label { font-size: 14px; font-weight: 700; }
.admin-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-form input { font-size: 15px; padding: 8px 12px; width: min(340px, 100%); }
.admin-form .btn { font-size: 14px; padding: 8px 18px; }
.admin-msg { color: var(--critical); font-size: 14px; font-weight: 700; min-height: 1.5em; margin: 4px 0 0; }
.admin-wrap ul.bullets { margin: 6px 0 20px; }
.admin-preview { font-size: 15px; margin: 4px 0 22px; }
.admin-actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ infographics */
.view-dash { overflow: auto; height: calc(100vh / var(--zoom) - var(--chrome)); }
/* EPFL page layout: left section menu with a grey rule, content to its right */
.dash { max-width: 1840px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 32px; }
.dash-aside { border-right: 1px solid var(--border); padding-top: 22px; }
.dash-aside nav { position: sticky; top: 0; padding: 4px 0 24px; }
.dash-aside ul { list-style: none; margin: 0; padding: 0; }
.dash-aside li { margin-right: -1px; }
.dash-aside button {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; color: var(--ink); line-height: 1.35;
  background: none; border: 0; cursor: pointer; padding: 10px 16px; position: relative;
  border-right: 2px solid transparent;
}
.dash-aside li + li button::before { content: ""; position: absolute; left: 16px; right: 28px; top: 0; border-top: 1px solid var(--border); }
.dash-aside button:hover { background: var(--surface-2); }
.dash-aside button[aria-current="true"] { background: var(--active-bg); font-weight: 700; border-right-color: var(--accent); }
.dash-aside button[aria-current="true"]::before,
.dash-aside li:has(> button[aria-current="true"]) + li button::before { border-color: transparent; }
.dash-aside .aside-title { padding: 6px 16px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.dash-main { min-width: 0; padding: 26px 0 0; }
.dash-main:last-child { padding-bottom: 64px; } /* no footer (public version) */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; margin-bottom: 22px; }
.dash-head h1 { font-size: 44px; font-weight: 700; line-height: 1.1; margin: 0 0 14px; letter-spacing: -.01em; text-wrap: balance; }
.dash-head p { margin: 0; color: var(--ink); max-width: 70ch; font-size: 16px; line-height: 1.55; }
.dash-source { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); font-weight: 700; max-width: 100%; }
.dash-source select { font-weight: 400; max-width: 340px; flex: 1 1 auto; min-width: 0; }
.filters {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px;
  padding: 10px 0 12px; background: var(--page); border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.filters .f { display: flex; flex-direction: column; gap: 3px; }
.filters .f label, .filters .f-lab { font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.filters select { max-width: 130px; }
.filters .f-count { margin-left: auto; text-align: right; }
.filters .f-val { font-size: 13px; color: var(--ink-2); line-height: 30px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.filters .f-val b { color: var(--ink); font-size: 16px; }
.filters .months { display: flex; gap: 4px; align-items: center; }
.filters .months input { width: 132px; }

.dsec { margin: 52px 0 10px; scroll-margin-top: 84px; }
.dsec h2 { font-size: 28px; font-weight: 700; line-height: 1.25; margin: 0 0 6px; text-wrap: balance; }
.dsec > p { margin: 0; color: var(--ink); font-size: 15px; max-width: 80ch; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px 14px; min-width: 0; display: flex; flex-direction: column; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.card-head h3 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; text-wrap: balance; }
.card-head .sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }
.card-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.card .viz { position: relative; min-height: 40px; }
.card .viz svg { display: block; overflow: visible; }
.card .note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.card .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 8px; }
.card .legend span { display: inline-flex; align-items: center; gap: 6px; }
.card .legend i { width: 12px; height: 12px; border-radius: 1px; display: inline-block; }
.tview { overflow: auto; max-height: 360px; }
table.dt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.dt th, table.dt td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.dt th { color: var(--ink); font-weight: 700; position: sticky; top: 0; background: var(--surface); box-shadow: inset 0 -3px 0 var(--border); border-bottom: 0; padding-bottom: 8px; }
table.dt td.num, table.dt th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt th.sortable { cursor: pointer; user-select: none; }
table.dt th.sortable:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .18em; }
table.dt tr.clickable { cursor: pointer; }
table.dt tr.clickable:hover td { background: var(--surface-2); }

.tiles { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 16px; margin-top: 4px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.tile.hero { border-top: 3px solid var(--accent); padding-top: 12px; }
.tile .lab { font-size: 13px; color: var(--ink-2); }
.tile .val { font-size: 32px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile.hero .val { font-size: 56px; letter-spacing: -.02em; }
.tile .det { font-size: 12px; color: var(--muted); margin-top: 4px; }

.search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.search-row input { flex: 1; }
.mark-hover { cursor: pointer; }

/* EPFL footer band: grey, small grey text, short rules under the column heads */
.dash-foot { grid-column: 1 / -1; margin: 64px -24px 0; background: var(--surface-3); color: var(--ink-2); }
.dash-foot .inner { max-width: 1200px; margin: 0 auto; padding: 40px 24px 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; font-size: 13px; line-height: 1.5; }
.dash-foot h4 { margin: 0 0 14px; font-size: 13px; font-weight: 700; color: var(--ink-2); display: inline-block; padding-bottom: 10px; border-bottom: 1px solid var(--border-strong); }
.dash-foot ul.bullets li { margin-bottom: 8px; }
.dash-foot code { font: 12px var(--mono); }

@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash-aside { display: none; }
}
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8 { grid-column: span 12; }
  .dash-foot .inner { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .view-inspect { height: auto; }
  .split { grid-template-columns: 1fr; grid-template-rows: calc(70vh / var(--zoom)) 0 auto; gap: 12px; }
  .gutter { display: none; }
  .pane-right { min-height: calc(70vh / var(--zoom)); }
  .topbar { gap: 18px; padding: 0 16px; }
  .crumbs { padding: 0 16px; }
  .crumbs .crumb-sub { display: none; }
  .view-inspect { padding: 12px 16px 16px; }
  .dash { padding: 0 16px; }
  .dash-foot { margin: 48px -16px 0; }
  .dash-head h1 { font-size: 34px; }
}
@media (max-width: 700px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .span-3, .span-4, .span-5, .span-6 { grid-column: span 12; }
  .browse-row { grid-template-columns: 1fr; gap: 2px; }
  .topbar { gap: 14px; }
  .brand-name { display: none; }
  .tabs { gap: 2px; }
  .tabs button { font-size: 14px; padding: 0 6px; }
  .lang { font-size: 13px; }
  .top-right { gap: 8px; }
  .access-tag { display: none; }
  .admin-wrap h1 { font-size: 34px; }
}
