/* Exocomp — an original LCARS-inspired theme (TNG-era palette). */
:root {
  --bg: #000;
  --ink: #f6dcbc;
  --ink-dim: #a8957e;
  --orange: #f2a04a;
  --peach: #ffc98f;
  --tan: #d99e76;
  --lilac: #cc99cc;
  --violet: #9b8bdb;
  --blue: #9cc2ff;
  --sky: #6ea6ff;
  --gold: #ffb43c;
  --red: #e5584f;
  --grey: #6b6b6b;
  --side: 170px;
  --bar: 22px;
  --gap: 5px;
  --radius-outer: 70px;
  --radius-inner: 34px;
  --font: "Antonio", "Arial Narrow", "Roboto Condensed", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); font-size: 18px; line-height: 1.35; letter-spacing: .02em; min-height: 100vh; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
h1, h2, h3 { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .4em; }
h1 { font-size: 2.2rem; color: var(--orange); }
h2 { font-size: 1.35rem; color: var(--lilac); }
h3 { font-size: 1.1rem; color: var(--peach); }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; color: var(--peach); }
.dim { color: var(--ink-dim); }
.upper { text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- frame ---------- */
.lcars { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; padding: 10px 12px; gap: var(--gap); }
.row { display: flex; gap: var(--gap); }

.elbow {
  position: relative; flex: 0 0 calc(var(--side) + 70px); height: 96px; background: var(--orange);
}
.elbow.top { border-top-left-radius: var(--radius-outer); }
.elbow.bottom { border-bottom-left-radius: var(--radius-outer); background: var(--lilac); }
.elbow::after {
  content: ""; position: absolute; right: 0; width: calc(100% - var(--side)); height: calc(100% - var(--bar));
  background: var(--bg);
}
.elbow.top::after { bottom: 0; border-top-left-radius: var(--radius-inner); }
.elbow.bottom::after { top: 0; border-bottom-left-radius: var(--radius-inner); }
.elbow .tag {
  position: absolute; left: 22px; font-weight: 700; color: #000; font-size: .95rem; letter-spacing: .1em;
}
.elbow.top .tag { bottom: 6px; }
.elbow.bottom .tag { top: 6px; }

.hbar { flex: 1; display: flex; flex-direction: column; }
.hbar .segs { display: flex; gap: var(--gap); height: var(--bar); }
.elbow.bottom + .hbar { justify-content: flex-end; }
.seg { background: var(--peach); flex: 1; }
.seg.a { background: var(--tan); flex: 0 0 90px; }
.seg.b { background: var(--violet); flex: 0 0 40px; }
.seg.c { background: var(--blue); flex: 2; }
.seg.d { background: var(--orange); flex: 0 0 24px; border-radius: 0 var(--bar) var(--bar) 0; }
.titlebar { display: flex; align-items: flex-end; justify-content: flex-end; gap: 18px; flex: 1; padding: 4px 6px 0 0; }
.titlebar .title { font-size: 3rem; font-weight: 700; color: var(--orange); line-height: .9; letter-spacing: .1em; }
.titlebar .meta { color: var(--ink-dim); font-size: .9rem; text-align: right; line-height: 1.2; }
.hbar.bottom-bar .meta { color: var(--ink-dim); font-size: .85rem; text-align: right; padding: 0 6px 4px 0; }

.mid { display: flex; gap: var(--gap); min-height: 0; }
.side { flex: 0 0 var(--side); display: flex; flex-direction: column; gap: var(--gap); }
.side a, .side .fill {
  display: flex; align-items: flex-end; justify-content: flex-end; min-height: 52px; padding: 4px 10px;
  color: #000; text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: .92rem;
  background: var(--peach); letter-spacing: .06em;
}
.side a:nth-child(4n+1) { background: var(--peach); }
.side a:nth-child(4n+2) { background: var(--tan); }
.side a:nth-child(4n+3) { background: var(--lilac); }
.side a:nth-child(4n) { background: var(--blue); }
.side a.unit { min-height: 40px; background: var(--violet); }
.side a.unit .st { width: 10px; height: 10px; border-radius: 50%; margin-right: auto; align-self: center; background: #000; }
.side a:hover { filter: brightness(1.15); }
.side a[aria-current="page"] { background: var(--gold); }
.side .fill { flex: 1; background: var(--orange); min-height: 30px; }
.side .label { color: var(--ink-dim); font-size: .8rem; text-transform: uppercase; padding: 8px 10px 0; text-align: right; letter-spacing: .12em; }

main { flex: 1; min-width: 0; padding: 14px 8px 20px 26px; }

/* ---------- pills / buttons ---------- */
.pill, button.pill {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px;
  min-width: 120px; min-height: 40px; padding: 4px 22px; border: 0; border-radius: 999px;
  background: var(--peach); color: #000; font: 700 .95rem var(--font); text-transform: uppercase;
  letter-spacing: .08em; text-decoration: none; cursor: pointer;
}
.pill:hover { filter: brightness(1.12); }
.pill.orange { background: var(--orange); } .pill.lilac { background: var(--lilac); }
.pill.blue { background: var(--blue); } .pill.red { background: var(--red); }
.pill.gold { background: var(--gold); } .pill.violet { background: var(--violet); }
.pill.small { min-width: 0; min-height: 30px; padding: 2px 14px; font-size: .8rem; }
.pill.left { justify-content: flex-start; }
.pill[disabled] { background: var(--grey); cursor: not-allowed; filter: none; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
form.inline { display: inline; }

/* ---------- panels ---------- */
.panel { display: flex; gap: var(--gap); margin: 0 0 18px; }
.panel .cap { flex: 0 0 14px; background: var(--lilac); border-radius: 14px 0 0 14px; }
.panel.orange .cap { background: var(--orange); } .panel.blue .cap { background: var(--blue); }
.panel.gold .cap { background: var(--gold); } .panel.red .cap { background: var(--red); }
.panel .body { flex: 1; min-width: 0; border-top: var(--gap) solid var(--lilac); padding: 12px 4px 4px 14px; }
.panel.orange .body { border-color: var(--orange); } .panel.blue .body { border-color: var(--blue); }
.panel.gold .body { border-color: var(--gold); } .panel.red .body { border-color: var(--red); }

/* ---------- status ---------- */
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 2px 14px 2px 10px; border-radius: 999px;
  font-weight: 700; font-size: .85rem; letter-spacing: .1em; color: #000; background: var(--grey);
}
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #000; }
.status.ok { background: var(--blue); }
.status.warn { background: var(--gold); }
.status.alert { background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.status.idle { background: var(--grey); color: #eee; }
.status.idle::before { background: #eee; }
.dot.ok { background: var(--blue) !important; } .dot.warn { background: var(--gold) !important; }
.dot.alert { background: var(--red) !important; } .dot.idle { background: #333 !important; }
@keyframes pulse { 50% { filter: brightness(.65); } }
@media (prefers-reduced-motion: reduce) { .status.alert { animation: none; } }

/* ---------- roster ---------- */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.unit-card {
  display: grid; grid-template-columns: 76px 1fr; text-decoration: none; color: var(--ink);
  border: 2px solid transparent; border-radius: 28px 0 0 28px; overflow: hidden; background: #111;
}
.unit-card:hover { border-color: var(--peach); }
.unit-card .code {
  background: var(--orange); color: #000; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-weight: 700; font-size: .85rem; gap: 6px; letter-spacing: .05em;
}
.unit-card.alert .code { background: var(--red); }
.unit-card.warn .code { background: var(--gold); }
.unit-card.idle .code { background: var(--grey); }
.unit-card .info { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.unit-card .name { font-size: 1.5rem; font-weight: 700; text-transform: uppercase; color: var(--peach); letter-spacing: .06em; line-height: 1; }
.unit-card .sub { color: var(--ink-dim); font-size: .85rem; }
.glyph { width: 34px; height: 34px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: separate; border-spacing: 0 4px; width: 100%; font-size: .95rem; }
th { text-align: left; color: #000; background: var(--tan); font-weight: 700; text-transform: uppercase;
     font-size: .78rem; letter-spacing: .1em; padding: 4px 10px; white-space: nowrap; }
th:first-child { border-radius: 999px 0 0 999px; padding-left: 18px; }
th:last-child { border-radius: 0 999px 999px 0; }
td { padding: 6px 10px; border-bottom: 1px solid #262626; vertical-align: middle; }
td:first-child { padding-left: 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.stat { border-left: 6px solid var(--blue); padding: 2px 10px; }
.stat .k { color: var(--ink-dim); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.stat .v { font-size: 1.6rem; font-weight: 700; color: var(--peach); font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
label { display: block; color: var(--ink-dim); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 10px 0 4px; }
input[type=text], input[type=url], input[type=number], select, textarea {
  width: 100%; max-width: 520px; background: #111; color: var(--ink); border: 2px solid var(--tan);
  border-radius: 12px; padding: 8px 12px; font: 400 1rem var(--font); letter-spacing: .03em;
}
textarea { min-height: 80px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; }
.checks label { display: flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: .02em; font-size: .95rem; color: var(--ink); margin: 0; }
.notice { border-left: 8px solid var(--gold); padding: 6px 12px; margin: 0 0 14px; background: #1a1408; }
.notice.bad { border-color: var(--red); background: #1c0907; }
.notice.good { border-color: var(--blue); background: #07101c; }

pre.log {
  background: #0b0b0b; border: 2px solid #222; border-radius: 12px; padding: 12px; overflow: auto; max-height: 70vh;
  font: 12.5px/1.45 ui-monospace, Consolas, monospace; color: #dcd3c4; white-space: pre-wrap; word-break: break-all;
}

.avatar { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }

/* ---------- login ---------- */
.login-main { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 30px 26px; }
.login-main .big { font-size: 4rem; color: var(--orange); font-weight: 700; letter-spacing: .12em; line-height: .9; }

/* ---------- narrow screens ---------- */
@media (max-width: 820px) {
  :root { --side: 86px; --radius-outer: 44px; --radius-inner: 22px; }
  body { font-size: 17px; }
  .lcars { padding: 6px; }
  .elbow { flex-basis: calc(var(--side) + 30px); height: 70px; }
  .elbow .tag { display: none; }
  .titlebar .title { font-size: 2rem; }
  .titlebar .meta { display: none; }
  .mid { flex-direction: column; }
  .side { flex-direction: row; overflow-x: auto; flex-basis: auto; }
  .side a, .side .fill { min-height: 38px; flex: 0 0 auto; padding: 4px 12px; align-items: center; }
  .side .fill, .side .label { display: none; }
  main { padding: 10px 4px 16px; }
  h1 { font-size: 1.7rem; }
  .login-main .big { font-size: 2.6rem; }
}

/* ---------- telemetry ---------- */
.panel.violet .cap { background: var(--violet); } .panel.violet .body { border-color: var(--violet); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 8px 0 6px; }
figure { margin: 0; }
figcaption { color: var(--ink-dim); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
svg.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
svg.chart .hit:hover { fill: rgba(255, 255, 255, .06); }
details.tableview { margin: 4px 0 14px; }
details.tableview summary, details.connect summary { cursor: pointer; color: var(--blue); }
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 8px; }
table.bars td { border-bottom: 0; padding: 3px 8px; }
table.bars td:first-child { padding-left: 0; white-space: nowrap; }
.barcell { width: 60%; }
.bar { display: block; height: 12px; background: var(--peach); border-radius: 0 4px 4px 0; min-width: 2px; }

/* ---------- connect callout / code ---------- */
details.connect { margin: 0 0 18px; }
details.connect > summary { list-style: none; display: flex; align-items: center; gap: 12px; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--lilac); padding: 6px 0 12px; }
details.connect > summary::-webkit-details-marker { display: none; }
details.connect[open] > summary { color: var(--violet); }
pre.code { position: relative; background: #0b0b0b; border: 2px solid #2b2b2b; border-left: 6px solid var(--violet);
  border-radius: 10px; padding: 12px 14px; overflow-x: auto; font: 13px/1.5 ui-monospace, Consolas, monospace;
  color: #e8dcc8; margin: 0 0 12px; }
pre.code .copy { position: absolute; top: 8px; right: 8px; min-height: 26px; font-size: .72rem; }

/* ---------- manual ---------- */
.manual { max-width: 980px; }
.manual h1 { margin-top: 6px; }
.manual h2 { margin-top: 1.6em; padding-top: .4em; border-top: 4px solid var(--lilac); }
.manual h3 { margin-top: 1.2em; }
.manual p, .manual li { font-family: system-ui, "Segoe UI", sans-serif; font-size: 1rem; letter-spacing: 0; line-height: 1.55; color: #eadbc8; }
.manual li { margin: .25em 0; }
.manual pre { background: #0b0b0b; border: 2px solid #2b2b2b; border-left: 6px solid var(--violet); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font: 13px/1.5 ui-monospace, Consolas, monospace; color: #e8dcc8; }
.manual pre code { color: inherit; font-size: inherit; }
.manual table { margin: 8px 0 16px; }
.manual td { font-family: system-ui, "Segoe UI", sans-serif; font-size: .95rem; letter-spacing: 0; }
.manual blockquote { border-left: 6px solid var(--gold); margin: 0 0 1em; padding: 4px 14px; background: #1a1408; }

/* ---------- version ---------- */
a.version { color: var(--ink-dim); text-decoration: none; letter-spacing: .08em; }
a.version:hover { color: var(--peach); text-decoration: underline; }

/* ---------- groups ---------- */
h2.group-head { margin: 18px 0 10px; }
h2.group-head a { color: inherit; text-decoration: none; }
h2.group-head a:hover { text-decoration: underline; }
.grouptag { display: inline-block; margin-left: 6px; padding: 1px 12px; border-radius: 999px; background: var(--lilac);
  color: #000; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.group-card .code { font-size: .75rem; letter-spacing: .12em; }

/* ---------- sidebar emblem (floats in the filler panel above Sign off) ---------- */
.side .fill { display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 12px 0; min-height: 120px; }
.side .fill a.emblem {
  position: sticky; top: calc(100vh - 116px);           /* rides near the bottom of the window… */
  width: 92px; height: 92px; min-height: 0; padding: 0; /* …but can't leave the filler panel */
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #000 !important; box-shadow: inset 0 0 0 3px #000;
  transform: translateY(var(--lag, 0px)) rotate(var(--tilt, 0deg)); will-change: transform;
}
.side .fill a.emblem:hover { filter: none; }
/* Idle float: a slow bob and a slower sway on separate properties, each easing gently between two
   points, so the motion never snaps or reverses abruptly. Different periods keep it from looking looped. */
.side .fill a.emblem img { width: 64px; height: 64px; will-change: translate, rotate;
  animation: antigrav-bob 4.8s ease-in-out infinite alternate, antigrav-sway 7.3s ease-in-out infinite alternate; }
@keyframes antigrav-bob  { from { translate: 0 1.5px; } to { translate: 0 -3px; } }
@keyframes antigrav-sway { from { rotate: -1.5deg; } to { rotate: 1.5deg; } }
@media (prefers-reduced-motion: reduce) { .side .fill a.emblem img { animation: none; } }

@media (max-width: 820px) { .side .fill { display: none; } }

/* keep a long button row from widening the page on phones: it scrolls sideways on its own */
.lcars { grid-template-columns: minmax(0, 1fr); }
.lcars > *, .mid, .side, main { min-width: 0; }
@media (max-width: 820px) { .side { max-width: 100%; } }
@media (max-width: 820px) { html, body { overflow-x: clip; } }
.manual table { display: block; max-width: 100%; overflow-x: auto; }
