/* OM Support - one stylesheet for the whole console. No build step.
   Colors only through the variables below. Class list (use these in module views):
   layout   .page-head .page-actions .crumbs .grid .grid-2 .split (.split-main .split-side) .stack .row .spacer
            .muted .small .mono .num
   boxes    .card .card-head .card-body .card-foot .empty .alert(.alert-ok|warn|bad|info) .callout(-warn) .kv .kv-stack
   tables   .table-wrap > table.table   (wrap every table: it scrolls inside, never the page)
   buttons  .btn .btn-primary .btn-danger .btn-ghost .btn-sm .link-btn .icon-btn
   badges   .badge .badge-ok|warn|bad|info|muted      (or the badge() helper)   .pill .dot
   forms    .form .field (label, input, select, textarea, .hint, .field-error) .form-actions .form-section .check
   filters  .toolbar .tabs (.tab, .tab-count)
   setup    .steps .step-item .step-num .stepper .setup-shell .progress
   tickets  .track (.track-step) .track-sm .timeline .timeline-item .findings .ticket-head .meter .note-body
   switch   .switch (input[role=switch] + .switch-track + .switch-label)  .repo-switches .repo-switch  .sr-only
   dashboard .dash-wait (.dash-wait-item .dash-wait-num) .stats (.stat .stat-label .stat-value .stat-note) .chart (.chart-plot
            .chart-col .chart-bar .chart-tip .chart-max .chart-axis) .chart-table .dash-list .dash-title
   knowledge .kb-repo (.kb-repo-head .kb-repo-body) .kb-block .kb-section .kb-entry .kb-text .kb-suggestions .kb-add
   shadow   .shadow-start .shadow-verdict .shadow-scores .shadow-reply-head
   setup    .rt-form .rt-online .rt-local (step 4: key field / plan share)
*/

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    font-style: normal; font-weight: 400 700; font-display: swap;
    src: url("../fonts/atkinson-next-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    font-style: normal; font-weight: 400 700; font-display: swap;
    src: url("../fonts/atkinson-next-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Atkinson Hyperlegible Mono";
    font-style: normal; font-weight: 400 500; font-display: swap;
    src: url("../fonts/atkinson-mono-latin.woff2") format("woff2");
}

:root {
    /* base */
    --bg: #f1f4f3;            /* fog: page */
    --surface: #ffffff;       /* paper: cards */
    --surface-2: #f5f7f6;     /* table heads, quiet fills */
    --surface-3: #e9eeec;
    --border: #dde4e1;
    --border-strong: #c3cdc9;
    --text: #172226;          /* ink */
    --text-2: #546368;        /* slate */
    --text-3: #84918f;
    /* brand: pine */
    --night: #0f2628;         /* side menu */
    --night-2: #1b393c;
    --night-text: #c9d8d6;
    --night-dim: #86a09d;
    --accent: #0f6b66;
    --accent-hover: #0b5753;
    --accent-soft: #e0efec;
    --accent-line: #a8d2cb;
    /* status: Working / Waiting for a person / Done / Failed */
    --info: #2a56c0;   --info-soft: #e9eefb;  --info-line: #c4d2f3;
    --warn: #935400;   --warn-soft: #fcf1dc;  --warn-line: #efd29b;  --warn-dot: #d48a12;
    --ok: #1c7444;     --ok-soft: #e3f3e9;    --ok-line: #b8dcc6;    --ok-dot: #2f9a5e;
    --bad: #b02a22;    --bad-soft: #fbe9e7;   --bad-line: #f0c3be;
    --muted-dot: #b4bfbc;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 0 rgba(15, 38, 40, .04), 0 1px 2px rgba(15, 38, 40, .06);
    --shadow-pop: 0 12px 32px rgba(15, 38, 40, .18);
    --side-w: 236px;
    --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: "Atkinson Hyperlegible Mono", ui-monospace, Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); overflow-x: hidden; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
h1, h2, h3, .h1, .h2, .h3 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 700; letter-spacing: -.012em; }
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.0625rem; }
h3, .h3 { font-size: .96875rem; }
p { margin: 0 0 .75rem; }
strong { font-weight: 650; }
code, pre, .mono { font-family: var(--mono); font-size: .8125rem; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.6; margin: 0; }
pre code { background: none; padding: 0; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
details > summary { cursor: pointer; color: var(--text-2); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
details > summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 10px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: 0 0 var(--side-w); background: var(--night); color: var(--night-text); padding: 18px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 30px; display: block; }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { display: block; font-size: .75rem; font-weight: 400; color: var(--night-dim); letter-spacing: 0; margin-top: 3px; }
.menu-group { margin-bottom: 18px; }
.menu-label { font-size: .78rem; color: var(--night-dim); padding: 0 10px 6px; }
.menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--night-text); font-weight: 500; font-size: .9375rem; position: relative; }
.menu a:hover { background: var(--night-2); color: #fff; text-decoration: none; }
.menu a.active { background: #fff; color: var(--night); font-weight: 600; }
.menu a.active svg { color: var(--accent); }
.menu-meta { margin-left: auto; font-size: .75rem; color: var(--night-dim); font-weight: 500; }
.menu a.active .menu-meta { color: var(--text-2); }
.menu-meta.is-todo { color: #f0c46b; }
.menu a.active .menu-meta.is-todo { color: var(--warn); }
.menu svg, .icon-btn svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--night-2); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8125rem; }
.me-text { min-width: 0; line-height: 1.25; }
.me-name { color: #fff; font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-email { color: var(--night-dim); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-links { display: flex; gap: 4px; padding: 0 2px; flex-wrap: wrap; }
.me-links a, .me-links .link-btn { color: var(--night-text); font-size: .8125rem; padding: 5px 8px; border-radius: 6px; }
.me-links a:hover, .me-links .link-btn:hover { background: var(--night-2); color: #fff; text-decoration: none; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 32px; background: rgba(241, 244, 243, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; color: var(--text-2); font-size: .875rem; }
.top-title strong { color: var(--text); font-weight: 650; }
.top-status { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .8125rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
a.pill:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-dot); flex: 0 0 8px; }
.dot-ok { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot-warn { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot-info { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.pill-bad { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.icon-btn.menu-toggle { display: none; }
.content { padding: 28px 32px 48px; max-width: 1280px; width: 100%; }
.side-backdrop { display: none; }

/* ---------- page parts ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--text-2); margin: 0 0 8px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--text-3); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--text-2); margin: 0; max-width: 68ch; }
.page-head > div:first-child { min-width: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .muted { font-size: .8125rem; }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card > .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-2); }
.empty-title { color: var(--text); font-weight: 650; font-size: 1rem; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.split-side { position: sticky; top: 78px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--text-2); }
.small { font-size: .8125rem; }
.num { font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-stack { display: grid; gap: 14px; margin: 0; }
.kv-stack dt { color: var(--text-2); font-size: .8125rem; margin-bottom: 2px; }
.kv-stack dd { margin: 0; overflow-wrap: anywhere; }
.section-title { font-size: .9375rem; font-weight: 700; margin: 0 0 10px; }

/* ---------- alerts, callouts, badges, toasts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.alert-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout-warn { border-left-color: var(--warn-dot); background: var(--warn-soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.55; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-muted { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; max-width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--night); color: #fff; padding: 12px 16px 12px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); border-left: 4px solid var(--accent-line); animation: toast-in .2s ease-out; overflow-wrap: anywhere; }
.toast-ok { border-left-color: #5cc48a; }
.toast-warn { border-left-color: #f0b44c; }
.toast-bad { border-left-color: #f2766a; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 0 rgba(15, 38, 40, .04); transition: background-color .12s ease, border-color .12s ease; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--surface); border-color: var(--bad-line); color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: .8125rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-weight: 600; font-size: .9375rem; }
.field .hint, .hint { color: var(--text-2); font-size: .8125rem; }
.field-error { color: var(--bad); font-size: .8125rem; }
.form-section { border-top: 1px solid var(--border); padding-top: 18px; }
.form-section-title { font-weight: 700; margin: 0 0 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=time], input[type=file], select, textarea {
    width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background-color: var(--surface); color: var(--text); font: inherit; font-size: .9375rem;
    transition: border-color .12s ease, box-shadow .12s ease;
}
input[type=file] { padding: 6px 8px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23546368' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 11px 8px; }
select[multiple] { background-image: none; padding-right: 12px; }
textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-2); color: var(--text-3); }
.is-invalid { border-color: var(--bad) !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; flex: 0 0 17px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.check input { margin-top: 3px; }
.field[role=radiogroup] .check { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); transition: border-color .12s ease, background-color .12s ease; cursor: pointer; }
.field[role=radiogroup] .check:hover { border-color: var(--border-strong); }
.field[role=radiogroup] .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.field[role=radiogroup] .check:has(input:disabled) { cursor: default; background: var(--surface-2); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 160px; }
.toolbar input[type=search] { min-width: 260px; padding-left: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2384918f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 16px 16px; }

/* ---------- tabs (status filter) ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; color: var(--text-2); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: .75rem; font-weight: 600; min-width: 22px; padding: 0 7px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.tab.active .tab-count { background: var(--accent); color: #fff; }
.tab-count.is-warn { background: var(--warn-soft); color: var(--warn); }
.tab-count.is-bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table td { vertical-align: middle; }
.table th { font-size: .8125rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: #f8faf9; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--text-2); font-size: .8125rem; margin-top: 1px; }
a.cell-main:hover { color: var(--accent); }
.ticket-no { font-family: var(--mono); font-size: .8125rem; color: var(--text-2); white-space: nowrap; }
a.ticket-no:hover { color: var(--accent); }

/* ---------- the pipeline track (the one bold element) ---------- */
/* Small: 7 segments in a ticket row. */
.track-sm { display: flex; gap: 3px; width: 132px; margin-bottom: 6px; }
.track-sm i { flex: 1 1 0; height: 6px; border-radius: 2px; background: var(--surface-3); }
.track-sm i.s-done { background: var(--accent); }
.track-sm i.s-skipped { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, var(--surface-3) 2px 4px); }
.track-sm i.s-running { background: var(--info); animation: track-pulse 1.6s ease-in-out infinite; }
.track-sm i.s-waiting { background: var(--warn-dot); }
.track-sm i.s-failed { background: var(--bad); }
.track-sm i.s-stopped { background: var(--text-3); }
.track-sm.is-done i.s-done { background: var(--ok-dot); }
.track-text { font-size: .8125rem; color: var(--text-2); max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes track-pulse { 50% { opacity: .45; } }

/* Large: the ticket page header. */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.track-step { position: relative; padding: 0 10px 0 0; min-width: 0; }
.track-bar { height: 8px; background: var(--surface-3); border-radius: 3px; margin-bottom: 12px; }
.track-step.s-done .track-bar { background: var(--accent); }
.track.is-done .track-step.s-done .track-bar { background: var(--ok-dot); }
.track-step.s-skipped .track-bar { background: repeating-linear-gradient(135deg, var(--border-strong) 0 3px, var(--surface-3) 3px 6px); }
.track-step.s-running .track-bar { background: var(--info); animation: track-pulse 1.6s ease-in-out infinite; }
.track-step.s-waiting .track-bar { background: var(--warn-dot); }
.track-step.s-failed .track-bar { background: var(--bad); }
.track-step.s-stopped .track-bar { background: var(--text-3); }
.track-name { font-weight: 700; font-size: .875rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-state { font-size: .8125rem; color: var(--text-2); line-height: 1.35; margin-top: 2px; }
.track-step.s-running .track-state { color: var(--info); font-weight: 600; }
.track-step.s-waiting .track-state { color: var(--warn); font-weight: 600; }
.track-step.s-failed .track-state { color: var(--bad); font-weight: 600; }
.track-step.s-pending .track-name { color: var(--text-3); }
.track-meta { font-size: .75rem; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- ticket page ---------- */
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.ticket-head > div:first-child { min-width: 0; flex: 1 1 420px; }
.ticket-head h1 { font-size: 1.625rem; overflow-wrap: anywhere; margin-bottom: 8px; max-width: 40ch; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); font-size: .875rem; }
.ticket-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ticket-meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--text-3); }
.track-card { padding: 20px 20px 18px; }
.track-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.track-now { font-weight: 650; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.is-warn > span { background: var(--warn-dot); }
.meter.is-bad > span { background: var(--bad); }
.card.is-attention { border-color: var(--warn-line); box-shadow: 0 0 0 3px var(--warn-soft); }
.card.is-attention > .card-head { background: var(--warn-soft); border-bottom-color: var(--warn-line); border-radius: var(--radius) var(--radius) 0 0; }
.note-block + .note-block { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.note-body { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; line-height: 1.6; }
.qa + .qa { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }
.qa-question { font-size: 1rem; font-weight: 650; white-space: pre-wrap; margin: 4px 0 0; }
.side-actions { display: grid; gap: 8px; }
.side-actions .btn { width: 100%; }
.message { border-left: 2px solid var(--border-strong); padding-left: 14px; }
.message + .message { margin-top: 16px; }
.message-who { font-size: .8125rem; color: var(--text-2); margin-bottom: 4px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- setup ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step-item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); position: relative; }
.step-item:last-child { border-bottom: 0; }
.step-item:hover { background: #f8faf9; }
.step-num { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--text-2); font-weight: 700; font-size: .9rem; }
.step-item.is-done .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-item.is-next .step-num { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-main { flex: 1 1 auto; min-width: 0; }
.step-main h3 { margin: 0; font-size: 1rem; }
.step-main h3 a { color: var(--text); }
.step-main h3 a::after { content: ""; position: absolute; inset: 0; }
.step-main p { margin: 2px 0 0; color: var(--text-2); font-size: .875rem; }
.step-item .btn, .step-item .badge { position: relative; z-index: 1; }
.setup-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.stepper { list-style: none; margin: 0; padding: 0; position: sticky; top: 78px; }
.stepper li { position: relative; }
.stepper li + li { margin-top: 4px; }
.stepper a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: .9rem; border: 1px solid transparent; }
.stepper a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.stepper .step-num { width: 24px; height: 24px; flex: 0 0 24px; font-size: .75rem; border-width: 1.5px; }
.stepper a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border-color: var(--border); }
.stepper a.active .step-num { border-color: var(--accent); color: var(--accent); }
.stepper li.is-done .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- timeline (ticket page) ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 20px 16px; }
.timeline-item:last-child { padding-bottom: 4px; }
.timeline-item::before { content: ""; position: absolute; left: -28px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline-item.is-done::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px #fff; }
.timeline-item.is-failed::before { border-color: var(--bad); background: var(--bad); box-shadow: inset 0 0 0 2px #fff; }
.timeline-item.is-running::before { border-color: var(--info); }
.timeline-item.is-waiting::before { border-color: var(--warn-dot); background: var(--warn-soft); }
.timeline-meta { font-size: .8125rem; color: var(--text-2); margin-top: 2px; }
.findings { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.findings li { overflow-wrap: anywhere; }
.run + .run { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }

/* ---------- dialog ---------- */
.dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); color: var(--text); }
.dialog::backdrop { background: rgba(15, 38, 40, .45); }
.dialog form { margin: 0; }
.dialog-text { font-size: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- plain pages (sign in, forgot, reset) ---------- */
body.plain { background: var(--surface); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 44%) minmax(0, 1fr); }
.auth-panel { background: var(--night); color: var(--night-text); padding: 40px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-panel .brand { padding: 0; }
.auth-pitch h2 { color: #fff; font-size: 2.125rem; line-height: 1.12; letter-spacing: -.022em; margin-bottom: 14px; font-weight: 700; max-width: 17ch; }
.auth-pitch p { color: var(--night-text); font-size: 1rem; max-width: 40ch; margin: 0; }
.auth-flow { list-style: none; margin: 34px 0 0; padding: 0; max-width: 24rem; }
.auth-flow li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: start; position: relative; padding-bottom: 14px; }
.auth-flow li:last-child { padding-bottom: 0; }
.auth-flow li::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--night-2); }
.auth-flow li:last-child::after { display: none; }
.auth-flow b { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent-line); background: var(--night); position: relative; z-index: 1; }
.auth-flow li.is-on b { background: var(--accent-line); box-shadow: inset 0 0 0 4px var(--night); }
.auth-flow span { color: #fff; font-weight: 600; font-size: .9375rem; line-height: 22px; }
.auth-flow small { display: block; color: var(--night-dim); font-size: .8125rem; line-height: 1.4; font-weight: 400; }
.auth-foot { color: var(--night-dim); font-size: .8125rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 26px; }
.auth-card .form { max-width: none; }
.auth-card .btn-primary { width: 100%; height: 44px; font-size: 1rem; }
.auth-mobile-brand { display: none; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-row a { font-size: .8125rem; font-weight: 500; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
    .split { grid-template-columns: minmax(0, 1fr); }
    .split-side { position: static; }
}
@media (max-width: 960px) {
    .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
    body.menu-open .side { transform: none; box-shadow: 0 0 40px rgba(15, 38, 40, .3); }
    body.menu-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 38, 40, .4); }
    .icon-btn.menu-toggle { display: inline-flex; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .setup-shell { grid-template-columns: minmax(0, 1fr); }
    .stepper { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .stepper li + li { margin-top: 0; }
    .stepper a { white-space: nowrap; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-panel { display: none; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 700; font-size: 1.0625rem; color: var(--text); }
    .track { grid-template-columns: repeat(8, minmax(96px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
}
@media (max-width: 600px) {
    body { font-size: 14.5px; }
    h1, .h1 { font-size: 1.5rem; }
    .top { padding: 0 16px; gap: 8px; }
    .top-status .pill-text { display: none; }
    .top-status .pill { padding: 0 10px; }
    .content { padding: 18px 16px 40px; }
    .card-body { padding: 16px; }
    .card-head { padding: 12px 16px; }
    .step-item { padding: 14px 16px; flex-wrap: wrap; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 8px; }
    .toolbar select, .toolbar input, .toolbar input[type=search] { flex: 1 1 140px; min-width: 0; }
    .ticket-head h1 { font-size: 1.375rem; }
    .table th, .table td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
.top-mode { margin-left: 10px; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.track-sm i.s-unused { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.track-step.s-unused .track-bar { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.track-step.s-unused .track-name, .track-step.s-unused .track-state { color: var(--text-3); }
input.mono, textarea.mono, select.mono { font-family: var(--mono); font-size: .875rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check.choice { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.check.choice:hover { border-color: var(--border-strong); }
.check.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-about { display: block; color: var(--text-2); font-size: .8125rem; line-height: 1.4; margin-top: 2px; }
@media (max-width: 600px) { .choice-grid { grid-template-columns: minmax(0, 1fr); } }
.form > h2:not(:first-of-type), .form > h3:not(:first-of-type) { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 4px; }
.setup-shell > .card { max-width: 1000px; }
input[type=file]::file-selector-button { font: inherit; font-size: .875rem; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 5px 12px; margin-right: 12px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--surface-3); }
.card-body > .stack > section + section, .card-body > section + section { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 22px; }
.card-body section > h2:first-child { margin-bottom: 6px; }
.card-body section > .empty { padding: 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
/* Tickets table becomes a list of blocks on phones. */
@media (max-width: 600px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr { display: block; width: 100%; }
    .table-cards tr { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
    .table-cards tr:last-child { border-bottom: 0; }
    .table-cards td { display: block; border: 0; padding: 0; }
    .table-cards td:nth-child(1) { grid-column: 1; }
    .table-cards td:nth-child(2) { grid-column: 1 / -1; }
    .table-cards td:nth-child(3) { display: none; }
    .table-cards td:nth-child(4) { grid-column: 1 / -1; padding-top: 6px; }
    .table-cards td:nth-child(5) { grid-column: 1; }
    .table-cards td:nth-child(6) { grid-column: 2; grid-row: 1; text-align: right; font-size: .8125rem; }
    .table-cards .track-text { max-width: none; }
}
/* The big track turns into a vertical list on phones. */
@media (max-width: 600px) {
    .track { grid-template-columns: minmax(0, 1fr); gap: 10px; overflow: visible; padding-bottom: 0; }
    .track-step { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; column-gap: 12px; padding: 0; }
    .track-bar { grid-row: 1 / 3; grid-column: 1; width: 6px; height: auto; min-height: 36px; margin: 0; }
    .track-name, .track-state { grid-column: 2; margin: 0; }
    .track-meta { grid-column: 3; grid-row: 1 / 3; align-self: center; margin: 0; }
}

/* ---------- step-by-step guide (Setup step 3) ---------- */
.guide { border: 1px solid var(--accent-line); background: #f6fbfa; border-radius: var(--radius); margin-bottom: 24px; }
.guide > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 14px 18px; color: var(--text); }
.guide > summary h2 { margin: 0; font-size: 1rem; flex: 1 1 auto; }
.guide[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--accent-line); }
.guide-body { padding: 18px; }
.guide-part + .guide-part { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border-strong); }
.guide-part h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.guide-part.is-now h3::after, .guide-part.is-done h3::after { font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; letter-spacing: 0; }
.guide-part.is-now h3::after { content: "Do this now"; background: var(--accent); color: #fff; }
.guide-part.is-done h3::after { content: "Done"; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.guide-part.is-done .guide-steps { opacity: .75; }
.guide-steps { margin: 8px 0 0; padding-left: 24px; display: grid; gap: 9px; }
.guide-steps > li { padding-left: 4px; }
.guide-steps > li::marker { color: var(--accent); font-weight: 700; }
.guide-perms { margin: 6px 0; padding-left: 18px; }
.copy-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; vertical-align: middle; }
.copy-row code { overflow-wrap: anywhere; font-size: .8125rem; }

/* ---- On/off switch (Setup step 3) and the Repositories & knowledge page ---- */
.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; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: 0 0 auto; font-weight: 600; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track { width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background-color .15s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 38, 40, .25); transition: transform .15s ease; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label::before { content: "Off"; display: inline-block; min-width: 2em; }
.switch input:checked ~ .switch-label::before { content: "On"; color: var(--accent); }
.repo-switches { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
.repo-switch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.repo-switch:first-child { border-top: 0; }
.repo-switch-main { flex: 1 1 auto; min-width: 0; }
.repo-switch-main strong { overflow-wrap: anywhere; }

.kb-group-title { font-size: 1rem; margin: 22px 0 10px; }
.kb-repo > summary.kb-repo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin: 0; color: var(--text); }
.kb-repo[open] > summary.kb-repo-head { border-bottom: 1px solid var(--border); }
.kb-repo-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.kb-repo-name strong { overflow-wrap: anywhere; }
.kb-repo-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.kb-repo-body { padding: 16px; }
.kb-repo-off { opacity: .92; }
.kb-block + .kb-block { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; }
.kb-block > h2 { font-size: 1rem; margin: 0 0 10px; }
.kb-actions { gap: 8px; }
.kb-sections { display: flex; flex-direction: column; gap: 8px; }
.kb-section { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.kb-entries { display: flex; flex-direction: column; gap: 6px; }
.kb-entry { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }
.kb-entry > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text); font-weight: 400; }
.kb-entry-title { font-weight: 600; overflow-wrap: anywhere; }
.kb-entry-body { padding-top: 4px; }
.kb-entry-body .mono, .kb-entry-body a { overflow-wrap: anywhere; word-break: break-word; }
.kb-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9375rem; max-height: 420px; overflow: auto; }
.kb-suggestions .card-head h3 { margin: 0; font-size: .9375rem; }
.kb-suggestion-list { list-style: none; margin: 0; padding: 0; }
.kb-suggestion { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.kb-suggestion:first-child { border-top: 0; }
.kb-add { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; }
.kb-search-field { margin: 0; }

/* ---------- Add knowledge: write / upload a file / web address ---------- */
.kb-add-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.kb-add-panel { display: none; }
.kb-add:has(input[value="write"]:checked) .kb-add-panel[data-panel="write"],
.kb-add:has(input[value="upload"]:checked) .kb-add-panel[data-panel="upload"],
.kb-add:has(input[value="url"]:checked) .kb-add-panel[data-panel="url"] { display: grid; }
.kb-sources .table td { vertical-align: top; }
@media (max-width: 600px) { .kb-add-pick { grid-template-columns: minmax(0, 1fr); } }

/* Product details on the Repositories & knowledge page fold away (the heading stays visible). */
.kb-fold > summary { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; color: var(--text); }
.kb-fold > summary h2 { font-size: 1rem; margin: 0; }
.kb-fold[open] > summary { margin-bottom: 14px; }
/* A fieldset that only groups form fields (no border); disabled = read only for this role. */
.kb-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 18px; }

/* ---------- Users page ---------- */
.users-add > summary.card-head { cursor: pointer; border-bottom: 0; justify-content: flex-start; }
.users-add[open] > summary.card-head { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.users-set-password { display: none; }
.users-add:has(input[name="how"][value="set"]:checked) .users-set-password { display: grid; }
.user-box > summary.user-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; flex-wrap: wrap; cursor: pointer; color: var(--text); }
.user-box[open] > summary.user-head { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.user-box .avatar { background: var(--surface-3); color: var(--text); }
.user-box.is-off { opacity: .75; }
.user-who { display: grid; min-width: 0; flex: 1 1 200px; }
.user-who .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-last { margin-left: 6px; }

/* ---------- dashboard ---------- */
.dash-title { font-size: 1.0625rem; margin: 26px 0 12px; }
.dash-wait { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-wait-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-2); background: var(--surface); min-width: 0; }
.dash-wait-item:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.dash-wait-num { font-size: 1.5rem; font-weight: 650; color: var(--text-3); min-width: 1.5ch; }
.dash-wait-item.has-items { color: var(--text); border-color: var(--warn-line); }
.dash-wait-item.has-items .dash-wait-num { color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.stat-label { font-size: .8125rem; color: var(--text-2); }
.stat-value { font-size: 1.75rem; font-weight: 650; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
.stat-note { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.chart { position: relative; padding-top: 18px; }
.chart-max { position: absolute; top: 0; left: 0; font-size: .75rem; color: var(--text-3); }
.chart-plot { display: flex; align-items: flex-end; gap: 3px; height: 140px; border-top: 1px dashed var(--border); border-bottom: 1px solid var(--border-strong); }
.chart-col { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; outline: none; }
.chart-bar { display: block; width: 100%; max-width: 24px; background: var(--accent); border-radius: 4px 4px 0 0; }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { filter: brightness(.85); }
.chart-col:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.chart-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; background: var(--text); color: var(--surface); font-size: .75rem; line-height: 1.35; padding: 6px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.chart-col:hover .chart-tip, .chart-col:focus-visible .chart-tip { display: block; }
.chart-col:first-child .chart-tip { left: 0; transform: none; }
.chart-col:last-child .chart-tip { left: auto; right: 0; transform: none; }
.chart-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-3); margin-top: 6px; }
.chart-table { margin-top: 10px; }
.chart-table .table-wrap { max-height: 260px; overflow: auto; margin-top: 8px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list strong { color: var(--text); font-size: 1.0625rem; }
@media (max-width: 960px) { .dash-wait { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dash-wait { grid-template-columns: minmax(0, 1fr); } .stat-value { font-size: 1.5rem; } }

/* Shadow tests ---------------------------------------------------------------------------------- */
.shadow-start > summary.card-head { cursor: pointer; border-bottom: 0; justify-content: flex-start; }
.shadow-start[open] > summary.card-head { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.shadow-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.shadow-verdict .badge { font-size: .9375rem; padding: 4px 12px; }
.shadow-scores td.num, .shadow-scores th.num { width: 1%; white-space: nowrap; }
.shadow-reply-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* Setup step 4: show the API key field or the plan share, for the choice that is ticked */
.rt-form .rt-online { display: none; }
.rt-form:has(input[name="runtime"][value="api_key"]:checked) .rt-online { display: grid; }
.rt-form:has(input[name="runtime"][value="api_key"]:checked) .rt-local { display: none; }
