:root {
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --ink: #16202B;
  --muted: #5F6B78;
  --line: #D9DEE4;
  --action: #2457C5;
  --action-ink: #FFFFFF;
  --v-m: #D1342B;
  --v-s: #E2A11B;
  --v-c: #A9C4BC;
  --v-u: #E3E7EC;
  --v-f: #B4BCC7;
  --cell: 6px;
  --font: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161C23; --surface: #1E262F; --ink: #E6EAEE; --muted: #96A2AF; --line: #313C48;
    --action: #6C95F0; --action-ink: #0E1620;
    --v-m: #F0544A; --v-s: #F0B43A; --v-c: #4F7A6F; --v-u: #2C3640; --v-f: #56616D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161C23; --surface: #1E262F; --ink: #E6EAEE; --muted: #96A2AF; --line: #313C48;
  --action: #6C95F0; --action-ink: #0E1620;
  --v-m: #F0544A; --v-s: #F0B43A; --v-c: #4F7A6F; --v-u: #2C3640; --v-f: #56616D;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
main:focus { outline: none; }
a { color: var(--action); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.005em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bad { color: var(--v-m); }
.strong { font-weight: 600; }
p.muted.small { margin: -4px 0 12px; }

/* ---------- buttons */
button, .btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 13px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  text-decoration: none; font-size: 14px; white-space: nowrap;
}
button.primary, .btn.primary-link { background: var(--action); color: var(--action-ink); border-color: transparent; font-weight: 600; }
button.danger { color: var(--v-m); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1280px; margin: 0 auto; padding: 16px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand .b-c { fill: var(--v-c); } .brand .b-m { fill: var(--v-m); }
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.pill.demo { border-color: var(--v-s); color: var(--ink); }
.banner { width: min(1232px, calc(100% - 48px)); margin: 0 auto 8px; padding: 6px 10px; border-left: 3px solid var(--v-s); background: var(--surface); }

main { max-width: 1280px; margin: 0 auto; padding: 0 24px 72px; }

/* ---------- page heading: the sentence is the status */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); padding-top: 14px; }
.crumbs .sep { color: var(--line); }
.crumbs [aria-current] { color: var(--ink); }
.status { padding: 22px 0 28px; max-width: 980px; }
.status h1 {
  font-size: clamp(26px, 3.8vw, 42px); line-height: 1.1; letter-spacing: -0.02em;
  font-weight: 700; margin: 0 0 10px; text-wrap: balance;
}
.status.is-flagged h1 { color: var(--v-m); }
.status p { margin: 0; color: var(--muted); max-width: 75ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.errbox { border-left: 3px solid var(--v-m); padding: 4px 10px; margin-top: 10px !important; color: var(--ink) !important; }

.block { border-top: 1px solid var(--line); padding: 20px 0 26px; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.block-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 32px; }
.two-col > div { min-width: 0; }

/* ---------- KPIs: one ruled row, not cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.kpis > div { padding: 2px 18px 2px 0; margin-right: 18px; border-right: 1px solid var(--line); }
.kpis > div:last-child { border-right: 0; }
.kpis dt { font-size: 13px; color: var(--muted); }
.kpis dd { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpis dd.bad { color: var(--v-m); }
.kpis dd.note { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; height: 32px; padding: 0 10px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.tabs .count { margin-left: 6px; font-variant-numeric: tabular-nums; }
.tabs .flag-count { color: var(--v-m); }

/* ---------- tables */
.table-wrap { position: relative; overflow-x: auto; container: tw / inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }
tr.is-flagged td:first-child { box-shadow: inset 3px 0 0 var(--v-m); }
tr.is-current td { background: color-mix(in srgb, var(--action) 6%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.build .name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.det { font-weight: 700; font-size: 17px; }
.det.bad { color: var(--v-m); }
.det.warn { color: var(--v-s); }
.of { color: var(--muted); font-size: 13px; }
.state { font-size: 13px; color: var(--muted); }
.sig-m { color: var(--v-m); font-weight: 500; }
.sig-s { color: color-mix(in srgb, var(--v-s) 70%, var(--ink)); font-weight: 500; }
.spinner { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--action); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 0 7px; border-radius: 4px; line-height: 20px; white-space: nowrap; }
.chip-clean { background: color-mix(in srgb, var(--v-c) 35%, transparent); color: var(--ink); }
.chip-flagged { background: color-mix(in srgb, var(--v-m) 14%, transparent); color: var(--v-m); }
.chip-cleared { background: var(--v-u); color: var(--muted); }
.chip-pending, .chip-scanning { background: color-mix(in srgb, var(--action) 12%, transparent); color: var(--action); }
.chip-error { background: color-mix(in srgb, var(--v-s) 22%, transparent); color: var(--ink); }

/* ---------- the engine matrix: one column per engine, aligned across every row */
.engine-probe { font-size: 13px; color: var(--muted); min-height: 1.5em; }
.engine-probe strong { color: var(--ink); font-weight: 600; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 1px; height: 18px; width: max-content; }
.strip i, .heat-cells i, .verdict-track i { display: block; border-radius: 1px; }
.m, .legend .k-m { background: var(--v-m); }
.s, .legend .k-s { background: var(--v-s); }
.c, .legend .k-c { background: var(--v-c); }
.u, .legend .k-u { background: var(--v-u); }
.f, .legend .k-f { background: var(--v-f); }
.n, .legend .k-- { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.strip.pending { opacity: .35; }
.strip i.hot { outline: 2px solid var(--ink); position: relative; z-index: 1; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 14px; border-radius: 1px; }
i.tag { display: inline-block; width: 8px; height: 12px; margin-right: 8px; border-radius: 1px; vertical-align: -1px; }

/* ---------- charts */
.tchart { position: relative; }
.tchart svg { width: 100%; height: auto; display: block; overflow: visible; }
.tchart .grid { stroke: var(--line); }
.tchart text { fill: var(--muted); font: 11px var(--font); }
.tchart .series-line { fill: none; stroke: var(--c); stroke-width: 1.5; opacity: .75; }
.tchart .emph .series-line { stroke-width: 2.75; opacity: 1; }
.tchart .series-end { fill: var(--c); }
.tchart .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.tip {
  position: absolute; top: 8px; pointer-events: none; min-width: 150px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .12);
}
.tip-date { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tip-row i, .chart-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.spark { display: block; }
.spark .sb-zero { fill: var(--v-c); }
.spark .sb-bad { fill: var(--v-m); }

.heat-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.heat { display: grid; gap: 3px; width: max-content; }
.heat-row { display: grid; grid-template-columns: 150px auto; align-items: center; gap: 10px; }
.heat-label { font-size: 13px; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-label:hover { color: var(--action); text-decoration: underline; }
.heat-cells { display: grid; grid-auto-flow: column; grid-auto-columns: var(--hc, 7px); gap: 1px; height: 16px; }
.heat-dates { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.verdict-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(0px, 0.3vw, 2px); height: 34px; max-width: 900px; }
.verdict-track i.ep { box-shadow: inset 0 -4px 0 var(--ink); }
.track-dates { display: flex; justify-content: space-between; max-width: 900px; font-size: 12px; color: var(--muted); margin: 4px 0 10px; }

/* ---------- lists */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; align-content: start; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.hash { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; color: var(--muted); }
.verdicts { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); max-width: 900px; }
.verdicts li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.verdicts .sig { color: var(--muted); text-align: right; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--action); font-size: 14px; margin: 12px 0; }
.events { list-style: none; padding: 0; margin: 0; font-size: 14px; max-width: 900px; }
.events li { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.events time { color: var(--muted); font-size: 13px; }
.events .alert, .events .alert a { color: var(--v-m); font-weight: 500; }
.events .error { color: var(--v-m); }
.events a { color: inherit; text-decoration: none; }
.events a:hover { text-decoration: underline; }
.events .ev-build { color: var(--muted); font-weight: 500; text-decoration: none; margin-right: 4px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- upload dialog */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(10 15 20 / .4); }
#upload-form { padding: 22px 24px; display: grid; gap: 12px; }
#upload-form h2 { margin: 0; font-size: 20px; }
#upload-form p.muted.small { margin: -6px 0 0; }
.dlg-fields { display: grid; grid-template-columns: 1fr 140px; gap: 10px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.drop {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 12px;
  border: 1px dashed var(--muted); border-radius: 8px; color: var(--muted); cursor: pointer; text-align: center; font-size: 14px;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.over { border-color: var(--action); color: var(--ink); background: color-mix(in srgb, var(--action) 8%, transparent); }
.drop:focus-within { outline: 2px solid var(--action); outline-offset: 2px; }
.drop.has-files { border-style: solid; color: var(--ink); }
.note { margin: 0; font-size: 13px; color: var(--muted); }
.note .bad { color: var(--v-m); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 20; }


/* ---------- roles and signed-out state */
body.is-viewer .admin-only { display: none !important; }
body.signed-out .app-chrome { display: none !important; }
.mono { font-family: var(--mono); font-size: 13px; }
button.linkish {
  height: auto; padding: 2px 4px; border: 0; background: none; color: var(--action);
  text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; font-size: 14px;
}
button.linkish.danger { color: var(--v-m); }
button.danger-solid { background: var(--v-m); color: #fff; border-color: transparent; font-weight: 600; }
.banner.warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-left-color: var(--v-m); }

/* ---------- main navigation */
.nav { display: flex; gap: 2px; margin-left: 28px; }
.nav a {
  padding: 7px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- account menu */
.account { position: relative; }
.account summary {
  list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; height: 36px;
  padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink);
}
.account summary::-webkit-details-marker { display: none; }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13px;
}
.account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .12);
  display: grid; gap: 2px;
}
.account-who { margin: 0; padding: 8px 10px; display: grid; font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-who .muted { font-size: 13px; }
.account-menu button { border: 0; background: none; justify-content: flex-start; width: 100%; }
.account-menu button:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* ---------- sign-in */
#auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-panel {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 30px 30px 26px; box-shadow: 0 10px 40px rgb(10 20 30 / .06);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 26px; }
.auth-brand .b-c { fill: var(--v-c); } .auth-brand .b-m { fill: var(--v-m); }
.auth-panel h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 4px; }
.auth-panel > p.muted { margin: 0 0 20px; }
.auth-panel form { display: grid; gap: 14px; }
.auth-note { margin: 0 0 14px; padding: 6px 10px; border-left: 3px solid var(--v-s); font-size: 14px; }
button.wide { width: 100%; justify-content: center; height: 42px; font-size: 15px; }
.auth-panel .linkish { justify-self: center; }
.preview-hint {
  margin-top: 20px; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.55;
  background: color-mix(in srgb, var(--v-s) 14%, transparent); color: var(--ink);
}
.preview-hint strong { display: block; }
.preview-hint code { font-family: var(--mono); font-size: 12px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.preview-hint .linkish { padding: 0; margin-top: 4px; font-size: 13px; }
.preview-start { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.preview-start button { height: 34px; font-size: 13.5px; }

/* ---------- forms in dialogs */
#modal.wide { width: min(680px, calc(100vw - 32px)); }
.modal-form { padding: 22px 24px; display: grid; gap: 14px; }
.modal-form h2 { margin: 0; font-size: 20px; }
.modal-form > p.muted.small { margin: -8px 0 0; }
.modal-body { display: grid; gap: 14px; }
.field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--action); outline: 2px solid color-mix(in srgb, var(--action) 25%, transparent); outline-offset: 0; }
.help { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.form-error { margin: 0; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--v-m); background: color-mix(in srgb, var(--v-m) 10%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--action); flex: none; }
.input-with-btns { display: flex; gap: 6px; }
.input-with-btns input { flex: 1; font-family: var(--mono); font-size: 14px; }
.input-with-btns button { height: 40px; }
fieldset.roles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset.roles legend { font-size: 13px; color: var(--muted); margin-bottom: 4px; padding: 0; }
.role-opt { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14px; }
.role-opt:has(input:checked) { border-color: var(--action); background: color-mix(in srgb, var(--action) 6%, transparent); }
.role-opt input { accent-color: var(--action); margin-top: 3px; }
.role-opt strong { display: block; font-weight: 600; }

/* ---------- switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 32px; height: 18px; border-radius: 999px; background: var(--v-f); position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--action); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }
.switch em { font-style: normal; color: var(--muted); min-width: 2em; }

/* ---------- app management */
.app-admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.app-admin-head h2 { margin: 0; font-size: 19px; }
.app-admin-head h2 a { color: var(--ink); text-decoration: none; }
.app-admin-head h2 a:hover { color: var(--action); text-decoration: underline; }
.app-admin .desc { margin: 2px 0 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { height: 32px; padding: 0 11px; font-size: 13.5px; }
.src { margin: 12px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; }
.src-label { font-size: 13px; color: var(--muted); }
.src a.mono { color: var(--ink); overflow-wrap: anywhere; }
.src-note { flex-basis: 100%; font-size: 13px; }
.empty-builds { padding: 14px 16px; border: 1px dashed var(--line); border-radius: 8px; margin: 0; font-size: 14px; }

table.manage td a { color: var(--ink); }
table.manage td .muted a { color: inherit; }

/* ---------- users */
.you { font-size: 12px; font-weight: 500; color: var(--action); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; margin-left: 4px; }
tr.is-disabled td { color: var(--muted); }
.row-actions-cell { white-space: nowrap; }
.row-actions-cell .linkish { font-size: 13.5px; }
tr.is-empty td { background: color-mix(in srgb, var(--ink) 2%, transparent); }


/* ---------- settings */
.settings-block { max-width: 820px; }
.settings-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.settings-head h2 { margin: 0; }
.settings-intro { margin: 0 0 14px; max-width: 70ch; }
.current-key { margin: 0 0 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.key-form { display: grid; gap: 12px; max-width: 640px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.limits-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.limits-form .field { width: 190px; }
.limits-form input { font-variant-numeric: tabular-nums; }
.test-result { margin-top: 14px; padding: 12px 14px; border-radius: 8px; max-width: 640px; font-size: 14px; display: grid; gap: 8px; }
.test-result .facts { margin: 0; }
.ok-box { background: color-mix(in srgb, var(--v-c) 22%, var(--surface)); }
.bad-box { background: color-mix(in srgb, var(--v-m) 12%, var(--surface)); color: var(--v-m); }
.warn-box { background: color-mix(in srgb, var(--v-s) 18%, var(--surface)); }
.test-result .linkish { justify-self: start; padding: 0; }
a.pill.demo { text-decoration: none; color: var(--ink); }
a.pill.demo:hover { border-color: var(--action); }


/* ---------- hierarchy tree */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tr-build .sub { flex-wrap: nowrap; }
table.tree td { padding-top: 9px; padding-bottom: 9px; }
.tname-wrap { display: flex; align-items: flex-start; gap: 6px; padding-left: calc(var(--depth) * 22px); }
.tname { color: var(--ink); text-decoration: none; font-weight: 600; }
.tname:hover { color: var(--action); text-decoration: underline; }
.tname-wrap .sub { margin-top: 1px; }
.tr-developer td { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.tr-developer .tname { font-size: 16px; }
.tr-distributor .tname { font-weight: 600; }
.tr-app .tname { font-weight: 500; }
.tr-build .tname { font-weight: 500; font-variant-numeric: tabular-nums; }
.tr-build td { background: color-mix(in srgb, var(--ink) 1.5%, var(--surface)); }
.chev, .chev-space { flex: none; width: 22px; height: 22px; margin-top: 0; }
.chev {
  display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer;
}
.chev:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.chev svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .12s; }
.chev.open svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .chev svg { transition: none; } }

.appbar { display: flex; flex-wrap: wrap; gap: 2px; max-width: 340px; }
.appbar i, .legend i[class^="ab-"] { display: block; width: 14px; height: 18px; border-radius: 2px; }
.ab-flagged { background: var(--v-m); }
.ab-clean { background: var(--v-c); }
.ab-scanning { background: color-mix(in srgb, var(--action) 55%, var(--surface)); }
.ab-pending, .ab-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.ab-error { background: var(--v-s); }

.tree-tools { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.tree-tools .linkish { font-size: 13.5px; }
.select-inline select, .field select {
  height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.field select { height: 40px; background: var(--bg); width: 100%; }
#probe[hidden] { display: none; }
.block > .engine-probe { margin: -4px 0 8px; }

/* ---------- platform tags */
.plat {
  display: inline-block; font-size: 12px; font-weight: 500; line-height: 20px; padding: 0 7px; border-radius: 4px; white-space: nowrap;
  color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.plat-windows { background: color-mix(in srgb, #2457C5 13%, transparent); }
.plat-android { background: color-mix(in srgb, #2E8C83 18%, transparent); }
.plat-ios { background: color-mix(in srgb, #7A5BC7 15%, transparent); }
.plat-linux { background: color-mix(in srgb, #8A8F3C 20%, transparent); }
.app-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px !important; font-size: 14px; }
.kind-label { margin: 0 0 4px !important; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

input.masked { -webkit-text-security: disc; text-security: disc; }

/* ---------- version */
.app-footer { max-width: 1280px; margin: 0 auto; padding: 0 24px 28px; font-size: 12.5px; color: var(--muted); }
.account-version { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }


/* ---------- grouped Apps console */
details.dev-section > summary, details.dist-section > summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; cursor: pointer;
}
details.dev-section > summary::-webkit-details-marker, details.dist-section > summary::-webkit-details-marker { display: none; }
.sec-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-title::before {
  content: ""; width: 7px; height: 7px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
  transform: rotate(-45deg); align-self: center; transition: transform .12s; margin-right: 2px;
}
details[open] > summary .sec-title::before { transform: rotate(45deg); }
.sec-title .kind { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.dev-section > summary .sec-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.dist-section { margin: 14px 0 0 18px; padding: 12px 0 4px 16px; border-left: 2px solid var(--line); }
.dist-section > summary .sec-name { font-size: 17px; font-weight: 600; }
.section-body { padding-top: 6px; }
.dist-section .app-admin { margin: 12px 0 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.dist-section .app-admin .table-wrap { border-radius: 6px; }
.app-admin h4 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-admin h4 a { color: var(--ink); text-decoration: none; }
.app-admin h4 a:hover { color: var(--action); text-decoration: underline; }
.app-admin .src { margin: 8px 0; }
.freq-select { height: 32px; max-width: 210px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13.5px; }
fieldset.platforms { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
fieldset.platforms legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; width: 100%; }
.plat-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; }
.plat-opt:has(input:checked) { border-color: var(--action); background: color-mix(in srgb, var(--action) 8%, transparent); }
.plat-opt input { accent-color: var(--action); margin: 0; }
fieldset.platforms .help { width: 100%; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.estimate { margin: 14px 0 0; max-width: 70ch; font-size: 14px; }
.estimate.bad { color: var(--v-m); }
@media (max-width: 640px) { .two-fields { grid-template-columns: 1fr; } .dist-section { margin-left: 4px; padding-left: 10px; } }

@media (max-width: 1100px) {
  .top { flex-wrap: wrap; }
  .meta { display: none; }
}
@media (max-width: 860px) {
  .banner { width: calc(100% - 32px); }
  .nav { margin-left: 0; order: 3; width: 100%; }
  fieldset.roles { grid-template-columns: 1fr; }
  .row-actions-cell { white-space: normal; }
  .top { flex-direction: column; align-items: flex-start; }
  .top-right { width: 100%; justify-content: space-between; }
  .meta { justify-content: flex-start; }
  .two-col { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 14px 0; }
  .kpis > div:nth-child(2n) { border-right: 0; }
  .heat-row { grid-template-columns: 110px auto; }
  .events li { grid-template-columns: 80px 1fr; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* New app: how the first build arrives */
fieldset.first-build { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 10px; }
fieldset.first-build legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-opt { position: relative; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 8px; font-size: 14px; text-align: center; cursor: pointer; color: var(--muted); }
.seg-opt + .seg-opt { border-left: 1px solid var(--line); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:checked) { background: color-mix(in srgb, var(--action) 10%, transparent); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--action); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--action); outline-offset: -2px; }
.source-pane { display: grid; gap: 10px; }
.drop.small-drop { min-height: 76px; }
.nb-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nb-files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.nb-files .nb-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.nb-files .linkish { margin-left: auto; padding: 0; font-size: 13px; }
.nb-files .bad-file { border-color: var(--v-m); }
.nb-files .nb-err { width: 100%; font-size: 13px; color: var(--v-m); }
@media (max-width: 560px) {
  .seg { grid-template-columns: 1fr; }
  .seg-opt + .seg-opt { border-left: 0; border-top: 1px solid var(--line); }
}


/* ---------- tables that fit their frame
   No table scrolls sideways. Tables marked .fit have fixed column widths and drop their
   least important columns as the frame narrows; the other tables wrap their text and,
   on phones, turn each row into a small card. Widths are the frame's, not the window's. */
.fit table { table-layout: fixed; }
.fit th { white-space: normal; vertical-align: bottom; }
.fit td { overflow-wrap: anywhere; }
.fit .when { white-space: normal; }
.fit .strip { width: 100%; max-width: calc(var(--n, 70) * 6px); grid-auto-columns: 1fr; }
.fit .num { white-space: normal; }

/* dashboard, developer and distributor tree */
table.tree th, table.tree td { padding-left: 10px; padding-right: 10px; }
table.tree th:first-child, table.tree td:first-child { padding-left: 14px; }
table.tree .c-ver { width: 112px; }
table.tree .c-plat { width: 104px; }
table.tree .c-verdicts { width: 24%; }
table.tree td.c-ver { font-variant-numeric: tabular-nums; }
table.tree .ver { display: block; font-weight: 600; font-size: 14px; }
table.tree .ver-note { display: block; color: var(--muted); font-size: 12.5px; }
.ver-inline { display: none; }
.ver-inline .ver { display: inline; font-size: 13px; font-weight: 600; color: var(--ink); }
table.tree .c-det { width: 96px; }
table.tree .c-spark { width: 142px; }
table.tree .c-clean { width: 86px; }
table.tree .c-when { width: 112px; }
table.tree .c-plat .plat { margin: 1px 0; }
.tname-wrap > .tname-text { min-width: 0; }
.tr-build .tname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.plat-inline { display: none; }

/* builds on the app page */
table.builds .c-verdicts { width: 34%; }
table.builds .c-det { width: 100px; }
table.builds .c-flags { width: 90px; }
table.builds .c-added { width: 104px; }
table.builds .c-when { width: 130px; }

/* builds in Apps */
table.manage .c-ver { width: 96px; }
table.manage .c-added { width: 168px; }
table.manage .c-size { width: 84px; }
table.manage .c-status { width: 124px; }
table.manage .c-freq { width: 200px; }
table.manage .c-act { width: 92px; }
table.manage .freq-select { max-width: 100%; }
table.manage td.file { font-family: var(--mono); font-size: 12.5px; }

@container tw (max-width: 1180px) {
  table.tree .c-plat { display: none; }
  .plat-inline { display: inline-flex; flex-wrap: wrap; gap: 4px; }
}
@container tw (max-width: 1040px) {
  table.tree .c-clean { display: none; }
}
@container tw (max-width: 980px) {
  table.manage .c-size { display: none; }
}
@container tw (max-width: 940px) {
  table.tree .c-spark { display: none; }
}
@container tw (max-width: 900px) {
  table.builds .c-added { display: none; }
  .table-wrap:not(.fit) th, .table-wrap:not(.fit) .when { white-space: normal; }
  .row-actions-cell { white-space: normal; }
}
@container tw (max-width: 840px) {
  table.manage .c-added { display: none; }
}
@container tw (max-width: 760px) {
  table.builds .c-flags { display: none; }
}
@container tw (max-width: 640px) {
  table.tree .c-verdicts, table.builds .c-verdicts { display: none; }
  table.tree .c-det, table.builds .c-det { width: 84px; }
  .tr-build .sub { flex-wrap: wrap; }
  table.tree .of-noun { display: none; }
}
@container tw (max-width: 440px) {
  table.tree .c-when, table.builds .c-when { display: none; }
}
@container tw (max-width: 540px) {
  table.tree .c-ver { display: none; }
  .ver-inline { display: inline; }
}

@media (max-width: 700px) { .engine-probe { display: none; } }

/* phones: rows become cards. Labels come from the column headings (see labelTables in main.js). */
@container tw (max-width: 660px) {
  .table-wrap:not(.fit) table, .table-wrap:not(.fit) tbody, .table-wrap:not(.fit) tr,
  table.manage, table.manage tbody, table.manage tr { display: block; width: auto; }
  .table-wrap:not(.fit) thead, table.manage thead { display: none; }
  .table-wrap:not(.fit) tr, table.manage tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table-wrap:not(.fit) tbody tr:last-child, table.manage tbody tr:last-child { border-bottom: 0; }
  .table-wrap:not(.fit) td[class], .table-wrap:not(.fit) td, table.manage td[class] {
    display: block; position: relative; width: auto; min-height: 22px; padding: 3px 0 3px 36%;
    border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere;
  }
  .table-wrap:not(.fit) td[data-label]::before, table.manage td[data-label]::before {
    content: attr(data-label); position: absolute; left: 0; top: 4px; width: calc(36% - 10px);
    color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.35;
  }
  .table-wrap:not(.fit) td:not([data-label]), table.manage td[class]:not([data-label]),
  .table-wrap:not(.fit) td:first-child, table.manage td[class]:first-child { padding-left: 0; }
  .table-wrap:not(.fit) td:first-child::before, table.manage td:first-child::before { content: none; }
  .table-wrap:not(.fit) td:first-child, table.manage td[class]:first-child { font-size: 15px; padding-bottom: 6px; }
  table.manage td.c-act { padding-top: 6px; }
  table.manage .freq-select { width: 100%; }
  .table-wrap:not(.fit) tr.is-flagged td:first-child, table.manage tr.is-flagged td:first-child { box-shadow: none; }
  .table-wrap:not(.fit) tr.is-flagged, table.manage tr.is-flagged { box-shadow: inset 3px 0 0 var(--v-m); }
  .row-actions-cell { display: flex !important; flex-wrap: wrap; gap: 4px 14px; }
}
