/* Argus dashboard. Colors are the UpdateSet gateway theme
   (updateset/us-mcp apps/gateway/public/brand/theme.css).
   Hex values that failed WCAG 2.1 AA on #141b24 are noted next to the token.
   Inter and Fira Code are self-hosted (SIL OFL). The CSP allows no third-party origins. */
@font-face { font-family: Inter; src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fira Code"; src: url("/static/fonts/firacode-latin.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --background: #141b24;
  --surface: #1a222c;
  --surface-muted: #2a3644;
  --text: #f2f2f2;
  --text-muted: #a0a0a0;
  --accent: #40c2f1;
  --accent-strong: #7fd6f6;
  --primary: #c42d84;          /* brand #e03e9b; white on that fill is 3.9:1, this is 5.2:1 */
  --primary-strong: #a8236f;
  --success: #3dbe8a;
  --success-wash: #143028;
  --success-line: #1f6b4e;
  --warning: #e6b325;
  --danger: #ff8a8a;           /* text; brand #dc2626 is 2.7:1 on --background */
  --danger-strong: #dc2626;    /* button fill, 4.8:1 with white */
  --danger-pressed: #b91c1c;
  --danger-wash: #3a1a1a;
  --border: #3d4957;
  --control-border: #6b7a8c;   /* brand border is 1.8:1 on --surface; this is 3.7:1 */
  --bg-info: #163044;
  --bg-warning: #3a3018;
  --ink: var(--text);
  --frame: var(--background);
  --sidebar: var(--background);
  --nav: var(--text);
  --nav-muted: var(--text-muted);
  --nav-active-bg: var(--surface-muted);
  --nav-active: var(--accent);
  --bg: var(--surface);
  --bg-weak: var(--surface-muted);
  --bg-info-line: #245a78;
  --bg-warning-line: #6b5420;
  --line: var(--border);
  --radius: 4px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .28);
  --font-sans: Inter, Roboto, Helvetica, sans-serif;
  --font-mono: "Fira Code", ui-monospace, monospace;
  --header-h: 56px;
  --sidebar-w: 170px;
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--frame); color: var(--text); font-size: 14px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); color: var(--accent); padding: .5rem .75rem; z-index: 20;
  border: 2px solid var(--accent); border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.3; font-weight: 600; color: var(--ink); }
h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--bg-info); color: var(--accent); padding: .05rem .35rem; border-radius: var(--radius); word-break: break-all; }
pre { background: var(--bg-weak); color: var(--text); padding: 12px 14px; border-radius: var(--radius); overflow-x: auto;
  max-width: 52rem; border: 1px solid var(--line); }
pre code { background: none; padding: 0; word-break: normal; white-space: pre; color: var(--text); }
pre:focus-visible { outline: 2px solid var(--accent); }

/* Shell: full-width dark header, fixed dark sidebar, white content with a rounded top-left corner. */
.shell { display: flex; flex-direction: column; min-height: 100vh; background: var(--frame); }
.topbar { height: var(--header-h); flex: 0 0 var(--header-h); display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 16px 0 14px; background: var(--background); color: var(--text); color-scheme: dark; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 16px; }
.brand:hover { color: var(--text); }
.brand .mark { display: block; flex: none; }
.brand .badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nav-active);
  border: 1px solid var(--nav-active); border-radius: 999px; padding: 0 .4rem; line-height: 1.6; }
.topbar .account { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-end;
  gap: 10px; margin: 0; max-width: min(46vw, 28rem); min-width: 0; color: var(--text); font-size: 13px; }
.avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--nav-active-bg); color: var(--nav-active);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.topbar .account .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar .account .who-kicker { flex: none; color: var(--nav-muted); font-size: 12px; }
.topbar .account .who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; }
.topbar .account .badge { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nav-active);
  border: 1px solid var(--nav-active); border-radius: 999px; padding: 0 .4rem; }
.topbar .account > button { flex: none; margin: 0; white-space: nowrap; align-self: center; color: var(--text);
  background: transparent; border-color: var(--control-border); }
.topbar .account > button:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.topbar :focus-visible, .sidebar :focus-visible { outline-color: var(--nav-active); }

.frame { flex: 1; display: flex; min-height: 0; min-width: 0; }
.sidebar { flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); background: var(--sidebar); color: var(--nav);
  color-scheme: dark; overflow: auto; padding: 8px 0 24px; }
.nav-find { display: flex; flex-direction: column; gap: 4px; margin: 0 12px 8px; }
.nav-find label { font-size: 12px; color: var(--nav-muted); font-weight: 600; }
.nav-find input { background: var(--surface-muted); color: var(--text); border: 1px solid var(--control-border); border-radius: var(--radius);
  min-height: 32px; font-size: 13px; max-width: none; }
.nav-find input::placeholder { color: var(--text-muted); }
.nav-find .hint { min-height: 1rem; margin: 0; color: var(--nav-muted); font-size: 12px; }
.sidebar h2 { margin: 0; font-size: inherit; font-weight: inherit; }
.sidebar .nav-group h2 button { width: 100%; text-align: left; background: transparent; border: 0; color: var(--nav-muted);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 14px 16px 4px; min-height: 0;
  border-radius: 0; }
.sidebar .nav-group h2 button::before { content: "▸ "; }
.sidebar .nav-group h2 button[aria-expanded="true"]::before { content: "▾ "; }
.sidebar .nav-group h2 button:hover { color: var(--text); background: transparent; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 1px 0; }
.sidebar a { display: block; margin: 0 8px; padding: 6px 10px; border-radius: 6px; color: var(--nav); text-decoration: none;
  font-size: 14px; font-weight: 500; }
.sidebar a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.sidebar a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active); font-weight: 600; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  border-top-left-radius: 10px; }
main { flex: 1; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; }
main:focus { outline: none; }
main > .crumbs { order: 1; }
main > #status { order: 2; }
main > h1 { order: 3; }
main > .intro { order: 4; }
main > .learn-row { order: 5; }
main > :not(.crumbs):not(#status):not(h1):not(.intro):not(.learn-row) { order: 6; }
.intro { font-size: 14px; max-width: 46rem; color: var(--text-muted); margin: 0 0 4px; }
.learn-row { margin: 0 0 20px; }
.learn-more { font-weight: 600; text-decoration: none; }
.learn-more:hover { text-decoration: underline; }
.crumbs { margin: 0 0 12px; font-size: 13px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; color: var(--text-muted); margin: 0 .4rem; }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
footer.site { border-top: 1px solid var(--line); padding: 8px 32px 16px; color: var(--text-muted); font-size: 12px; }
footer.site p { margin: 0; }

main section { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 16px; margin: 0 0 16px; overflow: hidden; }
main section > h2 { margin: 0 0 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
main section > :not(h2):not(table):not(.table-wrap) { margin-left: 16px; margin-right: 16px; }
main section > .table-wrap { border-left: 0; border-right: 0; border-radius: 0; }
main section:has(> .table-wrap:last-child),
main section:has(> table:last-child) { padding-bottom: 0; }
main section > .table-wrap:last-child { border-bottom: 0; }
main section > h2 + form > label:not(.check):first-of-type { margin-top: 0; }
main section section { background: var(--bg-weak); padding: 12px 16px; margin: 0 16px 16px; }

/* Sign-in card on the dark frame, centered, with room on small screens. */
.splash-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; background: var(--frame); }
.splash { flex: 0 1 auto; align-self: center; width: min(28rem, 100%); max-width: 28rem; margin: 0; padding: 32px 28px 28px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.splash .brand { color: var(--ink); margin-bottom: 8px; }
.splash .brand .badge { color: var(--success); border-color: var(--success); }
.splash h1 { margin-top: 8px; }
.splash .local-admin { margin: 8px 0 0; font-size: 13px; }
.splash .local-admin a { color: var(--accent); }

/* Forms: label above the control, inside the card. */
form { display: flex; flex-direction: column; align-items: stretch; gap: 2px; margin: 8px 0 0; max-width: 40rem; }
#kb-search-form, #kb-file-form { gap: 12px; margin-bottom: 20px; padding-bottom: 8px; }
main section > form + .list-toolbar { margin-top: 16px; }
label { font-weight: 600; }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; margin-top: 8px; }
form > label:not(.check) { margin-top: 12px; }
form > button, form > .button { align-self: flex-start; margin-top: 12px; }
form > p.hint { margin: 2px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 12px; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 600; padding: 0 .3rem; }
details { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px 8px; background: var(--bg-weak); }
details > summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--text); }
details > summary:hover { color: var(--accent); }
.subform { display: flex; flex-direction: column; gap: 2px; }
.hint { font-weight: 400; color: var(--text-muted); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-muted); border: 1px solid var(--control-border);
  border-radius: var(--radius); padding: 6px 10px; min-height: 32px; width: 100%; max-width: 36rem; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(64, 194, 241, .28); outline: none; }
select option { background: var(--surface); color: var(--text); }
input:disabled, select:disabled { opacity: .7; background: var(--bg-weak); }
input[type="file"] { padding: 4px; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--text); background: var(--bg-weak);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; margin-right: 10px; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 1.5rem; height: 1.5rem; min-height: 0; max-width: none; margin: 0; flex: none; accent-color: var(--accent); }
form label:has(+ input:required)::before,
form label:has(+ select:required)::before,
form label:has(+ textarea:required)::before,
.subform label:has(+ input:required)::before,
.subform label:has(+ select:required)::before,
.subform label:has(+ textarea:required)::before {
  content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .4rem; border-radius: 50%;
  background: var(--danger); transform: translateY(-1px);
}
label.switch { display: inline-flex; flex-direction: row; align-items: center; gap: .6rem; font-weight: 600; margin-top: 8px; }
label.switch input[type="checkbox"] { appearance: none; width: 2.5rem; height: 1.5rem; border: 0; border-radius: 999px;
  background: var(--line); position: relative; cursor: pointer; }
label.switch input[type="checkbox"]::before { content: ""; position: absolute; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--text); top: .175rem; left: .175rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
label.switch input[type="checkbox"]:checked { background: var(--primary); }
label.switch input[type="checkbox"]:checked::before { left: 1.15rem; }

button, .button { font: inherit; font-weight: 600; font-size: 14px; display: inline-block; padding: 6px 12px; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; border: 1px solid var(--control-border); background: var(--surface-muted); color: var(--text); line-height: 1.3; min-height: 32px; }
button:hover, .button:hover { background: var(--bg-weak); color: var(--text); }
form > button[type="submit"], .actions > button[type="submit"], .dialog-actions > button[value="go"],
button.primary, .button.primary {
  background: var(--primary); border-color: var(--primary); color: #fff; }
form > button[type="submit"]:hover, .actions > button[type="submit"]:hover, .dialog-actions > button[value="go"]:hover,
button.primary:hover, .button.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
button.danger, form > button.danger, .actions > button.danger {
  background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
button.danger:hover, form > button.danger:hover, .actions > button.danger:hover {
  background: var(--danger-pressed); border-color: var(--danger-pressed); color: #fff; }
button.muted { background: transparent; border-color: var(--line); color: var(--text); font-weight: 500; }
button.copy { padding: 2px 8px; font-size: 12px; min-height: 28px; }
button.linkish { background: transparent; border-color: transparent; color: var(--accent); padding-left: 0; text-decoration: underline; }
tr.approval-row { cursor: pointer; }
dialog pre { white-space: pre-wrap; max-height: 16rem; overflow: auto; margin: 8px 0 16px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.badge.readonly { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem;
  line-height: 1.6; vertical-align: middle; }
.badge.scope-all { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--primary); border: 1px solid var(--accent); border-radius: 999px;
  padding: 0 .45rem; line-height: 1.6; vertical-align: middle; margin-left: .35rem; }
.hint.warn { border: 1px solid var(--primary); border-left: 4px solid var(--accent); background: var(--bg-warning);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius); }
.managed-note { color: var(--text-muted); font-size: 13px; margin: 0 0 8px; }

/* Tables sit in a bordered card with a filter and a column menu (added by app.js). */
.list-toolbar { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.list-filter { flex: 1; min-width: 0; }
.list-filter input { max-width: none; }
.col-toggle { margin-left: auto; flex: none; }
.col-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 12px; min-width: 12rem; display: flex; flex-direction: column; gap: 4px; }
.col-menu label.check { margin: 0; font-size: 13px; }
table { border-collapse: collapse; width: 100%; margin: 0; }
.table-wrap { overflow: auto; max-width: 100%; margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  scrollbar-color: var(--control-border) var(--bg-weak); }
.table-wrap > table { margin: 0; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-wrap > table[data-cols="2"] { min-width: 18rem; }
.table-wrap > table[data-cols="3"] { min-width: 24rem; }
.table-wrap > table[data-cols="4"] { min-width: 32rem; }
.table-wrap > table[data-cols="5"] { min-width: 38rem; }
.table-wrap > table[data-cols="6"], .table-wrap > table[data-cols="7"] { min-width: 46rem; }
.table-wrap.scrolls { max-height: min(75vh, 48rem); }
.table-wrap.scrolls > table > thead th { position: sticky; top: 0; z-index: 1; }
.table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg-weak); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--control-border); border-radius: 6px; border: 2px solid var(--bg-weak); }
.scroll-hint { margin: 4px 0; font-size: 12px; color: var(--text-muted); }
caption { text-align: left; font-weight: 600; font-size: 13px; color: var(--text-muted); padding: 12px 16px 8px; }
th, td { border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; text-align: left; vertical-align: middle; }
td { overflow-wrap: anywhere; }
.table-wrap td, .table-wrap th { min-width: 6.5rem; }
.table-wrap td:has(> input[type="checkbox"]:only-child),
.table-wrap th:has(> input[type="checkbox"]:only-child),
.table-wrap td:has(> .row-menu), .table-wrap th:last-child { min-width: 0; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:only-child td[colspan] { text-align: center; padding: 44px 16px; color: var(--text-muted); }
td button { margin: 2px 0; }
td select { width: auto; max-width: 100%; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--control-border); border-radius: var(--radius); background: var(--surface-muted); font-weight: 700; color: var(--text); }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover { background: var(--bg-weak); }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); min-width: 11rem; display: flex; flex-direction: column; padding: 4px; }
.row-menu-list button { width: 100%; text-align: left; background: transparent; border: 0; border-radius: var(--radius); font-weight: 500; }
.row-menu-list button:hover { background: var(--bg-weak); }
.row-menu-list button.danger { background: transparent; color: var(--danger); border: 0; }
.row-menu-list button.danger:hover { background: var(--danger-wash); color: var(--danger); }

.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 8px 0; }
.filters > div, .savebar > div, .bulk .row > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filters > div { flex: 1 1 12rem; max-width: 22rem; }
form.bulk, form.savebar { display: block; max-width: none; }
.bulk .row, .savebar .row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.bulk .row > div { flex: 0 1 16rem; }
.savebar { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.savebar.dirty { position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 2px solid var(--accent); padding: 12px 0 8px; }
.savebar > div:not(.row) { max-width: 36rem; }
.savebar > .row { flex-direction: row; }
.savebar p { margin: 0; font-weight: 600; }
.table-wrap > #risk-table { min-width: 52rem; }
#risk-table td:nth-child(2) { min-width: 13rem; }
#risk-table td:nth-child(4) { min-width: 9rem; }
#risk-table select { min-width: 11.5rem; width: auto; }
tr.pending > td { background: var(--bg-info); }
tr.pending > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tool-name { font-family: var(--font-mono); font-size: .92em; }
.tool-name > span { white-space: nowrap; }
#risk-table .tool-name > span { white-space: normal; overflow-wrap: anywhere; }
.risk { display: inline-block; padding: 0 .5rem; border-radius: 999px; border: 1px solid; font-weight: 600; font-size: 12px; }
.risk-read { color: var(--success); border-color: var(--success); }
.risk-write { color: var(--warning); border-color: var(--warning); }
.risk-destructive { color: var(--danger); border-color: var(--danger); }
.health { display: inline-block; padding: 0 .5rem; border-radius: 999px; border: 1px solid; font-weight: 600; font-size: 12px; }
.health-healthy { color: var(--success); border-color: var(--success); }
.health-unhealthy, .health-circuit-open { color: var(--danger); border-color: var(--danger); }
.health-half-open { color: var(--warning); border-color: var(--warning); }
dl.risk-levels { grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px 16px; max-width: 56rem; border: 0; }
dl.risk-levels dt, dl.risk-levels dd { border: 0; padding: 4px 0; }
dl.risk-levels dt { color: var(--text); }

ol.steps li, ul li { margin: .3rem 0; }
ul.plain { list-style: none; padding: 0; }
ul.cards, ul.resources { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px; }
ul.cards > li, ul.resources > li { margin: 0; background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
ul.cards > li > span, ul.resources a span { font-weight: 400; color: var(--text-muted); font-size: 13px; }
ul.resources a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
ul.resources a:hover { color: var(--accent); }
.callout { border: 1px solid var(--bg-info-line); border-left: 4px solid var(--accent); background: var(--bg-info);
  padding: 12px 14px; max-width: 52rem; border-radius: var(--radius); color: var(--text); }
.note { border: 1px solid var(--bg-warning-line); border-left: 4px solid var(--warning); background: var(--bg-warning);
  padding: 10px 14px; max-width: 52rem; border-radius: var(--radius); color: var(--text); }
.reauth { margin: 0 0 16px; }
.reauth-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 8px; }
.reauth p { margin: 0 0 8px; }
.reauth p:last-child { margin-bottom: 0; }
.status:empty { min-height: 0; margin: 0; padding: 0; }
.status:not(:empty) { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius); font-weight: 600;
  background: var(--bg-info); border: 1px solid var(--bg-info-line); color: var(--text); }
.status.error { background: var(--bg-warning); border-color: var(--bg-warning-line); color: var(--warning); }
.status.error::before { content: "Error: "; }
dl { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); border-top: 1px solid var(--line); margin: 8px 0 0; }
dt { font-weight: 600; color: var(--text); }
dd { margin: 0; overflow-wrap: anywhere; }
dt, dd { padding: 12px 8px; border-bottom: 1px solid var(--line); }
dd code { background: var(--bg-info); color: var(--accent); }

.tag { display: inline-block; margin-left: .35rem; padding: 0 .45rem; border-radius: var(--radius); background: var(--bg-weak);
  border: 1px solid var(--line); color: var(--text-muted); font-size: 12px; font-weight: 600; vertical-align: middle; }
.tag-on { background: var(--success-wash); border-color: var(--success-line); color: var(--success); }
.tag-off { background: var(--bg-warning); border-color: var(--bg-warning-line); color: var(--warning); }
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-muted); }
.empty-state::before { content: ""; display: block; width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--bg-info); box-shadow: inset 0 0 0 2px var(--bg-info-line); }
.empty-state h3 { margin: 0 0 4px; font-size: 18px; }

.field-tip { position: fixed; z-index: 30; margin: 0; max-width: min(22rem, calc(100vw - 1rem)); padding: 8px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--accent); border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 13px; font-weight: 400; line-height: 1.45; white-space: normal; overflow-wrap: anywhere;
  box-shadow: var(--shadow); }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 6px 16px; }
.checks label.check { align-items: flex-start; overflow-wrap: anywhere; margin: 0; }
.checks label.check input { margin-top: .15rem; }
.checks h3 { grid-column: 1 / -1; font-size: 14px; margin: 8px 0 0; }
form > div.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#gt-result pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.state-off { color: var(--text-muted); }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px;
  width: min(40rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); overflow: auto; overflow-wrap: anywhere;
  box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8, 12, 18, .72); }
dialog h2 { margin-top: 0; }
dialog form { display: block; margin: 0; max-width: none; }
dialog fieldset { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 8px 16px; align-items: center; margin: 12px 0; }
dialog fieldset > legend, dialog fieldset > p { grid-column: 1 / -1; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.diff-list { columns: 2 12rem; margin: 4px 0 12px; padding-left: 1.25rem; font-family: var(--font-mono); font-size: 13px; }

@media (max-width: 48rem) {
  .frame { flex-direction: column; }
  .sidebar { flex: none; width: 100%; max-height: 40vh; border-bottom: 1px solid var(--border); }
  .content { border-top-left-radius: 10px; }
  .topbar { padding: 0 12px; }
  .topbar .account { max-width: 58%; }
  .topbar .account .who-kicker, .topbar .account .badge { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  main { padding: 16px; }
  footer.site { padding: 8px 16px 16px; }
  pre { max-width: 100%; }
  dl { grid-template-columns: 1fr; }
  dt { padding-bottom: 0; border-bottom: 0; }
}
@media (max-width: 40rem) {
  form, .subform { max-width: none; }
  input, select, textarea { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.ou-tree, .ou-tree ul { list-style: none; margin: 0; padding: 0; }
.ou-tree ul { margin-left: 1.25rem; padding-left: .75rem; border-left: 1px solid var(--line); }
.ou-tree li { margin: .45rem 0; }
.ou-row { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: baseline; }
.ou-row .hint { display: inline; }

.ov-flow { display: flex; flex-direction: column; gap: 8px; }
.ov-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ov-node { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: var(--surface-muted); }
.ov-arrow { color: var(--accent); font-weight: 700; }
#ov-timeline { padding-left: 1.25rem; }
#ov-timeline li { margin: .35rem 0; }

.expiry-expired { color: var(--danger); font-weight: 700; }
.expiry-soon { color: var(--accent); font-weight: 700; }
.bars { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bars .bar { display: block; height: 8px; background: var(--accent); border-radius: 4px; }
