/* The case board's page (Blazor). Ported from the Python board's index.html: same look, light and dark. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --text: #1d2330; --muted: #5e6675; --line: #dde1e8;
  --accent: #2459d6; --accent-text: #ffffff; --input: #ffffff;
  --queued: #5e6675; --queued-bg: #eceef2;
  --run: #1f5fd1; --run-bg: #e3ecfd;
  --human: #9a5b00; --human-bg: #fff1d6;
  --done: #1d7a3e; --done-bg: #ddf3e4;
  --fail: #b42318; --fail-bg: #fde5e2; --fail-text: #ffffff;
  --off: #6b7280; --off-bg: #eef0f3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .18);
  --scrim: rgba(10, 14, 22, .45);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --panel: #1b2029; --text: #e6e9ef; --muted: #9aa3b2; --line: #2c3340;
    --accent: #5b8cff; --accent-text: #0d1220; --input: #141820;
    --queued: #b3bac6; --queued-bg: #262c37;
    --run: #8fb2ff; --run-bg: #1c2a45;
    --human: #ffc35c; --human-bg: #3a2c12;
    --done: #6fd394; --done-bg: #17321f;
    --fail: #ff8f85; --fail-bg: #3d1a17; --fail-text: #2a0b08;
    --off: #9aa3b2; --off-bg: #232933;
    --shadow: none; --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151b; --panel: #1b2029; --text: #e6e9ef; --muted: #9aa3b2; --line: #2c3340;
  --accent: #5b8cff; --accent-text: #0d1220; --input: #141820;
  --queued: #b3bac6; --queued-bg: #262c37;
  --run: #8fb2ff; --run-bg: #1c2a45;
  --human: #ffc35c; --human-bg: #3a2c12;
  --done: #6fd394; --done-bg: #17321f;
  --fail: #ff8f85; --fail-bg: #3d1a17; --fail-text: #2a0b08;
  --off: #9aa3b2; --off-bg: #232933;
  --shadow: none; --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
/* one colour scheme for every status: blue running or new, amber needs someone, green done or in use,
   red error, grey closed. A component sets a tone class and takes --c / --cb from it (2026-10-15). */
.t-run { --c: var(--run); --cb: var(--run-bg); }
.t-human { --c: var(--human); --cb: var(--human-bg); }
.t-done { --c: var(--done); --cb: var(--done-bg); }
.t-fail { --c: var(--fail); --cb: var(--fail-bg); }
.t-off { --c: var(--off); --cb: var(--off-bg); }
.t-queued { --c: var(--queued); --cb: var(--queued-bg); }
/* the board's header: name, tabs (with what waits for you), runners, who is signed in */
header.bh { background: var(--panel); border-bottom: 1px solid var(--line); }
.bh .wrap { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 16px; white-space: nowrap; }
.logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font: 700 11px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .02em;
}
.hright { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; background: var(--off-bg); color: var(--off); text-decoration: none;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
a.pill:hover { filter: brightness(.96); }
.pill.on { background: var(--done-bg); color: var(--done); }
.pill.idle { background: var(--human-bg); color: var(--human); }
/* "⋯" and the user's menu: a <details>, shut by wwwroot/board.js */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; }
.dd > summary::-webkit-details-marker { display: none; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; padding: 6px; display: grid;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.dd-menu button, .dd-menu a {
  border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 13px;
  color: var(--text); text-decoration: none; cursor: pointer; font: inherit; font-size: 13px; display: block; width: 100%;
}
.dd-menu button:hover, .dd-menu a:hover { background: var(--bg); }
.dd-menu button.danger { color: var(--fail); }
.dd-menu button.confirming { background: var(--fail); color: var(--fail-text); }
.dd-menu button.confirming:not(.danger) { background: var(--accent); color: var(--accent-text); }
.dd-menu form { margin: 0; }
.dd-who { padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.umenu > summary { font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.umenu > summary:hover { background: var(--bg); }
.more > summary {
  border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font-size: 14px; line-height: 1.4;
  background: var(--panel); color: var(--muted);
}
.more > summary:hover { border-color: var(--muted); color: var(--text); }
/* the top of every page: its name, one line about it, its main actions */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.ph h2 { font-size: 21px; line-height: 1.25; margin: 0; font-weight: 600; text-wrap: balance; }
.ph p { margin: 3px 0 0; color: var(--muted); font-size: 14px; max-width: 72ch; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
main > .ph { grid-column: 1 / -1; }
main {
  max-width: 1180px; margin: 0 auto; padding: 16px;
  display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 980px) {
  main { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
  .side { position: sticky; top: 16px; }
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; box-shadow: var(--shadow);
}
.card h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
label .hint { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; min-height: 60px; }
input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button {
  font: inherit; font-size: 13px; cursor: pointer; border-radius: 8px; padding: 6px 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
button:hover { border-color: var(--muted); }
button:disabled:not(.primary) { opacity: .55; cursor: not-allowed; border-color: var(--line); }
button.primary {
  width: 100%; margin-top: 16px; padding: 10px; font-size: 15px; font-weight: 600;
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}
button.primary:disabled { opacity: .6; cursor: progress; }
a.button.primary {
  display: block; text-align: center; text-decoration: none; border-radius: 8px; margin-top: 16px; padding: 10px;
  font-size: 15px; font-weight: 600; background: var(--accent); color: var(--accent-text);
}
button.danger { color: var(--fail); }
/* a ConfirmButton waiting for its second click: red when it deletes or stops something, blue otherwise */
button.confirming, button.danger.confirming { background: var(--fail); border-color: var(--fail); color: var(--fail-text); }
button.confirming:not(.danger) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.msg { margin: 12px 0 0; font-size: 13px; min-height: 1.2em; }
.msg.ok { color: var(--done); }
.msg.err { color: var(--fail); }
/* "Sao chép đường dẫn" (wwwroot/copy.js): a note at the bottom of the window */
.copy-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70;
  max-width: min(92vw, 760px); padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: var(--done-bg); color: var(--done); border: 1px solid var(--line); box-shadow: var(--shadow); }
.copy-toast.err { background: var(--fail-bg); color: var(--fail); }
.copy-toast code { display: inline-block; margin-top: 6px; color: var(--text); user-select: all;
  word-break: break-all; }
/* sign-in (2026-10-14): who is signed in, top right; the sign-in pages; the members page */
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-left: auto; }
.who .me { font-weight: 600; }
.who a, button.link { color: var(--accent); text-decoration: none; }
button.link { border: none; background: none; padding: 0; font-size: 13px; }
button.link:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }
main.account { display: block; max-width: 420px; }
main.account .row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 12px; }
main.account form { margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row input { margin: 0; }
.tscroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; min-width: 640px; }
table.grid th, table.grid td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid th { color: var(--muted); font-weight: 600; }
table.grid td.actions { display: table-cell; margin: 0; }
table.grid td.actions > * { margin: 2px 6px 2px 0; vertical-align: middle; }
table.grid tr.off td { color: var(--muted); }
section > .card + .card { margin-top: 16px; }
ul.plain { list-style: none; padding: 0; margin: 8px 0; }
ul.plain li { display: flex; gap: 8px; align-items: center; padding: 4px 0; flex-wrap: wrap; }
.card.secret { margin-top: 16px; border-color: var(--human); background: var(--human-bg); }
.card.secret code { display: block; padding: 8px; border-radius: 6px; background: var(--panel); user-select: all;
  word-break: break-all; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.filters .n { opacity: .75; margin-left: 4px; }
.stamp { color: var(--muted); font-size: 12px; }
.banner {
  display: none; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--fail-bg); color: var(--fail); font-size: 13px;
}
.banner.show { display: block; }
ul.cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cid { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; color: var(--muted); }
.folder { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.folder b { font-weight: 600; }
.folder .parent { display: block; color: var(--muted); font-size: 12px; }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--cb, var(--queued-bg)); color: var(--c, var(--queued));
}
.badge.in_progress { background: var(--run-bg); color: var(--run); }
.badge.needs_human, .badge.manual { background: var(--human-bg); color: var(--human); }
.badge.done { background: var(--done-bg); color: var(--done); }
.badge.failed { background: var(--fail-bg); color: var(--fail); }
.badge.cancelled { background: var(--off-bg); color: var(--off); }
.progress { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--c, var(--run)); border-radius: 3px; transition: width .4s; }
.progress.indet > div { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { margin-left: -35%; } to { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress.indet > div { animation: none; margin-left: 0; } }
.ptext { margin-top: 6px; font-size: 13px; }
.note, .result { margin-top: 8px; font-size: 13px; padding: 8px 10px; border-radius: 6px; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.result.failed { background: var(--fail-bg); }
.result.manual { background: var(--human-bg); }
.result.done { background: var(--done-bg); }
.meta { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions button.primary { width: auto; }
details.log { margin-top: 8px; font-size: 13px; }
details.log summary { cursor: pointer; color: var(--muted); }
details.log ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
details.log li { display: grid; grid-template-columns: 64px 120px 1fr; gap: 8px; }
details.log time, details.log .by { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 32px 16px; }
.help { margin-top: 16px; font-size: 13px; }
.help summary { cursor: pointer; font-weight: 600; }
.help code, .help pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }
.help pre { background: var(--bg); padding: 8px 10px; border-radius: 6px; overflow-x: auto; white-space: pre; }
.help p { margin: 8px 0; }
@media (max-width: 520px) {
  details.log li { grid-template-columns: 56px 1fr; }
  details.log li .by { display: none; }
}
nav.tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; }
nav.tabs a {
  display: inline-flex; align-items: center; white-space: nowrap; padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px;
}
nav.tabs a:hover { color: var(--text); background: var(--bg); }
nav.tabs a.active { color: var(--accent); background: var(--run-bg); font-weight: 600; }
nav.tabs .cnt { margin-left: 6px; font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--human-bg); color: var(--human); font-weight: 600; font-variant-numeric: tabular-nums; }
nav.tabs .cnt.hot { background: var(--human); color: var(--panel); }
nav.tabs .cnt:empty { display: none; }
@media (max-width: 820px) { nav.tabs { order: 3; flex-basis: 100%; } }
select {
  width: 100%; font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
.v-ok { background: var(--done-bg); color: var(--done); }
.v-ok_after_fix { background: var(--human-bg); color: var(--human); }
.v-redo { background: var(--fail-bg); color: var(--fail); }
.v-note { background: var(--queued-bg); color: var(--queued); }
.fbst { font-size: 12px; color: var(--muted); }
.fbst.new { color: var(--run); font-weight: 600; }
.fbst.planned { color: var(--human); font-weight: 600; }
.fbst.fixed { color: var(--done); font-weight: 600; }
.fbs { margin-top: 8px; display: grid; gap: 4px; font-size: 13px; }
.fbs > div { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fbs .t { overflow-wrap: anywhere; }
ul.fblist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fb { padding: 12px 16px; border-left: 4px solid var(--line); }
.fb[data-status="new"] { border-left-color: var(--run); }
.fb[data-status="planned"] { border-left-color: var(--human); }
.fb[data-status="fixed"] { border-left-color: var(--done); }
.topic { font-size: 13px; }
.radios { display: grid; gap: 6px; margin-top: 4px; }
.radios label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; font-size: 14px; }
.radios input, label.check input { width: auto; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal {
  width: min(480px, 100%); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 16px; margin: 0 0 4px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal .row button.primary { width: auto; margin: 0; padding: 8px 16px; font-size: 14px; }
ol.events { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px;
  max-height: 420px; overflow-y: auto; }
ol.events li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
ol.events time { color: var(--muted); font-size: 12px; }
ol.events .k-step { font-weight: 600; }
ol.events .k-warning { color: var(--human); }
ol.events .k-error { color: var(--fail); }
ol.events .k-human { color: var(--human); font-weight: 600; }
ol.events .k-tool { color: var(--muted); }
pre.out { margin: 6px 0 0; padding: 8px 10px; border-radius: 6px; background: var(--bg); font-family: Consolas, "Cascadia Mono", monospace;
          font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }

/* a new log line arrives on top: the browser keeps the line being read where it is */
ol.events { overflow-anchor: auto; }
.ptext button { margin-left: 4px; }

/* the one note at the bottom of the window (ToastService): a click's result or refusal */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  max-width: min(92vw, 640px); padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg);
  background: var(--done-bg); color: var(--done); border: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline;
}
.toast.err { background: var(--fail-bg); color: var(--fail); }
.toast button.link { color: inherit; opacity: .8; flex: none; }

#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; padding: 10px 16px;
  background: var(--fail-bg); color: var(--fail); font-size: 13px; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
}
#blazor-error-ui .reload { margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* the queue page (2026-10-15): one column, "needs you" first, a row per case */
main.single { grid-template-columns: minmax(0, 1fr); }
.helpbox { font-size: 13px; display: grid; gap: 6px; }
.helpbox p { margin: 0; max-width: 80ch; }
.helpbox pre { margin: 0; background: var(--bg); padding: 8px 10px; border-radius: 6px; overflow-x: auto; font: 12px/1.5 Consolas, "Cascadia Mono", monospace; }
.helpbox kbd, .search kbd { font: 11px/1 Consolas, "Cascadia Mono", monospace; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--muted); }
button.ghost { border-color: transparent; background: none; color: var(--muted); }
button.ghost:hover, button.ghost[aria-expanded="true"] { color: var(--text); border-color: var(--line); }
.composer { display: grid; gap: 8px; }
.composer h3 { margin: 0; font-size: 15px; }
.composer label { margin: 4px 0 0; }
.comp-row { display: flex; gap: 8px; flex-wrap: wrap; }
.comp-row input { flex: 1 1 320px; min-width: 0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 14px; }
.comp-row button.primary { width: auto; margin: 0; padding: 8px 18px; font-size: 14px; }
.comp-check { font-size: 13px; color: var(--muted); min-height: 1.2em; }
.comp-check.ok { color: var(--done); }
.comp-check.bad { color: var(--fail); }
/* a case's files: uploaded (the composer), downloaded (a case's row) */
.composer .drop, .filedrop .drop { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.composer .drop.over, .filedrop .drop.over { border-color: var(--accent); background: var(--run-bg); }
.composer .drop p, .filedrop .drop p { margin: 4px 0; }
.composer label.linkish, .filedrop label.linkish { display: inline; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; margin: 0; }
.upl { display: flex; gap: 10px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.upl .name { min-width: 160px; overflow-wrap: anywhere; }
.upl progress { flex: 1; min-width: 120px; }
.upl .err { color: var(--fail); }
.up-files { font-size: 13px; }
.up-files ul, .case-files ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.up-files li, .case-files li { overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.case-files { font-size: 13px; margin-top: 6px; }
.case-files .dl-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.attn { display: grid; gap: 10px; }
.attn-h { margin: 0; font-size: 12px; font-weight: 700; color: var(--human); text-transform: uppercase; letter-spacing: .07em; }
.acard { border: 1px solid var(--human); background: var(--human-bg); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; min-width: 0; }
.a-head { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; }
.a-head b { color: var(--human); }
.a-left { color: var(--human); font-weight: 600; font-variant-numeric: tabular-nums; }
.a-q { margin: 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.a-why { margin: 0; font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.a-text { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.acard .opts { display: flex; gap: 8px; flex-wrap: wrap; }
.acard .opts button.primary, .acard .acts button.primary { width: auto; margin: 0; padding: 6px 14px; font-size: 13px; }
.acard .other { display: flex; gap: 8px; }
.acard .other input { flex: 1; min-width: 0; margin: 0; }
.acard .stamp { margin: 0; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acts button.primary { width: auto; margin: 0; padding: 6px 14px; font-size: 13px; }
/* a link that looks like the row's primary button (the web editor's page, in a new tab) */
.acts a.btn { font-size: 13px; border-radius: 8px; padding: 6px 14px; text-decoration: none; border: 1px solid var(--line); color: var(--text); }
.acts a.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.idlink { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; color: var(--accent); text-decoration: none; }
.idlink:hover { text-decoration: underline; }
.search { position: relative; flex: 1 1 280px; max-width: 460px; min-width: 0; display: flex; align-items: center; }
.search input { padding-left: 32px; padding-right: 36px; }
.search::before { content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-65%); pointer-events: none; }
.search::after { content: ""; position: absolute; left: 20px; top: 56%; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); pointer-events: none; }
.search kbd { position: absolute; right: 8px; pointer-events: none; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
mark { background: var(--human-bg); color: inherit; border-radius: 2px; padding: 0 1px; box-shadow: 0 0 0 1px var(--human); }
.found { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
ul.rows { list-style: none; margin: 0; padding: 0; overflow: hidden; }
ul.rows.card { padding: 0; }
.rrow + .rrow { border-top: 1px solid var(--line); }
.rrow { box-shadow: inset 3px 0 0 var(--c, transparent); position: relative; }
/* the web editor's button on a row: over the row's lower right, left of the chevron */
.rrow > button.r-web { position: absolute; right: 40px; bottom: 9px; width: auto; margin: 0; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.rrow > button.r-web.primary { font-weight: 600; }
/* the web editor's sessions on the Harness page */
.websl { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.webslot { padding: 12px 14px; display: grid; gap: 6px; }
.webslot.free { opacity: .75; }
.webslot .ws-head { display: flex; align-items: center; gap: 8px; }
.webslot .ws-text { margin: 0; font-size: 13px; color: var(--muted); }
.webslot .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.webslot button.primary { width: auto; margin: 0; padding: 5px 12px; font-size: 13px; }
.webslot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.webslot .dot.on { background: var(--done); }
/* an admin's limits of the web editor: how many cases at once, when an unused session closes */
.websettings {
  margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px 12px; align-items: center;
  max-width: 620px;
}
.websettings label { margin: 0; }
.websettings button { grid-column: 2; justify-self: start; }
.websettings.addnode { grid-template-columns: minmax(0, 1fr) 180px; }
/* the machines that host web sessions (the board's own and the lab's others) */
.webslot .ws-node { margin-left: auto; font-size: 12px; color: var(--muted); }
.nodes-h { margin: 14px 0 6px; font-size: 14px; }
.nodes-wrap { overflow-x: auto; }
.nodes { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; }
.nodes th, .nodes td { padding: 8px 10px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.nodes thead th { border-top: 0; color: var(--muted); font-weight: 600; }
.nodes .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.nodes .dot.on { background: var(--done); }
.nodes tr.off td { color: var(--muted); }
.nodes-act { white-space: nowrap; }
.nodes-act input { width: 70px; display: inline-block; padding: 4px 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.btn { display: inline-block; font-size: 13px; border-radius: 8px; padding: 5px 12px; text-decoration: none; border: 1px solid var(--line); color: var(--text); background: var(--panel); }
a.btn:hover { border-color: var(--muted); }
a.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.rsum {
  display: grid; width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: 12px 16px; color: inherit;
  grid-template-columns: 124px minmax(0, 1fr) auto; grid-template-areas: "badge main side" "badge sub chev";
  gap: 3px 12px; align-items: center; font-size: 14px;
}
.rsum:hover { background: var(--bg); border: 0; }
.r-badge { grid-area: badge; align-self: start; justify-self: start; margin-top: 1px; }
.r-main { grid-area: main; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; min-width: 0; }
.r-sub { grid-area: sub; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; color: var(--muted); min-width: 0; }
.r-side { grid-area: side; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-chev { grid-area: chev; justify-self: end; color: var(--muted); font-size: 16px; line-height: 1; transition: transform .15s; }
.rrow.open .r-chev { transform: rotate(90deg); }
.r-id { font: 600 13px Consolas, "Cascadia Mono", monospace; }
.one { min-width: 0; max-width: 64ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-prog { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.mini-prog .progress { width: 84px; margin-top: 0; display: inline-block; flex: none; }
.flag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--human-bg); color: var(--human); }
.flag.calm { background: var(--bg); color: var(--muted); font-weight: 400; }
.rdetail { padding: 0 16px 16px; display: grid; gap: 10px; min-width: 0; }
@media (min-width: 641px) { .rdetail { padding-left: calc(16px + 124px + 12px); } }
@media (max-width: 640px) {
  .rsum { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "badge side" "main main" "sub chev"; }
}
.rdetail .note { margin-top: 0; }
.note.tone { background: var(--cb); }
.kv { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: var(--muted); margin: 0; }
.kv b { color: var(--text); font-weight: 600; }
.older { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.rdetail .dd-menu, .acts .dd-menu { left: 0; right: auto; }

/* the Harness page (2026-10-15): a status strip, runner cards, run rows, and the settings form in its own tab */
.status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.st-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; flex: 1 1 340px; }
.st-main > .sdot { margin-top: 8px; box-shadow: 0 0 0 4px var(--cb); }
.sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--off)); flex: none; }
.st-text { min-width: 0; display: grid; gap: 2px; }
.st-title { font-weight: 600; font-size: 16px; }
.st-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.status .row { margin: 0; }
.status .row button.primary { width: auto; margin: 0; padding: 7px 18px; font-size: 14px; }
.st-doing { flex-basis: 100%; display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--run-bg); color: var(--run); }
.st-foot { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 10px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-right-color: currentColor; opacity: .6; } }
details.mini > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.banner { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--human-bg); border: 1px solid var(--human); font-size: 13px; }
.banner .bt { flex: 1 1 380px; min-width: 0; }
.banner b { color: var(--human); }
.subtabs { display: flex; gap: 2px; align-items: center; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtabs [role="tab"] { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 14px; font-size: 14px; color: var(--muted); margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.subtabs [role="tab"]:hover { color: var(--text); }
.subtabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dirty-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--human); }
.stack { display: grid; gap: 22px; min-width: 0; align-content: start; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 10px; }
.block-head h3 { font-size: 16px; margin: 0; font-weight: 600; }
.runners { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.rc { display: grid; gap: 7px; align-content: start; padding: 14px; min-width: 0; }
.rc-head { display: flex; align-items: center; gap: 8px; }
.rc-head .sdot { width: 8px; height: 8px; }
.rc-head b { font: 600 14px Consolas, "Cascadia Mono", monospace; }
.rc-head .badge { margin-left: auto; }
.rc-case, .rc-act { font-size: 13px; overflow-wrap: anywhere; }
.rc-act { color: var(--muted); }
.rc .progress { margin-top: 0; }
.rc-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; border-top: 1px solid var(--line); padding-top: 7px; }
.rc-acts { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
.rc-acts button:not(.link) { padding: 3px 10px; font-size: 12px; }
.lbl { color: var(--muted); font-size: 12px; }
.idv { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.kchip { font-size: 12px; padding: 2px 10px; border-radius: 999px; color: var(--muted); }
.kchip[aria-pressed="true"] { color: var(--text); background: var(--bg); border-color: var(--muted); }
.kchip .n { margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.block-head .filters .n { opacity: .75; margin-left: 4px; }
ol.events { background: var(--bg); padding: 8px 10px; border-radius: 6px; margin-top: 0; }
ol.events .k-info { color: var(--text); }
ol.events .k-text { font-style: italic; }
ol.events .k-tool { font: 12px/1.6 Consolas, "Cascadia Mono", monospace; }
.settings { display: grid; min-width: 0; max-width: 780px; }
.set-head { display: grid; gap: 2px; margin-bottom: 4px; }
.set-head h3 { font-size: 16px; margin: 0; font-weight: 600; }
.set-head p { margin: 0; }
.group { border-top: 1px solid var(--line); padding-block: 14px; min-width: 0; }
.group:first-of-type { border-top: 0; }
.group label { margin-top: 12px; }
.group .gh + label, .group legend + label { margin-top: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.gh, legend { font-size: 14px; font-weight: 600; margin: 0 0 8px; padding: 0; }
.cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.ocard { position: relative; display: grid; gap: 2px; align-content: start; padding: 10px 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--input); font-size: 14px; margin: 0 !important; font-weight: 400; }
.ocard:hover { border-color: var(--muted); }
.ocard input { position: absolute; opacity: 0; pointer-events: none; width: auto; }
.ocard b { font: 600 14px Consolas, "Cascadia Mono", monospace; }
.ocard span { font-size: 12px; color: var(--muted); }
.ocard:has(input:checked) { border-color: var(--accent); background: var(--run-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.ocard:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.two { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.row.grow, .grow { flex: 1 1 180px; min-width: 0; }
.test { margin-top: 14px; display: grid; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; align-items: baseline; }
.ok-i { color: var(--done); font-weight: 700; }
.no-i { color: var(--fail); font-weight: 700; }
.keystate { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.keystate .sdot { width: 8px; height: 8px; }
.savebar {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end;
  margin: 0 -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px;
}
.savebar .dirty { margin-right: auto; font-size: 13px; color: var(--muted); }
.savebar .dirty.on { color: var(--human); font-weight: 600; }
.savebar button.primary { width: auto; margin: 0; padding: 7px 18px; font-size: 14px; }

/* feedback and memory as lists of items (2026-10-15) */
.chip { border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip .n { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }
.flow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.flow .arr { color: var(--muted); font-size: 12px; }
.flow .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.item { padding: 12px 16px; display: grid; gap: 6px; min-width: 0; box-shadow: inset 3px 0 0 var(--c, transparent); list-style: none; }
.item + .item { border-top: 1px solid var(--line); }
.it-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.it-head .push { margin-left: auto; }
.it-title { font-weight: 600; }
.it-text { margin: 0; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.it-text.muted { color: var(--muted); }
.devnote { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--bg); overflow-wrap: anywhere; }
.item .meta { margin-top: 0; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.shared { border-color: var(--accent); background: var(--accent); color: var(--accent-text); font-weight: 600; }
.tag.personal { color: var(--text); }
/* the memory dialog: when the agent is reminded, and the recipe's steps to pick */
.mem-when { margin-top: 12px; }
.mem-when .radios { display: grid; gap: 4px; }
.steps-pick { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; margin-top: 8px; padding: 6px 10px;
              border: 1px solid var(--line); border-radius: 8px; }
.steps-pick label.check { margin: 0; font-size: 13px; }
.steps-pick .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; min-width: 9.5em; }
.ph-actions button.primary { width: auto; margin: 0; padding: 7px 16px; font-size: 14px; }

/* members, sign-in, password (2026-10-15) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stackcard { display: grid; gap: 12px; }
.stackcard .stamp, .stackcard .row { margin: 0; }
.stackcard .row input { margin: 0; }
.stackcard label.check { margin: 0; font-size: 13px; }
.subtabs .n { font-size: 12px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.subtabs .cnt { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--human); color: var(--panel); font-weight: 600; }
code.secret-v { display: block; margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--human-bg); border: 1px solid var(--human); font: 600 16px/1.4 Consolas, "Cascadia Mono", monospace; user-select: all; word-break: break-all; letter-spacing: .04em; color: var(--text); }
table.grid td.idv { font-family: Consolas, "Cascadia Mono", monospace; }
.pw { display: flex; gap: 6px; }
.pw input { flex: 1; min-width: 0; }
.caps { margin: 4px 0 0; font-size: 12px; color: var(--human); }
.pwchecks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.pwchecks li::before { content: "○"; display: inline-block; width: 1.4em; }
.pwchecks li.ok { color: var(--done); }
.pwchecks li.ok::before { content: "✓"; font-weight: 700; }
button.primary:disabled { opacity: .5; cursor: not-allowed; }

/* the lab's design parameters (2026-10-20): job form, Harness defaults, a case's detail */
.dp-box { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.dp-head { display: grid; gap: 2px; }
.dp-grid { display: grid; gap: 10px; }
.dp-row { display: grid; gap: 4px; min-width: 0; }
.dp-row label { margin: 0; }
.dp-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dp-ctl select { width: auto; min-width: 0; max-width: 100%; }
.dp-num { width: 7em; }
.dp-locked { font-size: 14px; }
.badge-lock { margin-left: 6px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.dp-show span b { font-variant-numeric: tabular-nums; }

/* "Làm tiếp từ điểm lưu" (2026-10-21): who goes on, the checkpoints, the files edited by hand */
.modal h4 { margin: 14px 0 4px; font-size: 14px; }
.modal label.field { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; font-weight: 400; }
.modal .resume-files { max-height: 280px; overflow: auto; }
.hand-up { border: 2px dashed var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; font-size: 13px; }
.hand-up.over { border-color: var(--accent); background: var(--run-bg); }
.hand-up label.linkish { display: inline; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; margin: 0; }

/* money (billing, 2026-10-23): the wallet and the admin's cash flow */
.money-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.money-tiles .card { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.money-tiles b { font-size: 20px; font-variant-numeric: tabular-nums; }
.money-tiles .low b { color: var(--fail); }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.neg { color: var(--fail); }
td.pos { color: var(--done); }
button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
button.primary.inline { width: auto; margin-top: 0; padding: 6px 14px; font-size: 13px; }
.topup { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 12px; }
.topup img { border-radius: 8px; background: #fff; padding: 6px; image-rendering: pixelated; }
.topup dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.topup dt { color: var(--muted); }
.topup dd { margin: 0; }
input.amount { width: 160px; flex: none; }
.row > input[type="month"], .row > input[type="date"], .row > select { width: auto; flex: none; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
tr.sel td { background: var(--accent-bg, rgba(31, 95, 209, .06)); }
