@font-face { font-family:"Space Grotesk"; font-weight:400; font-display:swap; src:url("/static/fonts/space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-weight:500; font-display:swap; src:url("/static/fonts/space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-weight:600; font-display:swap; src:url("/static/fonts/space-grotesk-600.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-weight:700; font-display:swap; src:url("/static/fonts/space-grotesk-700.woff2") format("woff2"); }

/* Fairlead — daytime chart (light) */
:root {
  --bg: #e7eef2;
  --surface: #ffffff;
  --surface-2: #eef4f7;
  --line: #d2dfe8;
  --line-2: #e6eef3;
  --txt: #0a2236;
  --txt-2: #4d6577;
  --muted: #5b7488;
  --accent: #0c9aa0;
  --accent-hover: #0a868c;
  --accent-soft: #0c9aa016;
  --accent-ring: #0c9aa033;
  --ok: #0f9d6b;
  --ok-soft: #0f9d6b16;
  --warn: #c98314;
  --danger: #df4747;
  --danger-soft: #df474714;
  --violet: #6d5ae0;
  --brass: #ad7a26;
  --brass-soft: #ad7a2618;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(10,34,54,.07), 0 1px 3px rgba(10,34,54,.05);
  --shadow: 0 2px 4px rgba(10,34,54,.06), 0 12px 30px rgba(10,34,54,.10);
  --shadow-lg: 0 18px 54px rgba(10,34,54,.20);
  --glow: 0 0 22px -7px var(--accent);
  --sysbar-bg: #0a1f33;
  --sysbar-txt: #bccfdd;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
/* Fairlead — helm at night (dark, primary identity) */
:root[data-theme="dark"] {
  --bg: #07182a;
  --surface: #0e2339;
  --surface-2: #16334e;
  --line: #234462;
  --line-2: #1a3450;
  --txt: #e6f1f8;
  --txt-2: #8eabc2;
  --muted: #7f99af;
  --accent: #22cebf;
  --accent-hover: #46dccd;
  --accent-soft: #22cebf1e;
  --accent-ring: #22cebf45;
  --ok: #2ddc9f;
  --ok-soft: #2ddc9f1c;
  --warn: #f4c45a;
  --danger: #ff6b6b;
  --danger-soft: #ff6b6b1c;
  --violet: #8f7cff;
  --brass: #e8b86f;
  --brass-soft: #e8b86f1e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow: 0 2px 8px rgba(0,0,0,.45), 0 14px 34px rgba(2,10,20,.55);
  --shadow-lg: 0 20px 60px rgba(2,8,16,.66);
  --sysbar-bg: #040f1d;
  --sysbar-txt: #9db5cb;
}
:root[data-theme="dark"] .note { border-color: #234462; color: #b9c8e6; }
:root[data-theme="dark"] .placeholder { border-color: #234462; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1 { letter-spacing: -.01em; }

/* ---- auth ---- */
.login-wrap {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #e8efff 0%, var(--bg) 55%);
}
.login-card {
  width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-lg);
}
.login-brand { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.login-sub { color: var(--muted); margin: 0 0 14px; }
.login-card label { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 500; }
.login-card input {
  background: var(--surface); border: 1px solid var(--line); color: var(--txt);
  border-radius: var(--radius-sm); padding: 11px 13px; outline: none; transition: .15s;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.login-error { background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f7caca; padding: 9px 11px; border-radius: var(--radius-sm); font-size: 13px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--txt); padding: 9px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; transition: .15s; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: #d4dbe6; background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff;
  margin-top: 18px; justify-content: center; padding: 9px 14px; box-shadow: 0 2px 8px var(--accent-ring); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line-2); color: var(--txt); }

/* ---- app shell ---- */
.layout { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar > nav { flex: 1 1 auto; overflow-y: auto; min-height: 0; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar > nav::-webkit-scrollbar { width: 0; height: 0; }
.sidebar-foot { margin: 8px 6px 0; padding: 10px 4px 2px; border-top: 1px solid var(--line-2); font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.sidebar-foot a { color: var(--muted); text-decoration: none; }
.sidebar-foot a b { color: var(--txt-2); font-weight: 600; }
.sidebar-foot a:hover { color: var(--accent); }
.sidebar-foot a:hover b { color: var(--accent); }
.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 9px; padding: 6px 8px 18px; }
.brand-logo { max-height: 42px; max-width: 200px; display: block; object-fit: contain; }
.logo-preview { margin: 8px 0 14px; }
.logo-preview img { max-height: 52px; max-width: 220px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px; background: var(--surface-2); }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #4f86ff); color: #fff; font-size: 15px;
  box-shadow: 0 2px 8px var(--accent-ring);
}
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--txt); margin-bottom: 2px; font-weight: 500; transition: .12s; }
.nav-item:hover { background: var(--line-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--line-2); color: var(--muted); font-size: 13px; flex: 0 0 auto; transition: .12s; }
.nav-item:hover .nav-icon { color: var(--accent); }
.nav-item.active .nav-icon { background: var(--accent); color: #fff; }

/* collapsible groups */
.nav-group { margin-top: 4px; }
.nav-group-head { display: flex; align-items: center; border-radius: var(--radius-sm); transition: .12s; }
.nav-group-head:hover { background: var(--line-2); }
.nav-group-head.active { background: var(--accent-soft); }
.nav-group-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border: 0; background: none; font: inherit; color: var(--muted); font-weight: 600; cursor: pointer;
  text-align: left; border-radius: var(--radius-sm); }
.nav-group-head.active .nav-group-link { color: var(--accent); }
.chev { margin-left: auto; flex: none; border: 0; background: none; cursor: pointer; padding: 9px 10px;
  transition: transform .18s ease; font-size: 11px; color: var(--txt-2); }
.chev.open { transform: rotate(90deg); }
.nav-group-items { display: none; margin: 2px 0 6px 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-group-items.open { display: block; }
.nav-group-items .nav-item { font-weight: 450; }
.nav-group-items .nav-icon { width: 22px; height: 22px; font-size: 12px; background: transparent; }
.nav-group-items .nav-item:hover .nav-icon { background: var(--line-2); }
/* nested subgroup (3rd level) — slightly smaller header */
.nav-group-items .nav-group-link { font-weight: 550; font-size: 13px; }

.main { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 28px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5; }
.ctx-selector { display: flex; align-items: center; gap: 8px; }
.ctx-selector label { font-size: 12px; color: var(--muted); }
.ctx-selector select { background: var(--surface); color: var(--txt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 7px 11px; }
.ctx-hint { font-size: 12px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* theme toggle */
.theme-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; transition: .15s; box-shadow: var(--shadow-sm); }
.theme-btn:hover { color: var(--accent); border-color: #d4dbe6; }
:root[data-theme="dark"] .theme-btn:hover { border-color: #36414f; }
.theme-btn .t-sun { display: none; font-size: 1.3em; line-height: 1; }
.theme-btn .t-moon { display: inline; }
:root[data-theme="dark"] .theme-btn .t-sun { display: inline; color: var(--warn); }
:root[data-theme="dark"] .theme-btn .t-moon { display: none; }
.login-corner { position: fixed; top: 18px; right: 18px; z-index: 10; }
.who { font-size: 13px; color: var(--muted); }
.role-tag { background: var(--accent-soft); color: var(--accent); padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600; }
.role-tag.user { background: var(--ok-soft); color: var(--ok); }

.flash { background: var(--accent-soft); border-bottom: 1px solid var(--line);
  padding: 9px 28px; color: var(--accent); font-size: 13px; }

.content { padding: 24px 30px 44px; max-width: none; }
.content h1 { margin: 0 0 5px; font-size: 25px; font-weight: 680; letter-spacing: -.02em; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head p { margin: 0; }
.page-head .btn { flex: 0 0 auto; margin-top: 2px; }
/* eyebrow label for grouping sections */
.eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: .07em; font-weight: 700;
  color: var(--muted); margin: 26px 0 10px; }
.muted { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px; margin: 0 0 18px; }
@media (max-width: 1080px){ .cards { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 620px){ .cards { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--line); }
.card-k { color: var(--muted); font-size: 12px; font-weight: 500; }
.card-v { font-size: 19px; font-weight: 680; margin-top: 4px; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }

/* stat cards with icon chip */
.card.stat { display: flex; align-items: flex-start; gap: 13px; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.stat-body { min-width: 0; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* progress bars — fixed 3 columns so rows/data don't reflow as the window resizes */
.bars { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px 28px; margin: 4px 0; }
@media (max-width: 920px){ .bars { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px){ .bars { grid-template-columns: 1fr; } }
.bar-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; font-weight: 500; }
.bar { height: 9px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.tone-ok { background: linear-gradient(90deg, var(--accent), #4f86ff); }
.tone-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tone-danger { background: linear-gradient(90deg, #ef4444, #f87171); }

.note { background: var(--accent-soft); border: 1px solid #dbe6ff; border-radius: var(--radius);
  padding: 15px 17px; color: #33507f; margin-top: 8px; }
.spf-help { margin: 8px 0 0; padding-left: 18px; }
.spf-help li { margin: 5px 0; line-height: 1.5; }

/* forms */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm); margin: 0 0 20px; }
.form-title { margin: 0 0 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line-2);
  font-size: 15px; font-weight: 650; }
/* when a title leads straight into tabs, the tabs row is the divider instead */
.form-title:has(+ .tabs) { border-bottom: none; padding-bottom: 0; margin-bottom: 14px; }
.form-sub { margin: 20px 0 6px; font-size: 13px; font-weight: 600; padding-top: 14px; border-top: 1px solid var(--line-2); }
.form-sub .muted { font-weight: 400; font-size: 12px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.form-row:last-of-type { border-bottom: none; }
.form-label > div:first-child { font-weight: 500; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 3px; max-width: var(--hint-w); }
.input { background: var(--surface); border: 1px solid var(--line); color: var(--txt);
  border-radius: var(--radius-sm); padding: 9px 12px; outline: none; min-width: 200px; transition: .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.ip-checks { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.ip-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 11px; }
.ip-check input { accent-color: var(--accent); }
.form-actions { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-actions .btn { margin-top: 0; }
.form-actions .btn.primary { margin-top: 0; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* primary buttons carry a margin-top (for form submits); never let it misalign a row */
.btn-row .btn, .inline-form .btn, .page-head .btn { margin-top: 0; }
/* toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface); color: var(--txt); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 11px 16px; font-size: 13px; font-weight: 500; min-width: 200px;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: var(--danger); }
.code-area { width: 100%; min-height: 280px; resize: vertical; line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; white-space: pre; }
/* apache module toggle grid */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; margin: 4px 0; }
.mod-item { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 2px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.mod-info { min-width: 0; }
.mod-name { font-weight: 500; font-size: 13px; }
.mod-item .form-hint { margin-top: 1px; }
.kv { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
/* read-only facts: tidy responsive 2-column grid */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; max-width: none; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0;
  border-bottom: 1px solid var(--line-2); font-size: 13px; }
.fact span { color: var(--muted); }
.fact b { font-weight: 600; text-align: right; word-break: break-word; }

/* grid form + table */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 18px; margin: 8px 0 6px; max-width: var(--form-w); }
.grid-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.grid-form .input { min-width: 0; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: none; }
.btn.danger:hover { filter: brightness(.95); background: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
/* quiet icon-only action (e.g. view log) — secondary, doesn't compete with buttons */
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); cursor: pointer; transition: .12s; vertical-align: middle; }
.icon-btn:hover { color: var(--accent); background: var(--line-2); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.icon-btn svg { display: block; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 6px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.ta-right { text-align: right; }
/* Certificate manager cells + edit-modal textareas */
/* Site logs tab */
.joblog.log-box { max-height: 52vh; } /* override .joblog's 360px cap (higher specificity) */
/* Log viewer control bar — one height for every control, groups split by dividers */
.logbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 7px 9px; margin-bottom: 10px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; }
.logbar-grp { display: inline-flex; align-items: center; gap: 6px; }
.logbar-div { align-self: center; width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.logbar-lbl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.logbar .input, .logbar .btn { height: 34px; box-sizing: border-box; min-width: 0; }
.logbar .input { padding: 0 10px; font-size: 13px; }
.logbar .btn { padding: 0 13px; font-size: 12px; box-shadow: none; }
.logbar .btn:hover { transform: none; box-shadow: none; }
.logbar-sel { width: 232px; }
.logbar-srch { width: 188px; }
.logbar-num { width: 56px; text-align: center; padding: 0 6px; -moz-appearance: textfield; appearance: textfield; }
.logbar-num::-webkit-inner-spin-button, .logbar-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.joblog mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }

/* pager (Panel Jobs history, etc.) */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cb-col { width: 34px; text-align: center; }
/* single-record detail grid */
.detail-grid { display: grid; grid-template-columns: 130px 1fr; gap: 9px 18px; align-items: center; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: 13px; }
.detail-grid dd { margin: 0; }
.notif-item.unread { border-left-width: 4px; }
.notif-item.unread .notif-row b::after { content: "●"; color: var(--accent); font-size: 9px; vertical-align: middle; margin-left: 6px; }
.notif-item.read { opacity: .55; } /* read notifications dim, then drop after 15 min */

/* notification center — topbar bell + right slide-in panel */
.notif { position: relative; display: inline-flex; }
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: .15s; }
.notif-bell:hover, .notif-bell.active { background: var(--surface-2); color: var(--txt); }
.notif-badge { position: absolute; top: -1px; right: -1px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.notif-scrim { position: fixed; inset: 0; z-index: 70; }
.notif-panel { position: fixed; top: 0; right: 0; z-index: 71; width: 360px; max-width: 92vw; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 48px -28px rgba(0,0,0,.45); transform: translateX(100%); transition: transform .22s ease; }
.notif-panel.open { transform: none; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.notif-list { flex: 1; overflow: auto; padding: 8px; }
.notif-item { display: block; padding: 9px 12px; margin-bottom: 8px; border-radius: 10px; text-decoration: none; color: var(--txt); background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--line); transition: .12s; }
.notif-item:hover { border-color: var(--accent); }
.notif-item.run { border-left-color: var(--accent); }
.notif-item.ok { border-left-color: #1e9e5a; }
.notif-item.warn { border-left-color: #d79633; }
.notif-item.err { border-left-color: var(--danger); }
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notif-row b { font-weight: 600; font-size: 13px; }
.notif-status { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.notif-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 16px; }
.cert-hosts { max-width: 240px; overflow-wrap: anywhere; line-height: 1.5; }
.cert-sites { display: flex; flex-wrap: wrap; gap: 3px; max-width: 240px; }
.code-area.sm { min-height: 90px; }
.code-area.md { min-height: 120px; }
.code-area.xs { min-height: 70px; }
.inline-form { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
/* Databases row actions: equal-width buttons so the column lines up; System is an inert button */
.db-act { min-width: 92px; justify-content: center; }
.inline-form .rm { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.pill.on { background: var(--accent-soft); color: var(--accent); }
.pill.err { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: #fbe6c8; color: #9a6a06; }
.pill.run { background: var(--accent-soft); color: var(--accent); animation: blink 1.1s ease-in-out infinite; }
/* table action bar (a "New …" button above a list) + empty state + paused rows */
.tbl-actions { display: flex; gap: 8px; align-items: center; }
.empty-hint { color: var(--muted); font-size: 13px; padding: 16px 2px; }
/* Updates → History changelog */
.changelog { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cl-entry { border-left: 2px solid var(--line); padding: 6px 0 10px 16px; margin-left: 4px; }
.cl-entry.cl-current { border-left-color: var(--accent); }
.cl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cl-ver { font-size: 15px; font-weight: 700; }
.cl-date { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.cl-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.cl-list li { font-size: 13px; color: var(--txt-2); line-height: 1.45; }
.tbl tr.row-off > td { opacity: .5; }
:root[data-theme="dark"] .pill.warn { background: #3a2c0e; color: var(--warn); }
.auth-block { padding: 15px 0; border-top: 1px solid var(--line); }
.auth-block:first-of-type { border-top: none; padding-top: 2px; }
.auth-head { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
.auth-head b { font-size: 14px; }
.dns-field { display: block; margin-top: 9px; max-width: 720px; }
.dns-field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
/* A published DNS record: a wrapping monospace value (long DKIM keys wrap, no scroll) with a
   copy button in the header. */
.rec { max-width: 760px; margin-top: 10px; }
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.rec-name { font-size: 12px; color: var(--muted); }
.rec-val { font: 12px/1.6 var(--mono); color: var(--txt); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px;
  white-space: pre-wrap; word-break: break-all; -webkit-user-select: all; user-select: all; }
.rec-copied { color: var(--ok); border-color: var(--ok); }
/* Mail health-check: one row per check — a status pill on the left, label + finding + fix
   on the right. Read like a checklist; the pill colour carries the pass/warn/fail signal. */
.hc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hc-tally { display: flex; gap: 6px; }
.hc-sub { font-weight: 400; color: var(--muted); }
.hc-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.hc-row:first-of-type { border-top: none; }
.hc-row > .pill { margin-top: 1px; min-width: 44px; text-align: center; flex-shrink: 0; }
.hc-body { flex: 1; min-width: 0; }
.hc-label { font-size: 13px; font-weight: 600; }
.hc-detail { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.hc-fix { font-size: 12px; color: var(--accent); margin-top: 3px; }
/* Engine/variant picker — used by every "choose a stack" page (mail, web, DB, DNS). The
   active choice is marked with the panel's teal accent (same as active nav / "current"
   pills); every card shows the same decision axes on an instrument-plate to compare. */
.rig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(274px, 1fr)); gap: 16px; }
.rig { position: relative; display: flex; flex-direction: column; padding: 18px 18px 15px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rig:not(.rig-on):hover { border-color: var(--accent-ring); }
.rig-on { border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent), var(--shadow-sm);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70px); }
.rig-flag { position: absolute; top: 15px; right: 16px; font: 600 10px/1 var(--mono);
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 5px 8px; border-radius: 6px; }
.rig-name { font-family: var(--display); font-size: 15.5px; font-weight: 600; letter-spacing: -.01em;
  color: var(--txt); margin: 1px 0 7px; }
.rig-on .rig-name { padding-right: 82px; }
.rig-thesis { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; }
.rig-spec { margin: 0 0 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.rig-spec > div { display: grid; grid-template-columns: 94px 1fr; gap: 10px; align-items: baseline; padding: 8px 12px; }
.rig-spec > div + div { border-top: 1px solid var(--line-2); }
.rig-spec dt { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rig-spec dd { margin: 0; font: 12px/1.35 var(--mono); color: var(--txt); }
.rig-trade { font-size: 11.5px; line-height: 1.45; color: var(--txt-2); margin: 0 0 3px; }
.rig-trade span { font: 600 10px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin-right: 7px; }
.rig-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line-2); }
.rig-status { font: 600 11px/1 var(--mono); letter-spacing: .04em; color: var(--accent); }
.rig-soon { font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .rig { transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease; }
  .rig:not(.rig-on):hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}

/* Mail service policies — each row states what it does and its default, one job per element. */
/* inline checkbox + label (single opt-in, lighter than .policy) */
.ck { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.5;
  color: var(--txt); cursor: pointer; }
.ck > input { margin: 3px 0 0; flex: none; }
.ck .form-hint { display: inline; }
.policy-list { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 2px 15px; }
.policy { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--line-2); cursor: pointer; margin: 0; }
.policy:first-child { border-top: none; }
.policy > input { margin: 2px 0 0; }
.policy-name { display: block; font-size: 13.5px; font-weight: 550; color: var(--txt); }
.policy-desc { display: block; font-size: 12px; line-height: 1.45; color: var(--muted); margin-top: 3px; }
.policy-def { align-self: center; font: 600 10px/1 var(--mono); letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); background: var(--surface-2);
  padding: 4px 7px; border-radius: 5px; white-space: nowrap; }
/* Observability — Panel Services status board (engine-room instrument plate) */
.svc-group { margin-top: 22px; }
.svc-group:first-of-type { margin-top: 8px; }
.svc-group .eyebrow { color: var(--muted); margin-bottom: 9px; }
.svc-list { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.svc { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; gap: 16px; align-items: center;
  padding: 13px 16px; border-top: 1px solid var(--line-2); }
.svc:first-child { border-top: none; }
.svc-lamp { width: 10px; height: 10px; border-radius: 999px; background: var(--muted);
  box-shadow: 0 0 0 3px var(--line-2); }
.svc-lamp.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.svc-lamp.err { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.svc-name { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--txt); line-height: 1.2; }
.svc-unit { font: 11px/1 var(--mono); color: var(--muted); margin-top: 4px; }
.svc-ctl { display: flex; align-items: center; gap: 13px; }
.svc-state { font: 700 10px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); min-width: 64px; text-align: right; }
.svc-state.on { color: var(--accent); }
.svc-state.err { color: var(--danger); }
.svc-div { width: 1px; height: 20px; background: var(--line); flex: 0 0 auto; }
.svc-force { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  font: 600 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.svc-force input { margin: 0; accent-color: var(--danger); }
@media (max-width: 820px) {
  .svc { grid-template-columns: 12px 1fr; row-gap: 12px; }
  .svc-ctl { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}

/* Observability → System: headline stat cards + usage meters */
.sys-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 4px; }
.sys-stat { padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.sys-val { font-family: var(--display); font-size: 30px; font-weight: 680; line-height: 1; letter-spacing: -.02em; color: var(--txt); }
.sys-lab { font-size: 12.5px; color: var(--muted); margin-top: 9px; }
.meter { height: 6px; background: var(--line-2); border-radius: 999px; margin-top: 11px; overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
/* per-core load strip */
.cores { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 13px 18px; }
.core-head { display: flex; justify-content: space-between; align-items: baseline; }
.core-n { font: 600 10px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.core-head .mono { font-size: 12px; color: var(--txt); }
.core-bar { height: 6px; background: var(--line-2); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.core-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
/* process table: fixed columns (no jitter as values update) + full names (wrap, never cut) */
.proc-tbl { table-layout: fixed; width: 100%; }
.proc-tbl th:nth-child(2), .proc-tbl td:nth-child(2) { width: 120px; }
.proc-tbl th:nth-child(3), .proc-tbl td:nth-child(3) { width: 76px; }
.proc-tbl th:nth-child(4), .proc-tbl td:nth-child(4) { width: 76px; }
.proc-tbl th:nth-child(5), .proc-tbl td:nth-child(5) { width: 92px; }
.proc-cmd { word-break: break-word; }
/* Databases → Processes: cap the running-query cell so a long statement doesn't blow up the
   table (full text on hover); the row still scrolls in its .tbl-scroll wrapper. */
.proc-q { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mail filters rule builder: each rule is a padded card — a match-mode line (for 2+
   conditions), one line per condition (If / and / or …), then the → action line. */
.filt-rule { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; }
.rule-when { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.cond-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.rule-lab { color: var(--muted); font-weight: 600; min-width: 28px; }
.filt-rule .input { min-width: 0; }
.filt-rule select.input { flex: 0 0 auto; width: auto; }
.filt-rule .rule-val { flex: 1 1 150px; }
.cond-add { margin: 0 0 4px 28px; }
.rule-then { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; padding-top: 11px; border-top: 1px dashed var(--line-2); }

.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--txt); }
.th-arrow { color: var(--accent); font-size: 9px; }

.chart-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* Administration → System → Settings → Core: kernel tunables form */
.ks-row { display: grid; grid-template-columns: 1fr 330px; gap: 14px 28px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.ks-row:first-of-type { border-top: 0; padding-top: 4px; }
.ks-label { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ks-label code { font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.ks-explain { margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.ks-note { margin: 6px 0 0; font-size: 12px; font-style: italic; color: var(--muted); }
.ks-ctl { display: flex; flex-direction: column; gap: 8px; }
.ks-ctl .input { width: 100%; }
.ks-presets, .ks-actions { display: flex; align-items: center; gap: 13px; font-size: 12px; flex-wrap: wrap; }
.ks-plabel { color: var(--muted); }
.ks-presets a, .ks-actions a { color: var(--accent); cursor: pointer; font-weight: 500; }
.ks-presets a:hover, .ks-actions a:hover { text-decoration: underline; }
.ks-row[data-off] { opacity: .5; }
.ks-actions { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); gap: 16px; }
.ks-actions .btn { margin: 0; }
.ks-how { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.ks-how li { margin: 5px 0; }
.ks-how b { color: var(--txt); font-weight: 600; }
@media (max-width: 860px) { .ks-row { grid-template-columns: 1fr; } }

/* Administration → Firewall */
.fw-pending { border: 1px solid var(--accent); background: var(--accent-soft); }
.fw-offnote { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.fw-offnote b { color: var(--txt); }
.fw-status { display: flex; align-items: center; gap: 14px; }
.fw-state { font: 600 15px/1 var(--display); margin-top: 5px; }
.fw-state.on { color: var(--accent); }
.fw-state.off { color: var(--muted); }
.fw-state.warn { color: var(--danger); }
.fw-state .on-txt { color: var(--accent); }
.fw-state .off-txt { color: var(--muted); }
.fw-live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 3px; vertical-align: middle; animation: fwpulse 1.6s ease-in-out infinite; }
@keyframes fwpulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.fw-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; margin-top: 12px; }
.fw-preset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; background: var(--surface); }
.fw-preset.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fw-preset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fw-preset-title { font: 600 15px/1 var(--display); }
.fw-preset-sum { margin: 8px 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.fw-preset-pts { margin: 0 0 14px; padding-left: 16px; font-size: 12px; line-height: 1.55; color: var(--muted); flex: 1 1 auto; }
.fw-preset-pts li { margin: 4px 0; }
.fw-preset > form { margin-top: auto; }
.fw-preset .btn { width: 100%; justify-content: center; }
.fw-ports { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.fw-port-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.port-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.fw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 12px; }
.chip-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 2px; }
.chip-x:hover { color: var(--danger); }
.tgl { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; cursor: pointer; }
.tgl input { width: 16px; height: 16px; accent-color: var(--accent); }
.fw-prot-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.fw-prot-sec:first-of-type { border-top: 0; padding-top: 2px; }
.fw-prot-desc { margin: 6px 0 12px 26px; font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 780px; }
.fw-prot-sec .grid-form { margin-left: 26px; max-width: 900px; }
.fw-prot-sec .field { font-size: 12px; color: var(--muted); font-weight: 600; }
.field-hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); font-weight: 400; line-height: 1.4; }
/* reserve a uniform two-line height for Protection field labels so a label that wraps
   doesn't push its input below the others in the same row */
.fw-prot-sec .field-lbl { display: block; line-height: 1.3; min-height: 2.6em; }
/* these fields carry a hint BELOW the input, so the grid-form's default margin-top:auto
   (which bottom-aligns inputs to the hint) would misalign them — pin the input to the label */
.fw-prot-sec .grid-form label > .input { margin-top: 6px; }
.tbl-scroll { overflow-x: auto; }
.fw-rules-tbl { min-width: 720px; }
.fw-ruleform { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fw-rf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; }
.fw-rf-grid .field { margin: 0; min-width: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.fw-rf-grid .input { min-width: 0; width: 100%; } /* let inputs shrink inside the grid instead of overflowing */
.fw-ruleform .form-actions { margin: 14px 0 0; }
.fw-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.mw-140 { max-width: 140px; }
.mw-180 { max-width: 180px; }

/* Observability → Web: live connection-count tiles (click for detail) */
.conn-tiles { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.conn-tile { flex: 1 1 220px; text-align: left; padding: 18px 20px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  transition: border-color .12s ease, background .12s ease; }
.conn-tile:hover { border-color: var(--accent); background: var(--surface-2); }
.conn-num { font-family: var(--display); font-size: 38px; font-weight: 680; line-height: 1;
  letter-spacing: -.02em; color: var(--accent); }
.conn-lab { font-size: 13.5px; font-weight: 600; color: var(--txt); margin-top: 11px; }
.conn-sub { font: 11px/1 var(--mono); color: var(--muted); margin-top: 5px; }

.av-note { display: flex; gap: 17px; align-items: center; padding: 15px 17px; margin: 0 0 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.av-note-fig { font-family: var(--display); font-size: 25px; font-weight: 680; letter-spacing: -.02em;
  color: var(--txt); white-space: nowrap; }
.av-note-body { font-size: 12.5px; line-height: 1.5; color: var(--txt-2); }
.joblog { background: #0e1219; color: #d7dde8; border-radius: var(--radius); padding: 14px 16px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 360px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; margin: 8px 0; border: 1px solid var(--line); }

/* modal (log viewer) */
[x-cloak] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(8,12,20,.55); }
.modal-card { position: relative; z-index: 1; width: min(920px, 100%); max-height: 82vh;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 14px; }
.modal-log { margin: 0; border: 0; border-radius: 0; max-height: none; flex: 1; }
/* download progress bar (job modal): a teal-filled track + a percentage label + a byte/speed/ETA line */
.jm-progress { display: flex; flex-direction: column; gap: 7px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.jm-progress-top { display: flex; align-items: center; gap: 12px; }
.jm-detail { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.jm-bar { flex: 1; height: 8px; border: 0; border-radius: 999px; overflow: hidden; -webkit-appearance: none; appearance: none; background: var(--accent-soft); }
.jm-bar::-webkit-progress-bar { background: var(--accent-soft); border-radius: 999px; }
.jm-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.jm-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.jm-pct { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--accent); min-width: 40px; text-align: right; }
/* truncate a long cell (e.g. a WebDAV URL) inside a fixed-layout table instead of overflowing */
.tbl.fixed td.ellipsis { max-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Observability → Logs */
.logs-layout { display: grid; grid-template-columns: 232px minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 720px) { .logs-layout { grid-template-columns: 1fr; } }
.logs-sources { display: flex; flex-direction: column; gap: 2px; max-height: 68vh; overflow-y: auto; padding-right: 4px; }
.logs-grp { margin: 10px 2px 3px; }
.logs-grp:first-child { margin-top: 0; }
.logs-src { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%; border: 0; background: transparent;
  padding: 6px 9px; border-radius: 8px; cursor: pointer; color: var(--txt); font: inherit; font-size: 13px; }
.logs-src:hover { background: var(--accent-soft); }
.logs-src.active { background: var(--accent); color: #fff; }
.logs-src-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logs-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; }
.logs-src.active .logs-kind { opacity: .85; }
.logs-viewer { min-width: 0; }
.logs-vhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.logs-box { max-height: 62vh; overflow: auto; white-space: pre; }
.logs-box.logs-wrap { white-space: pre-wrap; word-break: break-all; }
.logs-box > div { min-height: 1.2em; }
.logs-empty { color: var(--muted); padding: 28px 4px; }
.logs-results .logs-hits { max-height: 64vh; overflow: auto; padding: 8px 10px; }
.logs-hit { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; border-bottom: 1px solid #ffffff0f; }
.logs-hit-src { flex: none; min-width: 130px; text-align: left; border: 0; background: transparent; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; }
.logs-hit-src:hover { text-decoration: underline; }
.logs-hit-line { flex: 1; white-space: pre-wrap; word-break: break-all; font-size: 12px; color: #d7dde8; }
/* cron jobs: friendly schedule builder + list */
.cron-builder { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; padding: 8px 0 2px; }
.cron-b-field { display: flex; align-items: center; gap: 8px; margin: 0; }
.w-70 { width: 70px; flex: none; }
.w-auto { width: auto; }
.pill-btn { border: 0; cursor: pointer; font: inherit; line-height: inherit; }
.lead-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.muted.sm, .mono.sm { font-size: 12px; }
/* a checkbox row inside a grid-form must stay horizontal (grid-form forces column on labels) */
.grid-form label.check-row { flex-direction: row; align-items: center; gap: 9px; font-size: 14px; color: inherit; }

/* radio variant rows (server stack) */
.radio-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 10px 0;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: .12s; }
.radio-row:hover { border-color: #cdd6e4; }
.radio-row.active { border-color: var(--accent); background: var(--accent-soft); }
.radio-row input { margin-top: 3px; accent-color: var(--accent); }
.radio-title { font-weight: 600; }
.pkgs { font-size: 12px; color: var(--muted); margin-top: 4px; font-family: ui-monospace, monospace; }
.uninstall-form { display: inline; margin-left: 8px; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; cursor: pointer; background: var(--line); border-radius: 999px; transition: .2s; }
.slider::before { content: ""; position: absolute; height: 19px; width: 19px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.placeholder { background: var(--surface); border: 1px dashed #d4dbe6; border-radius: var(--radius);
  padding: 48px; text-align: center; margin-top: 18px; box-shadow: var(--shadow-sm); }
.placeholder-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 26px; }

/* ---- top status bar (server vitals — the cockpit strip) ---- */
.sysbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--sysbar-bg); color: var(--sysbar-txt); padding: 6px 28px;
  font: 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.sysbar-vitals { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.vital { display: inline-flex; align-items: baseline; gap: 6px; letter-spacing: .02em; }
.vital i { font-style: normal; color: #79859e; text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }
.vital b { color: var(--sysbar-txt); font-weight: 600; }
.vital b.v-warm { color: var(--warn); }
.vital b.v-hot { color: var(--danger); }
.has-pop { position: relative; cursor: default; outline: none; }
.sysbar-pop { position: absolute; top: 100%; left: 0; z-index: 30; display: none;
  background: var(--surface); color: var(--txt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 7px; margin-top: 6px;
  min-width: 320px; font: 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.has-pop:hover .sysbar-pop, .has-pop:focus-within .sysbar-pop { display: block; }
.dl-head { font-family: inherit; text-transform: uppercase; font-size: 10px; letter-spacing: .06em;
  color: var(--muted); padding: 3px 8px 6px; }
.dl-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: baseline;
  padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.dl-row:hover { background: var(--line-2); }
.dl-dev { color: var(--txt); font-weight: 600; }
.dl-mt { color: var(--muted); }
.dl-sz { color: var(--txt); text-align: right; }
.dl-pc { color: var(--muted); text-align: right; min-width: 34px; }
.dl-pc.v-warm { color: var(--warn); }
.dl-pc.v-hot { color: var(--danger); }
.sysbar-clock { display: inline-flex; align-items: center; gap: 8px; color: var(--sysbar-txt); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3a4761; display: inline-block; flex: 0 0 auto; }
.dot.live { background: var(--ok); animation: sb-pulse 2.4s infinite; }
@keyframes sb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

/* ---- tabs (split big editors: plans, settings) ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 0; overflow-x: auto; }
.tab { padding: 10px 15px; font-size: 13px; font-weight: 550; color: var(--muted);
  border: 0; background: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--txt); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding-top: 20px; }
.tab-panel.active { display: block; }

/* ---- elevation + color life (de-bleach) ---- */
.card, .form-card { border-color: var(--line); }
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .form-card { box-shadow: inset 0 1px 0 rgba(255,255,255,.045), var(--shadow-sm); }
.cards .card:nth-child(4n+1) .stat-icon { background: #e8f0ff; color: #2563eb; }
.cards .card:nth-child(4n+2) .stat-icon { background: #e6f8f0; color: #0ea871; }
.cards .card:nth-child(4n+3) .stat-icon { background: #f2ecfe; color: #7c3aed; }
.cards .card:nth-child(4n+4) .stat-icon { background: #e0f4f2; color: #0d9488; }
:root[data-theme="dark"] .cards .card:nth-child(4n+1) .stat-icon { background: #16284a; color: #7aa2ff; }
:root[data-theme="dark"] .cards .card:nth-child(4n+2) .stat-icon { background: #103127; color: #34d399; }
:root[data-theme="dark"] .cards .card:nth-child(4n+3) .stat-icon { background: #261a44; color: #b794ff; }
:root[data-theme="dark"] .cards .card:nth-child(4n+4) .stat-icon { background: #0f2e2b; color: #2dd4bf; }

/* Apache per-module panes */
.pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 2px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.pane-off { opacity: .5; }
.rule-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 2px; border-bottom: 1px solid var(--line-2); }
.rule-row .mod-name { font-weight: 500; font-size: 13px; }

/* Sites */
.mono { font-family: var(--mono); }
.site-head { display: flex; align-items: center; gap: 12px; }
.site-head .back { color: var(--muted); }

/* Site file manager */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 13px; }
.crumbs a { color: var(--accent); cursor: pointer; }
.fm-name a { cursor: pointer; }
/* canonical padded, scrollable modal body — holds forms/textareas consistently */
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
/* any code editor inside a modal fills the width (no more cols-based shrink) */
.modal-card .code-area { width: 100%; margin: 0; box-sizing: border-box; }
/* a form-actions row that is a DIRECT child of the card is the modal footer: it
   must carry the card's horizontal padding so buttons never touch the edge */
.modal-card > .form-actions { margin: 0; padding: 14px 18px; border-top: 1px solid var(--border); }
/* modal size variants (snapped to a small scale; default card is min(920px,100%)).
   Declared after .modal-card so source order wins when both classes are present. */
.size-sm { width: min(460px, 94%); }
.size-md { width: min(560px, 96%); }
.size-lg { width: min(700px, 96%); }
.size-xl { width: min(860px, 97%); }

/* Visual file manager (Explorer-like) */
.fm-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.fm-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--accent-soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; font-size: 13px; margin-bottom: 12px; }
.fm-path a { color: var(--accent); cursor: pointer; }
.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 4px; }
.fm-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px;
  border-radius: 10px; cursor: pointer; user-select: none; border: 1px solid transparent; text-align: center; transition: .1s; }
.fm-item:hover { background: var(--accent-soft); }
.fm-item.sel { background: var(--accent-soft); border-color: var(--accent); }
.fm-ic { font-size: 42px; line-height: 1; }
.fm-label { font-size: 12px; word-break: break-word; max-width: 100%; }
.fm-empty { padding: 44px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.ctx-menu { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 176px; }
.ctx-menu button { display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 7px 12px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.ctx-menu button:hover { background: var(--accent-soft); }
.ctx-menu button.danger-text { color: var(--danger); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* File manager — view toggle + drag & drop states */
.fm-viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fm-viewtoggle button { border: 0; background: var(--surface); padding: 5px 11px; cursor: pointer; font-size: 15px; color: var(--muted); }
.fm-viewtoggle button.active { background: var(--accent-soft); color: var(--accent); }
.fm-stage { position: relative; min-height: 120px; }
.fm-grid.dragover, .fm-empty.dragover, .fm-list.dragover { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); border-radius: 12px; }
.fm-item.dropok, .fm-list tr.dropok > td { background: var(--accent-soft); }
.fm-item.dropok { outline: 2px solid var(--accent); }
.fm-item[draggable="true"], .fm-list tr[draggable="true"] { -webkit-user-drag: element; }
.fm-list tr { cursor: pointer; user-select: none; }
.fm-list tr.sel > td { background: var(--accent-soft); }
.fm-list th { cursor: pointer; user-select: none; white-space: nowrap; }
.fm-path a.dropok { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 5px; }

/* DB permissions */
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--accent); }

/* Bond/bridge member picker — a compact, scrollable checkbox list */
.member-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow-y: auto; }
.member-row { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.member-row:hover { border-color: var(--accent); }
.member-row input { accent-color: var(--accent); }
.member-row:has(input:checked) { border-color: var(--accent); background: var(--accent-ring); }
.priv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin: 4px 0 8px; }

/* Theme-aware warning / callout card */
.warn-card { background: #fdf1da; border-color: #eec585; color: #7a5206; box-shadow: none; }
.warn-card b { color: #6e4a05; }
.warn-card .form-hint, .warn-card .muted { color: #7a5206; opacity: .85; }
.warn-card a { color: #875806; text-decoration: underline; }
:root[data-theme="dark"] .warn-card { background: #332710; border-color: #6e5417; color: #f1c684; }
:root[data-theme="dark"] .warn-card b { color: #ffd590; }
:root[data-theme="dark"] .warn-card .form-hint, :root[data-theme="dark"] .warn-card .muted { color: #e7bd78; }
:root[data-theme="dark"] .warn-card a { color: #ffda93; }

/* Prefixed input (user_ + name) */
.prefixed { display: flex; align-items: stretch; }
.prefixed .pfx { display: flex; align-items: center; padding: 0 11px; background: var(--accent-soft);
  border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; font-family: var(--mono);
  font-size: 13px; color: var(--muted); white-space: nowrap; }
.prefixed .input { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
/* Composite fields share the row: the input fills the remainder; a trailing domain <select>
   gets extra weight so even short domains aren't clipped in a narrow grid column. */
.prefixed > .input { flex: 1 1 0; }
.prefixed > select.input { flex: 2 1 0; }

/* ---- form polish: label spacing + dark-friendly checkboxes ---- */
label > .input, label > select.input, label > textarea.input { display: block; width: 100%; margin-top: 6px; }
label > .prefixed { margin-top: 6px; }
/* Bottom-align inputs in a grid row so varying hint lengths don't make fields drift. */
/* inputs are pinned to the bottom of the cell (margin-top:auto) so that across a row, fields with a
   multi-line hint and fields without one still line their inputs up on the same baseline. */
.grid-form label > .input, .grid-form label > select.input, .grid-form label > .prefixed { margin-top: auto; }
.prefixed > .input { margin-top: 0; }
.field { display: block; margin-bottom: 14px; font-size: 12px; font-weight: 500; color: var(--muted); }

.chk input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; margin: 0; flex: 0 0 auto;
  width: 16px; height: 16px; border: 1.5px solid var(--line); border-radius: 4px;
  background: var(--surface); cursor: pointer; position: relative; transition: border-color .12s, background .12s; }
.chk input[type="checkbox"]:hover { border-color: var(--accent); }
.chk input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.chk input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.chk input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }

/* ===== SQL UI ===== */
.sql-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 13px; cursor: pointer; color: var(--muted); font: inherit; }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.sql-body { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
.sql-side { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; position: sticky; top: 12px; max-height: 82vh; overflow: auto; }
.sql-side-head { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.sql-tables { list-style: none; margin: 0; padding: 0; }
.sql-tables li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sql-tables li:hover { background: var(--accent-soft); }
.sql-tables li.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sql-main { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.sql-grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-width: 100%; }
.sql-grid { margin: 0; font-size: 13px; white-space: nowrap; }
.sql-grid th { cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.nullc { color: var(--muted); font-style: italic; opacity: .7; }
.rowact { white-space: nowrap; }
.rowact button { background: none; border: 0; cursor: pointer; padding: 2px 5px; font-size: 14px; opacity: .65; }
.rowact button:hover { opacity: 1; }
.sql-msg { padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.sql-msg.err { background: var(--danger-soft); color: var(--danger); }
.sql-msg.ok { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px){ .sql-body { grid-template-columns: 1fr; } .sql-side { position: static; max-height: none; } }

/* SQL UI — tree + builders */
.sql-tree { list-style: none; margin: 0; padding: 0; }
.sql-tree .dbrow { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.sql-tree .dbrow:hover { background: var(--surface-2); border-color: var(--line); }
.sql-tree .dbrow.active { color: var(--accent); background: var(--accent-soft); }
.sql-tree .twist { width: 11px; font-size: 11px; color: var(--accent); transition: transform .15s; flex: 0 0 auto; }
.sql-tree .dbrow.open .twist { transform: rotate(90deg); }
.db-ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; opacity: .82; flex: 0 0 auto; }
.dbcount { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 1px 7px; font-family: var(--mono); }
.sql-tree .tbls { list-style: none; margin: 1px 0 4px 16px; padding: 0; border-left: 1px solid var(--line); }
.sql-tree .tbls li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 5px; cursor: pointer; font-size: 12.5px; }
.sql-tree .tbls li:hover { background: var(--accent-soft); }
.sql-tree .tbls li.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.colrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.colrow .input, .colrow select.input { margin-top: 0; }
.sel-bar { display: flex; gap: 8px; align-items: center; background: var(--accent-soft); padding: 6px 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }

.rowact button { color: var(--txt); opacity: .75; }
.rowact button:hover { opacity: 1; color: var(--accent); }

/* ===== SQL desktop grid ===== */
.sgrid { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.sgrid-bar { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.sgrid-scroll { overflow: auto; height: 62vh; position: relative; outline: none; }
.sgrid-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-ring); }
.sgrid-inner { position: relative; }
.sgrid-head { position: sticky; top: 0; z-index: 4; display: flex; height: 36px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sgrid-hcell { position: relative; flex: 0 0 auto; padding: 9px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; box-sizing: border-box; }
.sgrid-hcell.sticky { position: sticky; left: 0; z-index: 5; background: var(--surface); text-align: center; }
.sgrid-htext { cursor: pointer; }
.sgrid-htext:hover { color: var(--accent); }
.sgrid-resize { position: absolute; right: -3px; top: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 6; }
.sgrid-resize:hover { background: var(--accent); opacity: .4; }
.sgrid-rows { position: absolute; left: 0; top: 0; will-change: transform; }
.sgrid-row { display: flex; height: 30px; }
.sgrid-row:hover .sgrid-cell { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.sgrid-cell { user-select: none; flex: 0 0 auto; padding: 6px 8px; font-size: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; cursor: cell; background: var(--surface); }
.sgrid-cell.sticky { position: sticky; left: 0; z-index: 2; text-align: center; color: var(--muted); cursor: default; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.sgrid-cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.sgrid-cell.dirty { background: color-mix(in srgb, #f5c842 22%, var(--surface)); }
.sgrid-cell.loading { color: var(--muted); opacity: .5; }
.sgrid-cell .nullc { color: var(--muted); font-style: italic; opacity: .65; }
.sgrid-cell.gutter .gnum { flex: 1; text-align: left; font-size: 11px; }
.sgrid-cell.gutter .gacts { display: none; gap: 1px; }
.sgrid-row:hover .gutter .gacts { display: inline-flex; }
.sgrid-row:hover .gutter .gnum { display: none; }
.gact { background: none; border: 0; cursor: pointer; padding: 0 3px; font-size: 13px; color: var(--txt); opacity: .7; }
.gact:hover { opacity: 1; color: var(--accent); }
.sgrid-edit { position: absolute; z-index: 10; box-sizing: border-box; border: 2px solid var(--accent); border-radius: 0; padding: 5px 7px; font-size: 13px; font-family: inherit; background: var(--surface); color: var(--txt); outline: none; }

/* SQL autocomplete popup */
.sql-ac { position: absolute; z-index: 1000; min-width: 160px; max-height: 240px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 13px; padding: 4px; }
.sql-ac-item { padding: 5px 9px; border-radius: 5px; cursor: pointer; font-family: var(--mono, monospace); }
.sql-ac-item.on, .sql-ac-item:hover { background: var(--accent-soft); color: var(--accent); }

/* ===== Fairlead branding ===== */
.brand-plate { display: inline-flex; align-items: center; }
.login-logo { max-width: 248px; width: 100%; height: auto; display: block; }
/* On dark themes the navy wordmark needs a light plate to stay legible */
:root[data-theme="dark"] .brand-plate { background: #eef3f8; border-radius: 11px; padding: 7px 12px; box-shadow: var(--shadow-sm); }
.login-brand { justify-content: center; }

/* toolbar field: single-row label+control that lines up with buttons */
.tb-field { display: inline-flex; align-items: center; gap: 7px; }
.tb-lab { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
/* the inline label must not inherit the stacked-form field spacing (margin-top/full width),
   or its select sits lower than sibling inputs on the same toolbar row */
.tb-field > .input, .tb-field > select.input { margin-top: 0; width: auto; display: inline-flex; }
/* the one canonical filter/selector bar (account picker + search), used everywhere */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-bar .tb-field .input { min-width: 180px; }

/* ============================================================
   FAIRLEAD design layer — helm console identity
   ============================================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-image: radial-gradient(820px 440px at 106% -12%, var(--accent-soft), transparent 60%);
  background-attachment: fixed;
}
h1, h2, .form-title, .page-head h1, .eyebrow, .brand-word, .modal-head b, .login-word {
  font-family: var(--display);
}
.content h1 { font-weight: 600; letter-spacing: -.022em; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 600; color: var(--accent); }

/* nicer scrollbars (instrument feel) */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 7px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---- sidebar = hull ---- */
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 13px; }
:root[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0f2740, var(--surface) 42%); }
.brand { gap: 11px; padding: 2px 8px 22px; align-items: center; }
.fl-mark { display: block; }
.brand-icon { width: 32px; height: 32px; flex: 0 0 auto; color: var(--txt); }
.brand-word { font-weight: 600; font-size: 19px; line-height: 1; letter-spacing: -.01em; color: var(--txt); }
.brand-word .sub { color: var(--accent); font-weight: 500; }

.nav-item { border-radius: 9px; gap: 11px; padding: 9px 11px; font-weight: 500; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.nav-icon { background: var(--surface-2); border-radius: 8px; }
.nav-item:hover .nav-icon { color: var(--accent); }
.nav-item.active .nav-icon { background: var(--accent); color: var(--surface); box-shadow: 0 0 14px -3px var(--accent); }
.nav-group-link { font-family: inherit; text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 600; color: var(--txt); }
.nav-group-items .nav-group-link { font-size: 13px; font-weight: 550; }
.nav-group-items { border-left: 1px solid var(--line); }
.nav-group-head.active .nav-icon { background: var(--accent); color: var(--surface); }

/* ---- topbar ---- */
.topbar { padding: 12px 28px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.role-tag { font-family: var(--mono); letter-spacing: .03em; }

/* ---- cards = hull panels with a struck top edge ---- */
.form-card, .card { border-radius: 14px; box-shadow: var(--shadow-sm), inset 0 1px 0 color-mix(in srgb, var(--accent) 13%, transparent); }
:root[data-theme="dark"] .form-card { box-shadow: var(--shadow-sm), inset 0 1px 0 color-mix(in srgb, var(--accent) 18%, transparent); }
.form-title { font-weight: 600; letter-spacing: -.01em; }

/* ---- buttons: one consistent interaction model (lift + shadow + colour shift) ---- */
.btn { border-radius: 9px; font-weight: 500;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease; }
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 7px 18px -7px var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 11px 26px -8px var(--accent); }
.btn.primary:active { transform: translateY(0); box-shadow: 0 4px 12px -6px var(--accent); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover { color: #052019; }

.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 6px 16px -8px var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: #ffcdcd; color: #fff; filter: brightness(.94); transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 11px 24px -8px var(--danger); }
.btn.danger:active { transform: translateY(0); filter: brightness(.88); box-shadow: 0 4px 10px -6px var(--danger); }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { transform: none; box-shadow: none; background: var(--surface-2); }

/* ---- inputs: teal focus ---- */
.input:focus, textarea.input:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }

/* ---- tables = instrument readout ---- */
.tbl thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.tbl tbody tr:hover > td { background: var(--accent-soft); }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }
.pill.on, .pill.connected { background: var(--accent-soft); color: var(--accent); }

/* ---- tabs / segments ---- */
.tab.active, .tabs .active { color: var(--accent); }
.seg button.active { background: var(--accent-soft); color: var(--accent); }

/* ============ LOGIN — the helm at night ============ */
.login-wrap {
  min-height: 100%; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background: radial-gradient(1200px 700px at 50% -20%, #114054 0%, #0a2740 32%, #06182a 100%);
  color: #e6f1f8;
}
.login-aura {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 320px at 50% 14%, rgba(34,206,191,.18), transparent 70%);
  animation: auraDrift 9s ease-in-out infinite alternate;
}
@keyframes auraDrift { from { transform: translateY(-8px) scale(1); } to { transform: translateY(12px) scale(1.06); } }
.login-card {
  position: relative; width: 384px; max-width: 92vw; padding: 34px 32px 30px; border-radius: 20px;
  background: rgba(13,33,55,.74); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 34px 90px -24px rgba(2,12,22,.85), inset 0 1px 0 rgba(255,255,255,.10);
  display: flex; flex-direction: column; gap: 9px;
}
.login-mark { width: 104px; margin: 2px auto 12px; filter: drop-shadow(0 8px 18px rgba(2,12,22,.55)); }
.login-mark .fl-mark { width: 100%; height: auto; color: #e9f1f6; }
.login-mark .fl-cable { stroke-dasharray: 62; stroke-dashoffset: 62; animation: cableDraw 1.5s .3s cubic-bezier(.55,0,.2,1) forwards; }
@keyframes cableDraw { to { stroke-dashoffset: 0; } }
.login-word { font-weight: 600; font-size: 27px; letter-spacing: -.015em; text-align: center; color: #eaf3f8; }
.login-word span { color: var(--accent); }
.login-sub { color: #9fbace; margin: 0 0 16px; text-align: center; font-size: 13px; }
.login-card label { font-size: 12px; color: #9fbace; margin-top: 8px; font-weight: 500; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.login-card input {
  background: rgba(5,18,30,.55); border: 1px solid rgba(255,255,255,.12); color: #eaf3f8;
  border-radius: 10px; padding: 12px 14px; outline: none; transition: .15s; font-size: 14px;
}
.login-card input::placeholder { color: #5f7d93; }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,206,191,.28); background: rgba(5,18,30,.8); }
.login-card .btn.primary { margin-top: 20px; color: #052019; box-shadow: 0 10px 28px -8px rgba(34,206,191,.7); }
.login-error { background: rgba(255,107,107,.14); color: #ff9d9d; border: 1px solid rgba(255,107,107,.4); padding: 9px 12px; border-radius: 10px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .login-aura { animation: none; }
  .login-mark .fl-cable { animation: none; stroke-dashoffset: 0; }
}

/* ===== Fairlead full logo (lockup), theme-swapped ===== */
.brand { padding: 6px 6px 20px; align-items: center; }
.brand-logo { width: 198px; max-width: 100%; max-height: none; height: auto; display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.login-logo { width: 300px; max-width: 86%; height: auto; display: block; margin: 2px auto 16px; animation: loIn .7s cubic-bezier(.2,.7,.2,1) both; }
.login-sub { animation: loIn .7s .09s cubic-bezier(.2,.7,.2,1) both; }
.login-card { animation: cardIn .55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes loIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .login-logo, .login-sub, .login-card { animation: none; } }

/* ===== login polish pass ===== */
.login-wrap { background: radial-gradient(1300px 720px at 50% -22%, #164a60 0%, #0b2a44 30%, #05162a 78%); }
.login-aura { background: radial-gradient(700px 360px at 50% 10%, rgba(34,206,191,.20), transparent 72%); }
.login-card { width: 392px; padding: 36px 34px 30px; border-radius: 22px; background: rgba(13,34,56,.82);
  border: 1px solid rgba(132,172,202,.18); box-shadow: 0 46px 110px -34px rgba(1,9,18,.92), inset 0 1px 0 rgba(255,255,255,.09); }
.login-logo { width: 322px; }
.login-sub { color: #93b1c6; margin: 0 0 20px; letter-spacing: .01em; }
.login-card label { color: #9cbace; letter-spacing: .06em; }
.login-card input { background: rgba(255,255,255,.045); border: 1px solid rgba(152,184,208,.24); }
.login-card input:focus { background: rgba(255,255,255,.08); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,206,191,.3); }
.login-card .btn.primary { margin-top: 22px; padding: 12px; font-weight: 600; }

/* ===== login — light theme (the dark styles above are var-free, so light needs
   explicit overrides; otherwise the theme toggle does nothing on /login) ===== */
:root[data-theme="light"] .login-wrap { background: radial-gradient(1300px 720px at 50% -22%, #d6e8f0 0%, #e9f1f5 38%, #e7eef2 80%); color: var(--txt); }
:root[data-theme="light"] .login-aura { background: radial-gradient(700px 360px at 50% 10%, rgba(12,154,160,.16), transparent 72%); }
:root[data-theme="light"] .login-card { background: rgba(255,255,255,.92); border-color: var(--line);
  box-shadow: 0 30px 70px -28px rgba(10,34,54,.28), inset 0 1px 0 rgba(255,255,255,.7); }
:root[data-theme="light"] .login-word { color: var(--txt); }
:root[data-theme="light"] .login-sub { color: var(--muted); }
:root[data-theme="light"] .login-card label { color: var(--muted); }
:root[data-theme="light"] .login-card input { background: #fff; border-color: var(--line); color: var(--txt); }
:root[data-theme="light"] .login-card input::placeholder { color: #98aebd; }
:root[data-theme="light"] .login-card input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
:root[data-theme="light"] .login-card .btn.primary { color: #fff; }
:root[data-theme="light"] .login-error { background: var(--danger-soft); color: var(--danger); border-color: #f7caca; }

/* login logo: theme-swapped (two-class selectors beat plain .login-logo) */
.login-logo.logo-dark { display: none; }
:root[data-theme="dark"] .login-logo.logo-light { display: none; }
:root[data-theme="dark"] .login-logo.logo-dark { display: block; }

/* section divider inside a card (e.g. Apache handlers: CGI vs ITK) */
.pane-div { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

.grid-form label.span-2 { grid-column: 1 / -1; }

/* Forms whose first field is a composite address (local@domain): widen that column so the domain
   select has room, keep the others proportional. Collapses to one column on narrow viewports. */
.grid-form.addr-form { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.3fr) minmax(0, 0.9fr); }
@media (max-width: 560px) { .grid-form.addr-form { grid-template-columns: 1fr; } }

/* reveal: distinct, clearly-clickable collapsible sections */
.reveal { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--surface); overflow: hidden; }
.reveal > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 13px; color: var(--txt);
  list-style: none; display: flex; align-items: center; gap: 9px; user-select: none; transition: background .12s; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::before { content: "▸"; color: var(--accent); font-size: 11px; transition: transform .15s; }
.reveal[open] > summary::before { transform: rotate(90deg); }
.reveal > summary:hover { background: var(--surface-2); }
.reveal[open] > summary { border-bottom: 1px solid var(--line); }
.reveal > form, .reveal > .reveal-body { padding: 14px; }
.reveal > p { padding: 0 14px; } /* direct-child intros (e.g. LE block) align with the padded form, not the border */

/* SQL UI boot loader (avoids flashing the default view on refresh) */
.sql-booting { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--muted); font-size: 14px; }
.sql-booting .spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* inline spinner for action buttons + live "updating" states (no page refresh) */
.spin-inline { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; opacity: .9; }
.btn.loading { opacity: .8; pointer-events: none; }
/* when a button shows only the spinner (no label), centre it — no right margin, no overflow */
.btn.loading .spin-inline { margin: 0; }
.pill.updating { animation: blink 1.1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* ===== file manager: Explorer-style directory tree ===== */
.fm-layout { display: grid; grid-template-columns: 234px 1fr; gap: 14px; align-items: start; }
.fm-tree { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; max-height: 64vh; overflow: auto; }
.fm-tnode { display: flex; align-items: center; gap: 5px; padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: 13px; white-space: nowrap; color: var(--txt); }
.fm-tnode:hover { background: var(--surface); }
.fm-tnode.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.fm-tnode.dropok { outline: 2px dashed var(--accent); outline-offset: -2px; }
.fm-twist { width: 12px; font-size: 10px; color: var(--accent); transition: transform .12s; flex: 0 0 auto; text-align: center; }
.fm-twist.open { transform: rotate(90deg); }
.fm-tfo { font-size: 13px; flex: 0 0 auto; }
.fm-tname { overflow: hidden; text-overflow: ellipsis; }
.fm-right { min-width: 0; }
@media (max-width: 860px){ .fm-layout { grid-template-columns: 1fr; } .fm-tree { max-height: 200px; } }

/* simple readable bulleted list for descriptive copy */
.plain-list { margin: 6px 0 0; padding-left: 18px; color: var(--txt-2); line-height: 1.7; max-width: 760px; }
.plain-list li { margin: 2px 0; }
.plain-list b { color: var(--txt); }

/* checkbox rows (e.g. DNS listen IPs) */
.check-row { display: flex; align-items: center; gap: 9px; padding: 7px 2px; font-size: 14px; }
.check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.check-row.sm { font-size: 12.5px; color: var(--muted); padding: 4px 2px; }
.check-row.sm input[type=checkbox] { width: 14px; height: 14px; }

/* restore dry-run plan (read-only preview) */
.plan-list { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.plan-step { display: flex; gap: 10px; align-items: baseline; padding: 9px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.plan-step:last-child { border-bottom: 0; }
.plan-mark { flex: 0 0 auto; width: 16px; text-align: center; font-weight: 700; color: var(--accent); }
.plan-step.warn .plan-mark { color: var(--warn); }
.plan-step.skip { opacity: .62; }
.plan-step.skip .plan-mark { color: var(--muted); }
.plan-step.sub { padding-left: 42px; font-size: 12.5px; }
.plan-body { min-width: 0; }
.plan-label { font-weight: 500; }
.plan-detail { color: var(--muted); }

/* granular restore: per-item selectable tree */
.pick-tree { border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 12px 12px; }
.pick-tree .eyebrow { margin: 12px 0 4px; }
.pick-tree > .eyebrow:first-child { margin-top: 4px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px;
  border-bottom: 1px solid var(--line-2); font-size: 13.5px; cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.pick-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.pick-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-meta { font-size: 11.5px; color: var(--muted); }
.pick-tag { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; flex: 0 0 auto; }
.pick-row.locked { opacity: .6; cursor: not-allowed; }
.pick-sub { margin: 0 0 4px 26px; padding-left: 10px; border-left: 2px solid var(--line-2); }

/* inset sub-card for a grouped form within a card (e.g. DNS remote switch) */
.subcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); max-width: 820px; }

/* DNS zone record editor (WYSIWYG) */
.input.sm { padding: 6px 9px; font-size: 13px; width: 100%; }
.rec-edit td { padding: 5px 8px; vertical-align: middle; }
.rec-edit th { padding: 6px 8px; }
.rec-name { display: flex; align-items: center; gap: 2px; min-width: 0; }
.rec-name .input { flex: 1 1 auto; min-width: 60px; }
.rec-suffix { color: var(--muted); font-size: 12px; white-space: nowrap; max-width: 50%; overflow: hidden; text-overflow: ellipsis; }

/* user editor — plan overrides table */
.ov-table th, .ov-table td { padding: 7px 10px; vertical-align: middle; }
.ov-table .ov-sec td { padding-top: 16px; border-bottom: 1px solid var(--line); }
.ov-table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.ov-table .input.sm { max-width: 140px; padding: 5px 8px; }
.ov-table th:last-child, .ov-table td:last-child { text-align: right; }
.ov-table td:first-child { text-align: center; }
.ip-pick { display:inline-flex; align-items:center; gap:5px; margin:0 14px 4px 0; font-size:13px; white-space:nowrap; }
.ip-pick input[type=checkbox] { width:15px; height:15px; }
.ta-center { text-align: center; }

/* ============================================================================
   Utility layer — moved out of per-page inline styles (smaller HTML, cached CSS,
   one source of truth for spacing). Spacing is snapped to a small scale.
   ============================================================================ */
.mt-0{margin-top:0}.mt-2{margin-top:2px}.mt-4{margin-top:4px}.mt-6{margin-top:6px}
.mt-8{margin-top:8px}.mt-10{margin-top:10px}.mt-12{margin-top:12px}.mt-14{margin-top:14px}
.mt-16{margin-top:16px}.mt-18{margin-top:18px}
.mb-0{margin-bottom:0}.mb-4{margin-bottom:4px}.mb-6{margin-bottom:6px}.mb-8{margin-bottom:8px}
.mb-10{margin-bottom:10px}.mb-12{margin-bottom:12px}.mb-14{margin-bottom:14px}.mb-16{margin-bottom:16px}
.m-0{margin:0}
.w-full{width:100%}
.w-130{width:130px}
.w-220{width:220px}
.flex-1{flex:1}
.spacer{flex:1 1 auto}
.d-block{display:block}
/* a full-width label whose hint + field must stack (outside .grid-form, where labels are flex-column) */
.lbl-stack{display:flex;flex-direction:column;gap:6px}
.lbl-stack>.input{margin-top:0}
/* search bar: input grows, button matches its exact height (stretch) so nothing hangs low */
.log-search{display:flex;align-items:center;gap:10px}
.log-search .input,.log-search .btn{height:40px}
.log-search .input{flex:1 1 auto;min-width:0}
/* .btn.primary carries margin-top:18px for standalone form submits — zero it so it can't drop the row */
.log-search .btn{flex:0 0 auto;margin:0}
/* combined HH:MM time entry inside a form label */
.hm-row{display:flex;align-items:center;gap:8px}
.hm-row .input{width:80px;flex:0 0 auto}
.hm-sep{color:var(--muted);font-weight:600}
.nowrap{white-space:nowrap}

/* Status pill with a stable box so ok/error/running text swaps never reflow a table row. */
.pill.status{display:inline-block;min-width:42px;text-align:center}

/* Scalable account picker: search + chips + a scrollable checkbox list (handles hundreds). */
.acct-picker{border:1px solid var(--line-2);border-radius:10px;padding:12px}
.acct-picker .acct-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.acct-chips{display:flex;flex-wrap:wrap;gap:6px}
.acct-chip{display:inline-flex;align-items:center;gap:6px;background:var(--accent-soft);color:var(--fg);border-radius:999px;padding:3px 6px 3px 10px;font-size:12px;line-height:1.6}
.acct-chip button{border:0;background:none;cursor:pointer;color:var(--muted);font-size:15px;line-height:1;padding:0}
.acct-chip button:hover{color:var(--fg)}
.acct-list{max-height:232px;overflow-y:auto;margin-top:10px;border:1px solid var(--line-2);border-radius:8px}
.acct-list .acct-row{display:flex;align-items:center;gap:10px;padding:7px 12px;border-bottom:1px solid var(--line-2);font-size:13px;cursor:pointer}
.acct-list .acct-row:last-child{border-bottom:none}
.acct-list .acct-row:hover{background:var(--accent-soft)}
.acct-empty{padding:14px 12px;color:var(--muted);font-size:13px}
/* numbered one-time cloud setup steps */
.steps-list{margin:2px 0 12px;padding-left:22px;font-size:13px;line-height:1.65;color:var(--fg)}
.steps-list li{margin-bottom:5px}
/* fixed table layout: column widths are honoured exactly, so no cell content can ever reflow the grid */
.tbl.fixed{table-layout:fixed}
.tbl.fixed td{vertical-align:middle}
/* SYSTEMIC FIX: .btn.primary carries margin-top:18px (for standalone form submits). Inside any table
   row or action cluster that margin drops the primary button below its flat siblings. Neutralise it
   everywhere buttons sit in a row, so this whole class of misalignment can't recur panel-wide. */
.tbl td .btn,.row-actions .btn,.row-actions .btn.primary,.acct-summary .btn,.tbl-actions .btn,.tbl-actions form,.filter-bar .btn,.log-search .btn{margin:0}
/* row action buttons: a flex cluster, vertically centred and right-aligned, evenly spaced */
.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.row-actions form{display:inline-flex;margin:0}
.inline-flex{display:inline-flex;margin:0}
/* uniform action-button widths so a row of buttons lines up neatly */
.row-actions .btn,.row-actions form>.btn{min-width:76px;justify-content:center;text-align:center}
/* backup-tasks table: fixed widths + ellipsis → never overlaps, never reflows, always fits */
.tasks-tbl th:nth-child(1),.tasks-tbl td:nth-child(1){width:21%}
.tasks-tbl th:nth-child(2),.tasks-tbl td:nth-child(2){width:10%}
.tasks-tbl th:nth-child(3),.tasks-tbl td:nth-child(3){width:16%}
.tasks-tbl th:nth-child(4),.tasks-tbl td:nth-child(4){width:11%}
.tasks-tbl th:nth-child(5),.tasks-tbl td:nth-child(5){width:19%}
.tasks-tbl th:nth-child(6),.tasks-tbl td:nth-child(6){width:23%}
/* explicit column counts so a form never ragged-wraps (auto-fit reflows unpredictably) */
.grid-form.cols-1{grid-template-columns:1fr}
.grid-form.cols-2{grid-template-columns:1fr 1fr}
/* inline time fields (hour:minute / day) that stay a fixed size and don't stretch */
.time-row{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.time-row label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);font-weight:500}
.time-row .input{width:82px}
.time-row .input.freq{width:150px}
.time-row .sep{padding-bottom:9px;color:var(--muted)}
.spread{justify-content:space-between}
.d-inline{display:inline}
.fs-12{font-size:12px}
.mw-240{min-width:240px}
.nowrap{white-space:nowrap}
/* a form-hint that leads a section (sits just under a title/eyebrow) */
.lead-hint{margin:2px 0 12px}
/* a centered, readable-width content column */
.narrow{max-width:680px;margin:0}
.no-underline{text-decoration:none}
.cursor-default{cursor:default}
.fs-11{font-size:11px}
.fw-400{font-weight:400}
.text-danger{color:var(--danger)}
.mw-0{min-width:0}
.tight-hint{margin:-4px 0 10px}
.float-action{float:right;cursor:pointer}
/* usage thresholds in the Users table (disk/traffic used-of-allowed) */
td.near { color: var(--warn); }
td.over { color: var(--danger); font-weight: 600; }

/* ---- Statistics ---- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 0 0 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card.accent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-ring); }
.stat-card .sc-num { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat-card.accent .sc-num { color: var(--accent); }
.stat-card .sc-lab { font-size: 12px; color: var(--muted); margin-top: 4px; }
.chart { width: 100%; min-height: 250px; }
/* uPlot: plot + legend size themselves inside the card (no clip / border overlap) */
.u-legend { padding: 8px 2px 0; font-size: 12px; }
.u-legend .u-marker { width: 10px; height: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.stat-grid .form-card { margin: 0; }
.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 74%; }
.stat-row > b { white-space: nowrap; flex: 0 0 auto; }

/* horizontal histogram rows (message sizes) */
.mbar-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center;
  padding: 5px 0; font-size: 12.5px; }
.mbar-lab { color: var(--muted); font: 500 11.5px/1 var(--mono); }
.mbar { height: 8px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.mbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; }

/* ---- Dashboard instrument panel: gauges, leaderboards, top-lists, service tiles ---- */
/* Vitals: a fixed grid of identical gauge tiles (reusing .sys-stat), so the console never
   reflows. Metered tiles (memory/disk) and count tiles share one min-height. */
.gauge-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
@media (max-width: 900px){ .gauge-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.gauge-grid .sys-stat { min-height: 108px; }
.gauge-sub { font-size: 12px; color: var(--muted); margin-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Top-accounts leaderboard: readable name | weight bar | value. */
.lb-row { display: grid; grid-template-columns: minmax(90px,160px) 1fr auto; gap: 14px; align-items: center;
  padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.lb-row:last-child { border-bottom: 0; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { height: 8px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.lb-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; transition: width .4s ease; }
.lb-val { font: 600 12.5px/1 var(--mono); color: var(--txt); white-space: nowrap; }
/* Fixed 2×2 grid of top-N cards (no reflow); own bottom margin so the next section breathes. */
.top-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin: 0 0 18px; }
@media (max-width: 760px){ .top-grid { grid-template-columns: 1fr; } }
.top-grid .form-card { margin: 0; }
/* Top-accounts header: title + segment on one line, then a caption line that clearly
   separates the switcher from the ranked bars below. */
.lb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lb-cap { font-size: 12.5px; color: var(--muted); margin: 13px 0 10px; }
.lb-cap b { color: var(--txt); font-weight: 600; }
.lb-list { margin-top: 2px; }
/* Dense status chips — the whole service fleet in one or two rows; down services sort first
   and turn red so a fault is obvious at a glance. */
.svc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.svc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 10px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.svc-chip .svc-lamp { width: 8px; height: 8px; margin: 0; flex: 0 0 auto; }
.svc-chip.err { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
/* Anomaly tones: a vital gauge turns amber/red when it crosses into trouble. */
.sys-val.warn { color: #f59e0b; }
.sys-val.danger { color: var(--danger); }
.meter-fill.warn { background: #f59e0b; }
.meter-fill.danger { background: var(--danger); }
.txt-ok { color: var(--accent); }
.txt-danger { color: var(--danger); font-weight: 600; }
/* 24-column hour-of-day chart */
.hbars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; align-items: end;
  height: 120px; padding-top: 8px; }
.hbar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.hbar-fill { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px;
  opacity: .85; transition: height .2s; }
.hbar:hover .hbar-fill { opacity: 1; }
.hbar-x { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  font: 500 10px/1 var(--mono); color: var(--muted); }

/* on-demand scan cards + progress bar */
.scan-card { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 13px 15px; margin-bottom: 12px; }
.scan-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 10px; }
.scan-head .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.prog { height: 9px; background: var(--line-2); border-radius: 5px; overflow: hidden; position: relative; }
.prog-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width .3s ease; min-width: 3px; }
/* counting phase: total unknown → animated indeterminate sweep */
.prog.indet .prog-fill { position: absolute; width: 32%; min-width: 0; transition: none; animation: prog-indet 1.1s ease-in-out infinite; }
@keyframes prog-indet { 0% { left: -34%; } 100% { left: 100%; } }
.scan-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 12px; color: var(--muted); }
.scan-result { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.scan-acts { display: inline-flex; align-items: center; gap: 8px; }
.btn.xs { padding: 2px 9px; font-size: 11.5px; line-height: 1.7; }
/* raw clamd log viewer */
.rawlog { font: 12px/1.55 var(--mono); background: var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; max-height: 52vh; overflow: auto; white-space: pre; }
.rawlog > div { white-space: pre-wrap; word-break: break-all; }
.rawlog .ln-found { color: var(--danger); font-weight: 600; }
.rawlog .ln-err { color: var(--warn); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lnk { color: var(--accent); text-decoration: none; }
.lnk:hover { text-decoration: underline; }
/* segmented range control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); color: var(--muted); padding: 6px 14px; font-size: 13px;
  cursor: pointer; border-right: 1px solid var(--line); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--accent); color: #fff; }
.seg-btn:hover:not(.on) { background: var(--accent-soft); color: var(--accent); }

/* ---- Statistics: time-range picker (Grafana-style) ---- */
.range-pick { position: relative; }
.range-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; line-height: 1; cursor: pointer; color: var(--txt, inherit); box-shadow: var(--shadow-sm); }
.range-btn:hover { border-color: var(--accent); }
.range-btn .rp-ico { opacity: .7; }
.range-btn .rp-gran { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.range-btn .rp-caret { color: var(--muted); font-size: 11px; }
.range-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; display: flex; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md, 0 12px 34px rgba(0,0,0,.18));
  min-width: 460px; overflow: hidden; }
.rm-col { padding: 14px 16px; min-width: 190px; }
.rm-col.rm-custom { border-left: 1px solid var(--line); flex: 1; }
.rm-h { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.rm-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px;
  padding: 6px 8px; font-size: 13px; cursor: pointer; color: inherit; }
.rm-item:hover { background: var(--accent-soft); color: var(--accent); }
.rm-rel { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rm-n { width: 60px; }
.rm-abs { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.rm-abs .input { display: block; width: 100%; margin-top: 3px; }

/* ---- Statistics: world map + clickable panels ---- */
.geo-wrap { display: grid; grid-template-columns: 1fr 220px; gap: 18px; align-items: start; }
.geo-map { height: 360px; min-width: 0; }
.geo-list { max-height: 360px; overflow: auto; }
.form-card.clickable { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.form-card.clickable:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-ring); }
.form-sub .drill { float: right; font-size: 12px; font-weight: 500; color: var(--accent); }
.drill-list { margin-top: 10px; max-height: 160px; overflow: auto; }
@media (max-width: 720px) { .geo-wrap { grid-template-columns: 1fr; } .range-menu { min-width: 300px; flex-direction: column; } .rm-col.rm-custom { border-left: 0; border-top: 1px solid var(--line); } }

/* ---- Statistics: country map modal + wide modal ---- */
.modal-card.size-xl { width: min(1000px, 97%); }
.geo-map-modal { height: 440px; width: 100%; }
.geo-modal-list { margin-top: 14px; columns: 3; column-gap: 22px; }
.geo-modal-list .stat-row { break-inside: avoid; }
@media (max-width: 640px) { .geo-modal-list { columns: 1; } .geo-map-modal { height: 300px; } }

/* svgMap tooltip must sit above the modal (its own z-index is 2; modal is 100) */
.svgMap-tooltip { z-index: 300 !important; }
.map-wrap { position: relative; }
.map-loading { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 13px; color: var(--muted); background: var(--surface); border-radius: var(--radius-sm); }

/* Statistics header: force the All-sites button and the range picker to equal height */
.stats-toolbar .btn, .stats-toolbar .range-btn { height: 36px; box-sizing: border-box; margin-top: 0; }

/* WebShell terminal (Files → Shell) — height is sized to fill the viewport in JS (doFit). */
.webshell { min-height: 240px; background: #0b1020; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 6px 6px 10px; overflow: hidden; }
.webshell .xterm, .webshell .xterm-viewport, .webshell .xterm-screen { height: 100% !important; }

/* ============================================================================
   Form-audit normalization (2026-07-20): unified content widths + semantic
   classes that replace scattered per-page inline styles. See the width tokens
   above (.grid-form/.facts/.form-hint). Do NOT reintroduce inline max-width/
   width/margin — use these utilities.
   ============================================================================ */
:root { --form-w: 880px; --hint-w: 640px; }
.hint-wide { max-width: none; }              /* explanatory hint that spans its container */
.ta-left { text-align: left; }
.is-hidden { visibility: hidden; }           /* server-side hide that keeps the layout box */
.fw-650 { font-weight: 650; }
.text-accent { color: var(--accent); }
.mt-24 { margin-top: 24px; }
.mb-2 { margin-bottom: 2px; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.scroll-box { max-height: 9rem; overflow: auto; }   /* short scrollable list */
/* narrow numeric / select controls (ports, priorities, TTL) — one small width scale */
.w-field-xs { width: 80px; min-width: 0; }
.w-field-sm { width: 120px; min-width: 0; }
.w-field-md { width: 160px; min-width: 0; }
.w-field-lg { width: 240px; min-width: 0; }
.input.search { max-width: 260px; }          /* table search box */
/* callout variants — reuse the .note base (accent-soft) */
.note.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--txt); }
.note.danger b, .note.danger a { color: var(--danger); }
.form-card.danger { border-color: var(--danger); }
.form-card.accent { border-color: var(--accent); }
/* taller code editors (kept alongside .code-area.sm/md/xs) */
.code-area.lg { min-height: 320px; }
.code-area.tall { min-height: 52vh; }
/* grid-form alignment / column modifiers */
.grid-form.cols-wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
/* highlighted table row (e.g. the default/"all" row) */
tr.row-accent > td { background: var(--accent-soft); }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.code-area.xl { min-height: 360px; }
/* controls joined into one pill (e.g. local-part input + @ + domain select) */
.joined { display: flex; align-items: stretch; }
.joined > .input { flex: 1 1 0; min-width: 0; }
.joined > select.input { flex: 2 1 0; }
.joined > .pfx { display: flex; align-items: center; padding: 0 10px; background: var(--accent-soft);
  border: 1px solid var(--line); border-left: 0; border-right: 0; font-family: var(--mono);
  font-size: 13px; color: var(--muted); white-space: nowrap; }
/* zero the internal corners so the row reads as one continuous pill */
.joined > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.joined > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
label > .joined { margin-top: 6px; }
/* DNS record editor rows (moved out of an inline <style> block in domain_edit.html) */
.rec-fields { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rec-fields .input { flex: 1 1 120px; min-width: 0; }
tr.row-bad td { background: var(--danger-soft); }
.rec-err { color: var(--danger); font-size: 11px; margin-top: 3px; }
.rec-note { color: var(--muted); font-size: 11px; margin-top: 3px; }

/* --- audit consolidation: gap-filling utilities (2026-07-20) --- */
.pt-16 { padding-top: 16px; }
.mr-4 { margin-right: 4px; }
.px-8 { padding: 0 8px; }
.col-span-all { grid-column: 1 / -1; }
.cursor-pointer { cursor: pointer; }
.text-warn { color: var(--warn); }
.break-anywhere { overflow-wrap: anywhere; }
.sel-all { white-space: pre-wrap; user-select: all; }
.flex-2 { flex: 2; }
.field-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
/* min-width control sizers (siblings of .mw-240, which is ALSO min-width) */
.mw-160 { min-width: 160px; } .mw-300 { min-width: 300px; } .mw-340 { min-width: 340px; }
/* a card whose children lay out as a centered, wrapping flex row (e.g. cert auto-renew banner) */
.card-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
/* table column widths — a fixed scale so column sizing lives in CSS, never inline */
.cw-40{width:40px}.cw-72{width:72px}.cw-88{width:88px}.cw-90{width:90px}.cw-100{width:100px}
.cw-108{width:108px}.cw-110{width:110px}.cw-120{width:120px}.cw-150{width:150px}.cw-160{width:160px}
.cw-170{width:170px}.cw-20p{width:20%}
/* truncating cells cap their width so .ellip can ellipsize */
.clip-md{max-width:320px}.clip-lg{max-width:360px}
/* SQL console dividers + suggestion items (extracted from inline) */
.sql-div{margin-top:6px;border-top:1px solid var(--line);padding-top:6px}
.sql-div.top{margin-top:16px;padding-top:12px}
.sql-suggest{cursor:pointer;padding:2px 0}
/* SQL console bespoke layout (extracted from inline styles) */
.sql-grow { flex: 1; min-width: 160px; }
.sql-lbl { width: 160px; }
.sql-op { max-width: 90px; }
.sql-colname { width: 130px; }
.sql-empty { padding: 20px; }
.sql-compose { flex: 1; min-height: 70px; }
.sql-empty-item { padding: 6px; list-style: none; }
.modal-body.sql-scroll { max-height: 64vh; }
.modal-body.sql-scroll-lg { max-height: 66vh; }
.sql-side.static { position: static; }
.sql-body.pin { grid-template-columns: 1fr 200px; }

/* ── First-run setup wizard ─────────────────────────────────────────────────
   A focused, chrome-less flow in the Fairlead identity. Teal is the only accent
   (never brass); tokens flip with the theme automatically. */
/* Fixed full-viewport scroller so the page body never scrolls (no body scrollbar),
   and the wrap's own scrollbar is hidden — the card can't shift horizontally between
   steps of different heights. Still scrollable when a tall step overflows. */
.setup-wrap { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 40px; }
.setup-wrap::-webkit-scrollbar { width: 0; height: 0; display: none; }
.setup-card { position: relative; z-index: 1; width: 100%; max-width: 620px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 18px 50px -22px rgba(6,20,34,.5)); padding: 26px 30px 20px;
  display: flex; flex-direction: column; }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line-2); }
.setup-logo { height: 30px; width: auto; }
.setup-rail { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.setup-tick { width: 22px; height: 4px; border-radius: 3px; background: var(--line);
  transition: background .25s, box-shadow .25s; }
.setup-tick.done { background: var(--accent); opacity: .55; }
.setup-tick.on { background: var(--accent); box-shadow: var(--glow); opacity: 1; }

.setup-body { min-height: 260px; }
.setup-eyebrow { font: 600 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px; }
.setup-title { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em;
  line-height: 1.12; margin: 0 0 8px; color: var(--txt); }
.setup-lead { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 20px; max-width: 46ch; }
.setup-hint { color: var(--muted); font-size: 12px; font-weight: 400; }

.setup-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); text-transform: uppercase; margin: 16px 0 7px; }
.setup-input { width: 100%; background: var(--surface); border: 1px solid var(--line);
  color: var(--txt); border-radius: var(--radius-sm, 9px); padding: 10px 12px; font-size: 14px;
  font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.setup-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.setup-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }

/* radio "rig" — a compact selectable list */
.setup-rig { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.setup-rig-opt { display: flex; align-items: center; gap: 11px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm, 9px); padding: 11px 13px;
  transition: border-color .15s, background .15s, box-shadow .15s; }
.setup-rig-opt:hover { border-color: var(--accent-ring); }
.setup-rig-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.setup-rig-opt input { position: absolute; opacity: 0; pointer-events: none; }
.setup-rig-dot { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); transition: border-color .15s; position: relative; }
.setup-rig-opt.on .setup-rig-dot { border-color: var(--accent); }
.setup-rig-opt.on .setup-rig-dot::after { content: ""; position: absolute; inset: 2.5px;
  border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
.setup-rig-txt { font-size: 13.5px; color: var(--txt); }

/* toggle switch */
.setup-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 16px;
  font-size: 13.5px; color: var(--txt); }
.setup-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.setup-switch { flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: var(--line);
  position: relative; transition: background .18s; }
.setup-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .18s; }
.setup-toggle input:checked + .setup-switch { background: var(--accent); box-shadow: var(--glow); }
.setup-toggle input:checked + .setup-switch::after { transform: translateX(16px); }

/* instrument plate — spec rows */
.setup-plate { border: 1px solid var(--line); border-radius: var(--radius-sm, 9px); overflow: hidden; }
.setup-plate-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: baseline;
  padding: 11px 14px; }
.setup-plate-row + .setup-plate-row { border-top: 1px solid var(--line-2); }
.setup-plate-row span { font-size: 12px; color: var(--muted); }
.setup-plate-row b { font: 500 13px/1.3 var(--mono); color: var(--txt); text-align: right; }

.setup-foot { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line-2); }
.setup-foot .btn { margin-top: 0; } /* .btn.primary bakes in margin-top:18px → drops it below Back in the flex row */
.setup-req { font: 600 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--danger, #d9534f); margin-left: 6px; }
.setup-input-err { border-color: var(--danger, #d9534f) !important; }
.setup-err { color: var(--danger, #d9534f); font-size: 13px; margin: 6px 0 0; }
.setup-spacer { flex: 1; }
.setup-count { font: 500 11px/1 var(--mono); color: var(--muted); letter-spacing: .05em; }

@media (max-width: 520px) { .setup-grid2 { grid-template-columns: 1fr; } .setup-card { padding: 22px; } }

/* ── Setup wizard: IP list, own-cert, progress ──────────────────────────────── */
.setup-iplist { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.setup-ip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm, 9px); padding: 9px 12px; transition: opacity .15s; }
.setup-ip-row.off { opacity: .5; }
.setup-ip-use, .setup-ip-shared { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--txt); }
.setup-ip-use b { font: 500 13.5px/1 var(--mono); }
.setup-ip-shared { font-size: 12px; color: var(--muted); }
.setup-ip-shared.dim { opacity: .5; }
.setup-ip-tag { font: 600 9.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent-ring); border-radius: 5px; padding: 3px 6px; margin-left: 2px; }
/* custom checkbox box */
.setup-ip-use input, .setup-ip-shared input { position: absolute; opacity: 0; pointer-events: none; }
.setup-check { flex: 0 0 auto; width: 17px; height: 17px; border-radius: 5px; border: 2px solid var(--line);
  background: var(--surface); position: relative; transition: border-color .15s, background .15s; }
.setup-check.sm { width: 15px; height: 15px; border-radius: 4px; }
input:checked + .setup-check { border-color: var(--accent); background: var(--accent); }
input:checked + .setup-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.setup-check.sm.sm { }
input:checked + .setup-check.sm::after { left: 3px; top: 1px; }
input:disabled + .setup-check { opacity: .4; }
.setup-ipadd { display: flex; gap: 8px; margin-top: 8px; }
.setup-ipadd .setup-input { flex: 1; }
select.setup-input { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.setup-ta { font: 12px/1.4 var(--mono); resize: vertical; min-height: 60px; white-space: pre; overflow-x: auto; }

/* progress */
.setup-bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin: 8px 0 6px; }
.setup-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  box-shadow: var(--glow); transition: width .5s ease; }
.setup-bar-fill.done { background: var(--accent); }
.setup-bar-fill.bad { background: var(--danger, #d9534f); box-shadow: none; }
.setup-bar-pct { text-align: right; font: 600 11px/1 var(--mono); color: var(--muted); margin-bottom: 16px; }
.setup-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.setup-events li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--txt); }
.setup-events li.cur { color: var(--accent); }
.setup-events li.bad { color: var(--danger, #d9534f); align-items: flex-start; }
.setup-ev-mark { flex: 0 0 auto; width: 18px; text-align: center; color: var(--accent); font-weight: 700; }
.setup-events li.bad .setup-ev-mark { color: var(--danger, #d9534f); }
.setup-events li.cur .setup-ev-mark { animation: setupspin 1.1s linear infinite; display: inline-block; }
.setup-ev-reason { color: var(--danger, #d9534f); opacity: .85; }
@keyframes setupspin { to { transform: rotate(360deg); } }
.setup-showraw { margin-top: 16px; background: none; border: none; color: var(--muted); font-size: 12px;
  text-decoration: underline; cursor: pointer; padding: 0; }
.setup-rawlog { margin-top: 10px; max-height: 220px; overflow: auto; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm, 9px); padding: 10px 12px; font: 11.5px/1.5 var(--mono); color: var(--muted); white-space: pre-wrap; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* Network page — interface meta line (MAC / MTU) */
.net-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 4px 0 6px;
  font-size: 13px; }
.net-meta-k { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.net-meta b { margin-right: 8px; color: var(--txt); }

/* Network — collapsible interface cards + Configure modal sections */
.iface-card { border: 1px solid var(--line); border-radius: var(--radius-sm, 9px); margin-bottom: 10px; overflow: hidden; }
.iface-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; }
.iface-head:hover { background: var(--line-2); }
.iface-toggle { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; width: 14px;
  transition: transform .15s; }
.iface-toggle.open { transform: rotate(90deg); }
.iface-sum { font-size: 12.5px; }
.iface-body { padding: 4px 14px 14px; border-top: 1px solid var(--line-2); }
.cfg-sec { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin: 18px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.cfg-sec:first-of-type { margin-top: 4px; }
.iface-acts { display: flex; align-items: center; gap: 6px; }
.iface-acts .btn { margin: 0; }

/* ── Administration → System → SSH ─────────────────────────────────────────── */
.note.ok   { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.note.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.eyebrow.warn { color: var(--warn); }
.tag-warn { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); border-radius: 5px; padding: 1px 5px; vertical-align: middle; }

/* connection/mode plate */
.ssh-status { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.ssh-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ssh-stat-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ssh-stat-v { font-size: 14px; font-weight: 600; }

/* advisory preset cards */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.preset-card { text-align: left; display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; cursor: pointer;
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); transition: .12s; font: inherit; }
.preset-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.preset-title { font-weight: 700; font-size: 14px; }
.preset-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* directive rows — two columns: info on the left, control + recommendation on the right,
   so the recommendation sits WITH its control instead of floating to the page edge. */
.ssh-rows { display: flex; flex-direction: column; }
.ssh-row { display: grid; grid-template-columns: 1fr minmax(230px, 300px); gap: 6px 28px; align-items: start;
  padding: 15px 0; border-top: 1px solid var(--line-2); }
.ssh-row:first-child { border-top: 0; }
.ssh-row-info { min-width: 0; }
.ssh-row-label { font-weight: 600; font-size: 14px; }
.ssh-row-explain { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.45; max-width: 62ch; }
.ssh-row-ctl { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ssh-row-ctl > .input { width: 100%; }

/* recommendation, attached under its control */
.rec-line { font-size: 12px; line-height: 1.3; min-height: 15px; }
.rec-ok { color: var(--accent); font-weight: 600; }
.rec-hint { color: var(--muted); }
.rec-hint b { color: var(--ink); font-weight: 600; }
.rec-use { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer;
  padding: 0; margin-left: 8px; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.rec-use:hover { text-decoration: none; }
@media (max-width: 720px) { .ssh-row { grid-template-columns: 1fr; gap: 9px; } }

/* int + unit */
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit .input { width: 110px; flex: 0 0 auto; }
.input-unit .unit { color: var(--muted); font-size: 13px; }

/* pending confirm / auto-revert */
.revert-card { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.revert-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.lead-col { display: flex; flex-direction: column; gap: 8px; justify-content: center; }

.codeblock { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-2);
  font-family: ui-monospace, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre; overflow-x: auto; }

.setup-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px){ .setup-duo { grid-template-columns: 1fr; } }
