/* SPDX-License-Identifier: AGPL-3.0-only */
/* Shieldlist — the night-watch console. Deep blue-black ground, data in
   monospace as the CLI shows it, one action colour, one ban colour. */
:root {
  --ground: #0f1720;
  --panel: #16212d;
  --panel-2: #1c2937;
  --line: #24323f;
  --ink: #dce3ea;
  --ink-2: #a3aeba;
  --mute: #7f8b99;
  --act: #4c8dff;
  --act-ink: #0b1220;
  --ban: #ff7a45;
  --ok: #6bbf8a;
  --warn: #e3b341;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); font: 14px/1.45 var(--sans); }
a { color: var(--act); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, td.mono, .kv dd, input, select, textarea, button.mono { font-family: var(--mono); font-size: 13px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .5rem; }
h1 { font-size: 20px; } h1.mono { font-size: 20px; } h2 { font-size: 16px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin-top: 1.5rem; }
h3 { font-size: 14px; }
p { margin: 0 0 .75rem; color: var(--ink-2); }
button, .btn { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: .4rem .8rem; cursor: pointer; font: inherit; }
button:hover, .btn:hover { border-color: var(--act); }
button.primary { background: var(--act); color: var(--act-ink); border-color: var(--act); font-weight: 600; }
button.danger { color: var(--ban); }
button.danger:hover { border-color: var(--ban); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; }
input, select, textarea { background: var(--ground); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: .4rem .6rem; }
select { padding-right: 1.6rem; }
label { color: var(--ink-2); font-size: 12px; display: block; margin-bottom: .2rem; }

/* header */
.top { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; padding: .6rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { color: var(--ink); font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.mark { color: var(--act); font-size: 16px; }
.mark.big { font-size: 40px; }
.ver { color: var(--mute); font-family: var(--mono); font-weight: 400; font-size: 12px; margin-left: .4rem; }
.lookup { display: flex; gap: .5rem; max-width: 640px; }
.lookup input { flex: 1; font-size: 14px; padding: .5rem .8rem; }
.nav { display: flex; gap: 1rem; white-space: nowrap; }
.nav a { color: var(--ink-2); padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--ink); border-color: var(--act); }
.nav a:hover { text-decoration: none; color: var(--ink); }
.nav a.quiet { color: var(--mute); }

/* frame */
.frame { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 53px); }
.rail { border-right: 1px solid var(--line); background: var(--panel); padding: .75rem 0; }
.rail-head { padding: 0 1rem .5rem; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.rail-list a { display: grid; grid-template-columns: 10px 1fr auto; gap: .6rem; align-items: center; padding: .45rem 1rem; color: var(--ink); border-left: 2px solid transparent; }
.rail-list a:hover { background: var(--panel-2); text-decoration: none; }
.rail-list a.on { border-left-color: var(--act); background: var(--panel-2); }
.rail-list .name { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-list .sub { color: var(--mute); font-size: 11px; }
.rail-list .n { font-family: var(--mono); color: var(--ink-2); font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); }
.pulse.live { background: var(--ok); box-shadow: 0 0 0 0 rgba(107,191,138,.6); animation: pulse 2.4s ease-out infinite; }
.pulse.stale { background: var(--warn); }
.pulse.off { background: var(--ban); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(107,191,138,.5); } 70% { box-shadow: 0 0 0 7px rgba(107,191,138,0); } 100% { box-shadow: 0 0 0 0 rgba(107,191,138,0); } }
@media (prefers-reduced-motion: reduce) { .pulse.live { animation: none; } }
.main { padding: 1.25rem 1.5rem 3rem; max-width: 1200px; }

/* blocks */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .75rem .9rem; }
.card .k { color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.card .v { font-family: var(--mono); font-size: 22px; margin-top: .2rem; }
.card .v.ban { color: var(--ban); } .card .v.ok { color: var(--ok); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
th { text-align: left; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; padding: .5rem .7rem; border-bottom: 1px solid var(--line); }
td { padding: .45rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.mono { font-family: var(--mono); font-size: 13px; }
td.num { text-align: right; font-family: var(--mono); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--panel-2); }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: 11px; font-family: var(--mono); border: 1px solid var(--line); color: var(--ink-2); }
.tag.ban { color: var(--ban); border-color: rgba(255,122,69,.4); }
.tag.ok { color: var(--ok); border-color: rgba(107,191,138,.4); }
.tag.warn { color: var(--warn); border-color: rgba(227,179,65,.4); }
.tag.act { color: var(--act); border-color: rgba(76,141,255,.4); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.25rem; margin: 0 0 1rem; }
.kv dt { color: var(--mute); } .kv dd { margin: 0; }
.row { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.row > * { min-width: 0; }
.field { display: flex; flex-direction: column; }
.wide { grid-column: 1 / -1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; }
.empty { color: var(--mute); padding: 1.5rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); }
.err { color: var(--ban); white-space: pre-wrap; font-family: var(--mono); font-size: 12px; }
.small { font-size: 12px; color: var(--mute); }
.hero { margin: 0 0 1.5rem; }
.hero .v { font-family: var(--mono); font-size: 26px; }
.hero .v.ban { color: var(--ban); } .hero .v.ok { color: var(--ok); }
pre.code { background: var(--ground); border: 1px solid var(--line); border-radius: var(--r); padding: .75rem; overflow: auto; font-size: 12px; }
.toast { position: fixed; right: 1rem; bottom: 1rem; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--act); padding: .6rem .9rem; border-radius: var(--r); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; max-width: 480px; white-space: pre-wrap; z-index: 9; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { border-left-color: var(--ban); }
.login[hidden] { display: none; }
.login { position: fixed; inset: 0; background: var(--ground); display: grid; place-items: center; z-index: 10; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 2rem; width: min(420px, 92vw); display: flex; flex-direction: column; gap: .75rem; }
.login-card input { font-size: 14px; }
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; gap: .5rem; }
  .frame { grid-template-columns: 1fr; }
  .rail { border-right: none; border-bottom: 1px solid var(--line); }
  .rail-list { display: flex; overflow-x: auto; }
  .rail-list a { min-width: 180px; border-left: none; border-bottom: 2px solid transparent; }
  .rail-list a.on { border-bottom-color: var(--act); }
}
