:root {
  color-scheme: dark;
  --surface-root: #080c14; --surface-base: #0d1829; --surface-card: #101e32;
  --text-primary: #edf5ff; --text-secondary: #bbccdf; --text-brand: #5ddbff;
  --border-subtle: #30435b; --brand-500: #2d9cdb;
  font-family: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55; background: var(--surface-root); color: var(--text-primary);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--text-brand); text-underline-offset: .2em; }
button, .button { font: inherit; color: var(--text-primary); background: var(--surface-base); border: 1px solid var(--border-subtle); border-radius: .6rem; padding: .65rem 1rem; text-decoration: none; cursor: pointer; }
button:hover:not(:disabled), .button:hover { border-color: var(--text-brand); }
button:disabled { opacity: .6; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--text-brand); outline-offset: 4px; }
.skip-link { position: absolute; left: 1rem; top: -6rem; z-index: 5; padding: 1rem; background: var(--surface-base); }
.skip-link:focus { top: 1rem; }
.app-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.app-header { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 2rem; border-bottom: 1px solid var(--border-subtle); background: var(--surface-base); }
.header-brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--text-primary); }
.header-brand strong { font-size: 1.35rem; letter-spacing: .05em; }
.header-brand small { display: block; color: var(--text-secondary); }
.session-controls { display: flex; gap: .5rem; }
.app-sidebar { padding: 1.5rem; border-right: 1px solid var(--border-subtle); }
nav { display: grid; gap: .3rem; }
nav a { padding: .7rem .4rem; text-decoration: none; border-radius: .4rem; }
nav a:hover { background: var(--surface-card); }
.section-label, .eyebrow { color: var(--text-brand); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-note, .note, footer { color: var(--text-secondary); font-size: .875rem; }
.sidebar-note { margin-top: 2rem; }
.app-main { min-width: 0; width: 100%; max-width: 90rem; padding: 2rem; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; } h2 { font-size: 1.1rem; margin-top: 0; }
.eyebrow { margin: 0 0 .3rem; }
.connection-card, .status-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: .9rem; padding: 1.4rem; overflow-wrap: anywhere; }
.connection-card { margin-bottom: 1.5rem; background: var(--surface-base); }
.connection-card p { margin: .3rem 0; } #connectionStatus { font-weight: 600; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.wide { grid-column: 1 / -1; }
.status-card > p { color: var(--text-secondary); }
dl { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(0, 2fr); gap: .6rem 1rem; }
dt { color: var(--text-secondary); } dd { margin: 0; overflow-wrap: anywhere; }
pre { margin: 0; max-height: 24rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .85rem/1.6 ui-monospace, monospace; }
footer { margin-top: 2rem; }
input:not([type="checkbox"]), textarea, select { display: block; width: 100%; max-width: 100%; margin: .5rem 0 1rem; padding: .7rem; border: 1px solid var(--border-subtle); border-radius: .4rem; background: var(--surface-root); color: var(--text-primary); font: inherit; }
textarea { font-family: ui-monospace, monospace; resize: vertical; }
.table-scroll { overflow: auto; max-height: 30rem; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; vertical-align: top; padding: .65rem; border: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
td { max-width: 35rem; white-space: pre-wrap; }
#healthContent th:first-child, #healthContent td:first-child { min-width: 6rem; white-space: nowrap; }
dialog { width: min(36rem, 90vw); color: var(--text-primary); background: var(--surface-base); border: 1px solid var(--border-subtle); border-radius: .8rem; padding: 1.5rem; }
dialog::backdrop { background: #000b; }
@media (max-width: 850px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar { border-right: 0; border-bottom: 1px solid var(--border-subtle); padding: 1rem; }
  nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
  .sidebar-note { margin: .7rem 0 0; }
  .app-main { padding: 1.25rem; } .app-header { padding: 1rem; }
}
@media (max-width: 560px) { .status-grid { grid-template-columns: minmax(0, 1fr); } dl { grid-template-columns: 1fr; } dd { margin-bottom: .6rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
