:root {
  --paper: #e6ecef;
  --panel: #f6f9fa;
  --ink: #10243a;
  --muted: #566676;
  --rule: #c5d0d8;
  --accent: #1f5f8b;
  --danger: #b3321d;
  --c-http: #3b7ba3;
  --c-ping: #8798a6;
  --c-blocked: #d08a1e;
  --c-scan: #b3321d;
  --c-ssh_fail: #7b3e91;
  --c-ssh_ok: #2c7d59;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1a26;
    --panel: #152636;
    --ink: #e2eaf0;
    --muted: #8fa3b3;
    --rule: #28405a;
    --accent: #6cb4e4;
    --danger: #ff8a73;
    --c-http: #5aa3cf;
    --c-ping: #7f93a3;
    --c-blocked: #e5a03a;
    --c-scan: #ef6a52;
    --c-ssh_fail: #b57acb;
    --c-ssh_ok: #4fb286;
  }
}

* { box-sizing: border-box; }
html { font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* shared bits */
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-align: left; }
.btn { border: 1px solid var(--ink); background: transparent; border-radius: 4px; padding: 0.45rem 0.9rem; }
.btn.primary { background: var(--ink); color: var(--paper); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 0.3rem 0.7rem; border-right: 1px solid var(--rule); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.notice { margin: 0 0 1rem; padding: 0.6rem 0.8rem; border-left: 3px solid var(--c-blocked); background: var(--panel); font-size: 0.9rem; }
.empty { color: var(--muted); }

/* app shell */
.app { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 1.25rem; border-right: 1px solid var(--rule); }
.brand strong { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
#nav { display: flex; flex-direction: column; gap: 0.125rem; }
#nav a { padding: 0.45rem 0.6rem; border-radius: 4px; color: var(--ink); text-decoration: none; }
#nav a:hover { background: var(--panel); }
#nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.who { margin-top: auto; display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); }
main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; outline: none; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; border-right: 0; border-bottom: 1px solid var(--rule); padding: 0.75rem 1rem; }
  .brand span { display: none; }
  #nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin: 0 0 0 auto; }
}

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login form { width: min(23rem, 100%); display: grid; gap: 1rem; }
.login h1 { font-size: 2.4rem; }
.login .hint { margin: -0.5rem 0 0; color: var(--muted); }
.login label { display: grid; gap: 0.25rem; font-size: 0.9rem; }
.login label small { color: var(--muted); }
.login input { padding: 0.55rem 0.65rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); }
.login .error { margin: 0; padding: 0.55rem 0.75rem; border-left: 3px solid var(--danger); background: var(--panel); }
.login .btn { justify-self: start; }
