/* OpenRDS console: an instrument panel. Warm paper and graphite ink, a quiet
   sidebar in the theme's tones, one electric cobalt accent for action and selection, and colour
   otherwise only where it means something (status, alerts, chart series).
   Source Sans 3 for the interface, IBM Plex Mono for anything a machine reads:
   endpoints, ports, versions, numbers. Both are SIL OFL fonts, served from here.
   Dark mode is its own set of steps, not an inversion. */
@font-face { font-family: "Source Sans 3"; src: url(/fonts/source-sans-3.woff2) format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/ibm-plex-mono-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/ibm-plex-mono-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/ibm-plex-mono-600.woff2) format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap }
:root {
  color-scheme: light;
  --font: "Source Sans 3", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --canvas: #f2f0ea; --surface: #fcfbf8; --surface-2: #f6f4ef; --surface-3: #ece9e2;
  --ink: #14161d; --ink-2: #363944; --muted: #686b76; --line: #e3e0d8; --line-strong: #cdc9bf;
  --accent: #2f6f62; --accent-hover: #255a4f; --on-accent: #ffffff; --accent-ink: #275f54; --accent-soft: #e4efea;
  --rail: #f8f6f1; --rail-2: #eeebe4; --rail-ink: #43464f; --rail-muted: #868994; --rail-strong: #14161d; --rail-line: #e4e0d7; --rail-accent: #2f6f62;
  --rail-active: #e3eee9; --rail-active-ink: #24594e; --rail-field: #ffffff;
  --focus: #2f6f62; --code-bg: #f1efe9; --code-ink: #14161d;
  --good: #0a7148; --good-bg: #e2f3e9; --info: #0b6a80; --info-bg: #e0f1f4;
  --warn: #8a5300; --warn-bg: #fbefd6; --critical: #b02436; --critical-bg: #fce7ea;
  --neutral: #575a63; --neutral-bg: #ecebe5;
  --dot-good: #19a066; --dot-info: #1597b3; --dot-warn: #d79a00; --dot-critical: #dd3f4e; --dot-neutral: #a4a29b;
  --danger: #b3261e; --danger-hover: #8f1d17;
  --series-1: #2f6f62; --series-2: #e5780b; --grid: #ebe8e1; --axis: #cdc9bf;
  --meter-ok: #2f6f62; --meter-warn: #c27e00; --meter-critical: #c8303f;
  --engine-postgres: #336791; --engine-mysql: #00758f; --engine-valkey: #5a6ff0;
  --scrim: rgba(12, 14, 20, .45);
  --shadow: 0 1px 0 rgba(20, 22, 29, .03), 0 1px 3px rgba(20, 22, 29, .05);
  --shadow-pop: 0 18px 48px rgba(20, 22, 29, .16), 0 2px 6px rgba(20, 22, 29, .06);
  --radius: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --halo: rgba(47, 111, 98, .18);
  --grid-dot: rgba(20, 22, 29, .075);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0b0d12; --surface: #12151d; --surface-2: #171b25; --surface-3: #1f2430;
  --ink: #e8eaf0; --ink-2: #c1c5d0; --muted: #8b90a1; --line: #232837; --line-strong: #333a4c;
  --accent: #62b5a1; --accent-hover: #7cc9b6; --on-accent: #0b0d12; --accent-ink: #8fd0bf; --accent-soft: #13302a;
  --rail: #0d1017; --rail-2: #171b26; --rail-ink: #b8bccb; --rail-muted: #727789; --rail-strong: #f4f5f8; --rail-line: #1d2230; --rail-accent: #7cc9b6;
  --rail-active: #17292a; --rail-active-ink: #d8f0e8; --rail-field: #141822;
  --focus: #7cc9b6; --code-bg: #0c0e14; --code-ink: #dfe2ea;
  --good: #5ad49b; --good-bg: #10271c; --info: #6fd0e3; --info-bg: #0f2a31;
  --warn: #f2b84b; --warn-bg: #30250f; --critical: #ff8c96; --critical-bg: #36191c;
  --neutral: #b2b5bf; --neutral-bg: #1f2430;
  --dot-good: #3fd29b; --dot-info: #5cc8e0; --dot-warn: #f2b84b; --dot-critical: #ff7b86; --dot-neutral: #5f6475;
  --danger: #d6453c; --danger-hover: #b8372f;
  --series-1: #6cc0ab; --series-2: #f0913a; --grid: #1d2130; --axis: #333a4c;
  --meter-ok: #6cc0ab; --meter-warn: #e0a22c; --meter-critical: #ee5f6b;
  --engine-postgres: #86ade0; --engine-mysql: #4fbcd2; --engine-valkey: #8c9cff;
  --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, .6);
  --halo: rgba(98, 181, 161, .28);
  --grid-dot: rgba(255, 255, 255, .045);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0b0d12; --surface: #12151d; --surface-2: #171b25; --surface-3: #1f2430;
    --ink: #e8eaf0; --ink-2: #c1c5d0; --muted: #8b90a1; --line: #232837; --line-strong: #333a4c;
    --accent: #62b5a1; --accent-hover: #7cc9b6; --on-accent: #0b0d12; --accent-ink: #8fd0bf; --accent-soft: #13302a;
    --rail: #0d1017; --rail-2: #171b26; --rail-ink: #b8bccb; --rail-muted: #727789; --rail-strong: #f4f5f8; --rail-line: #1d2230; --rail-accent: #7cc9b6;
  --rail-active: #17292a; --rail-active-ink: #d8f0e8; --rail-field: #141822;
    --focus: #7cc9b6; --code-bg: #0c0e14; --code-ink: #dfe2ea;
    --good: #5ad49b; --good-bg: #10271c; --info: #6fd0e3; --info-bg: #0f2a31;
    --warn: #f2b84b; --warn-bg: #30250f; --critical: #ff8c96; --critical-bg: #36191c;
    --neutral: #b2b5bf; --neutral-bg: #1f2430;
    --dot-good: #3fd29b; --dot-info: #5cc8e0; --dot-warn: #f2b84b; --dot-critical: #ff7b86; --dot-neutral: #5f6475;
    --danger: #d6453c; --danger-hover: #b8372f;
    --series-1: #6cc0ab; --series-2: #f0913a; --grid: #1d2130; --axis: #333a4c;
    --meter-ok: #6cc0ab; --meter-warn: #e0a22c; --meter-critical: #ee5f6b;
    --engine-postgres: #86ade0; --engine-mysql: #4fbcd2; --engine-valkey: #8c9cff;
    --scrim: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-pop: 0 18px 48px rgba(0, 0, 0, .6);
    --halo: rgba(98, 181, 161, .28);
    --grid-dot: rgba(255, 255, 255, .045);
  }
}

/* ---------- base */
* { box-sizing: border-box }
[hidden] { display: none !important }
html { background: var(--canvas) }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--canvas); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; font-feature-settings: "ss01" }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0 }
ul, ol { padding: 0; list-style: none }
h1 { font-size: clamp(25px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.025em; font-weight: 700 }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.012em; font-weight: 650 }
h3 { font-size: 15px; font-weight: 650 }
a { color: var(--accent-ink) }
a:hover { text-decoration-thickness: 2px }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0 }
button:disabled, [aria-disabled="true"] { cursor: not-allowed }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px }
code, pre, kbd { font-family: var(--mono); font-size: .86em; font-weight: 450 }
.muted, small { color: var(--muted) }
small { font-size: 12px }
.small { font-size: 12px }
.kicker { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; color: var(--muted); margin-bottom: 4px }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle }
.spin { animation: spin 1s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none } }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.row.center { justify-content: center }
.stack { display: flex; flex-direction: column; gap: 1px; min-width: 0 }
.stack small { line-height: 1.35 }
.stack-gap { display: grid; gap: 16px; align-content: start; min-width: 0 }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease) }
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none }
.btn:active { transform: scale(.98) }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover) }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff }
.btn.danger:hover { background: var(--danger-hover) }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none }
.btn.ghost:hover { background: var(--surface-3) }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 9px }
.btn.wide { width: 100% }
.btn .icon { width: 16px; height: 16px }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface) }
.icon-btn:hover { background: var(--surface-3) }
.icon-btn.ghost { border-color: transparent; background: transparent }
.icon-btn:disabled { opacity: .5 }
.text-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); font-weight: 600; padding: 3px 4px; border-radius: 6px; text-decoration: none; font-size: 13px }
.text-btn:hover { background: var(--surface-3) }
.text-btn.danger { color: var(--danger) }
:root[data-theme="dark"] .text-btn.danger { color: var(--critical) }
.text-btn .icon { width: 15px; height: 15px }
.cell-actions { display: flex; flex-wrap: wrap; gap: 2px 6px }

/* ---------- chips and status */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; width: fit-content }
.chip.good { color: var(--good); background: var(--good-bg) } .chip.info { color: var(--info); background: var(--info-bg) }
.chip.warn { color: var(--warn); background: var(--warn-bg) } .chip.critical { color: var(--critical); background: var(--critical-bg) }
.chip.neutral { color: var(--neutral); background: var(--neutral-bg) }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; white-space: nowrap; vertical-align: middle }
.status .icon { width: 16px; height: 16px }
.status.good { color: var(--good) } .status.info { color: var(--info) } .status.warn { color: var(--warn) }
.status.critical { color: var(--critical) } .status.neutral { color: var(--neutral) }
h1 .status { font-size: 14px; letter-spacing: 0; margin-left: 4px }
.counter { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; color: var(--muted); background: var(--surface-3); font-family: var(--mono); font-size: 11px; font-weight: 500; vertical-align: 2px }

/* ---------- meters */
.meter { display: inline-block; position: relative; width: 64px; height: 6px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; vertical-align: middle }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--meter-ok) }
.meter.warn { background: var(--warn-bg) } .meter.warn .meter-fill { background: var(--meter-warn) }
.meter.critical { background: var(--critical-bg) } .meter.critical .meter-fill { background: var(--meter-critical) }
.with-meter { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap }

/* ---------- login */
.boot { min-height: 100dvh; display: grid; place-items: center; padding: 20px }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 730; letter-spacing: -.04em; color: inherit; text-decoration: none }

/* ---------- shell */
.shell { --rail-width: 248px; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: 100dvh; background: linear-gradient(90deg, var(--rail) 0 var(--rail-width), transparent var(--rail-width)) }
.shell.collapsed { --rail-width: 68px }
.sidebar { background: var(--rail); color: var(--rail-ink); border-right: 1px solid var(--rail-line); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 14px 12px 12px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; z-index: 30 }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px 6px }
.sidebar .brand { color: var(--rail-strong); font-size: 20px; min-width: 0 }
.rail-btn { color: var(--rail-muted); background: transparent; border-color: transparent; width: 32px; height: 32px }
.rail-btn:hover { background: var(--rail-2); color: var(--rail-strong) }
.mobile-only { display: none }
.nav-create { justify-content: flex-start; margin: 4px 2px 6px }
/* Jump to: a quiet search field that opens the palette. */
.jump { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; padding: 7px 8px 7px 10px; min-height: 36px; border-radius: 9px; border: 1px solid var(--rail-line); background: var(--rail-field); color: var(--rail-muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left; transition: border-color .15s var(--ease), color .15s var(--ease) }
.jump:hover, .jump:focus-visible { border-color: color-mix(in srgb, var(--rail-accent) 45%, var(--rail-line)); color: var(--rail-ink) }
.jump > span.label { flex: 1 }
.jump kbd { position: static; font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--rail-line); background: var(--rail); color: var(--rail-muted) }
nav#nav { flex: 1 0 auto; display: flex; flex-direction: column; gap: 8px }
.nav-end { margin-top: auto; padding-top: 8px }
.nav-group, .nav-items { display: grid; gap: 1px }
.nav-group.folded .nav-items { display: none }
.nav-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px 4px; border: 0; border-radius: 6px; background: none; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 500; color: var(--rail-muted); cursor: pointer }
.nav-label:hover { color: var(--rail-ink) }
.nav-label .label { flex: 1; text-align: left }
.nav-label .chevron { width: 12px; height: 12px; opacity: .7; transition: transform .15s var(--ease) }
.nav-group.folded .nav-label .chevron { transform: rotate(-90deg) }
nav#nav a { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 7px 10px; border-radius: 8px; color: var(--rail-ink); text-decoration: none; font-weight: 550; white-space: nowrap; position: relative; transition: background .12s var(--ease), color .12s var(--ease) }
nav#nav a .icon { color: var(--rail-muted); transition: color .12s var(--ease) }
nav#nav a:hover { background: var(--rail-2); color: var(--rail-strong) }
nav#nav a:hover .icon { color: var(--rail-ink) }
nav#nav a[aria-current="page"] { background: var(--rail-active); color: var(--rail-active-ink); font-weight: 650 }
nav#nav a[aria-current="page"] .icon { color: var(--rail-accent) }
nav#nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rail-accent) }
nav#nav .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis }
.nav-count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--rail-muted); font-variant-numeric: tabular-nums }
nav#nav a[aria-current="page"] .nav-count { color: var(--rail-active-ink); opacity: .7 }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 750; color: #fff; background: var(--rail-accent) }
.nav-badge.warn { color: var(--warn); background: var(--warn-bg) }
.nav-dot { width: 8px; height: 8px; margin: 0 4px 0 auto; border-radius: 50%; flex: none; background: var(--rail-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rail-accent) 22%, transparent) }
.nav-dbs:empty { display: none }
nav#nav a.db-quick { min-height: 31px; padding: 5px 10px 5px 12px; font-size: 13.5px; font-weight: 500; gap: 10px }
nav#nav a.db-quick.more { color: var(--rail-muted); font-size: 12.5px }
nav#nav a.db-quick.more .icon { width: 13px; height: 13px }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--rail-muted) }
.dot.good { background: var(--dot-good) } .dot.info { background: var(--dot-info) } .dot.warn { background: var(--dot-warn) } .dot.critical { background: var(--dot-critical) } .dot.neutral { background: var(--dot-neutral) }
.side-foot { margin-top: auto; border-top: 1px solid var(--rail-line); padding-top: 10px; display: grid; gap: 4px }
/* Getting started, as a small card with its progress. */
.start-card { display: grid; gap: 8px; margin-bottom: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rail-line); background: var(--rail-field); color: var(--rail-ink); text-decoration: none; transition: border-color .15s var(--ease) }
.start-card:hover, .start-card[aria-current="page"] { border-color: color-mix(in srgb, var(--rail-accent) 45%, var(--rail-line)) }
.start-card-head { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; white-space: nowrap }
.start-card-head .icon { color: var(--rail-accent) }
.start-card-head .label { flex: 1 }
.start-bar { display: block; height: 5px; border-radius: 99px; background: var(--rail-2); overflow: hidden }
#start-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--rail-accent); transition: width .3s var(--ease) }
.side-link { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: var(--rail-ink); text-decoration: none; font-weight: 550; white-space: nowrap }
.side-link .icon { color: var(--rail-muted) }
.side-link:hover { background: var(--rail-2); color: var(--rail-strong) }
.account .menu-wrap { display: block }
.account-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 10px; color: var(--rail-ink); text-align: left }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--rail-2); color: var(--rail-strong) }
.account-text { display: grid; min-width: 0; flex: 1; line-height: 1.25 }
.account-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.account-text small { color: var(--rail-muted); font-size: 11px }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; font-size: 12px; font-weight: 750; letter-spacing: .02em; color: var(--on-accent); background: var(--accent) }
.avatar.large { width: 48px; height: 48px; font-size: 17px }
.panel .avatar, .page-head .avatar { color: var(--accent-ink); background: var(--accent-soft) }
.account .menu { min-width: 272px }
/* Collapsed rail: icons only, with titles as tooltips. */
.shell.collapsed .sidebar { padding-inline: 10px }
.shell.collapsed .sidebar .label, .shell.collapsed .nav-count, .shell.collapsed .nav-dbs-group, .shell.collapsed .account .chevron, .shell.collapsed .start-bar { display: none }
.shell.collapsed .sidebar-top { flex-direction: column; padding: 0 0 8px }
.shell.collapsed .nav-label { height: 1px; padding: 0; margin: 6px 8px; background: var(--rail-line); overflow: hidden; pointer-events: none }
.shell.collapsed .nav-label .chevron { display: none }
.shell.collapsed .nav-group.folded .nav-items { display: grid }
.shell.collapsed nav#nav a, .shell.collapsed .side-link, .shell.collapsed .nav-create, .shell.collapsed .jump { justify-content: center; padding-inline: 0 }
.shell.collapsed nav#nav a[aria-current="page"]::before { left: -10px }
.shell.collapsed .start-card { padding: 9px 0; place-items: center }
.shell.collapsed .start-card-head { justify-content: center }
.shell.collapsed .nav-badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px }
.shell.collapsed .nav-dot { position: absolute; top: 7px; right: 11px; margin: 0 }
.shell.collapsed .account-btn { justify-content: center; padding-inline: 0 }
.scrim { position: fixed; inset: 0; z-index: 25; background: var(--scrim) }
.workspace { min-width: 0; display: flex; flex-direction: column; background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.2px); background-size: 22px 22px; background-position: -11px -11px }
.topbar-start { display: flex; align-items: center; gap: 8px; min-width: 0 }
.topbar { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(16px, 3vw, 36px); background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line) }
.crumbs ol { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--muted) }
.crumbs li + li::before { content: "/"; margin: 0 6px 0 2px; color: var(--line-strong) }
.crumbs a { color: var(--muted); text-decoration: none }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline }
.crumbs [aria-current] { color: var(--ink); font-weight: 600 }
.top-actions { display: flex; align-items: center; gap: 10px }
.link-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap }
.link-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong) }
.link-state.good .dot { background: var(--dot-good) } .link-state.warn { color: var(--warn) } .link-state.warn .dot { background: var(--meter-warn) }
.ops { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--info); background: var(--info-bg); padding: 3px 10px; border-radius: 99px; white-space: nowrap }
.ops .icon { width: 14px; height: 14px }
.page-alert { margin: 16px clamp(16px, 3vw, 36px) 0 }
#content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 36px) 64px; outline: none }
.skip { position: fixed; left: 12px; top: -100px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px }
.skip:focus { top: 12px }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap }
.page-head .muted { margin-top: 6px; max-width: 760px }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap }
.loading-page { padding: 40px; color: var(--muted) }

/* ---------- panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0 }
.panel + .panel { margin-top: 16px }
.stack-gap > .panel + .panel, .tab-grid > .panel + .panel { margin-top: 0 }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px }
.panel-head .muted { font-size: 13px; margin-top: 2px }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.panel-body { padding: 0 20px 18px; display: grid; gap: 14px; min-width: 0 }
.panel .table-wrap { border-top: 1px solid var(--line) }
.panel-body .table-wrap { border: 1px solid var(--line); border-radius: 8px }
.tab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start }
.tab-panel { outline: none }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 14px }
.more-row { display: flex; justify-content: center; padding: 12px }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line) }
.pager[hidden] { display: none }
.pager-text { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums }
.pager-buttons { display: flex; gap: 6px }
@media (max-width: 560px) { .pager-buttons .btn span { display: none } }
.more-row:empty { display: none }

/* ---------- key-value pairs */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px }
.kv.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.kv.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.kv dt { font-size: 12px; color: var(--muted); margin-bottom: 2px }
.kv dd { font-weight: 550; overflow-wrap: anywhere }
.kv.stacked { grid-template-columns: 1fr; gap: 0 }
.kv.stacked > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line) }
.kv.stacked > div:first-child { border-top: 0 }
.kv.stacked dt { margin: 0; font-size: 13px }
.kv.stacked dd { text-align: right; font-size: 13px }

/* ---------- tables */
.table-wrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px }
th, td { padding: 10px 16px; vertical-align: middle }
th:first-child, td:first-child { padding-left: 20px }
th:last-child, td:last-child { padding-right: 20px }
thead th { background: var(--surface-2); border-bottom: 1px solid var(--line); font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap }
tbody td { border-bottom: 1px solid var(--line); white-space: nowrap }
tbody tr:last-child td { border-bottom: 0 }
tbody tr:hover td { background: var(--surface-2) }
tbody tr.selected td { background: var(--accent-soft) }
td.wrap { white-space: normal; min-width: 220px; max-width: 520px }
td.shrink { white-space: normal }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums }
td.select, th.select { width: 36px; padding-right: 0 }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; color: inherit }
.sort-btn:hover { color: var(--ink) }
.sort-icon { width: 14px; height: 14px; opacity: .65 }
[aria-sort="ascending"] .sort-icon, [aria-sort="descending"] .sort-icon { opacity: 1; color: var(--accent-ink) }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer }
.db-cell { display: flex; align-items: center; gap: 10px }
.db-link { font-weight: 650; text-decoration: none }
.db-link:hover { text-decoration: underline }
.engine-badge { --engine: var(--muted); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; color: var(--engine);
  background: color-mix(in srgb, var(--engine) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--engine) 22%, var(--line)) }
.engine-badge .logo { width: 62%; height: 62%; display: block }
.engine-badge.postgres { --engine: var(--engine-postgres) } .engine-badge.mysql { --engine: var(--engine-mysql) } .engine-badge.valkey { --engine: var(--engine-valkey) }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px }
.tag-chip { font-size: 11px; padding: 0 7px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap }
table.diff th[scope="row"] { font-weight: 600; color: var(--ink-2); background: transparent; font-size: 13px }
table.diff td { white-space: normal }

/* ---------- toolbar controls */
input, select, textarea { min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); min-width: 0; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease) }
input:hover, select:hover, textarea:hover { border-color: var(--muted) }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--halo) }
input[type="radio"], input[type="checkbox"] { min-height: 0; padding: 0; box-shadow: none }
input::placeholder { color: var(--muted); opacity: .85 }
select { cursor: pointer; appearance: none; padding-right: 38px; background-image: url(/chevron.svg); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px }
input[aria-invalid="true"] { border-color: var(--critical); box-shadow: 0 0 0 4px color-mix(in srgb, var(--critical) 15%, transparent) }
.search { flex: 1 1 240px; display: flex; align-items: center; position: relative }
.search .icon { position: absolute; left: 10px; width: 16px; color: var(--muted); pointer-events: none }
.search input { width: 100%; padding-left: 34px; padding-right: 30px }
kbd { position: absolute; right: 9px; color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; pointer-events: none }

/* ---------- menus */
.menu-wrap { position: relative; display: inline-block }
.btn .chevron { width: 15px; height: 15px; margin-right: -4px }
.menu { position: absolute; top: calc(100% + 6px); z-index: 40; min-width: 232px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); transform-origin: top right; animation: menu-in .16s var(--ease) }
.menu.start { transform-origin: top left } .menu.up { transform-origin: bottom left }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98) } }
.menu.end { right: 0 } .menu.start { left: 0 }
.menu [role="menuitem"] { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; transition: background .12s var(--ease); text-align: left; font-weight: 550; color: var(--ink) }
.menu [role="menuitem"] .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--muted) }
.menu [role="menuitem"] span { display: flex; flex-direction: column }
.menu [role="menuitem"] small { font-weight: 400 }
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus { background: var(--surface-3); outline: none }
.menu [role="menuitem"]:focus-visible { box-shadow: inset 0 0 0 2px var(--focus) }
.menu [role="menuitem"][aria-disabled="true"] { color: var(--muted); opacity: .7 }
.menu .danger-item, .menu .danger-item .icon { color: var(--danger) }
:root[data-theme="dark"] .menu .danger-item, :root[data-theme="dark"] .menu .danger-item .icon { color: var(--critical) }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line) }

/* ---------- tabs */
.tabs { display: flex; gap: 2px; margin: 20px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin }
.tabs [role="tab"] { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0; transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease) }
@media (hover: hover) { .tabs [role="tab"]:hover { color: var(--ink); background: color-mix(in srgb, var(--surface-3) 70%, transparent) } }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent) }
a[role="tab"] { text-decoration: none }

/* ---------- alerts and toasts */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 9px; border: 1px solid transparent; font-size: 13px; line-height: 1.5 }
.alert > .icon { margin-top: 1px }
.alert > div { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line }
.alert .btn { margin-left: 8px; vertical-align: middle }
.alert.info { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 22%, transparent) }
.alert.warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 22%, transparent) }
.alert.error { color: var(--critical); background: var(--critical-bg); border-color: color-mix(in srgb, var(--critical) 25%, transparent) }
.alert.success { color: var(--good); background: var(--good-bg) }
.alert > div > * { color: var(--ink) }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 10px; width: min(400px, calc(100vw - 36px)) }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--info); box-shadow: var(--shadow-pop); animation: rise .18s ease-out }
.toast.success { border-left-color: var(--dot-good) } .toast.error { border-left-color: var(--meter-critical) } .toast.warn { border-left-color: var(--meter-warn) }
.toast-icon { margin-top: 1px } .toast.success .toast-icon { color: var(--good) } .toast.error .toast-icon { color: var(--critical) } .toast.info .toast-icon { color: var(--info) } .toast.warn .toast-icon { color: var(--warn) }
.toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere }
.toast-body p { font-size: 13px }
.toast .icon-btn { width: 28px; height: 28px }
@keyframes rise { from { transform: translateY(8px); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none } }

/* ---------- dialogs */
dialog.modal { width: min(540px, calc(100% - 24px)); max-height: min(88dvh, 900px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop) }
dialog.modal[open] { animation: dialog-in .2s var(--ease) }
dialog.modal[open]::backdrop { animation: fade-in .2s var(--ease) }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98) } }
@keyframes fade-in { from { opacity: 0 } }
dialog.modal.wide { width: min(780px, calc(100% - 24px)) }
dialog::backdrop { background: var(--scrim) }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 6px }
.modal-head h2 { font-size: 20px; overflow-wrap: anywhere }
.modal-form { display: grid; gap: 14px; padding: 8px 22px 20px }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px }
.field-label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px }
.modal-form input[type="text"] { width: 100% }

/* ---------- forms */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start }
.form-main { display: grid; gap: 16px; min-width: 0 }
.form-main > .panel + .panel { margin-top: 0 }
.form-section h2 { display: flex; align-items: center; gap: 10px }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 750 }
.form-summary { position: sticky; top: 74px }
.summary-body { padding: 0 20px 6px }
.summary-actions { display: grid; gap: 8px; padding: 14px 20px 20px; border-top: 1px solid var(--line) }
.capacity { padding: 12px 20px 14px; display: grid; gap: 10px; border-top: 1px solid var(--line) }
.capacity:empty { display: none }
.capacity h3 { font-size: 13px }
.capacity p { font-size: 12px }
.cap-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px }
.cap-row .meter { grid-column: 1 / -1; width: 100%; height: 8px }
.field { display: grid; gap: 6px; min-width: 0 }
.field input, .field select { width: 100% }
.hint, .field .hint { font-size: 12px; color: var(--muted) }
.field-error { font-size: 12px; color: var(--critical); font-weight: 600 }
.optional { font-weight: 400; color: var(--muted) }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.cards { display: grid; gap: 10px }
.cards.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.cards.cols-4 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) }
.card-choice { position: relative; display: block; cursor: pointer }
.card-choice input { position: absolute; opacity: 0; pointer-events: none }
.card-body { display: grid; gap: 3px; height: 100%; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease) }
@media (hover: hover) { .card-choice:hover .card-body { border-color: var(--accent) } }
.card-choice:has(input:checked) .card-body { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft) }
.card-choice:has(input:focus-visible) .card-body { outline: 3px solid var(--focus); outline-offset: 2px }
.card-choice.disabled { cursor: not-allowed }
.card-choice.disabled .card-body { opacity: .55; border-style: dashed }
.card-body small { line-height: 1.4 }
.card-body .reason { color: var(--warn); font-weight: 600 }
.card-body .engine-badge { margin-bottom: 6px }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer }
.check input { margin-top: 2px; flex-shrink: 0 }
.check > span { display: grid; gap: 1px }
.check.inline { align-items: center; gap: 6px; font-size: 13px; font-weight: 600 }
.check.inline input { margin: 0 }
h3.sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line) }
h3.sub:first-child { border-top: 0; padding-top: 0; margin-top: 0 }
h3.sub .icon { color: var(--muted); width: 17px; height: 17px }
.param-editor { display: grid; gap: 10px }
.param-table td { white-space: normal; vertical-align: top }
.param-table td:first-child { min-width: 240px }
.param-table td small { display: block; margin-top: 2px; line-height: 1.4 }
.param-table select, .param-table input { min-width: 0 }
.combo { display: inline-flex; align-items: center; gap: 6px }
.combo .num, input.num { width: 9rem }
.unit { color: var(--muted); font-size: 12px }
.checks { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; min-width: 200px }
.checks .check { font-size: 12px; align-items: center; gap: 6px }
.category-checks { border: 0; padding: 0; margin: 0; display: grid; gap: 10px }
.chips { display: flex; flex-wrap: wrap; gap: 4px }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.5 }
code.statement { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; font-size: 12px; line-height: 1.45 }
.param-editor > .row select { flex: 1 1 220px; max-width: 360px }
.tag-editor { display: grid; gap: 10px; justify-items: start }
.tag-rows { display: grid; gap: 8px; width: 100% }
.tag-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px }
.apply-choice { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; margin: 0 }
.apply-choice legend { font-weight: 650; padding: 0 4px }
.disclosure { margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 8px }
.disclosure summary { cursor: pointer; font-weight: 600 }
.disclosure p { font-size: 13px; margin: 8px 0 }

/* ---------- code */
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; line-height: 1.55; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--line); border-radius: 8px; font-size: 12px }
.code { display: flex; align-items: flex-start; gap: 8px; min-width: 0 }
.code pre { flex: 1; min-width: 0 }
.code .btn { flex-shrink: 0 }
pre.logs { max-height: 440px; overflow: auto; white-space: pre; overflow-wrap: normal }
.facts { display: grid; gap: 10px }
.facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px }
.facts .icon { color: var(--accent-ink); margin-top: 1px }
.protection { display: flex; gap: 10px; align-items: flex-start }
.protection .icon { color: var(--accent-ink) }
.resize { display: grid; gap: 6px }

/* ---------- empty states */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 20px 38px; border-top: 1px solid var(--line) }
.panel-head + .empty { border-top: 0 }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--accent-ink); background: var(--accent-soft); margin-bottom: 4px }
.empty p { font-size: 13px; color: var(--muted); max-width: 420px }
.empty .row { margin-top: 8px }
/* One line, for a panel that is mostly about something else. */
.empty.compact { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; column-gap: 12px; row-gap: 1px; padding: 14px 20px 16px }
.empty.compact .empty-icon { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 10px; margin: 0 }
.empty.compact h3 { font-size: 14px; align-self: end }
.empty.compact p { align-self: start; max-width: none }

/* ---------- dashboard */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px }
.stat { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .12s }
.stat:hover { border-color: var(--accent) }
.stat-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2) }
.stat-label .icon { color: var(--accent-ink); width: 17px; height: 17px }
.stat-value { font-size: clamp(26px, 2.6vw, 34px); font-weight: 650; letter-spacing: -.03em; line-height: 1.2 }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 16px; align-items: start }
.recs { display: grid }
.recs li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 12px 20px; border-top: 1px solid var(--line) }
.recs li p { font-size: 13px }
.rec-icon { margin-top: 1px }
.recs li.critical .rec-icon { color: var(--critical) } .recs li.warn .rec-icon { color: var(--warn) } .recs li.info .rec-icon { color: var(--info) }
.all-good { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px 20px; border-top: 1px solid var(--line) }
.all-good > .icon { color: var(--good); width: 22px; height: 22px }
.timeline { display: grid }
.timeline li { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 13px }
.timeline li strong { display: block; font-weight: 600 }
.timeline li small { display: block }

/* ---------- charts */
.filter-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--line) }
.segmented button { padding: 6px 13px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease) }
.segmented button:hover { color: var(--ink) }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow) }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; min-width: 0; transition: opacity .15s }
.chart.loading { opacity: .55 }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px }
.chart-head p { font-size: 12px; margin-top: 1px }
.chart-tools { display: flex; align-items: center; gap: 8px }
.chart-now { font-size: 13px; font-weight: 650; white-space: nowrap }
.legend { display: flex; gap: 14px; margin: 8px 0 0; font-size: 12px; color: var(--ink-2) }
.legend li { display: inline-flex; align-items: center; gap: 6px }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--series-1) }
.key.s2 { background: var(--series-2) }
.plot { position: relative; margin-top: 6px; border-radius: 6px }
.plot svg { display: block; width: 100%; height: auto; overflow: visible }
.plot .grid line { stroke: var(--grid); stroke-width: 1 }
.plot .grid line.axis { stroke: var(--axis) }
.plot .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums }
.plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round }
.plot .line.s1 { stroke: var(--series-1) } .plot .line.s2 { stroke: var(--series-2) }
.plot .area.s1 { fill: var(--series-1); fill-opacity: .1; stroke: none }
.plot .dot { stroke: var(--surface); stroke-width: 2 }
.plot .dot.s1 { fill: var(--series-1) } .plot .dot.s2 { fill: var(--series-2) }
.plot .end-label { fill: var(--ink-2); font-size: 11px; font-weight: 600 }
.plot .reference line { stroke: var(--ink-2); stroke-width: 1; opacity: .6 }
.plot .crosshair { stroke: var(--ink-2); stroke-width: 1; opacity: .7 }
.chart-tip { position: absolute; z-index: 5; min-width: 150px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); pointer-events: none; font-size: 12px }
.tip-time { color: var(--muted); margin-bottom: 4px }
.tip-row { display: flex; align-items: center; gap: 8px }
.tip-row strong { font-size: 13px; font-variant-numeric: tabular-nums }
.tip-row span:last-child { color: var(--muted) }
.key.line { width: 12px; height: 2px }
.chart-empty { position: absolute; inset: 30% 0 auto; text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px }
.chart-table { max-height: 260px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px }
.chart-table th, .chart-table td { padding: 6px 12px; font-variant-numeric: tabular-nums }
.chart-table thead th { position: sticky; top: 0 }

/* ---------- responsive */
@media (max-width: 1180px) {
  .form-layout { grid-template-columns: minmax(0, 1fr) }
  .form-summary { position: static }
  .dash-grid { grid-template-columns: minmax(0, 1fr) }
  .kv.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { display: block; background: none }
  .desktop-only { display: none }
  .mobile-only { display: inline-grid }
  /* The sidebar becomes a drawer over the page. */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100dvh; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-pop) }
  body.nav-open .sidebar { transform: none }
  body.nav-open { overflow: hidden }
  .shell.collapsed .sidebar .label, .shell.collapsed .nav-count, .shell.collapsed .account .chevron, .shell.collapsed .start-bar { display: revert }
  .shell.collapsed .nav-dbs-group { display: grid }
  .shell.collapsed .nav-label { height: auto; padding: 8px 10px 4px; margin: 0; background: none; pointer-events: auto }
  .shell.collapsed .nav-label .chevron { display: revert }
  .topbar { position: sticky; height: 52px; padding-inline: 12px 16px }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .cards.cols-3 { grid-template-columns: minmax(0, 1fr) }
  .form-summary { top: auto }
  .guide-controls { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { .sidebar { transition: none } }
@media (max-width: 640px) {
  #content { padding-top: 18px }
  .page-head { align-items: flex-start }
  .kv.cols-2, .kv.cols-4 { grid-template-columns: minmax(0, 1fr) }
  .form-grid, .cards.cols-2 { grid-template-columns: minmax(0, 1fr) }
  .stats { gap: 10px }
  .stat { padding: 12px 14px }
  .panel-head { padding: 14px 16px; flex-wrap: wrap }
  .panel-body { padding: 0 16px 16px }
  .toolbar { padding: 0 16px 12px }
  .crumbs ol { font-size: 12px }
  .link-state span:last-child { display: none }
  .tag-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tag-row input:nth-child(2) { grid-column: 1; grid-row: 2 }
  .tag-row button { grid-row: 1 / span 2; grid-column: 2 }
  .timeline li { grid-template-columns: minmax(0, 1fr) }
  /* Tables become one card per row, each value labelled. */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  .table-wrap tbody tr { padding: 12px 16px; border-top: 1px solid var(--line) }
  .table-wrap tbody tr:first-child { border-top: 0 }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0 !important; border: 0; white-space: normal; text-align: right; overflow-wrap: anywhere }
  .table-wrap td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0 }
  .table-wrap td:first-child { justify-content: flex-start; text-align: left }
  .table-wrap tbody tr { position: relative }
  .table-wrap tbody tr:has(td.select) { padding-right: 52px }
  .table-wrap td.select { position: absolute; top: 14px; right: 16px; padding: 0 !important }
  .table-wrap td.wrap { min-width: 0; max-width: none; display: block; text-align: left }
  .table-wrap td.wrap::before { display: block; margin-bottom: 2px }
  .cell-actions { justify-content: flex-end }
  tbody tr:hover td { background: transparent }
  .param-table td:first-child { min-width: 0 }
  .combo .num, input.num { width: 6.5rem }
  .chart { padding: 12px 10px 8px }
  .code { flex-direction: column; align-items: stretch }
  .code .btn { align-self: flex-end }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: minmax(0, 1fr) }
  .page-actions, .page-actions .btn, .page-actions .menu-wrap { width: 100% }
  .page-actions .menu-wrap .btn { width: 100% }
}
@media print {
  .sidebar, .topbar, .toasts, .page-actions, .tabs, .settings-nav { display: none }
  .shell { display: block }
}
@media (forced-colors: active) {
  .plot .line { stroke: CanvasText } .plot .line.s2 { stroke: LinkText }
  .meter-fill { background: Highlight }
}

/* ---------- menus: headings, radio items, opening upward */
.menu.up { top: auto; bottom: calc(100% + 6px) }
.menu-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); padding: 8px 10px 4px }
.menu [role="menuitemradio"] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; text-align: left; font-weight: 550; color: var(--ink) }
.menu [role="menuitemradio"] .icon { width: 17px; height: 17px; color: var(--muted) }
.menu [role="menuitemradio"] span { flex: 1 }
.menu [role="menuitemradio"]:hover, .menu [role="menuitemradio"]:focus { background: var(--surface-3); outline: none }
.menu [role="menuitemradio"]:focus-visible { box-shadow: inset 0 0 0 2px var(--focus) }
.menu .tick { color: var(--accent-ink) !important }

/* ---------- sign-in */
.link-btn { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px }
.password { position: relative; display: flex }
.password input { width: 100%; padding-right: 42px }
.password .reveal { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px }
.password .reveal[aria-pressed="true"] { color: var(--accent-ink) }
.stack-form { display: grid; gap: 14px }

/* ---------- connection guide */
.connect-guide h2, .connect-guide h2 .icon { display: flex; align-items: center; gap: 8px }
.connect-guide h2 .icon { color: var(--accent-ink) }
.guide-controls { display: grid; grid-template-columns: auto minmax(220px, 320px); gap: 16px 24px; align-items: end }
.guide-controls .control { display: grid; gap: 6px; min-width: 0 }
.guide-controls .segmented { flex-wrap: wrap }
.guide-controls select { width: 100% }
.credentials .muted { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.steps { counter-reset: step; display: grid; gap: 16px }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; display: grid; gap: 8px; min-width: 0 }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 750; color: var(--accent-ink); background: var(--accent-soft) }
.steps h4 { margin: 0; font-size: 14px; font-weight: 650 }
.code-wrap { display: grid; gap: 4px; min-width: 0 }
.code-caption { font-size: 12px; color: var(--muted); font-family: var(--mono) }

/* ---------- getting started */
.dash-start { margin-bottom: 18px }
.start-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)) }
.progress-row { display: flex; align-items: center; gap: 12px }
.progress { position: relative; flex: 1; height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden }
.progress-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--meter-ok) }
.checklist { display: grid; gap: 2px }
.checklist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line) }
.checklist li:first-child { border-top: 0 }
.checklist li p { font-size: 13px; margin-top: 2px }
.check-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 750; color: var(--muted); border: 1px solid var(--line-strong) }
.checklist li.done .check-mark { color: var(--on-accent); background: var(--accent); border-color: var(--accent) }
.checklist li.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong) }
.checklist.compact li { padding: 8px 0 }
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px }
.concept { display: flex; gap: 12px; align-items: flex-start }
.concept .empty-icon { width: 36px; height: 36px; margin: 0; flex-shrink: 0 }
.concept p { font-size: 13px; margin-top: 2px }

/* ---------- users */
.matrix th[scope="row"] { font-weight: 550; color: var(--ink); white-space: normal; background: transparent; font-size: 13px }
.you { color: var(--muted); font-weight: 500 }
.resource { display: inline-flex; align-items: center; gap: 6px }
.resource .icon { width: 15px; height: 15px; color: var(--muted) }
.chip .icon { width: 14px; height: 14px }

/* ---------- help toggletips */
.help { position: relative; display: inline-block; vertical-align: middle; margin-left: 4px }
.help-btn { width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 750; line-height: 1; color: var(--accent-ink); background: var(--accent-soft) }
.tip-bubble { position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 400; line-height: 1.45; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); text-transform: none; letter-spacing: 0 }
.field-head { display: flex; align-items: center; gap: 2px }
.field-head .field-label { margin: 0 }
h3.sub .help { margin-left: 2px }
.guide-controls .segmented { justify-self: start; width: fit-content; max-width: 100% }
.btn.icon-only { padding-inline: 6px }
.mark { width: 28px; height: 28px; flex-shrink: 0; color: var(--ink); stroke: var(--surface) }
.sidebar .mark { color: var(--rail-strong); stroke: var(--rail) }

/* ---------- switches: on/off settings */
input.switch { appearance: none; flex-shrink: 0; position: relative; width: 38px; height: 22px; margin: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; transition: background .2s var(--ease) }
input.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s var(--ease) }
input.switch:checked { background: var(--accent) }
input.switch:checked::before { transform: translateX(16px); background: var(--on-accent) }
input.switch:disabled { opacity: .5; cursor: not-allowed }
input.switch:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--halo) }
.check:has(input.switch) { align-items: center }

/* ---------- motion: pages settle in; everything calms down for reduced motion */
#content > * { animation: page-in .22s var(--ease) }
@keyframes page-in { from { opacity: 0; transform: translateY(4px) } }
.panel, .stat, .db-card { transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease) }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important }
}

/* ---------- customizable dropdowns where the browser supports them */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select }
  select { background-image: none; padding-right: 12px; display: inline-flex; align-items: center; gap: 8px }
  select::picker-icon { content: ""; width: 16px; height: 16px; margin-left: auto; background: url(/chevron.svg) center / 16px no-repeat; transition: rotate .2s var(--ease) }
  select:open::picker-icon { rotate: 180deg }
  ::picker(select) { margin-block: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
    opacity: 0; transform: translateY(-4px); transition: opacity .16s var(--ease), transform .16s var(--ease), display .16s allow-discrete, overlay .16s allow-discrete }
  ::picker(select):popover-open { opacity: 1; transform: none }
  @starting-style { ::picker(select):popover-open { opacity: 0; transform: translateY(-4px) } }
  select option { padding: 8px 10px; border-radius: 8px; gap: 8px; transition: background .12s var(--ease) }
  select option:hover, select option:focus-visible { background: var(--surface-3); outline: none }
  select option:checked { font-weight: 600 }
  select option::checkmark { color: var(--ink) }
}

/* ---------- dashboard */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px }
.dash-hero h1 { font-size: clamp(24px, 2.4vw, 30px) }
.dash-hero .summary { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted) }
.dash-hero .summary .dot { width: 8px; height: 8px }
.stats { gap: 14px }
.stat { gap: 4px; padding: 18px 20px; border-radius: var(--radius); box-shadow: none }
.stat:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px) }
.stat-label { justify-content: space-between; font-size: 13px; font-weight: 550; color: var(--muted) }
.stat-label .icon { color: var(--muted) }
.stat-value { font-size: clamp(28px, 2.8vw, 36px); font-weight: 650 }
.dash-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 18px; align-items: start }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 12px }
.section-head h2 { font-size: 16px }
.section-head a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none }
.section-head a:hover { color: var(--ink); text-decoration: underline }
.db-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px }
.db-card { position: relative; display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none }
.db-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px) }
.db-card-head { display: flex; align-items: center; gap: 12px; min-width: 0 }
.db-card-head .stack { flex: 1 }
.db-card-head strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.db-card .open-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit }
.db-card .open-link { color: inherit; text-decoration: none }
.db-card .open-link:focus-visible { outline: none }
.db-card:has(.open-link:focus-visible) { box-shadow: 0 0 0 4px var(--halo); border-color: var(--ink) }
.usage { display: grid; gap: 10px }
.usage-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; color: var(--muted) }
.usage-row strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--meter-ok); transition: width .4s var(--ease) }
.bar.warn > span { background: var(--meter-warn) } .bar.critical > span { background: var(--meter-critical) }
.db-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted) }
.db-card-foot .connect { position: relative; z-index: 1; font-weight: 600; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 4px }
.db-card-foot .connect:hover { text-decoration: underline }
.db-card-foot .connect .icon { width: 14px; height: 14px }
.db-card.add { place-items: center; align-content: center; min-height: 168px; border-style: dashed; color: var(--muted); font-weight: 600 }
.db-card.add .icon { width: 22px; height: 22px }
.side-stack { display: grid; gap: 16px }
.attention { display: grid }
.attention li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 12px 20px; border-top: 1px solid var(--line) }
.attention li a { grid-column: 2; justify-self: start; margin-top: 6px }
.attention .icon { margin-top: 1px }
.attention li.critical > .icon { color: var(--critical) } .attention li.warn > .icon { color: var(--warn) } .attention li.info > .icon { color: var(--info) }
.attention p { font-size: 13px }
.cap { display: grid; gap: 14px }
.cap-line { display: grid; gap: 6px; font-size: 13px }
.cap-line > div { display: flex; justify-content: space-between; gap: 10px }
.cap-line span { color: var(--muted) }
.cap-line strong { font-weight: 600; font-variant-numeric: tabular-nums }
.activity { display: grid }
.activity li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 13px }
.activity li > .icon { width: 16px; height: 16px; margin-top: 2px }
.activity li.completed > .icon { color: var(--good) } .activity li.failed > .icon { color: var(--critical) } .activity li.started > .icon { color: var(--info) }
.activity strong { display: block; font-weight: 600 }
.activity small { display: block }
@media (max-width: 1180px) { .dash-main { grid-template-columns: minmax(0, 1fr) } }
.usage-empty { min-height: 44px; display: flex; align-items: center; margin: 0; font-size: 13px }

/* ---------- network access, encryption and database users */
.rule-rows { display: grid; gap: 8px; margin-bottom: 10px }
.rule-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center }
.with-icon { display: inline-flex; align-items: center; gap: 6px }
.with-icon .ico { width: 15px; height: 15px; color: var(--muted) }
.panel .protection + .alert { margin-top: 12px }
.panel .alert + .kv, .panel .protection + .kv { margin-top: 14px }
.panel .kv + .table-wrap, .panel .kv + table { margin-top: 14px }
td.actions { text-align: right; width: 1% }
@media (max-width: 640px) {
  .rule-row { grid-template-columns: 1fr auto }
  .rule-row input:nth-child(2) { grid-column: 1; grid-row: 2 }
}
.steps > li > .btn { justify-self: start }
.attempts:not(:empty) { margin-top: 18px }
.modal .form-grid input { width: 100% }
.modal .form-grid { align-items: start }
/* With "Connect as", the guide has three controls. */
.guide-controls:has(> .control:nth-child(3)) { grid-template-columns: auto minmax(170px, 1fr) minmax(150px, 1fr) }
@media (max-width: 1280px) {
  .guide-controls:has(> .control:nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .guide-controls:has(> .control:nth-child(3)) > .control:first-child { grid-column: 1 / -1 }
}
@media (max-width: 900px) {
  .guide-controls:has(> .control:nth-child(3)) { grid-template-columns: minmax(0, 1fr) }
}

/* ---------- sign-in, setup and invitations: an introduction beside the form */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: clamp(14px, 4vw, 40px); background: var(--canvas) }
.login-wrap { width: min(100%, 1000px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; animation: rise .4s var(--ease) both }
.login-intro { display: flex; flex-direction: column; gap: 36px; padding: clamp(28px, 4vw, 48px); background: var(--surface-2); border-right: 1px solid var(--line) }
.login-intro .brand { color: var(--ink) }
.login-intro .mark { width: 34px; height: 34px }
.intro-body { display: grid; gap: 32px; align-content: start; flex: 1 }
.intro-copy h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -.035em; margin: 6px 0 12px; text-wrap: balance }
.intro-copy p:last-child { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 40ch }
.intro-points, .intro-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px }
.intro-points li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; align-items: start }
.intro-points strong, .intro-steps li { display: block; font-size: 14px; font-weight: 650; color: var(--ink) }
.intro-points small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.5 }
.intro-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--ink) }
.intro-icon .icon { width: 18px; height: 18px }
.intro-steps { gap: 0; position: relative }
.intro-steps li { display: flex; align-items: center; gap: 14px; padding: 9px 0; color: var(--muted); font-weight: 550; position: relative }
.intro-steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 38px; bottom: -8px; width: 2px; border-radius: 2px; background: var(--line) }
.intro-steps .dot { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 750; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); position: relative; z-index: 1 }
.intro-steps li.current { color: var(--ink); font-weight: 650 }
.intro-steps li.current .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--halo) }
.intro-foot { margin: 0; font-size: 12px; color: var(--muted) }

.login-card { padding: clamp(24px, 4.5vw, 52px); display: flex; flex-direction: column; justify-content: center; min-width: 0 }
.login-card h1 { font-size: clamp(24px, 2.6vw, 28px); line-height: 1.15; letter-spacing: -.03em; margin: 4px 0 8px; text-wrap: balance }
.login-card .lead { margin: 0; line-height: 1.55 }
.auth-form { display: grid; gap: 18px; margin-top: 26px }
.auth-form .form-grid { gap: 18px 14px; align-items: start }
.auth-form .field { gap: 6px }
.auth-form .field-label { margin: 0 }
.auth-form .optional { color: var(--muted); font-weight: 500 }
.auth-form input { width: 100%; height: 44px }
.auth-form .hint { margin: 0; min-height: 18px; font-size: 12px; line-height: 1.5; color: var(--muted); transition: color .15s var(--ease) }
.auth-form .hint.ok { color: var(--good) }
.auth-form .hint.error { color: var(--critical); font-weight: 600 }
.auth-form .hint.warn { color: var(--warn); font-weight: 600; display: flex; align-items: center; gap: 6px; min-height: 0 }
.auth-form .hint.warn .icon { width: 14px; height: 14px }
.auth-form input[aria-invalid="true"] { border-color: var(--critical) }
.auth-form input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 18%, transparent) }
.auth-form .btn.wide { height: 46px; margin-top: 0; font-size: 14px }
.strength-word:empty { min-width: 0 }
.auth-form.compact .hint:empty { display: none }
.intro-included { display: grid; gap: 16px; padding-top: 28px; border-top: 1px solid var(--line) }
.auth-form .btn.busy { cursor: progress; opacity: .8 }
.auth-form .btn.busy .icon { animation: nudge 1s var(--ease) infinite }
@keyframes nudge { 50% { transform: translateX(3px) } }
.auth-form > .alert:first-child { margin-bottom: -4px }
.auth-form input.setup-code { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase }
.auth-form .lost-code { margin-top: -6px }
.auth-note { display: flex; gap: 10px; margin: 2px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; line-height: 1.55; color: var(--muted) }
.auth-note .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--ink) }

/* password strength: four bars and a word */
.pw-feedback { display: grid; gap: 8px }
.strength-row { display: flex; align-items: center; gap: 10px; min-height: 18px }
.strength { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px }
.strength i { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s var(--ease) }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--meter-critical) }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--meter-warn) }
.strength[data-score="3"] i:nth-child(-n+3), .strength[data-score="4"] i { background: var(--meter-ok) }
.strength-word { min-width: 64px; text-align: right; font-size: 12px; font-weight: 650; color: var(--muted) }
.strength-word.s1 { color: var(--critical) }
.strength-word.s2 { color: var(--warn) }
.strength-word.s3, .strength-word.s4 { color: var(--good) }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px }
.rules li { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); transition: color .15s var(--ease) }
.rules .icon { width: 14px; height: 14px; padding: 2px; border-radius: 50%; background: var(--line); color: transparent; transition: background .15s var(--ease), color .15s var(--ease) }
.rules li.met { color: var(--good) }
.rules li.met .icon { background: var(--good); color: var(--surface) }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); border-radius: 18px }
  .login-intro { gap: 18px; padding: 22px 22px 20px; border-right: 0; border-bottom: 1px solid var(--line) }
  .intro-body { gap: 0 }
  .intro-copy h2 { font-size: 22px; margin-bottom: 6px }
  .intro-copy p:last-child { font-size: 14px }
  .intro-points, .intro-steps, .intro-included, .intro-foot { display: none }
  .login-card { padding: 24px 22px 28px }
}
@media (max-width: 480px) {
  .login-screen { padding: 0; place-items: stretch }
  .login-wrap { border-radius: 0; border: 0; min-height: 100dvh; box-shadow: none; grid-template-rows: auto 1fr }
  .login-card { justify-content: flex-start }
  .auth-form .form-grid { grid-template-columns: minmax(0, 1fr) }
}
@media (prefers-reduced-motion: reduce) {
  .login-wrap, .auth-form .btn.busy .icon { animation: none }
}

/* ---------- console-style details: columns of label/value pairs */
.info-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) }
.info-cols.n1 { grid-template-columns: minmax(0, 1fr) }
.info-cols.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.info-cols.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.info-col { min-width: 0; padding: 2px 24px 4px }
.info-col:first-child { padding-left: 0 }
.info-col:last-child { padding-right: 0 }
.info-col + .info-col { border-left: 1px solid var(--line) }
.info-col h3 { margin: 0 0 14px; font-size: 13px; font-weight: 700; color: var(--ink) }
.info-col dl { display: grid; gap: 14px; margin: 0 }
.info-col dt { margin-bottom: 3px; font-size: 12px; color: var(--muted) }
.info-col dd { margin: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere }
.info-col code { font-size: 13px }
.stack-tight { display: grid; gap: 6px; justify-items: start }
.row.tight { gap: 10px }
@media (max-width: 1100px) { .info-cols.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)) } .info-cols.n4 .info-col:nth-child(3) { border-left: 0; padding-left: 0 } .info-cols.n4 .info-col:nth-child(n+3) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line) } }
@media (max-width: 760px) {
  .info-cols, .info-cols.n2, .info-cols.n4 { grid-template-columns: minmax(0, 1fr) }
  .info-col, .info-cols.n4 .info-col:nth-child(n+3) { padding: 16px 0 0; margin-top: 16px; border-left: 0; border-top: 1px solid var(--line) }
  .info-col:first-child { padding-top: 0; margin-top: 0; border-top: 0 }
}

/* ---------- dashboard: first run, next step and resources */
.first-run { display: grid; gap: 18px }
.first-pick { padding: clamp(22px, 3vw, 32px) }
.first-head h2 { font-size: clamp(20px, 2vw, 24px); letter-spacing: -.02em; margin: 0 0 6px }
.engine-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px }
.engine-pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease) }
.engine-pick:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px) }
.engine-pick:focus-visible { outline: none; box-shadow: var(--halo) }
.engine-pick strong { display: block; font-size: 15px }
.engine-pick small { color: var(--muted); font-size: 13px }
.engine-pick > .icon { color: var(--muted); transition: transform .15s var(--ease) }
.engine-pick:hover > .icon { transform: translateX(3px); color: var(--ink) }
.engine-pick .engine-badge { width: 44px; height: 44px; border-radius: 12px }
.how-it-works { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }
.how-it-works li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line) }
.how-it-works small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.how-it-works strong { display: block; margin: 2px 0 2px; font-size: 15px }
.how-it-works .muted { font-size: 13px }
.how-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line) }
.res-list { display: grid; margin: -4px 0 4px }
.res-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center; padding: 10px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 13px }
.res-row:last-child { border-bottom: 0 }
.res-row .icon { width: 16px; height: 16px; color: var(--muted) }
.res-row strong { font-weight: 600; font-variant-numeric: tabular-nums }
.res-row:hover span { text-decoration: underline }
@media (max-width: 900px) {
  .engine-picks, .how-it-works { grid-template-columns: minmax(0, 1fr) }
}

/* ---------- connect your application: one string, the rest tucked away */
.conn-label { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--ink-2) }
.conn-after:empty { display: none }
.conn-string { align-items: center; padding: 6px 6px 6px 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--code-bg) }
.conn-string pre { margin: 0; border: 0; background: transparent; padding: 8px 14px; white-space: pre-wrap; word-break: break-all }
.conn-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0 }
.conn-actions .icon-btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--surface-3) }
.conn-after { display: grid; gap: 8px }
.conn-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; font-size: 13px; color: var(--muted) }
.conn-note .icon { width: 15px; height: 15px }
.conn-note a { color: var(--ink); font-weight: 600 }
.conn-more { margin-top: 2px }
.conn-options { display: grid; gap: 12px; margin-top: 12px }
.conn-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); gap: 12px 16px }
.conn-controls .control { display: grid; gap: 6px }
.conn-controls select { width: 100% }
.conn-example { display: grid; gap: 10px }

/* ---------- settings: one row per setting, changed in place */
.set-list { display: grid; margin: -4px 0 -6px }
.set-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.4fr) auto; gap: 8px 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line) }
.set-row:first-child { border-top: 0 }
.set-label strong { display: block; font-size: 14px; font-weight: 650 }
.set-label small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted) }
.set-value { min-width: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere }
.set-value .btn.ghost { margin-left: 4px }
.set-action { display: flex; justify-content: flex-end; min-width: 84px }
@media (max-width: 760px) {
  .set-row { grid-template-columns: minmax(0, 1fr) auto }
  .set-value { grid-column: 1; grid-row: 2 }
  .set-action { grid-column: 2; grid-row: 1 / span 2 }
}

/* ---------- automated backups: coverage and one row per schedule */
.coverage { display: grid; gap: 8px; padding: 2px 0 14px; border-bottom: 1px solid var(--line) }
.coverage-text { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2) }
.coverage-text .icon { width: 16px; height: 16px; color: var(--warn) }
.coverage.full .coverage-text .icon { color: var(--good) }
.coverage-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden }
.coverage-bar span { display: block; height: 100%; border-radius: 6px; background: var(--meter-warn) }
.coverage.full .coverage-bar span { background: var(--meter-ok) }
.sched-list { display: grid; margin-bottom: -6px }
.sched-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(200px, 1.5fr) minmax(110px, .8fr) minmax(130px, .9fr) auto; gap: 8px 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line) }
.sched-row:first-child { border-top: 0 }
.sched-db { display: flex; align-items: center; gap: 12px; min-width: 0 }
.sched-db a { color: var(--ink); text-decoration: none }
.sched-db a:hover { text-decoration: underline }
.sched-plan, .sched-when { display: grid; gap: 2px; min-width: 0 }
.sched-plan strong { font-size: 14px; font-weight: 600 }
.sched-plan small, .sched-when small { font-size: 12px; color: var(--muted) }
.sched-when span { font-size: 14px }
.sched-action { display: flex; justify-content: flex-end; min-width: 84px }
.cell-actions .btn.icon-only { padding: 0 6px; min-width: 30px }
@media (max-width: 900px) {
  .sched-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto }
  .sched-db { grid-column: 1 / 3 }
  .sched-plan { grid-column: 1 / -1; grid-row: 2 }
  .sched-action { grid-column: 3; grid-row: 1 }
}
.menu.floating { position: fixed; right: auto; bottom: auto; transform-origin: top center }
td.actions .cell-actions { flex-wrap: nowrap; white-space: nowrap; justify-content: flex-end; align-items: center }

/* ---------- backup storage */
.cards.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) }
.provider-cards .card-body { padding: 12px 14px; min-height: 0 }
.storage-form { display: grid; gap: 14px }
.storage-form .form-grid { align-items: start }
.storage-points { margin-bottom: 2px }
@media (max-width: 900px) { .cards.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)) } }

/* ---------- users and the account menu */
.users-head { align-items: center; flex-wrap: wrap; gap: 12px }
.user-search { width: min(100%, 260px); height: 36px }
.seg-count { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--muted) }
.segmented [aria-pressed="true"] .seg-count { color: inherit }
.role-select { width: auto; min-width: 128px; height: 34px; font-size: 13px }
.you-chip { margin-left: 8px; font-size: 11px; vertical-align: 1px }
.th-help { display: inline-flex; align-items: center; gap: 4px }
.menu-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px 6px }
.menu-profile .stack strong { font-size: 14px }
.menu-profile .stack small { color: var(--muted) }
.menu-theme-row { display: grid; gap: 6px; padding: 4px 8px 6px }
.menu-theme-row .menu-heading { padding: 0 2px }
.menu-theme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line) }
.menu-theme button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: 7px; font-size: 13px; color: var(--muted); background: transparent }
.menu-theme button .icon { width: 15px; height: 15px }
.menu-theme button:hover { color: var(--ink) }
.menu-theme button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08) }
.menu-theme button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus) }
@media (max-width: 640px) { .user-search { width: 100% } }
.btn.icon-only { color: var(--ink-2) }
.btn.icon-only:hover { background: var(--surface-3); color: var(--ink) }

/* ---------- identity details */
.btn { border-radius: 9px; font-weight: 600 }
.btn.primary { box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent) }
.btn.icon-only { min-width: 32px; justify-content: center }
.btn.icon-only .icon { width: 17px; height: 17px }
.panel { border-radius: var(--radius) }
.panel-head h2 { font-size: 16px }
.status { font-size: 14px }
.page-head h1 { text-wrap: balance }
.chip, .tag-chip { font-family: var(--font) }
.tag-chip { font-size: 12px; padding: 0 7px; border: 1px solid var(--line); background: var(--surface-2) }
.tag-chip.more { color: var(--muted) }
.seg-count { font-family: var(--mono); font-weight: 500 }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent) }
.engine-badge.large { width: 40px; height: 40px; border-radius: 11px }
.engine-badge.xl { width: 48px; height: 48px; border-radius: 13px }
.engine-badge.small { width: 24px; height: 24px; border-radius: 7px }

/* copyable endpoint: a quiet pill that reads like a terminal token */
.endpoint { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 7px 3px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; transition: border-color .15s var(--ease), background .15s var(--ease) }
.endpoint .host { color: var(--muted) }
.endpoint strong { font-weight: 600 }
.endpoint > span { overflow: hidden; text-overflow: ellipsis }
.endpoint .icon { width: 14px; height: 14px; color: var(--muted); opacity: .55; transition: opacity .15s var(--ease) }
.endpoint:hover { border-color: var(--accent); background: var(--accent-soft) }
.endpoint:hover .icon { opacity: 1; color: var(--accent-ink) }

/* ---------- databases: the fleet table and its preview */
.fleet-page .page-head { align-items: flex-end }
.fleet-summary { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; margin-top: 6px }
.fleet-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start }
.fleet-layout.with-preview { grid-template-columns: minmax(0, 1fr) 360px }
.fleet-panel { overflow: hidden }
.fleet-toolbar { padding: 14px 16px; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface) }
.toolbar-end { display: flex; gap: 8px; flex: 1 1 360px; justify-content: flex-end; flex-wrap: wrap }
.toolbar-end .search { max-width: 380px }
.status-filter { flex-wrap: wrap }
.status-filter button.attention .seg-count { color: var(--critical) }
.fleet-wrap { border-top: 0 !important }
table.fleet { font-size: 14px }
table.fleet th, table.fleet td { padding: 12px 14px }
table.fleet th:first-child, table.fleet td:first-child { padding-left: 18px }
table.fleet td.c-actions, table.fleet th.c-actions { width: 1%; padding-right: 12px; text-align: right }
.fleet-row { cursor: pointer; outline: none; transition: background .12s var(--ease) }
.fleet-row td { transition: background .12s var(--ease) }
.fleet-row:focus-visible td { background: var(--surface-2); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent) }
.fleet-row:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent) }
tbody tr.fleet-row.selected td { background: var(--accent-soft) }
tbody tr.fleet-row.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent) }
.fleet-row .db-link { font-size: 15px; color: var(--ink) }
.fleet-row small { font-size: 12.5px }
.fleet-row .of { color: var(--ink-2); font-weight: 600 }
.fleet-row.child td { background: color-mix(in srgb, var(--surface-2) 55%, transparent) }
.fleet-row.child .db-cell { padding-left: 8px }
.tree { width: 14px; height: 22px; margin-right: -2px; margin-top: -14px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 6px; flex-shrink: 0 }
.repl-line { color: var(--muted) }
.repl-line .status { font-size: 12px }
.repl-line .status .icon { width: 13px; height: 13px }
.load { display: grid; grid-template-columns: auto 72px auto; gap: 4px 8px; align-items: center; font-size: 12px }
.load-label { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .04em }
.load-val { font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 46px }
.load .bar { height: 5px }

.fleet-side { position: sticky; top: 72px; min-width: 0 }
.preview { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-pop); animation: slide-in .22s var(--ease); max-height: calc(100dvh - 92px); overflow: auto; scrollbar-width: thin }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px) } }
.pv-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start }
.pv-title { display: flex; gap: 12px; align-items: center; min-width: 0 }
.pv-title h2 { font-size: 20px; letter-spacing: -.02em; overflow-wrap: anywhere }
.pv-title .kicker { margin: 0 }
.pv-actions { display: flex; flex-wrap: wrap; gap: 6px }
.trends { display: grid; gap: 8px }
.trend { display: grid; grid-template-columns: minmax(0, 1fr) 120px; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2) }
.trend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; grid-column: 1 }
.trend-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.trend-now { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em }
.trend .spark { grid-column: 2; grid-row: 1 / span 2 }
.trend small { grid-column: 1; font-size: 12px }
.spark { display: block; width: 100%; height: 34px; overflow: visible }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke }
.spark-area { fill: var(--series-1); opacity: .1 }
.spark-base { stroke: var(--line-strong); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke }
.pv-facts { display: grid; margin: 0 }
.pv-facts > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px }
.pv-facts > div:first-child { border-top: 0 }
.pv-facts dt { color: var(--muted); font-size: 13px }
.pv-facts dd { margin: 0; text-align: right; min-width: 0 }
.pv-section { display: grid; gap: 8px }
.pv-section h3 { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.pv-repl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px }
.pv-list { display: grid; gap: 6px }
.pv-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px }

/* ---------- a database: identity, key facts, and the overview */
.instance-page .page-head { align-items: center; row-gap: 14px; margin-bottom: 4px }
.title-block { display: flex; align-items: center; gap: 14px; min-width: 0 }
.title-block .kicker { margin-bottom: 2px }
.title-block .kicker a { color: inherit; font-weight: 600 }
.title-block h1 { overflow-wrap: anywhere }
.facts-strip { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden }
.fact { display: grid; gap: 3px; padding: 11px 18px; border-right: 1px solid var(--line); min-width: 0; flex: 1 1 auto }
.fact:last-child { border-right: 0 }
.fact-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap }
.fact-value { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.fact-value .status { font-size: 14px }
.fact-value a { color: var(--ink) }
.overview { display: grid; gap: 16px }
.health-wrap { display: grid; gap: 6px }
.health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.tile { display: grid; gap: 2px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); min-width: 0; position: relative; overflow: hidden }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); opacity: .85 }
.tile.warn::before { background: var(--meter-warn) }
.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px }
.tile-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.tile-head small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tile-now { font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums }
.tile .spark { height: 38px; margin-top: 6px }
.health-note { padding-left: 2px; font-family: var(--mono); font-size: 11px }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start }
dl.rows { display: grid; margin: 0 }
dl.rows > div { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px }
dl.rows > div:first-child { border-top: 0; padding-top: 2px }
dl.rows dt { color: var(--muted); font-size: 13px }
dl.rows dd { margin: 0; min-width: 0; overflow-wrap: anywhere }
dl.rows .row.tight { gap: 8px }
.activity li.none { grid-template-columns: 0 1fr }
@media (max-width: 1280px) { .fleet-layout.with-preview { grid-template-columns: minmax(0, 1fr) 330px } }
@media (max-width: 1180px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr) }
  .health { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
/* Phones: each database is a compact card: its name, engine and tags beside
   its status, then the endpoint and its load. Size and backups are one tap away. */
@media (max-width: 760px) {
  .fleet-wrap table, .fleet-wrap tbody { display: block }
  .fleet-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  .fleet-wrap tr.fleet-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name status actions" "endpoint load load"; align-items: center; gap: 8px 10px; padding: 12px 12px 12px 14px !important; border-top: 1px solid var(--line) }
  .fleet-wrap tr.fleet-row:first-child { border-top: 0 }
  .fleet-wrap tr.fleet-row td { display: block !important; padding: 0 !important; border: 0 !important; text-align: left !important; background: transparent !important; box-shadow: none !important; min-width: 0 }
  .fleet-wrap td.c-name { grid-area: name }
  .fleet-wrap td.c-status { grid-area: status; justify-self: end; text-align: right !important }
  .fleet-wrap td.c-status .stack { align-items: flex-end }
  .fleet-wrap td.c-actions { grid-area: actions; width: auto !important; margin: -6px -6px -6px 0 }
  .fleet-wrap td.c-endpoint { grid-area: endpoint }
  .fleet-wrap td.c-load { grid-area: load; justify-self: end }
  .fleet-wrap tr.fleet-row td:is(.c-size, .c-backups, .c-pick) { display: none !important }
  .fleet-wrap .db-cell { gap: 10px }
  .fleet-wrap .db-sub { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 3px 6px }
  .fleet-wrap .load { display: flex; align-items: baseline; gap: 4px }
  .fleet-wrap .load .bar { display: none }
  .fleet-wrap .load-val { min-width: 0 }
  .fleet-wrap .load-val + .load-label { margin-left: 8px }
  .fleet-wrap tr.fleet-row.child { padding-left: 28px !important }
  .fleet-wrap tr.fleet-row.child .tree { display: none }
  .fleet-wrap tr.fleet-row.picked { background: color-mix(in srgb, var(--accent-soft) 70%, transparent) }
  /* Select mode: a tick box leads each card; the row menu and load step aside. */
  .fleet-wrap table.selecting tr.fleet-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pick name status" "pick endpoint endpoint" }
  .fleet-wrap table.selecting tr.fleet-row td.c-pick { display: block !important; grid-area: pick; align-self: center }
  .fleet-wrap table.selecting tr.fleet-row td:is(.c-actions, .c-load) { display: none !important }
  .health { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px }
  .tile { padding: 10px 12px 8px }
  .tile-now { font-size: 20px }
  .tile .spark { height: 28px; margin-top: 4px }
  .title-block { gap: 10px }
  .engine-badge.xl { width: 40px; height: 40px }
  dl.rows > div { grid-template-columns: minmax(0, 1fr); gap: 2px }
}
/* The narrowest phones keep two tiles a row; a limit goes under its label. */
@media (max-width: 380px) { .tile-head { flex-wrap: wrap; row-gap: 0 } }

/* page entrance: panels settle in one after another */
/* backwards, not both: a held transform would make these the containing
   block of fixed children, such as the bulk bar on phones */
.overview > *, .fleet-layout > * { animation: page-in .3s var(--ease) backwards }
.overview > *:nth-child(2) { animation-delay: .05s }
.overview-grid > .stack-gap > * { animation: page-in .3s var(--ease) backwards }
.overview-grid > .stack-gap > *:nth-child(2) { animation-delay: .06s }
.overview-grid > .stack-gap > *:nth-child(3) { animation-delay: .12s }

/* ---------- refinements after review */
.fleet-layout.with-preview :is(.c-size, .c-load, .c-backups) { display: none }
.trend { grid-template-rows: auto }
.trend-head { display: grid; gap: 1px; align-content: center }
.trend .spark { grid-row: 1 }
.trend-head small { font-size: 12px }

/* ---------- servers */
.nav-count.warn { color: var(--warn) }
.server-line { display: inline-flex; align-items: center; gap: 5px; color: var(--muted) }
.server-line .icon { width: 13px; height: 13px }
.srv-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: stretch }
.srv-card { display: grid; gap: 14px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0 }
.srv-card.down { border-color: color-mix(in srgb, var(--critical) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--critical), var(--shadow) }
.srv-head { display: flex; align-items: center; gap: 12px; min-width: 0 }
.srv-head .stack { min-width: 0; flex: 1 }
.srv-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0; overflow-wrap: anywhere }
.srv-head small { color: var(--muted); font-family: var(--mono); font-size: 11.5px }
.srv-head-end { display: flex; align-items: center; gap: 6px; flex-shrink: 0 }
.srv-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft) }
.srv-card.down .srv-icon { color: var(--critical); background: var(--critical-bg) }
.srv-memory { display: grid; gap: 7px }
.srv-memory-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted) }
.srv-memory-head strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums }
.srv-memory .meter { width: 100% }
.srv-rows { display: grid; gap: 6px; margin: 0 }
.srv-rows > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 28px }
.srv-rows dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted) }
.srv-rows dd { margin: 0; min-width: 0; overflow-wrap: anywhere }
.srv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line) }
.srv-dbs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0 }
.srv-dbs a.tag-chip { text-decoration: none }
.srv-add { place-items: center; place-content: center; text-align: center; gap: 6px; min-height: 220px; border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; cursor: pointer; color: var(--ink); font: inherit; transition: border-color .15s var(--ease), background .15s var(--ease) }
.srv-add:hover, .srv-add:focus-visible { border-color: var(--accent); background: var(--accent-soft) }
.srv-add small { color: var(--muted) }
.srv-add-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--on-accent); background: var(--accent); margin-bottom: 4px }
.srv-intro { padding: 18px 20px }
.srv-intro h2 { font-size: 16px; margin: 0 0 12px }
.srv-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) }
.srv-reasons li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45 }
.srv-reasons .icon { color: var(--accent); flex: none; margin-top: 2px }

/* a server's storage, on its card */
.srv-disks { display: grid; gap: 7px }
.srv-disks-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted) }
.srv-disks-head a { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; text-decoration: none }
.srv-disks-head a .icon { width: 14px; height: 14px }
.srv-disk { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px }
.srv-disk > .status { grid-column: 2 / -1; justify-self: start }
.srv-disk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.srv-disk .meter { width: 100% }
.srv-disk small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }

/* the Disks page */
.disk-grid { display: grid; gap: 14px; padding: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: stretch }
.disk-card { display: grid; gap: 12px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0 }
.disk-card.system { background: var(--surface-2) }
.disk-card.down { border-color: color-mix(in srgb, var(--critical) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--critical) }
/* The name and status share the top row; the model and device run under both,
   so "Hetzner volume · /dev/sdb" stays on one line in a narrow card. */
.disk-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; min-width: 0 }
.disk-head .disk-icon { grid-row: 1 / span 2 }
.disk-head .stack { display: contents }
.disk-head h3 { grid-column: 2; grid-row: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 15px; overflow-wrap: anywhere }
.disk-head small { grid-column: 2 / -1; grid-row: 2; color: var(--muted); font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere }
.disk-head-end { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 32px /* as tall as the menu button, so cards without one line up */ }
.disk-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft) }
.disk-card.down .disk-icon { color: var(--critical); background: var(--critical-bg) }
.disk-usage { display: grid; gap: 7px }
.disk-usage-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted) }
.disk-usage-head strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums }
.disk-usage .meter { width: 100%; height: 8px }
.disk-note-actions { margin-top: 8px }
.disk-foot { padding-top: 12px; border-top: 1px solid var(--line) }
.disk-dbs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0 }
.disk-dbs a.tag-chip { text-decoration: none; display: inline-flex; align-items: center; gap: 4px }
.tag-chip.pending { border-style: dashed; color: var(--info) }
.tag-chip .icon { width: 12px; height: 12px }
.disk-found-list { list-style: none; margin: 0; padding: 0 }
.disk-found { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap }
.disk-found:first-child { border-top: 0 }
.disk-found > .stack { flex: 1 1 260px; gap: 2px }
.disk-found strong { font-family: var(--mono); font-size: 13.5px }
.disk-found small { color: var(--muted); overflow-wrap: anywhere }
.disk-found small.reason { color: var(--warn) }
.disk-found.unusable .disk-icon { color: var(--muted); background: var(--surface-3) }
.disk-found-actions { flex-wrap: wrap; justify-content: flex-end }
.disk-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; list-style: decimal }
.disk-steps li::marker { color: var(--muted); font-weight: 600 }
.stack-gap-sm { display: grid; gap: 10px; align-content: start; min-width: 0 }
@media (max-width: 640px) {
  .disk-found-actions { width: 100%; justify-content: stretch }
  .disk-found-actions .btn { flex: 1 }
}

/* the add-server wizard */
.wizard { display: grid; gap: 18px }
.wizard-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: step }
.wizard-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 13px }
.wizard-steps li.current { color: var(--accent-ink); background: var(--accent-soft) }
.wizard-steps li.done { color: var(--good) }
.wizard-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px }
.wizard-steps li.current .wizard-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
.wizard-steps li.done .wizard-num { background: var(--good-bg); border-color: transparent; color: var(--good) }
.wizard-num .icon { width: 13px; height: 13px }
.wizard-page { display: grid; gap: 12px }
.wizard-page p { margin: 0; line-height: 1.5 }
.wizard-back:has(button[hidden]) { display: none }
.fingerprints { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line) }
.fingerprints code { font-size: 12.5px; word-break: break-all }

/* moving a database */
.move-targets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)) }
.move-target-head { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.move-address { display: grid; gap: 6px; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line) }
.move-address > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.move-address dt { color: var(--muted); font-size: 13px }
.move-address dd { margin: 0 }
.move-plan { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5 }
.move-progress .stack { gap: 8px }
.move-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 16px; flex-wrap: wrap }
.move-steps li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px }
.move-steps li.done { color: var(--good) }
.move-steps li.current { color: var(--ink) }
.move-steps .icon { width: 14px; height: 14px }
.update-foot { justify-content: space-between; gap: 12px 16px }
.update-foot .note-line { flex: 1 1 320px }
.move-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; margin: 0 3px }
.hint.warn-text, .stack small.warn-text { color: var(--warn) }

/* ---------- jump to (Ctrl/Cmd K) */
.palette { width: min(620px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column }
.palette[open] { display: flex }
.palette::backdrop { background: var(--scrim); backdrop-filter: blur(2px) }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line) }
.palette-search .icon { color: var(--muted); flex: none }
.palette-input, .palette-input:focus, .palette-input:focus-visible { flex: 1; min-width: 0; border: 0; outline: 0; box-shadow: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 4px 0 }
.palette kbd { position: static; font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); pointer-events: none }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1 }
.palette-group { padding: 10px 10px 4px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted) }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer }
.palette-item[aria-selected="true"] { background: var(--accent-soft) }
.palette-item[aria-selected="true"] strong { color: var(--accent-ink) }
.palette-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--muted); position: relative }
.palette-icon.good::after, .palette-icon.critical::after, .palette-icon.warn::after, .palette-icon.info::after, .palette-icon.neutral::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface) }
.palette-icon.good::after { background: var(--dot-good) } .palette-icon.critical::after { background: var(--dot-critical) } .palette-icon.warn::after { background: var(--dot-warn) }
.palette-icon.info::after { background: var(--dot-info) } .palette-icon.neutral::after { background: var(--dot-neutral) }
.palette-icon.engine-badge { color: var(--engine); background: color-mix(in srgb, var(--engine) 11%, var(--surface)) }
.palette-text { display: grid; min-width: 0; flex: 1 }
.palette-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.palette-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.palette-empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted) }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2) }
.palette-foot kbd { margin-right: 2px }
@media (max-width: 600px) { .palette { margin-top: 8vh } .palette-foot { display: none } }

/* Security settings and the audit log */
dialog.modal.confirm-dialog { width: min(440px, calc(100% - 24px)) }
.table-note { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--line) }
/* ---------- domain and HTTPS */
.domain-form { display: flex; gap: 10px; flex-wrap: wrap }
.domain-form input { flex: 1 1 260px; min-width: 0 }
.domain-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.6 }
.domain-steps .endpoint { vertical-align: middle }
.domain-checks { margin: 8px 0; padding-left: 18px; font-size: 13px }
.status.pending { color: var(--info) }
.note-line { display: flex; align-items: flex-start; gap: 8px; margin: 0 }
.note-line .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--muted) }
/* Beside the settings menu the audit log has less room: its values wrap, request paths too. */
#audit-list td.wrap { min-width: 9rem; overflow-wrap: anywhere }

/* ---------- settings: a menu of the sections beside each section's page */
.settings-page { container-type: inline-size }
.settings-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 32px; align-items: start }
.settings-nav { position: sticky; top: 82px; display: grid; gap: 18px; padding-top: 2px }
.settings-group { display: grid; gap: 2px }
.settings-label { padding: 0 10px 4px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted) }
.settings-nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 550; white-space: nowrap; transition: background .12s var(--ease), color .12s var(--ease) }
.settings-nav a .icon { width: 17px; height: 17px; color: var(--muted) }
.settings-nav a .label { flex: 1; min-width: 0 }
.settings-nav a:hover { background: color-mix(in srgb, var(--surface-3) 80%, transparent); color: var(--ink) }
.settings-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650 }
.settings-nav a[aria-current="page"] .icon { color: var(--accent-ink) }
.settings-nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 750; color: var(--on-accent); background: var(--accent) }
@container (max-width: 760px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 18px }
  .settings-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 0 0 4px; scrollbar-width: thin }
  .settings-group { display: contents }
  .settings-label { display: none }
  .settings-nav a { flex: none; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface) }
  .settings-nav a[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft) }
}

/* ---------- metric alarms */
.alarm-line { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.alarm-line .icon { width: 13px; height: 13px; flex: none }
.alarm-line.warn { color: var(--warn) } .alarm-line.critical { color: var(--critical) }
.field .threshold { flex-wrap: nowrap }
.field .threshold input.num { width: 8rem; flex: none }
.field .threshold select { width: auto; flex: none }
.threshold .unit { color: var(--muted); font-weight: 600 }
.scope-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px }
.scope-choice .row { gap: 18px; flex-wrap: wrap }
.pick-list { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; max-height: 13rem; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 8px 14px }

/* ---------- engine patches and maintenance */
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
@media (max-width: 640px) { .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr) } }
.patch-note { display: inline-flex; align-items: flex-start; gap: 5px; color: var(--info); font-weight: 600 }
.patch-note .icon { width: 14px; height: 14px; flex: none; margin-top: 2px }

/* ---------- restore drills and backup encryption */
.drill-line { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px }
.drill-line .status { font-size: inherit; align-self: center }
.drill-line .status .icon { width: 14px; height: 14px }
.key-reveal { display: grid; gap: 12px }
.key-reveal .code pre { font-size: 15px; letter-spacing: .02em; white-space: pre-wrap; word-break: break-all }
.recovery-input { width: 100%; font-family: var(--mono); font-size: 14px; resize: vertical; min-height: 64px }
.enc-state { display: inline-flex; align-items: center; gap: 6px }

/* ---------- two-factor sign-in */
.tf-setup { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 24px; align-items: start }
.tf-scan { display: grid; justify-items: center }
.qr { display: block; width: 184px; height: 184px; border-radius: 10px; border: 1px solid var(--line); background: #fff }
.tf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; counter-reset: tf }
.tf-steps > li { counter-increment: tf; position: relative; display: grid; gap: 6px; padding-left: 38px; min-width: 0 }
.tf-steps > li::before { content: counter(tf); position: absolute; left: 0; top: -3px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 750; color: var(--muted); background: var(--surface); border: 1px solid var(--line-strong) }
.tf-steps strong { font-size: 14px; color: var(--ink) }
.tf-steps small { color: var(--muted); font-size: 12px; line-height: 1.5 }
.tf-steps .disclosure { margin-top: 2px; padding: 10px 12px }
.tf-steps .disclosure .code pre { white-space: pre-wrap; word-break: break-all; letter-spacing: .04em }
.code-input { width: 100%; max-width: 200px; height: 44px; font-family: var(--mono); font-size: 20px; letter-spacing: .25em; font-variant-numeric: tabular-nums }
.code-input::placeholder { color: var(--line-strong) }
.recovery-codes { list-style: none; margin: 0; padding: 14px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); counter-reset: rc }
.recovery-codes li { counter-increment: rc; display: flex; align-items: baseline; gap: 10px }
.recovery-codes li::before { content: counter(rc); min-width: 16px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums }
.recovery-codes code { font-family: var(--mono); font-size: 15px; letter-spacing: .05em; background: none; padding: 0; color: var(--ink) }
.tf-panel { display: grid; gap: 14px; align-content: start; justify-items: start }
.tf-panel > .kv, .tf-panel > .alert { width: 100% }
.tf-panel > p { margin: 0 }
.tf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.login-card .tf-setup { grid-template-columns: minmax(0, 1fr); gap: 20px }
.login-card .tf-scan { justify-self: start }
.login-card .code-input { max-width: none }
@media (max-width: 640px) {
  .tf-setup { grid-template-columns: minmax(0, 1fr) }
  .tf-scan { justify-self: start }
  .recovery-codes { grid-template-columns: minmax(0, 1fr) }
}
.tf-line { display: inline-flex; align-items: center; gap: 4px; color: var(--muted) }
.tf-line.on { color: var(--good) }
.tf-line .icon { width: 13px; height: 13px }
.tf-done { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 650; color: var(--good) }
.tf-done .icon { width: 18px; height: 18px }
.tf-steps .disclosure p { margin: 8px 0 }
.tf-steps .disclosure .btn { margin-bottom: 2px }
.intro-steps li.done { color: var(--ink) }
.intro-steps li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }

/* Scoped access */
.scope-chips { display: flex; flex-wrap: wrap; gap: 6px }
.scope-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-family: var(--mono); background: var(--surface-2) }
.scope-chip .icon { width: 13px; height: 13px; color: var(--muted) }
.scope-body { gap: 10px }
.scope-body p { margin: 0 }
.scope-rules { display: grid; gap: 8px; margin-top: 4px }
.scope-rules .field-label { margin: 8px 0 0 }
.scope-rules > .btn { justify-self: start }
.scope-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px }
.scope-line { display: inline-flex; align-items: center; gap: 4px; color: var(--muted) }
.scope-line .icon { width: 12px; height: 12px }
.role-stack { align-items: flex-start }
.scope-note { margin-top: 4px }

/* Bulk actions on the databases list */
table.fleet th.c-pick, table.fleet td.c-pick { width: 1%; padding-right: 0 }
table.fleet.pickable th:nth-child(2), table.fleet.pickable td:nth-child(2) { padding-left: 10px }
label.pick { display: grid; place-items: center; width: 32px; height: 32px; margin: -8px -8px -8px -10px; border-radius: 8px; cursor: pointer }
@media (hover: hover) { label.pick:hover { background: var(--surface-3) } }
tbody tr.fleet-row.picked td { background: color-mix(in srgb, var(--accent-soft) 70%, transparent) }
tbody tr.fleet-row.picked td:first-child { box-shadow: inset 3px 0 0 var(--accent) }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--accent-soft); animation: fade-in .15s var(--ease) }
.bulk-count { display: grid; margin: 0; font-size: 13.5px; line-height: 1.25 }
.bulk-count small { font-size: 12px; color: var(--muted) }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0 }
.bulk-actions .btn .seg-count { margin-left: 2px }
.bulk-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); max-height: 264px; overflow: auto; background: var(--surface) }
.bulk-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line) }
.bulk-list li:first-child { border-top: 0 }
.bulk-list li .stack strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.bulk-list.bulk-progress { max-height: 340px }
.bulk-state { display: grid; justify-items: end; gap: 2px; text-align: right; max-width: 260px }
.bulk-state small { font-size: 12px; color: var(--critical); overflow-wrap: anywhere }
.bulk-summary { margin: 0 0 4px; color: var(--muted) }
.bulk-plan { display: grid; gap: 10px }
/* Phones: the bar floats at the bottom of the screen while the list scrolls. */
@media (max-width: 760px) {
  .bulk-bar { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-pop); animation: rise .2s var(--ease) }
  .bulk-actions { flex-basis: 100%; order: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)) }
  .bulk-actions .btn, .bulk-actions .menu-wrap, .bulk-actions .menu-wrap .btn { width: 100%; justify-content: center }
  .bulk-count { flex: 1 }
  .fleet-page:has(.bulk-bar) { padding-bottom: 150px }
  .fleet-wrap label.pick { margin: -6px 0 -6px -8px; width: 40px; height: 40px }
  .bulk-state { max-width: 150px }
}
.bulk-meter { display: grid; gap: 8px }
.bulk-meter .progress { flex: none }
.bulk-meter .progress-fill { transition: width .3s var(--ease) }
.bulk-meter .progress-fill.failing { background: var(--meter-warn) }

/* ---------- database management: the list's toolbar on phones, sticky tabs,
   and a compact header on phones */
.db-sub { display: flex; flex-direction: column; gap: 1px; min-width: 0 }
.load-val.warn { color: var(--warn) }
.load-val.critical { color: var(--critical) }
.filter-menu, .select-toggle, .btn-short, .bulk-hint { display: none }
.tabs { position: relative }
.tabs-wrap { position: relative }
.tabs-wrap::before, .tabs-wrap::after { content: ""; position: absolute; z-index: 1; top: 0; bottom: 1px; width: 36px; pointer-events: none; opacity: 0; transition: opacity .15s var(--ease) }
.tabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--canvas) 20%, transparent) }
.tabs-wrap::after { right: 0; background: linear-gradient(270deg, var(--canvas) 20%, transparent) }
.tabs-wrap.fade-start::before, .tabs-wrap.fade-end::after { opacity: 1 }
.db-sticky { position: sticky; top: 56px; z-index: 12; margin: 18px calc(-1 * clamp(16px, 3vw, 36px)); padding: 0 clamp(16px, 3vw, 36px); transition: background .15s var(--ease), box-shadow .15s var(--ease) }
/* Solid, not frosted: the bar above the tabs can't blur what's behind it
   (a backdrop filter inside another one sees only its parent). */
.db-sticky.stuck { background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 10px 18px -16px rgba(20, 22, 29, .4) }
.db-sticky.stuck .tabs { border-bottom-color: transparent }
.db-sticky.stuck .tabs-wrap::before { background: linear-gradient(90deg, var(--surface) 20%, transparent) }
.db-sticky.stuck .tabs-wrap::after { background: linear-gradient(270deg, var(--surface) 20%, transparent) }
.instance-page .tabs { margin: 0 }
.db-mini, .chart-jump { display: none }
.instance-page .chart { scroll-margin-top: 116px }
@media (max-width: 900px) { .db-sticky { top: 52px } }
@media (max-width: 760px) {
  /* The list: title and New on one line; search, Filters and Select, then
     the status chips across. */
  .fleet-page .page-head { flex-wrap: nowrap; align-items: flex-start; gap: 12px }
  .fleet-page .page-head .page-actions, .fleet-page .page-head .page-actions .btn { width: auto }
  .fleet-page .page-head .btn-long { display: none }
  .fleet-page .page-head .btn-short { display: inline }
  .fleet-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "search filters select" "chips chips chips"; align-items: center; gap: 10px 8px; padding: 12px }
  .fleet-toolbar:not(:has(.select-toggle)) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search filters" "chips chips" }
  .fleet-toolbar .toolbar-end { display: contents }
  .fleet-toolbar .search { grid-area: search; max-width: none }
  .fleet-toolbar .search kbd { display: none }
  .fleet-toolbar .filter-menu { grid-area: filters; display: block }
  .fleet-toolbar .filter-menu .btn { min-width: 42px; padding-inline: 11px }
  .fleet-toolbar .engine-filter, .fleet-toolbar .server-filter { display: none }
  .fleet-toolbar .status-filter { grid-area: chips; justify-self: start; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none }
  .fleet-toolbar .status-filter::-webkit-scrollbar { display: none }
  .fleet-toolbar .status-filter button { flex: none; padding: 6px 10px }
  .fleet-toolbar .select-toggle { grid-area: select; display: inline-flex }
  .fleet-toolbar .select-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft) }
  .filter-menu .btn.filtered { border-color: var(--accent); color: var(--accent-ink) }
  .bulk-hint { display: block; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 13px; color: var(--accent-ink) }

  /* A database: name and status, one line of facts and the endpoint, then
     its three buttons. Once that scrolls away, a bar with the name sits on
     the tabs. */
  .db-sticky { top: 96px }
  .db-mini { display: flex; align-items: center; gap: 8px; position: absolute; left: 0; right: 0; bottom: 100%; height: 44px; padding: 0 clamp(16px, 3vw, 36px); background: var(--surface); visibility: hidden; opacity: 0; transition: opacity .15s var(--ease), visibility .15s }
  .db-sticky.stuck .db-mini { visibility: visible; opacity: 1 }
  .db-mini-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px }
  .db-mini .status { font-size: 13px; white-space: nowrap }
  .db-mini .btn { margin-left: auto; flex: none }
  .tabs { scrollbar-width: none }
  .tabs::-webkit-scrollbar { display: none }
  .tabs [role="tab"] { padding: 10px 12px; font-size: 14.5px }
  .instance-page .page-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 0 }
  .instance-page .title-block { align-items: flex-start }
  .instance-page .title-block .stack { flex: 1 }
  .instance-page h1 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; font-size: 24px }
  .instance-page h1 .status { font-size: 14px; letter-spacing: 0 }
  .db-meta { display: grid; gap: 8px; margin-top: 4px; font-size: 13.5px; color: var(--muted) }
  .db-meta a { color: var(--ink-2); font-weight: 600 }
  .db-meta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px }
  .db-meta-line .with-icon { color: var(--ink-2) }
  .instance-page .page-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; width: 100% }
  .instance-page .page-actions:not(:has(.menu-wrap)) { grid-template-columns: 1fr auto }
  .instance-page .page-actions > .btn { justify-content: center }
  .instance-page .page-actions .menu-wrap .btn { width: 44px; justify-content: center }
  .chart-jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px calc(-1 * clamp(16px, 3vw, 36px)) 14px; padding: 2px clamp(16px, 3vw, 36px) }
  .chart-jump::-webkit-scrollbar { display: none }
  .chart-jump button { flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap }
  .chart-jump button:active { background: var(--accent-soft); border-color: var(--accent) }
  .instance-page .chart { scroll-margin-top: 156px }
  /* A chart's reading and Table button go under its title when they don't fit beside it. */
  .chart-head { flex-wrap: wrap; row-gap: 6px }
  .chart-head > div:first-child { flex: 1 1 160px; min-width: 0 }
  /* Engines as rows: the logo beside the name. */
  .card-body:has(> .engine-badge.large) { grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 12px 14px }
  .card-body:has(> .engine-badge.large) > .engine-badge { grid-row: 1 / span 2; margin: 0 }
  .card-body:has(> .engine-badge.large) > strong { align-self: end }
  .card-body:has(> .engine-badge.large) > small { align-self: start }
}


/* ---------- the database settings tab: rows in groups */
.set-group + .set-group { margin-top: 20px }
.set-group-title { padding-bottom: 8px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.set-group .set-list { margin-top: 0 }

/* ---------- the create wizard: a rail of steps, one step at a time */
.create-steps { gap: 6px }
.create-steps li { padding: 0 }
.create-steps button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; color: inherit; font-weight: 600 }
.create-steps li:not(.current) button:hover { color: var(--ink) }
.wizard-step { display: grid; gap: 16px; outline: none }
.wizard-step > .panel + .panel { margin-top: 0 }
.wizard-nav { display: flex; align-items: center; gap: 10px }
.wizard-nav .wizard-next { margin-left: auto; min-width: 140px; justify-content: center }
.wizard-progress { display: none }
.review-groups { display: grid; gap: 18px }
.review-group { display: grid; gap: 6px }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line) }
.review-head h3 { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.review-group .kv.stacked > div:first-child { border-top: 0 }
/* On the last step the review replaces the summary. */
.wizard-form.on-review .form-summary .panel-head, .wizard-form.on-review .form-summary .summary-body { display: none }
.wizard-form.on-review .form-summary .capacity { border-top: 0 }
@media (min-width: 1181px) { .wizard-cancel { display: none !important } }
@media (max-width: 1180px) {
  .wizard-form:not(.on-review) .form-summary { display: none }
  .wizard-form .summary-actions { display: none }
}
@media (max-width: 760px) {
  .create-steps { flex-wrap: nowrap }
  .create-steps li:not(.current) .step-label { display: none }
  .create-steps li:not(.current) button { padding: 6px }
  .wizard-form { padding-bottom: 72px }
  .wizard-nav { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; gap: 8px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px) }
  .wizard-progress { display: grid; flex: 1; min-width: 0; text-align: center; line-height: 1.3 }
  .wizard-progress small { font-size: 11.5px; color: var(--muted) }
  .wizard-progress span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: var(--ink-2) }
  .wizard-nav .wizard-next { margin-left: 0; min-width: 0 }
  /* Restore and modify: their buttons stay at the bottom of the screen. */
  .form-layout:not(.wizard-form) { padding-bottom: 72px }
  .form-layout:not(.wizard-form) .summary-actions { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; grid-template-columns: 1fr 1fr; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px) }
  .form-layout:not(.wizard-form) .summary-actions .btn.primary { order: 2 }
}
