/* xjoins mock hub.
   No external fonts, CDN or framework (S-6, CLAUDE.md): system fonts only, one stylesheet, no inline styles
   (CSP style-src 'self', S-32).
   The look is a test bench: a graphite bar with a strip of test tape, a port panel at the top of the Reference
   page, and quiet hairline structure everywhere else. */

:root {
  color-scheme: light;
  --ground: #edf0ee;
  --panel: #ffffff;
  --sunk: #f4f6f5;
  --ink: #172026;
  --ink-2: #4f5a63;
  --line: #d6ddd9;
  --line-strong: #b5bfba;
  --signal: #0b7268;
  --signal-hover: #085a52;
  --signal-ink: #ffffff;
  --signal-soft: #ddefec;
  --tape: #f2c230;
  --graphite: #1e2328;
  --graphite-2: #2a3036;
  --graphite-line: #3c454c;
  --graphite-ink: #e8ecea;
  --graphite-ink-2: #a9b3ae;
  --ok: #1b7743;
  --ok-soft: #dff1e6;
  --bad: #b3261e;
  --bad-soft: #fbe5e2;
  --warn: #7a5200;
  --warn-soft: #fbefcc;
  --display: Bahnschrift, "DIN Alternate", "DIN 2014", Barlow, "Arial Narrow", system-ui, sans-serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --r-s: 4px;
  --r-m: 8px;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #14181b;
    --panel: #1b2024;
    --sunk: #111518;
    --ink: #e3e9e6;
    --ink-2: #9ba7a2;
    --line: #2b3338;
    --line-strong: #3d474d;
    --signal: #3fbfaf;
    --signal-hover: #6ad6c8;
    --signal-ink: #04201c;
    --signal-soft: #15332f;
    --graphite: #0d1012;
    --graphite-2: #1c2227;
    --graphite-line: #333c42;
    --ok: #5ccb8c;
    --ok-soft: #12301f;
    --bad: #ff8a7e;
    --bad-soft: #3a1714;
    --warn: #f0c04e;
    --warn-soft: #2e2510;
  }
}

/* --- Base ----------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.55 var(--text); }
a { color: var(--signal); text-underline-offset: 2px; }
a:hover { color: var(--signal-hover); }
code, pre { font-family: var(--mono); font-size: 0.88em; }
code {
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 0.02em 0.35em; overflow-wrap: anywhere;
}
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2rem; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 0.95rem; font-weight: 600; margin: 1.4rem 0 0.5rem; }
h1 code, h2 code, h3 code { background: none; border: 0; padding: 0; font-size: 0.85em; }
p { margin: 0 0 0.75rem; }
ul { margin: 0; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--panel); color: var(--ink); padding: 0.4rem 0.75rem; border-radius: var(--r-s); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-2); }
.num, .when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hint { font-size: 0.86rem; color: var(--ink-2); }
.scroll { overflow-x: auto; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* --- Bar and test tape -------------------------------------------------------------------------- */
.bar { background: var(--graphite); color: var(--graphite-ink); }
.bar-in {
  max-width: var(--wrap); margin: 0 auto; padding: 0 16px; min-height: 58px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 2rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.6rem 0;
  color: inherit; text-decoration: none; font-family: var(--display); font-size: 1.15rem;
}
.brand:hover { color: inherit; }
.brand-mark {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 4px solid var(--tape); background: var(--graphite);
}
.brand-name { font-weight: 700; }
.brand-sub { color: var(--graphite-ink-2); }
.nav { display: flex; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.nav a {
  display: flex; align-items: center; padding: 0 0.85rem; white-space: nowrap;
  border-top: 3px solid transparent; border-bottom: 3px solid transparent;
  color: var(--graphite-ink-2); text-decoration: none; font-family: var(--display); font-size: 1rem;
}
.nav a:hover { color: var(--graphite-ink); }
.nav a[aria-current="page"] { color: var(--graphite-ink); border-bottom-color: var(--tape); }
.nav a:focus-visible { outline-offset: -4px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 0.85rem; }
.role {
  font-size: 0.8rem; padding: 0.05rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--graphite-line); color: var(--graphite-ink-2);
}
.role-admin { border-color: var(--tape); color: var(--tape); }
button.on-bar {
  background: none; border: 0; padding: 0.3rem 0; color: var(--graphite-ink);
  text-decoration: underline; text-underline-offset: 3px;
}
button.on-bar:hover { color: var(--tape); }
.tape { background: var(--warn-soft); border-bottom: 1px solid var(--line); }
.tape p {
  max-width: var(--wrap); margin: 0 auto; padding: 0.4rem 16px;
  display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--warn);
}
.tape p::before {
  content: ""; flex: none; width: 44px; height: 10px; border-radius: 2px;
  background: repeating-linear-gradient(-45deg, var(--tape) 0 6px, var(--graphite) 6px 12px);
}
@media (max-width: 760px) {
  .bar-in { gap: 0 1rem; }
  .nav { order: 3; width: calc(100% + 1.2rem); margin: 0 -0.6rem; align-self: auto; }
  .nav a { padding: 0.55rem 0.6rem; }
}

/* --- Page frame --------------------------------------------------------------------------------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 2rem 16px 5rem; }
.head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem 2rem; margin-bottom: 1.75rem;
}
.head-text { max-width: 70ch; }
.lead { color: var(--ink-2); margin: 0.45rem 0 0; }
.switch { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.switch-label { font-size: 0.86rem; color: var(--ink-2); }
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-m);
}
.seg a { padding: 0.32rem 0.85rem; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.seg a:hover { background: var(--sunk); color: var(--ink); }
.seg a[aria-current] { background: var(--signal); color: var(--signal-ink); }
.back { margin-bottom: 1.25rem; }
.back a { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; overflow-wrap: anywhere; }
.back a::before {
  content: ""; flex: none; width: 0.45rem; height: 0.45rem;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.notice, .alert {
  margin: 0 0 1.5rem; padding: 0.65rem 0.9rem; border-radius: var(--r-m);
  border-left: 4px solid currentColor; overflow-wrap: anywhere;
}
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.error, .alert { background: var(--bad-soft); color: var(--bad); }
.empty { color: var(--ink-2); padding: 1.25rem 1.1rem; }
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  padding: 0.08rem 0.5rem; border-radius: 999px; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line);
}
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* --- Buttons and fields ------------------------------------------------------------------------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-size: 0.9rem; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer;
  padding: 0.5rem 0.95rem; border-radius: var(--r-m);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
}
button:hover, .button:hover { border-color: var(--signal); color: var(--signal); }
button.primary, .button.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
button.primary:hover, .button.primary:hover { background: var(--signal-hover); border-color: var(--signal-hover); color: var(--signal-ink); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: var(--bad); color: var(--panel); }
button.mini { padding: 0.12rem 0.5rem; font-size: 0.8rem; border-radius: var(--r-s); }
button[disabled], button[disabled]:hover { opacity: 0.5; cursor: not-allowed; border-color: var(--line-strong); color: var(--ink); background: var(--panel); }
.button.quiet { background: transparent; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.actions form { display: inline; margin: 0; }
.downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; }

form.fields { display: grid; gap: 0.85rem; align-content: start; }
form.fields h3 { margin: 0; }
.fields label, form.inline label { display: grid; gap: 0.3rem; font-size: 0.88rem; color: var(--ink-2); }
.fields label.check { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); }
input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]), select, textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 0.5rem 0.65rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--signal); outline-offset: 0; border-color: var(--signal); }
input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--signal); }
input[type="file"] { max-width: 100%; font: inherit; font-size: 0.88rem; color: var(--ink); }
input[type="file"]::file-selector-button {
  font: inherit; margin-right: 0.75rem; padding: 0.4rem 0.8rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--sunk); color: var(--ink);
}
textarea { resize: vertical; }

/* --- Tables ------------------------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--line-strong); white-space: nowrap; }
th.num, td.num { text-align: right; }

/* --- Reference: port panel ---------------------------------------------------------------------- */
.panel {
  background: var(--graphite); color: var(--graphite-ink); border-radius: 12px; border: 1px solid var(--graphite-line);
  padding: 1.25rem 1.5rem 1.1rem; margin-bottom: 2.5rem;
}
.panel code { background: none; border: 0; padding: 0; color: inherit; }
.panel-host { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-bottom: 1.15rem; }
.panel-host-label, .panel-rule { font-size: 0.86rem; color: var(--graphite-ink-2); }
.panel-host-value { font-size: 1.1rem; }
.panel-rule { margin-left: auto; }
.panel button.mini, .panel .button.quiet { background: transparent; color: var(--graphite-ink); border-color: var(--graphite-line); }
.panel button.mini:hover, .panel .button.quiet:hover { border-color: var(--tape); color: var(--tape); }
.panel-groups { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; }
.panel-group { display: grid; gap: 0.45rem; align-content: start; }
.panel-label { font-size: 0.86rem; color: var(--graphite-ink-2); text-decoration: none; }
.panel-label:hover { color: var(--tape); }
.jacks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.jack {
  position: relative; display: grid; align-content: start; min-width: 7.75rem; max-width: 11rem;
  padding: 0.55rem 2rem 0.6rem 0.8rem; border-radius: var(--r-m);
  background: var(--graphite-2); border: 1px solid var(--graphite-line); color: var(--graphite-ink); text-decoration: none;
}
.jack::after {
  content: ""; position: absolute; top: 0.75rem; right: 0.7rem;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--tape);
}
.jack:hover { border-color: var(--tape); color: var(--graphite-ink); }
.jack:hover::after { background: var(--tape); }
.jack-port {
  font-family: var(--display); font-size: 1.8rem; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.jack-proto { font-size: 0.8rem; line-height: 1.3; color: var(--graphite-ink-2); }
.panel-foot {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--graphite-line);
}
@media (max-width: 760px) {
  .panel { padding: 1rem; }
  .panel-rule { margin-left: 0; width: 100%; }
  .jack { min-width: 6.75rem; }
  .jack-port { font-size: 1.5rem; }
}

/* --- Reference: one section per server ---------------------------------------------------------- */
.server { padding: 2.25rem 0 0.5rem; border-top: 1px solid var(--line-strong); scroll-margin-top: 1rem; }
.panel + .server { border-top: 0; padding-top: 0; }
.server-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem; }
.connector { font-size: 0.86rem; color: var(--ink-2); }
.server-sum { color: var(--ink-2); max-width: 75ch; margin: 0.45rem 0 1.25rem; }
.server-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem 2.25rem; align-items: start; }
@media (max-width: 900px) { .server-body { grid-template-columns: minmax(0, 1fr); } }
.slip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0.1rem 1.2rem 1.2rem; }
.slip > h3:first-child { margin-top: 1rem; }
.ports-table th, .ports-table td { padding: 0.35rem 0.75rem 0.35rem 0; font-size: 0.9rem; }
.ports-table th { font-weight: 500; white-space: nowrap; width: 1%; }
.ports-table td.num { text-align: left; width: 1%; }
.ports-table td.muted { font-size: 0.84rem; }
.ports-table tr:last-child th, .ports-table tr:last-child td { border-bottom: 0; }
.cred { padding: 0.7rem 0; border-top: 1px solid var(--line); }
.slip h3 + .cred { border-top: 0; padding-top: 0; }
.cred-label { font-weight: 600; margin: 0 0 0.35rem; }
.cred dl, .settings { margin: 0; display: grid; gap: 0.3rem; }
.cred dl > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.cred dt, .settings dt { color: var(--ink-2); font-size: 0.88rem; }
.cred dd, .settings dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; overflow-wrap: anywhere; }
.secret { white-space: pre-wrap; word-break: break-all; }
.ways > h3:first-child { margin-top: 0; }
.ways > .hint { margin-top: -0.25rem; }

details.config, details.way { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 0.6rem; }
details > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.6rem; list-style: none; cursor: pointer;
  padding: 0.65rem 0.9rem; font-weight: 600;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; flex: none; align-self: center; width: 0.42rem; height: 0.42rem; margin-right: 0.15rem;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg); transition: transform 0.15s ease;
}
details[open] > summary::before { transform: rotate(45deg); }
details[open] > summary { border-bottom: 1px solid var(--line); }
details > summary:hover { color: var(--signal); }
details > summary .muted { font-weight: 400; }
details .note { margin: 0.75rem 0.9rem 0; font-size: 0.9rem; color: var(--ink-2); }
details pre {
  margin: 0.75rem 0.9rem; padding: 0.8rem; max-height: 24rem; overflow: auto; white-space: pre; font-size: 0.82rem;
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-s);
}
details .actions { margin: 0 0.9rem 0.9rem; }
details .settings { margin: 0.6rem 0.9rem 0; gap: 0; }
.settings > div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 560px) { .settings > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }
.notes { padding-left: 1.15rem; }
.notes li { margin-bottom: 0.35rem; }
details .notes { margin: 0.75rem 0.9rem 0.9rem; }

/* --- Sections for admin tools ------------------------------------------------------------------- */
.tools { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line-strong); scroll-margin-top: 1rem; }
.tools > .lead { max-width: 75ch; margin-bottom: 1.1rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; }
.tool-grid form.fields { max-width: 46rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1rem 1.15rem 1.15rem; }

/* --- Mail --------------------------------------------------------------------------------------- */
.mail { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .mail { grid-template-columns: minmax(0, 1fr); } }
.boxes { display: grid; gap: 0.6rem; }
.box-name {
  display: block; padding: 0.45rem 0.65rem; border-radius: var(--r-m); border: 1px solid transparent;
  color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere;
}
.box-name:hover { background: var(--panel); color: var(--ink); }
.box-name[aria-current] { background: var(--panel); border-color: var(--line); }
.folders { list-style: none; padding: 0.25rem 0 0; }
.folders a {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.38rem 0.65rem 0.38rem 1rem;
  border-radius: var(--r-s); color: var(--ink); text-decoration: none;
}
.folders a:hover { background: var(--panel); color: var(--ink); }
.folders a[aria-current] { background: var(--signal-soft); box-shadow: inset 3px 0 0 var(--signal); font-weight: 600; }
.folder-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.unseen {
  font-size: 0.74rem; font-weight: 700; padding: 0 0.45rem; border-radius: 999px;
  background: var(--signal); color: var(--signal-ink); font-variant-numeric: tabular-nums;
}
.count { font-size: 0.82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.inbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.inbox-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 1rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line);
}
.inbox-head .muted { font-size: 0.86rem; }
.messages { list-style: none; padding: 0; }
.msg {
  position: relative; display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto;
  align-items: baseline; gap: 0.15rem 1rem; padding: 0.65rem 1.1rem 0.65rem 1.4rem; border-bottom: 1px solid var(--line);
}
.msg:last-child { border-bottom: 0; }
.msg:hover { background: var(--sunk); }
.msg-from { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-subject { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.msg-subject::after { content: ""; position: absolute; inset: 0; }
.msg-subject:hover { color: var(--signal); }
.msg-subject:focus-visible { outline: none; }
.msg:has(.msg-subject:focus-visible) { outline: 2px solid var(--signal); outline-offset: -2px; }
.msg-meta { display: flex; align-items: baseline; gap: 0.8rem; font-size: 0.84rem; color: var(--ink-2); }
.msg.unread .msg-from, .msg.unread .msg-subject { color: var(--ink); font-weight: 650; }
.msg.unread::before {
  content: ""; position: absolute; left: 0.6rem; top: 1.15rem;
  width: 7px; height: 7px; border-radius: 50%; background: var(--signal);
}
@media (max-width: 700px) { .msg { grid-template-columns: minmax(0, 1fr); } }
.pager { display: flex; gap: 0.5rem; padding: 0.85rem 1.1rem; border-top: 1px solid var(--line); }

.letter { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1.5rem; }
.letter-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 1rem; }
.letter-head h1 { font-size: 1.65rem; overflow-wrap: anywhere; }
.flags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.letter-meta { display: grid; gap: 0.25rem; margin: 1rem 0 0; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.letter-meta > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; }
.letter-meta dt { color: var(--ink-2); }
.letter-meta dd { margin: 0; overflow-wrap: anywhere; }
h2.sub { font-family: var(--text); font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.6rem; }
h2.sub .muted { font-size: 0.88rem; font-weight: 400; }
.attachments { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.attachments a {
  display: grid; min-width: 12rem; max-width: 24rem; padding: 0.55rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-m); color: var(--ink); text-decoration: none;
}
.attachments a:hover { border-color: var(--signal); color: var(--ink); }
.att-name { font-weight: 600; overflow-wrap: anywhere; }
.att-meta { font-size: 0.8rem; color: var(--ink-2); overflow-wrap: anywhere; }
iframe.mail-html { display: block; width: 100%; height: 28rem; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
pre.mail-text {
  margin: 0; padding: 0.9rem; max-height: 32rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 0.85rem; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-s);
}

/* --- Files -------------------------------------------------------------------------------------- */
.browser { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; margin-bottom: 0.75rem; }
.pathbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem;
  padding: 0.7rem 1.1rem; background: var(--sunk); border-bottom: 1px solid var(--line);
}
.pathbar .muted { font-size: 0.86rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.3rem; font-family: var(--mono); font-size: 0.9rem; }
.crumbs a { padding: 0.1rem 0.3rem; border-radius: var(--r-s); text-decoration: none; overflow-wrap: anywhere; }
.crumbs a:hover { background: var(--panel); }
.crumbs a[aria-current] { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--ink-2); }
.file-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2.5rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin: 0; }
form.inline input[name="name"] { width: 14rem; max-width: 100%; }
form.inline button, form.inline input[name="name"] { min-height: 2.6rem; }
.file-hint { margin: 0; padding: 0.7rem 1.1rem; font-size: 0.88rem; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.files { min-width: 34rem; }
.files th:first-child, .files td:first-child { padding-left: 1.1rem; }
.files th:last-child, .files td:last-child { padding-right: 1.1rem; }
.files tbody tr:hover td { background: var(--sunk); }
.files tbody tr:last-child td { border-bottom: 0; }
.files td.num, .files td.when { color: var(--ink-2); font-size: 0.88rem; }
.row-action { width: 1%; text-align: right; }
.row-action form { margin: 0; }
.entry { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.entry:hover { color: var(--signal); }
.entry::before {
  content: ""; flex: none; width: 13px; height: 16px; border: 1.5px solid var(--ink-2); border-radius: 2px 5px 2px 2px;
}
.entry.dir { font-weight: 600; }
.entry.dir::before {
  width: 18px; height: 14px; border: 0; border-radius: 2px; background: var(--signal);
  clip-path: polygon(0 0, 42% 0, 52% 20%, 100% 20%, 100% 100%, 0 100%);
}
.entry.up { color: var(--ink-2); font-weight: 400; }
.entry.up::before {
  width: 0.45rem; height: 0.45rem; margin: 0 0.25rem; border: 0; border-radius: 0;
  border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg);
}

/* --- Databases ---------------------------------------------------------------------------------- */
.db { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.5rem; align-items: start; }
.db-area { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.db-area > header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 1rem; padding: 1rem 1.1rem 0; }
.db-area > header .muted { font-size: 0.86rem; }
.db-area > .hint { margin: 0.35rem 1.1rem 0.85rem; }
.db-area > .alert { margin: 0 1.1rem 0.85rem; }
.tables { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.tables li { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1.1rem; border-bottom: 1px solid var(--line); }
.tables li:last-child { border-bottom: 0; }
.tables li:hover { background: var(--sunk); }
.tables li > a { flex: 1; min-width: 0; text-decoration: none; overflow-wrap: anywhere; }
.tables li > a code { background: none; border: 0; padding: 0; color: inherit; font-size: 0.9rem; }
.tables .num { font-size: 0.85rem; color: var(--ink-2); }
.tables form { margin: 0; }
.tables li.empty { display: block; padding: 1.1rem; }
.tables li.empty:hover { background: none; }
.grid-wrap { overflow: auto; max-height: 75vh; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); }
table.cells { width: max-content; min-width: 100%; }
table.cells th {
  position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--ink);
  font-family: var(--mono); font-size: 0.8rem; box-shadow: inset 0 -1px 0 var(--line-strong); border-bottom: 0;
}
table.cells td { font-family: var(--mono); font-size: 0.8rem; white-space: pre-wrap; max-width: 28rem; overflow-wrap: anywhere; }
table.cells th + th, table.cells td + td { border-left: 1px solid var(--line); }
table.cells tbody tr:nth-child(even) td { background: var(--sunk); }
.null { color: var(--ink-2); font-style: italic; }

/* --- Manage ------------------------------------------------------------------------------------- */
.block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1.5rem; }
.block-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.85rem; }
.block-head .muted { font-size: 0.86rem; }
.block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.block-grid .block { margin: 0; display: flex; flex-direction: column; }
.block-grid .block .actions { margin-top: auto; padding-top: 0.5rem; }
.pill { font-size: 0.82rem; font-weight: 600; padding: 0.18rem 0.7rem; border-radius: 999px; background: var(--sunk); color: var(--ink-2); }
.pill.ok, .pill.on { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.health { list-style: none; padding: 0; margin-bottom: 1rem; }
.health li {
  display: grid; grid-template-columns: 6rem 8rem minmax(0, 1fr) auto; align-items: baseline; gap: 0.1rem 1rem;
  padding: 0.6rem 0; border-top: 1px solid var(--line);
}
.health-name { font-weight: 600; }
.health .detail { grid-column: 2 / -1; font-size: 0.85rem; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .health li { grid-template-columns: 5.5rem minmax(0, 1fr) auto; }
  .health-check { grid-column: 2 / -1; }
  .health .detail { grid-column: 1 / -1; }
}
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.audit { min-width: 52rem; }
.audit td { font-size: 0.88rem; overflow-wrap: anywhere; }

/* --- Log in and errors -------------------------------------------------------------------------- */
.signed-out main { display: flex; justify-content: center; }
.login {
  width: min(100%, 25rem); margin-top: 2.5rem; padding: 1.75rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.login .fields { margin-top: 1.25rem; gap: 0.35rem; }
.login label { margin-top: 0.45rem; }
.login button { margin-top: 1.1rem; padding: 0.65rem; }
.login .hint { margin: 1.25rem 0 0; }
.error-page { text-align: center; margin: 3rem auto 0; max-width: 40rem; }
.error-code { font-family: var(--display); font-size: 4.5rem; font-weight: 600; line-height: 1; color: var(--line-strong); margin: 0 0 0.5rem; }
.error-page h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }
