/* Design tokens: one source of truth. Light by default; dark by data-theme or system preference. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef0f3; --border: #d9dde3; --text: #1b1f24; --muted: #5f6a75;
  --accent: #1f6feb; --accent-text: #ffffff; --good: #1a7f37; --warn: #9a6700; --bad: #c62828; --code-bg: #f0f2f5;
  --radius: 8px; --shadow: 0 8px 30px rgba(0,0,0,.12); color-scheme: light;
}
/* Dark theme: terminal green accent on near-black. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#0b0f0c; --surface:#121712; --surface-2:#1a221b; --border:#27332a; --text:#d9e6d9; --muted:#8fa392; --accent:#2bd96b; --accent-text:#07110a; --good:#2bd96b; --warn:#e0b84a; --bad:#ff5c5c; --code-bg:#1a221b; --shadow:0 8px 30px rgba(0,0,0,.6); color-scheme: dark; } }
:root[data-theme="dark"] { --bg:#0b0f0c; --surface:#121712; --surface-2:#1a221b; --border:#27332a; --text:#d9e6d9; --muted:#8fa392; --accent:#2bd96b; --accent-text:#07110a; --good:#2bd96b; --warn:#e0b84a; --bad:#ff5c5c; --code-bg:#1a221b; --shadow:0 8px 30px rgba(0,0,0,.6); color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; } h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; font-size: .9em; } code.id { color: var(--bad); }
code.big { font-size: 1.3rem; letter-spacing: .08em; }
pre.codes { font-size: 1.1rem; background: var(--code-bg); padding: 1rem; border-radius: var(--radius); }
.muted { color: var(--muted); } .small-text { font-size: .85em; } .help { display: block; color: var(--muted); font-size: .85em; }
.top { display: flex; align-items: center; gap: 1.5rem; padding: .5rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.top .brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.top nav { display: flex; gap: 1rem; align-items: center; } .top nav a, .top nav summary { color: var(--text); padding: .35rem 0; border-bottom: 2px solid transparent; cursor: pointer; list-style: none; }
.top nav a.on, .top nav summary.on { border-color: var(--accent); }
.top .who { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.menu { position: relative; } .menu-list { position: absolute; top: 2.2rem; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 14rem; padding: .4rem 0; display: flex; flex-direction: column; }
.top .menu-list a { padding: .35rem 1.25rem; border: 0; } .menu-list a:hover { background: var(--surface-2); text-decoration: none; }
.menu-group { padding: .5rem 1rem .15rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.page { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
body.plain { display: grid; place-items: center; } .card.narrow { width: min(26rem, 92vw); }
.brand-big { text-align: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; }
label { display: block; margin: .6rem 0; font-weight: 500; }
label input:not([type=checkbox]):not([type=radio]):not([type=file]), label select, label textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; } label.row-inline { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 400; margin: .25rem 0; }
button, .button { font: inherit; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; display: inline-block; }
button:hover, .button:hover { filter: brightness(.96); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.small { padding: .25rem .6rem; font-size: .85em; } button.link { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; }
form.inline, .inline { display: inline; }
.flash { padding: .6rem 1.25rem; border-bottom: 1px solid var(--border); } .flash.ok { background: color-mix(in srgb, var(--good) 15%, var(--surface)); } .flash.error { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .8rem; background: var(--surface-2); }
table.list td { padding: .55rem .8rem; border-top: 1px solid var(--border); vertical-align: top; }
table.list tr:hover td { background: var(--surface-2); }
td.actions { white-space: nowrap; } td.actions form { margin-right: .3rem; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); }
.badge.kind { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: .7rem; }
.st-active, .st-done, .st-sent, .st-included, .st-review { background: color-mix(in srgb, var(--good) 18%, var(--surface)); border-color: var(--good); color: var(--good); }
.st-pending, .st-queued, .st-running, .st-capped, .st-stale, .st-screening { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); border-color: var(--warn); color: var(--warn); }
.st-disabled, .st-failed, .st-rejected, .st-removed, .st-stopped, .st-excluded { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); border-color: var(--bad); color: var(--bad); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; } .tabs a { padding: .35rem .7rem; border-radius: 6px; color: var(--text); } .tabs a.on { background: var(--surface-2); font-weight: 600; } .tabs .count { color: var(--muted); font-size: .8em; }
.empty { text-align: center; padding: 3rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; } .row label { flex: 1 1 14rem; margin: 0; }
/* Right-side panel: 50% wide, no centred modals. */
.panel { position: fixed; top: 0; right: 0; height: 100%; width: 50%; min-width: 22rem; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow); padding: 1.5rem; overflow: auto; z-index: 20; }
.panel[hidden] { display: none; } .panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 19; } .panel-backdrop[hidden] { display: none; }
.panel .close { position: absolute; top: .8rem; right: 1rem; }
@media (max-width: 800px) { .panel { width: 100%; min-width: 0; } .top { flex-wrap: wrap; } }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
/* Review workspace */
.page.wide { max-width: none; }
.ws { display: grid; grid-template-columns: var(--tree-w, 18rem) 6px 1fr; grid-template-rows: auto 1fr; gap: .5rem; height: calc(100vh - 7.5rem); }
.ws .splitter { cursor: col-resize; background: var(--border); border-radius: 3px; } .ws .splitter:hover, .ws .splitter.drag { background: var(--accent); }
.ws .tree .did { font-size: .72em; color: var(--muted); background: none; padding: 0; } .ws .tree .mark { display: inline-block; font-size: .65em; font-weight: 700; padding: 0 .3em; border-radius: 3px; color: #fff; vertical-align: middle; } .ws .tree .mark.ok { background: var(--good); } .ws .tree .mark.bad { background: var(--bad); } .ws .tree .mark.warn { background: var(--warn); }
.ws .tree .ic { display: inline-block; min-width: 1.6em; font-weight: 700; font-size: .7em; vertical-align: middle; text-align: center; border-radius: 3px; padding: 0 .2em; } .ws .tree .ic.has { color: #fff; background: var(--bad); } .ws .tree .ic.none { color: var(--muted); border: 1px solid var(--border); }
.ws .main .text { white-space: pre-wrap; font: .9rem/1.5 ui-monospace, monospace; }
.ws .decide { grid-column: 1 / -1; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem .6rem; }
.ws .decide .grp { display: flex; align-items: center; gap: .35rem; padding-right: .75rem; border-right: 1px solid var(--border); }
.ws .decide .grp:last-of-type, .ws .decide .grp.nav { border-right: 0; padding-right: 0; }
.ws .decide form.joined { display: inline-flex; } .ws .decide form.joined button { border-top-right-radius: 0; border-bottom-right-radius: 0; } .ws .decide form.joined select { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding: .45rem .4rem; font-size: .85em; max-width: 9rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.ws .decide button, .ws .decide .button { padding: .4rem .7rem; }
.ws .decide .icon, .button.icon { width: 2.2rem; padding: .4rem 0; text-align: center; font-size: 1rem; line-height: 1; } .button.icon.disabled { opacity: .35; pointer-events: none; }
.ws .decide .count { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 .4em; font-size: .75em; }
.ws .decide .spacer { flex: 1; } .ws .tree { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; font-size: .9rem; }
.ws .tree details { margin-left: .4rem; } .ws .tree summary { cursor: pointer; padding: .15rem .2rem; } .ws .tree a { display: block; padding: .2rem .5rem; color: var(--text); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws .tree a.on { background: var(--accent); color: var(--accent-text); } .ws .tree .n { color: var(--muted); font-size: .8em; }
.ws .main { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.ws .main .tabs { padding: .5rem .75rem; border-bottom: 1px solid var(--border); } .ws .main .body { flex: 1; overflow: auto; padding: 1rem; }
.ws iframe { width: 100%; height: 100%; border: 0; min-height: 70vh; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .35em; font-size: .8em; }
.mfa-setup { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; } .mfa-setup .qr { flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; } .mfa-setup > ol, .mfa-setup > form { flex: 1 1 20rem; } details.muted summary { cursor: pointer; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; text-align: center; color: var(--muted); font-size: .7rem; padding: .25rem; background: var(--surface); border-top: 1px solid var(--border); z-index: 4; }
body.plain .foot { border: 0; }
.page { padding-bottom: 3rem; }
/* Notes panel: list on top, editor fills the rest, button at the bottom */
.panel.notes { display: flex; flex-direction: column; } .panel.notes[hidden] { display: none; } .panel.notes .notes-list { overflow: auto; max-height: 40%; } .panel.notes .note-form { display: flex; flex-direction: column; flex: 1; gap: .5rem; min-height: 0; } .panel.notes textarea { flex: 1; width: 100%; resize: none; padding: .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; } .panel.notes button { align-self: flex-end; }
form.meta label { margin: .3rem 0; }
/* Full-screen review */
body.fullscreen .top, body.fullscreen .foot, body.fullscreen .flash { display: none; }
body.fullscreen .page { max-width: none; padding: .5rem; }
body.fullscreen .ws { height: calc(100vh - 1rem); }
/* Review tree as a grid */
.ws .tree .tree-head input { width: 100%; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
.ws .tree .chips { display: flex; flex-wrap: wrap; gap: .25rem; margin: .4rem 0; } .ws .tree .chip { display: inline-block; padding: .1rem .5rem; border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; color: var(--text); } .ws .tree .chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); } .ws .tree .chip .n { opacity: .7; }
.ws .tree .rows { display: grid; grid-template-columns: 1.3em 1fr; align-items: center; } .ws .tree label.sel { display: flex; justify-content: center; margin: 0; } .ws .tree label.sel input { margin: 0; }
.ws .tree .bulk-bar { display: flex; align-items: center; gap: .35rem; margin: .2rem 0 .4rem; font-size: .85rem; } .ws .tree .bulk-bar .spacer { flex: 1; } .ws .tree .bulk-bar select { font-size: .8rem; padding: .2rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); max-width: 8rem; } .ws .tree .bulk-bar label.check { margin: 0; font-weight: 400; }
.ws .tree a.row { display: grid; grid-template-columns: 4.6em 2.6em 1em 2.4em 2.6em 1fr; column-gap: .35rem; align-items: center; padding: .2rem .3rem; border-radius: 4px; color: var(--text); }
.ws .tree a.row > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws .tree a.row.on { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); } .ws .tree a.row:hover { background: var(--surface-2); text-decoration: none; }
.ws .tree .mark { display: inline-block; width: 100%; text-align: center; font-size: .65em; font-weight: 700; padding: .15em 0; border-radius: 3px; color: #fff; line-height: 1.4; } .ws .tree .mark.none { visibility: hidden; }
.ws .tree .ic { width: 100%; text-align: center; } .ws .tree .flag { color: var(--warn); text-align: center; } .ws .tree .yr { color: var(--muted); font-size: .85em; }
.inline-check { display: inline-flex; align-items: center; gap: .35rem; margin: .2rem 1rem .2rem 0; font-weight: 400; } .field { margin: .6rem 0; } .field-label { font-weight: 500; display: block; margin-bottom: .25rem; }
.docid { margin: 0 0 .5rem; font-size: .8rem; color: var(--muted); } .docid code { user-select: all; }
.ws .tree .tree-opts { display: flex; align-items: center; gap: .4rem; margin: .2rem 0 .4rem; } .ws .tree .tree-opts .chip.on::before, .ws .tree .chip.on { } 
.ws .tree .rows.with-source a.row { grid-template-columns: 4.6em 2.6em 1em 2.4em 6em 2.6em 1fr; }
.ws .tree .src { color: var(--muted); font-size: .8em; }
.ws .tree .ttl { display: flex; flex-direction: column; min-width: 0; } .ws .tree .ttl > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ws .tree .t2 { color: var(--muted); font-size: .8em; }
.table-wrap { overflow-x: auto; max-width: 100%; margin-bottom: .5rem; } .table-wrap table.list { min-width: max-content; width: 100%; }
.card { overflow: visible; } .page > .grid2 > .card { min-width: 0; }
fieldset.auth { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .9rem; margin: .6rem 0; } fieldset.auth legend { padding: 0 .3rem; font-weight: 500; } fieldset.auth label.check { margin: .3rem 0; } .auth-password, .auth-key { margin-left: 1.4rem; display: none; } fieldset.auth:has(input[value=password]:checked) .auth-password, fieldset.auth:has(input[value=key]:checked) .auth-key { display: block; }
.attach-bar { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.ws .tree .rows.public { display: block; }
.top .brand { display: inline-flex; align-items: center; gap: .5rem; } .top .logo { height: 28px; width: auto; }
.top .logo.dark { display: none; } html[data-theme="dark"] .top .logo.light { display: none; } html[data-theme="dark"] .top .logo.dark { display: inline; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .top .logo.light { display: none; } html[data-theme="auto"] .top .logo.dark { display: inline; } }
.spinner { display: inline-block; width: .9em; height: .9em; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-right: .3em; } @keyframes spin { to { transform: rotate(360deg); } }
.panel.bulk { display: flex; flex-direction: column; } .panel.bulk[hidden] { display: none; } .panel.bulk .bulk-form { display: flex; flex-direction: column; flex: 1; gap: .5rem; min-height: 0; } .panel.bulk textarea { flex: 1; width: 100%; resize: none; font: .9rem/1.4 ui-monospace, monospace; padding: .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); white-space: pre; } .panel.bulk button { align-self: flex-end; }
