:root {
  --bg: #f5f6f8; --panel: #ffffff; --text: #14161b; --muted: #5e6470; --line: #e4e6eb; --line-soft: #eceef2; --hover: #f8f9fb;
  --accent: #3f4fe0; --accent-hover: #2b37b0; --accent-text: #ffffff; --accent-soft: #e8ebfd; --accent-ink: #2b37b0; --sel: #f3f4fe;
  --danger: #a12a2a; --danger-soft: #fbeaea; --danger-line: #f0c7c7; --danger-ink: #6e1f1f;
  --ok: #0e6b43; --ok-soft: #e3f4ec; --ok-dot: #1f8a5b;
  --warn: #7a4a00; --warn-soft: #fdf3e1; --warn-line: #f1d9aa; --warn-ink: #5c3a00;
  --chip: #f0f1f4; --chip-text: #3a3f4a; --code: #f0f1f4; --field: #ffffff; --field-line: #d9dce2;
  --add: #e6f4ec; --add-text: #0b4d31; --del: #fbecec; --del-text: #7a1f1f;
  --side: #111318; --side-text: #a9afbb; --side-dim: #8c93a1; --side-on: #1f232c; --side-line: #23262e; --side-bright: #ffffff;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --panel: #171a20; --text: #e8eaee; --muted: #9ba1ad; --line: #2a2e37; --line-soft: #23272f; --hover: #1b1f26;
    --accent: #8c98ff; --accent-hover: #aeb6ff; --accent-text: #0e1220; --accent-soft: #23284a; --accent-ink: #b9c0ff; --sel: #1d2140;
    --danger: #ff8f8a; --danger-soft: #3a1e1e; --danger-line: #5a2a2a; --danger-ink: #ffc2be;
    --ok: #6fd49c; --ok-soft: #15301f; --ok-dot: #4cc282;
    --warn: #f2c46b; --warn-soft: #352812; --warn-line: #5a4318; --warn-ink: #f7d99a;
    --chip: #23272f; --chip-text: #c9cdd5; --code: #1c2027; --field: #12151a; --field-line: #333844;
    --add: #15301f; --add-text: #a6e8c0; --del: #3a1e1e; --del-text: #ffc2be;
    --side: #0a0b0e; --side-on: #1c1f27; --side-line: #1e2129;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
p { margin: 8px 0; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
code { background: var(--code); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--code); padding: 14px 16px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 8px 0; line-height: 1.6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--danger); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.mark img { display: block; width: 100%; height: 100%; }

/* Layout: dark navigation on the left + workspace on the right */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--side); color: var(--side-text); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side a { color: var(--side-text); text-decoration: none; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: var(--side-bright); }
.side .brand:hover { color: var(--side-bright); }
.side .mark { width: 36px; height: 36px; flex: none; }
.side .brand b { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.side .brand span { display: block; font-size: 12px; color: var(--side-dim); line-height: 1.3; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; }
.side nav a:hover { background: var(--side-on); color: var(--side-bright); }
.side nav a.on { background: var(--side-on); color: var(--side-bright); }
.side svg { flex: none; }
.side .spacer { flex: 1; min-height: 24px; }
.side .foot { border-top: 1px solid var(--side-line); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.side .avatar { width: 28px; height: 28px; border-radius: 999px; background: #2a2e38; color: #e6e8ec; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; text-transform: uppercase; }
.side .who { flex: 1; min-width: 0; line-height: 1.25; }
.side .who b { display: block; color: #e6e8ec; font-size: 13px; font-weight: 500; }
.side .who span { display: block; font-size: 12px; color: var(--side-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .signout { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--side-dim); display: flex; align-items: center; justify-content: center; }
.side .signout:hover { background: var(--side-on); color: var(--side-bright); }
.workspace { flex: 1; min-width: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 40px; }
main.wrap { padding-top: 32px; padding-bottom: 64px; }
.shell main.wrap { margin: 0; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 24px; }
.page-head > div:first-child { flex: 1; min-width: 240px; }
.page-head .lede, .lede { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { font-size: 13px; margin: 0 0 10px; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
h1.file { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; }

/* Cards, panels and tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 12px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.grid > .card { margin: 0; }
.stat { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
a.stat-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
a.stat-card:hover { text-decoration: none; border-color: var(--field-line); color: var(--text); }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .sub { font-size: 12.5px; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 12px 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15px; }
.panel-head .small { font-weight: 500; }
.panel-foot { padding: 12px 20px; font-size: 13px; color: var(--muted); }
.panel .empty { padding: 18px 20px; }
.row-link { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.row-link:last-child { border-bottom: 0; }
.pick-row { display: flex; align-items: center; border-bottom: 1px solid var(--line-soft); }
.pick-row:last-of-type { border-bottom: 0; }
.pick-row > input { flex: none; margin: 0 0 0 20px; width: 16px; height: 16px; }
.pick-row > .row-link { flex: 1; min-width: 0; border-bottom: 0; padding-left: 12px; }
.pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
a.row-link:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.row-link .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-link .name { font-family: var(--mono); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.row-link .title { font-weight: 500; }
.row-link .desc { font-size: 13px; color: var(--muted); }
.row-link .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-link .end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; color: var(--muted); text-align: right; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; margin: 20px 0; }
.split > .main-col { flex: 999 1 520px; min-width: 0; }
.split > .side-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split .panel { margin: 0; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--hover); }
td.nowrap, .nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 14px 16px; }
.chip { display: inline-block; background: var(--chip); color: var(--chip-text); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.6; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.err { background: var(--danger-soft); color: var(--danger); }
.chip.outline { background: none; border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
.scope { font-family: var(--mono); font-size: 12px; background: var(--chip); color: var(--chip-text); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.tag { display: inline-block; flex: none; min-width: 72px; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; border-radius: 6px; padding: 2px 8px; background: var(--chip); color: var(--chip-text); white-space: nowrap; }
.tag.update { background: var(--accent-soft); color: var(--accent-ink); }
.tag.new, .tag.applied { background: var(--ok-soft); color: var(--ok); }
.tag.conflict { background: var(--danger-soft); color: var(--danger); }
.tag.due, .tag.proposed { background: var(--warn-soft); color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--field-line); flex: none; }
.dot.ok { background: var(--ok-dot); } .dot.warn { background: var(--warn); } .dot.err { background: var(--danger); }
.status-line { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; }
.status-line > span:nth-child(2) { flex: 1; }
.count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--side); background: #f2c46b; border-radius: 999px; padding: 0 8px; line-height: 20px; }
progress.bar { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 5px; border: 0; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--line-soft); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.scope-row { display: flex; flex-direction: column; gap: 7px; padding: 10px 20px; color: var(--text); }
a.scope-row:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.scope-row .top { display: flex; align-items: center; gap: 8px; }
.scope-row .top .id { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.scope-row .top .n { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Segments and tabs (plain links; pages run no scripts) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--chip); border-radius: 9px; }
.seg a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 7px; color: var(--chip-text); font-size: 13px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(20, 22, 27, .12); font-weight: 500; }
.seg a .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.jump a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 13px; }
.jump a:hover { text-decoration: none; border-color: var(--field-line); }
.jump a .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.jump a.hot .n { color: var(--warn); font-weight: 600; }

/* Forms */
form.inline { display: inline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 8px 0; }
.row > label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; margin: 6px 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
input[type=text], input[type=email], input[type=search], input[type=number], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--field-line); border-radius: 9px; padding: 0 12px; min-height: 38px; min-width: 0; max-width: 100%;
}
select { padding: 0 8px; }
textarea { width: 100%; min-height: 70px; padding: 10px 12px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); }
button, .button { font: inherit; font-weight: 500; border: 1px solid var(--field-line); background: var(--panel); color: var(--text); min-height: 38px; padding: 0 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button:hover, .button:hover { border-color: var(--muted); text-decoration: none; color: var(--text); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
button.danger, .button.danger { color: var(--danger); border-color: var(--danger-line); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 400; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--danger); background: none; }
.notice { display: block; background: var(--accent-soft); color: var(--text); border: 1px solid transparent; padding: 12px 16px; border-radius: 10px; margin: 12px 0; }
.notice.err { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.notice a { color: inherit; font-weight: 600; text-decoration: underline; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.banner > span { flex: 1; min-width: 220px; }
.banner svg { flex: none; }
.filters { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; }
.filters .check { margin: 0; font-size: 13px; }

/* Sign-in and consent pages */
.auth { max-width: 440px; margin: 10vh auto; padding: 0 16px; }
.auth h1 { margin-bottom: 12px; }
.auth input:not([type=radio]):not([type=checkbox]), .auth button.primary { width: 100%; margin: 6px 0; min-height: 42px; }
.auth fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 12px 0; background: var(--panel); }
.auth legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.scope-pick { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 5px 0; }
.scope-pick select { min-height: 34px; }

/* Records and diffs */
.diff { padding: 8px 0; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; line-height: 1.7; }
.diff div { white-space: pre-wrap; word-break: break-word; padding: 0 18px; min-height: 1.7em; }
.diff .add { background: var(--add); color: var(--add-text); }
.diff .del { background: var(--del); color: var(--del-text); }
.diff .hunk { color: var(--muted); background: var(--hover); margin: 4px 0; }
.panel .diff { border: 0; border-radius: 0; margin: 0; }
.diffstat { font-family: var(--mono); font-size: 12.5px; }
.diffstat .a { color: var(--ok); } .diffstat .d { color: var(--danger); }
.frontmatter { color: var(--muted); }
pre.doc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0; }
pre.doc + pre.doc { border-top: 0; border-radius: 0 0 12px 12px; }
pre.doc.frontmatter { border-radius: 12px 12px 0 0; background: var(--hover); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; margin: 0; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.toolbar input { width: 220px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.source { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 10px 0; }
.source pre { background: none; padding: 0; margin: 8px 0 0; }

/* Agent cards */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin: 0 0 12px; }
.agent { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.agent.revoked { opacity: .62; }
.agent .head { display: flex; align-items: flex-start; gap: 12px; }
.agent .icon { width: 38px; height: 38px; border-radius: 10px; background: var(--chip); color: var(--chip-text); display: flex; align-items: center; justify-content: center; flex: none; }
.agent .title { flex: 1; min-width: 0; }
.agent .title b { font-size: 15px; font-weight: 600; margin-right: 6px; overflow-wrap: anywhere; }
.agent .state { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.agent .state.ok { color: var(--ok); } .agent .state.err { color: var(--danger); }
.agent .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.access { display: flex; flex-wrap: wrap; gap: 6px; }
.access span { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: 12px; }
.access code { background: var(--hover); border-radius: 0; padding: 1px 7px; font-size: 12px; }
.access b { padding: 1px 7px; font-weight: 600; background: var(--chip); color: var(--chip-text); }
.access b.rw { background: var(--accent-soft); color: var(--accent-ink); }
.agent .facts-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 12px; }
.agent .links { display: flex; flex-wrap: wrap; gap: 8px; }
.agent .links a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 8px; color: var(--text); font-size: 13px; }
.agent .links a:hover { text-decoration: none; border-color: var(--muted); }
.agent details { border-top: 1px solid var(--line-soft); padding-top: 4px; }
.cmd { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: center; margin: 0; }
.cmd dt { font-size: 13px; color: var(--muted); }
.cmd dd { margin: 0; min-width: 0; }
.cmd code { display: block; background: var(--side); color: #e6e8ec; padding: 10px 12px; border-radius: 9px; overflow-x: auto; white-space: nowrap; }

/* Sign-in and authorization pages: brand panel on the left + form on the right */
.auth-shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 400px; background: var(--side); color: var(--side-text); padding: 48px 56px; display: flex; flex-direction: column; gap: 40px; }
.auth-brand .logo { display: flex; align-items: center; gap: 12px; color: var(--side-bright); font-weight: 600; font-size: 17px; }
.auth-brand .logo .mark { width: 44px; height: 44px; flex: none; }
.auth-brand .pitch { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 26px; max-width: 440px; }
.auth-brand .pitch b { color: var(--side-bright); font-size: 32px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.auth-brand ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 14.5px; }
.auth-brand li { display: flex; gap: 12px; }
.auth-brand li::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); margin-top: 9px; flex: none; }
.auth-brand .host { font-size: 12.5px; color: var(--side-dim); }
.auth-shell .auth { flex: 999 1 460px; max-width: none; margin: 0; padding: 48px 24px; display: flex; align-items: center; justify-content: center; }
.auth-shell .auth > .auth-body { width: 100%; max-width: 380px; }
.auth h1 { font-size: 26px; }
.auth input:not([type=radio]):not([type=checkbox]) { min-height: 46px; font-size: 15px; }
.auth button, .auth .button { min-height: 46px; font-size: 15px; }
.auth input[autocomplete="one-time-code"] { font-family: var(--mono); font-size: 20px; letter-spacing: .35em; text-align: center; }
.auth p.center { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.auth p.center::before, .auth p.center::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.auth-icon.ok { background: var(--ok-soft); color: var(--ok); }

/* Audit: grouped by day, colored dots mark the category */
.day { padding: 9px 20px; background: var(--hover); border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.event { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.event:last-child { border-bottom: 0; }
.event .time { flex: none; width: 46px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.event .time.wide { width: 96px; white-space: nowrap; }
.event .dot { margin-top: 7px; }
.event .what { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.event .what > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.event .what code { background: none; padding: 0; font-weight: 500; }
.event .detail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.event .who { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; color: var(--muted); text-align: right; }
.event .who > span:first-child { color: var(--text); }
.dot.k-record { background: #3f4fe0; } .dot.k-access { background: #0f766e; } .dot.k-auth { background: #b4531b; } .dot.k-agent { background: #8c2525; }
@media (prefers-color-scheme: dark) {
  .dot.k-record { background: #8c98ff; } .dot.k-access { background: #3cc4b4; } .dot.k-auth { background: #f0a060; } .dot.k-agent { background: #ff8f8a; }
}
.seg .dot { width: 7px; height: 7px; }

/* Small widgets for the admin and security pages */
.tile-value { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.tile-value.mono { font-family: var(--mono); font-weight: 500; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.person:last-child { border-bottom: 0; }
.person.off { opacity: .72; }
.person .avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--chip); color: var(--chip-text); display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; text-transform: uppercase; }
.person .body { flex: 1; min-width: 220px; }
.person .stat-col { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; color: var(--muted); min-width: 120px; }
.person form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.person form button { min-height: 34px; font-size: 13px; }
.pair { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin: 12px 0; }
.pair > * { flex: 1 1 360px; min-width: 0; margin: 0; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.key-row form { flex: 1; min-width: 240px; display: flex; gap: 8px; margin: 0; }
.key-row form input { flex: 1; }
.key-row .when { font-size: 12.5px; color: var(--muted); min-width: 190px; }
.key-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--chip); color: var(--chip-text); display: flex; align-items: center; justify-content: center; flex: none; }
.panel form.add { padding: 16px 20px; background: var(--hover); margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { margin: 0; }
progress.bar.wide { height: 6px; margin-top: 6px; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 6px; }
  .side .brand { padding: 4px 6px; }
  .side .brand > span:last-child, .side .spacer, .side .who { display: none; }
  .side nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; gap: 2px; }
  .side nav a { min-height: 36px; padding: 0 10px; }
  .side nav a svg { display: none; }
  .side .foot { border: 0; padding: 0; margin-left: auto; flex-direction: row; align-items: center; }
  .side .foot nav { width: auto; order: 0; }
  .side .me { padding: 0; }
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 22px; }
  .cmd { grid-template-columns: 1fr; gap: 4px; }
  .cmd dd { margin-bottom: 8px; }
  .toolbar input { width: 100%; }
  .auth-shell { flex-direction: column; }
  .auth-brand { padding: 20px 24px; gap: 0; flex: none; }
  .auth-brand .pitch, .auth-brand .host { display: none; }
  .auth-shell .auth { padding: 32px 20px; align-items: flex-start; }
}
@media (max-width: 600px) {
  th, td { padding: 9px 10px; }
  .hide-sm { display: none; }
  h1 { font-size: 22px; }
  .row-link { padding: 12px 16px; align-items: flex-start; }
  .tag { min-width: 0; }
}
.grow { flex: 1; min-width: 180px; }
.flush { margin: 0; }
.narrow { max-width: 460px; }
details summary { cursor: pointer; color: var(--accent); margin-top: 8px; font-size: 13px; font-weight: 500; min-height: 32px; display: flex; align-items: center; }
h1 code, h2 code { font-size: .9em; background: none; padding: 0; }
td a, td code { overflow-wrap: anywhere; }
.center { text-align: center; }
.auth button { width: 100%; margin: 6px 0; min-height: 46px; }
.auth details { margin-top: 14px; }
.codes { columns: 2; font-family: var(--mono); font-size: 15px; background: var(--code); padding: 12px 16px; border-radius: 10px; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; padding: 8px; }
textarea.editor { min-height: 60vh; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
