:root {
  --bg: #f4f5f7; --panel: #ffffff; --line: #e2e5ea; --text: #1d2330; --muted: #6b7382;
  --accent: #1f5fbf; --accent-soft: #e8f0fc; --ok: #1d8a4a; --ok-soft: #e6f5ec;
  --bad: #c62828; --bad-soft: #fdecec; --warn: #a86400; --warn-soft: #fff4e0;
  --radius: 8px; --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .04);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.boot { padding: 40px; color: var(--muted); }

/* header */
header { display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 54px; background: #17233a; color: #fff; }
header .brand { font-weight: 600; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
header .brand span { color: #8fb4ee; font-weight: 400; }
header nav { display: flex; gap: 4px; }
header nav a { color: #c9d4e8; text-decoration: none; padding: 7px 12px; border-radius: 6px; }
header nav a.on, header nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
header .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px;
  background: rgba(255, 255, 255, .1); color: #dbe4f3; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8a94a6; flex: none; }
.dot.ok { background: #3ccf74; } .dot.bad { background: #ff6b6b; } .dot.busy { background: #f5b942; }
header select, header .linkbtn { background: #24324d; border: 1px solid rgba(255, 255, 255, .25); color: #fff;
  border-radius: 6px; padding: 4px 8px; cursor: pointer; }
header select option { background: #24324d; color: #fff; }

/* layout */
main { padding: 16px 20px 40px; max-width: 1700px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > h2, .card > .head { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px;
  font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card > .head .spacer { flex: 1; }
.card .body { padding: 14px 16px; }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .spacer { flex: 1; }

/* controls */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #b9c1cf; background: #fafbfc; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #1a53a8; }
.btn.big { padding: 11px 26px; font-size: 15px; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--muted); }

/* login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 380px; max-width: 100%; }
.login .body { display: grid; gap: 14px; }
.login h1 { font-size: 20px; margin: 0 0 4px; }
.error { color: var(--bad); background: var(--bad-soft); border-radius: 6px; padding: 8px 10px; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 8px 10px; }
.info { background: var(--accent-soft); color: #1b4b94; border-radius: 6px; padding: 8px 10px; }

/* model tree */
.tree-tools { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.tree { max-height: calc(100vh - 360px); min-height: 240px; overflow: auto; padding: 6px 0; }
.node { display: flex; align-items: center; gap: 6px; padding: 3px 10px; cursor: pointer; user-select: none; line-height: 1.5; }
.node:hover { background: #f3f6fb; }
.node.sel { background: var(--accent-soft); }
.node .tw { width: 14px; text-align: center; color: var(--muted); font-size: 10px; flex: none; }
.node.group > .name { font-weight: 500; }
.node.top > .name { font-weight: 600; }
.node .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .size { color: var(--muted); font-size: 12px; flex: none; }
.node.off .name { color: #9aa1ad; }
.node input { margin: 0; flex: none; }
.count { background: #eef1f5; border-radius: 99px; padding: 0 7px; font-size: 11.5px; color: var(--muted); flex: none; }
.count.on { background: var(--accent); color: #fff; }
.details { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 13px; }
.details table { border-collapse: collapse; width: 100%; }
.details td { padding: 2px 0; vertical-align: top; }
.details td:first-child { color: var(--muted); width: 38%; padding-right: 10px; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }

/* photos */
.drop { border: 2px dashed #c6cdd9; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted);
  cursor: pointer; transition: .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop b { color: var(--text); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #f0f2f5; }
.thumb img { width: 100%; height: 90px; object-fit: cover; display: block; }
.thumb .cap { font-size: 11.5px; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .x { position: absolute; top: 4px; right: 4px; border: none; background: rgba(0, 0, 0, .55); color: #fff;
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; }
.runbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.runbar .what { flex: 1; min-width: 200px; }
.progress { height: 6px; background: #e8ebf0; border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); width: 30%; animation: slide 1.4s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
pre.log { margin: 0; background: #10161f; color: #c9d3e0; font: 12px/1.45 Consolas, "SF Mono", monospace; padding: 10px 12px;
  border-radius: 6px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
details > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin: 8px 0; }

/* results */
.tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: none; background: none; padding: 10px 12px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: 11px; background: var(--bad-soft); color: var(--bad); }
.tabs .badge.ok { background: var(--ok-soft); color: var(--ok); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.res { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: zoom-in; background: #fff; }
.res:hover { border-color: #b9c1cf; }
.res img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #20242c; display: block; }
.res .meta { padding: 7px 9px; font-size: 12.5px; }
.res .meta .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict { font-weight: 600; }
.verdict.bad { color: var(--bad); } .verdict.ok { color: var(--ok); }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 7px 10px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
table.list tr.click { cursor: pointer; } table.list tr.click:hover td { background: #f7f9fc; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.status { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #eef1f5; }
.status.done { background: var(--ok-soft); color: var(--ok); } .status.failed { background: var(--bad-soft); color: var(--bad); }
.status.running, .status.queued { background: var(--warn-soft); color: var(--warn); }

/* viewer */
.modal { position: fixed; inset: 0; background: #0b0f17; z-index: 50; display: flex; flex-direction: column; }
.modal .top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #fff; flex-wrap: wrap; }
.modal .top .title { flex: 1; min-width: 200px; }
.modal .top .title div { font-size: 12.5px; color: #b8c3d6; }
.modal .seg { display: inline-flex; border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; overflow: hidden; }
.modal .seg button { background: none; border: none; color: #dfe6f2; padding: 6px 12px; cursor: pointer; }
.modal .seg button.on { background: rgba(255, 255, 255, .18); color: #fff; }
.modal .close, .modal .nav { background: rgba(255, 255, 255, .12); border: none; color: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.modal.dialog { background: rgba(10, 14, 22, .6); align-items: center; justify-content: center; }
.modal .stage { flex: 1; display: flex; gap: 8px; padding: 0 16px 16px; min-height: 0; justify-content: center; }
.modal .stage figure { margin: 0; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.modal .stage img { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
.modal .stage figcaption { color: #9fb0c8; text-align: center; font-size: 12px; padding-top: 4px; }

/* admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.linkbox { display: flex; gap: 6px; margin-top: 8px; }
.linkbox input { flex: 1; font-family: Consolas, monospace; font-size: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #17233a; color: #fff;
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); z-index: 100; max-width: 90vw; }
.toast.bad { background: var(--bad); }

/* tablets and phones */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .tree { max-height: 55vh; min-height: 0; }
}
@media (max-width: 700px) {
  header { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 8px 10px; }
  header .brand { font-size: 15px; }
  header .brand span { display: none; }
  header .spacer { display: none; }
  #statuspill { margin-left: auto; }
  header nav { order: 10; width: 100%; overflow-x: auto; margin: 0 -12px; padding: 0 8px 6px; }
  header nav a { padding: 7px 10px; flex: none; }
  header select { max-width: 130px; padding: 5px 6px; }
  #statuspill .pill { padding: 4px 6px; font-size: 0; gap: 0; }        /* only the colored dots */
  #statuspill .pill .dot { width: 10px; height: 10px; }
  main { padding: 10px 10px 90px; }
  .card > h2, .card > .head { padding: 10px 12px; flex-wrap: wrap; }
  .card .body { padding: 12px; }
  input, select, textarea, button { font-size: 16px; }                    /* no zoom on iPhone */
  .btn.small { font-size: 14px; padding: 6px 10px; }
  .drop { padding: 16px 10px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .thumb img { height: 72px; }
  .thumb .x { width: 28px; height: 28px; font-size: 18px; }
  .node { padding-top: 7px; padding-bottom: 7px; }                       /* bigger tap targets */
  #runcard { position: sticky; bottom: 0; z-index: 20; }
  #runcard .card { box-shadow: 0 -4px 18px rgba(20, 30, 50, .14); }
  .runbar .what { min-width: 0; flex-basis: 100%; }
  .runbar .what .muted { display: none; }
  #runcard .card .body { padding: 10px 12px; }
  .runbar { gap: 8px; }
  .runbar .btn.big { padding: 9px 16px; }
  .runbar .btn.big { flex: 1; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .res .meta { padding: 6px 7px; font-size: 12px; }
  table.list { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.list td, table.list th { white-space: nowrap; padding: 7px 8px; }
  .hide-m { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv > div:nth-child(odd) { margin-top: 8px; }
  .modal .top { padding: 8px 10px; gap: 8px; }
  .modal .top .title { flex-basis: 100%; }
  .modal .seg button { padding: 6px 8px; font-size: 13px; }
  .modal .stage { padding: 0 6px 10px; }
  .modal .stage.side { flex-direction: column; }
  .login { width: 100%; }
}
.kv > div { min-width: 0; }
.kv select, .kv input[type=text] { max-width: 100%; }

/* debug page */
.flow { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.flow-card { flex: 1 1 0; min-width: 170px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  background: #fbfcfe; transition: .3s; }
.flow-card.live { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(31, 95, 191, .12);
  animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(31, 95, 191, .06); } }
.flow-title { font-weight: 700; margin-bottom: 2px; }
.flow-arrow { align-self: center; color: #b9c1cf; font-size: 22px; flex: none; }
.flow-arrow.live { color: var(--accent); animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(3px); } }
.big { font-size: 26px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px;
  font-size: 12px; margin: 4px 4px 0 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.hot { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.lane { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.lane-user { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dotq { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: none; }
.slots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin: 8px 0 4px; }
.slot { height: 18px; border-radius: 3px; background: #e8ebf0; font-size: 9px; color: #fff; text-align: center; line-height: 18px; }
.slot.busy { background: var(--accent); }
.progress-static { height: 6px; background: #e8ebf0; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.progress-static div { height: 100%; background: var(--ok); transition: width 1s linear; }
.debug-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .debug-grid { grid-template-columns: 1fr; } }
table.list tr.sel td { background: var(--accent-soft); }
.events { max-height: 520px; overflow: auto; font-size: 12.5px; }
.ev { padding: 4px 0; border-bottom: 1px solid #f0f2f5; }
.ev-t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.ev-k { display: inline-block; width: 18px; text-align: center; }
.ev-step-done .ev-k, .ev-finish .ev-k { color: var(--ok); } .ev-step-failed .ev-k, .ev-gpu-stop .ev-k { color: var(--bad); }
.ev-touch .ev-k { color: var(--accent); }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 12px; max-height: 420px; overflow: auto; }
.tl { position: relative; padding: 4px 0; font-size: 12.5px; }
.tl::before { content: ""; position: absolute; left: -18px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: #b9c1cf; }
.tl.ok::before { background: var(--ok); } .tl.bad::before { background: var(--bad); } .tl.sig::before { background: var(--accent); }
.tl-t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.tl-n { font-weight: 600; }
ol.how li { margin: 6px 0; }
@media (max-width: 700px) { .flow { flex-direction: column; } .flow-arrow { transform: rotate(90deg); } .flow-card { min-width: 0; } }

/* debug board */
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 18px; font-size: 13px; }
.glossary b { color: var(--accent); }
.board-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .board-wrap { grid-template-columns: 1fr; } }
.board { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; gap: 4px; align-items: start; }
.col { background: #f6f8fb; border-radius: var(--radius); padding: 10px; min-height: 260px; }
.col-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.col-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid;
  place-items: center; font-size: 12px; }
.col-count { margin-left: auto; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.col-help { margin: 4px 0 8px; min-height: 32px; }
.col-empty { color: #a2a9b5; font-size: 12.5px; text-align: center; padding: 30px 0; border: 1px dashed #d5dbe4; border-radius: 6px; }
.step { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 6px 8px;
  margin-bottom: 6px; box-shadow: var(--shadow); }
.step.bad { background: var(--bad-soft); }
.step.pop { animation: pop .6s ease-out; }
@keyframes pop { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.step-user { font-size: 11.5px; font-weight: 700; }
.step-model { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-arrow { align-self: center; text-align: center; font-size: 22px; color: #c6cdd9; }
.board-arrow.live { color: var(--accent); animation: nudge 1s ease-in-out infinite; }
@media (max-width: 700px) { .board { grid-template-columns: 1fr; } .board-arrow { transform: rotate(90deg); } }
.gpu-panel .lamp-row { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.lamp { width: 18px; height: 18px; border-radius: 50%; background: #b9c1cf; box-shadow: inset 0 -2px 4px rgba(0,0,0,.15); }
.lamp.on { background: #2ec46b; box-shadow: 0 0 12px #2ec46b; }
.lamp.starting { background: #f5b942; box-shadow: 0 0 12px #f5b942; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.ring { position: relative; width: 150px; height: 150px; border-radius: 50%; }
.ring.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(31, 95, 191, .6); } 100% { box-shadow: 0 0 0 26px rgba(31, 95, 191, 0); } }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-time { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.reset-badge { text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 4px; font-weight: 600; font-size: 13px; }
details.tech > summary { cursor: pointer; list-style: none; }
details.tech > summary::before { content: "▶ "; color: var(--muted); }
details.tech[open] > summary::before { content: "▼ "; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: #f6f8fb; border-radius: 6px; padding: 8px 10px; }
.stat-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 11.5px; color: var(--muted); }
.step.click { cursor: pointer; }
.step.click:hover { border-color: #b9c1cf; transform: translateY(-1px); }

/* results page */
.seg-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-tabs button { border: none; background: #fff; padding: 5px 12px; cursor: pointer; color: var(--muted); }
.seg-tabs button.on { background: var(--accent); color: #fff; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { min-width: 220px; flex: 0 1 300px; }
.filters .spacer { flex: 1; }
.run-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.run-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: .15s; }
.run-card:hover { border-color: #b9c1cf; transform: translateY(-2px); }
.run-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: #20242c; height: 92px; }
.run-thumbs img { width: 100%; height: 92px; object-fit: cover; display: block; }
.run-thumbs img.flag { outline: 3px solid var(--bad); outline-offset: -3px; }
.run-nothumb { grid-column: 1 / -1; color: #9aa3b2; display: grid; place-items: center; font-size: 13px; }
.run-body { padding: 10px 12px; display: grid; gap: 4px; }
.run-user { font-weight: 700; font-size: 13px; }
.run-models { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-radius: 99px; padding: 1px 8px; font-size: 12px; }
.linkish { border: none; background: none; cursor: pointer; font-size: 12px; float: right; padding: 0; }
.linkish.danger { color: var(--bad); }
.res-group { margin-bottom: 18px; }
.group-head { border-left: 4px solid; padding: 2px 10px; margin-bottom: 10px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable.on { color: var(--accent); }
@media (max-width: 700px) { .filters input[type=search] { min-width: 0; flex: 1 1 100%; } }

/* scoring page: three steps */
.step-head { gap: 10px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid;
  place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.step-n.done { background: var(--ok); }
.kind-tabs { width: 100%; display: flex; }
.kind-tabs button { flex: 1; }
.tree-foot { display: flex; gap: 14px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.tree-foot a { color: var(--muted); text-decoration: none; }
.info-btn { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--muted); font: italic 600 11px Georgia, serif; cursor: pointer; opacity: 0; transition: .15s; }
.node.leaf:hover .info-btn, .info-btn.on { opacity: 1; }
.info-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (hover: none) { .info-btn { opacity: 1; } }
.model-info { background: #f6f8fb; border-radius: 6px; padding: 8px 10px; margin: 2px 12px 6px 0; font-size: 12.5px; }
.model-info td { padding: 1px 10px 1px 0; vertical-align: top; } .model-info td:first-child { color: var(--muted); }
.node .size { display: none; }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip.removable { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; margin: 0; font-size: 12.5px;
  background: var(--accent-soft); border-color: #c9dafb; color: #1b4b94; max-width: 100%; }
.chip.removable button { border: none; background: none; cursor: pointer; color: inherit; font-size: 15px; line-height: 1; padding: 0 4px; }
.advanced { margin-top: 10px; padding: 10px 12px; background: #f6f8fb; border-radius: 6px; display: grid; gap: 6px; }
#photocard.has-photos .drop { padding: 10px; }
#photocard.has-photos .drop .small { display: none; }
.grid > *, .stack > *, .board-wrap > *, .debug-grid > * { min-width: 0; }
.chosen .chip.removable { white-space: normal; }
/* simple model list */
.mlist { padding: 0 0 6px; }
.mgroup { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-weight: 700; font-size: 13px;
  position: sticky; top: 0; background: #fff; z-index: 1; }
.mgroup-kind { font-weight: 400; font-size: 11px; color: var(--muted); background: #eef1f5; border-radius: 99px; padding: 0 7px; }
.mgroup .count { margin-left: auto; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 6px 14px; cursor: pointer; border-left: 3px solid transparent; }
.mrow:hover { background: #f3f6fb; }
.mrow.sel { background: var(--accent-soft); border-left-color: var(--accent); }
.mrow.off { opacity: .55; }
.mrow input { margin: 0; flex: none; }
.mrow-text { flex: 1; min-width: 0; }
.mrow-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-sub { font-size: 11.5px; color: var(--muted); }
.mrow:hover .info-btn, .mrow .info-btn.on { opacity: 1; }
.mproject { display: flex; align-items: baseline; gap: 8px; padding: 14px 14px 2px; margin-top: 4px;
  border-top: 1px solid var(--line, #e3e7ee); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.mlist > .mproject:first-child { border-top: 0; margin-top: 0; }
.mproject-repo { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; opacity: .6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* model details stay folded; the "i" is quiet until hovered or opened */
.mrow .info-btn { opacity: 0; background: transparent; color: var(--muted); border-color: #d5dbe4; }
.mrow:hover .info-btn { opacity: 1; }
.mrow .info-btn.on { opacity: 1; background: #eef1f5; color: var(--text, #1b2330); border-color: #c9d1dc; }
@media (hover: none) { .mrow .info-btn { opacity: .7; } }
.mlist .model-info { font-size: 12.5px; }

/* change-detection flights: regions as toggles */
.mflight { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 17px; }
.mflight:hover .info-btn { opacity: 1; }
.mflight .info-btn { opacity: 0; background: transparent; color: var(--muted); border-color: #d5dbe4; }
.mflight .info-btn.on { opacity: 1; background: #eef1f5; }
@media (hover: none) { .mflight .info-btn { opacity: .7; } }
.mflight-name { flex: none; width: 80px; text-align: left; background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--text, #1b2330); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mflight-name:hover { text-decoration: underline; }
.mflight-name.on { color: var(--accent); font-weight: 600; }
.mregions { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.mregion { font: inherit; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid #d5dbe4; background: #fff;
  color: var(--text, #1b2330); cursor: pointer; }
.mregion:hover { border-color: var(--accent); }
.mregion.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mregion.off { opacity: .45; cursor: help; }

/* foldable headings */
.fold { cursor: pointer; user-select: none; }
.fold .tw { width: 12px; flex: none; color: var(--muted); font-size: 11px; }
.mproject .tw { margin-left: -3px; }
.mgroup.fold:hover, .mproject.fold:hover { color: var(--accent); }
.mgroup-n { font-weight: 400; font-size: 11.5px; color: var(--muted); }
