/* =====================================================================================================
   Orion HUD  -  the design language of LLM Gateway, consolidated into one stylesheet.
   Dark only. Read ORION-DESIGN-GUIDE.md first: colour here MEANS something (see "Colour meaning").
   Fonts are bundled in ./fonts (SIL Open Font License). Change the path in the @font-face rules if you move them.
   ===================================================================================================== */

@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url(fonts/space-grotesk-500.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url(fonts/space-grotesk-700.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(fonts/inter-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(fonts/inter-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(fonts/inter-ext-400.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(fonts/inter-ext-600.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-400.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url(fonts/jetbrains-mono-600.woff2) format("woff2"); }

/* ------------------------------------------------------------------------------------------------ TOKENS */
:root {
  color-scheme: dark;

  /* type */
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;   /* headings, big numbers */
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;   /* labels, data, buttons */

  /* surfaces: black and graphite, NO blue cast */
  --page: #030303;
  --surface: #0c0c0d;
  --surface-2: #121213;
  --surface-3: #1b1b1d;
  --panel: rgba(255, 255, 255, 0.018);      /* cards are almost transparent */
  --text: #f5f5f6;
  --text-2: #c4c5cb;
  --muted: #8d8e98;
  --grid: #1a1a1c;
  --axis: #2b2b30;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --bracket: rgba(190, 200, 220, 0.28);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.7);

  /* ACTION: amber. Selection, primary buttons, focus, switches. Nothing else. */
  --hl: #f0a04b;
  --hl-rgb: 240, 160, 75;
  --hl-ink: #140d04;                         /* text on an amber button */
  --accent-wash: rgba(240, 160, 75, 0.07);

  /* STATUS: always paired with a word */
  --good: #0ca30c;   --good-rgb: 12, 163, 12;
  --warning: #fab219;
  --critical: #e66767;
  --warn-wash: rgba(250, 178, 25, 0.12);

  /* LEVEL (rgb triplets, used as rgb(var(--g))). Thresholds: 40 / 75 / 90 % of capacity */
  --lvl-idle: 43, 181, 138;       /* teal   */
  --lvl-normal: 79, 147, 224;     /* blue   */
  --lvl-elevated: 240, 160, 75;   /* amber  */
  --lvl-high: 230, 103, 103;      /* red    */

  /* METRIC: one fixed colour per tracked quantity, identical in every tile, chart, report. Rename to yours. */
  --m-requests: 76, 201, 240;     /* cyan   */
  --m-tokens: 167, 139, 250;      /* violet */
  --m-data: 244, 114, 182;        /* pink   */
  --m-busy: 52, 211, 153;         /* mint   */
  --m-energy: 234, 208, 78;       /* yellow */
  --m-cost: 163, 214, 82;         /* lime   */
  --m-users: 107, 156, 247;       /* blue   */

  /* IDENTITY: per-person / per-item colours, fixed order (validated categorical palette). Charts and swatches only. */
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --idle: #5a5a60;  --idle-stripe: #909097;   /* "nothing happening" is a striped pattern, never an identity colour */

  /* Orion mark */
  --rigel: #8cb9ff;  --betelgeuse: #ff8a5c;  --star: 255, 255, 255;

  /* shape + rhythm */
  --radius: 3px;                 /* panels, buttons, inputs, pills, dialogs. Only dots and count badges are round. */
  --gap: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);        /* the standard curve */
  --ease-pop: cubic-bezier(.2, 1.2, .4, 1);   /* dialogs and toasts only */
}

/* ------------------------------------------------------------------------------------------------ BASE */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: #040404; color: var(--text); min-height: 100vh;
  font: 14px/1.5 var(--body); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
/* soft warm, violet and teal glows give the black depth without a colour cast */
body::before {
  content: ""; position: fixed; inset: -25vh -15vw; z-index: -2; pointer-events: none;
  background:
    radial-gradient(48vw 38vh at 10% 2%, rgba(240, 160, 75, 0.075), transparent 68%),
    radial-gradient(44vw 34vh at 92% 10%, rgba(150, 135, 240, 0.06), transparent 68%),
    radial-gradient(58vw 42vh at 52% 110%, rgba(30, 165, 120, 0.05), transparent 68%),
    radial-gradient(40vw 40vh at 78% 60%, rgba(214, 120, 70, 0.035), transparent 72%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(3vw, 2vh, 0) scale(1.05); } }
#stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }   /* orionStarfield(canvas) fills this */
a { color: var(--hl); }
:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 64px; }
main.wrap { padding-top: 24px; }
[hidden] { display: none !important; }
.sub { color: var(--text-2); font-size: 13px; }
.hint { color: var(--text-2); font-size: 12px; margin-top: 12px; }
.spacer { flex: 1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------------------------------------ TYPE
   Labels are uppercase mono; big readouts are Space Grotesk; running text is Inter. */
h1, h2, h3, .tile .label, .gauge .glabel, th, nav button, .kv > .k, .status, .btn, .seg button, .pill, .field > span {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em;
}
h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .2em; }
h2 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .16em; }
h3 { display: flex; align-items: center; gap: 12px; margin: 24px 0 10px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.tile .value, .livebar .big, .gauge text, .engine .name { font-family: var(--display); }
td.num, tfoot td, code.inline, kbd, .tile .note, .gauge .gsub { font-family: var(--mono); }

/* ------------------------------------------------------------------------------------------------ HEADER + TABS */
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(3, 3, 3, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar .wrap { padding-bottom: 0; }
.topbar::after {   /* a faint light line under the header */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28) 50%, transparent); background-size: 200% 100%;
  animation: hairline 9s linear infinite; opacity: .5;
}
@keyframes hairline { from { background-position: 0 0; } to { background-position: -200% 0; } }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .version { color: var(--text-2); font: 10.5px var(--mono); letter-spacing: .12em; }
.head-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 11px; padding: 5px 12px;
  border-radius: var(--radius); border: 1px solid var(--border); background: rgba(255, 255, 255, .025); }
.dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; transition: background-color .3s; }
.dot.on { background: var(--good); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--critical); }
.dot.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3); opacity: 0; } }

nav { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav button { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text-2);
  padding: 8px 12px 11px; font-size: 11.5px; cursor: pointer; white-space: nowrap; border-radius: 3px 3px 0 0; transition: color .2s, background-color .2s; }
nav button:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
nav button[aria-selected="true"] { color: var(--hl); font-weight: 600; }
.tab-indicator { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--hl); border-radius: 2px;
  box-shadow: 0 0 12px rgba(var(--hl-rgb), .7); transition: transform .3s var(--ease), width .3s var(--ease); }
kbd, .count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px;
  font: 600 10px/1 var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
kbd { color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 2px; background: rgba(255, 255, 255, .03); }
nav button[aria-selected="true"] kbd { border-color: rgba(var(--hl-rgb), .6); color: var(--hl); }
.count { border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--text-2); }
nav button[aria-selected="true"] .count { background: rgba(var(--hl-rgb), .16); color: var(--hl); }
[role="tabpanel"]:not([hidden]) { animation: panel-in .35s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------------------------------------ PANELS
   Square hairline panels with corner brackets. Nearly invisible until hovered. */
.card, .tile {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.card { padding: 18px; margin-bottom: var(--gap); min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 42%),
              radial-gradient(120% 90% at 100% 0%, rgba(150, 135, 240, .03), transparent 55%), var(--panel); }
.tile { padding: 14px 16px; background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 55%), var(--panel); }
.card::after, .tile::after, dialog::after {   /* the corner brackets: 8 gradients, one per bracket arm */
  content: ""; position: absolute; inset: -1px; pointer-events: none; --c: var(--bracket); --l: 7px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px no-repeat,     linear-gradient(var(--c), var(--c)) top left / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px no-repeat,    linear-gradient(var(--c), var(--c)) top right / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px no-repeat,  linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l) no-repeat;
}
/* hover is neutral (white brackets) on anything you can't click; amber is reserved for actions */
.card.lift:hover { border-color: rgba(255, 255, 255, .09); box-shadow: var(--shadow); transform: translateY(-2px); }
.card.lift:hover::after, .tile:not([data-metric]):hover::after { --c: rgba(255, 255, 255, .5); --l: 14px; }
.tile:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-head h2::before {   /* a small neutral tick before each panel title; metric panels take their metric's colour */
  content: ""; display: inline-block; width: 3px; height: 11px; margin-right: 9px; vertical-align: -1px; border-radius: 2px;
  background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .12));
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.grid2 > .card { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
[role="tabpanel"]:not([hidden]) .card, [role="tabpanel"]:not([hidden]) .tile { animation: rise .45s var(--ease) both; }
[role="tabpanel"] .tile:nth-child(2) { animation-delay: .04s; } [role="tabpanel"] .tile:nth-child(3) { animation-delay: .08s; }
[role="tabpanel"] .tile:nth-child(4) { animation-delay: .12s; } [role="tabpanel"] .tile:nth-child(5) { animation-delay: .16s; }
[role="tabpanel"] .tile:nth-child(6) { animation-delay: .2s; }

/* tiles: label, big value, note. data-metric="x" gives value text, underline, hover glow and brackets that metric's colour */
.tile .label { color: var(--muted); font-size: 10.5px; }
.tile .value { margin-top: 2px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .note { margin-top: 2px; color: var(--muted); font-size: 11px; }
[data-metric="requests"] { --tint: var(--m-requests); } [data-metric="tokens"] { --tint: var(--m-tokens); }
[data-metric="data"] { --tint: var(--m-data); }         [data-metric="busy"] { --tint: var(--m-busy); }
[data-metric="energy"] { --tint: var(--m-energy); }     [data-metric="cost"] { --tint: var(--m-cost); }
[data-metric="users"] { --tint: var(--m-users); }
.tile[data-metric] { box-shadow: inset 0 -2px 0 -1px rgba(var(--tint), .45); }
.tile[data-metric] .value { color: color-mix(in srgb, rgb(var(--tint)) 72%, white); }
.tile[data-metric]:hover { border-color: rgba(var(--tint), .35); box-shadow: inset 0 -2px 0 -1px rgba(var(--tint), .8), 0 10px 30px -16px rgba(var(--tint), .4); }
.tile[data-metric]:hover::after { --c: rgb(var(--tint)); --l: 14px; }
.card-head[data-metric] h2::before { background: linear-gradient(rgb(var(--tint)), rgba(var(--tint), .25)); }
.skeleton { position: relative; overflow: hidden; min-height: 86px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------------------------------------------------------------------------ BUTTONS, INPUTS, SWITCH, SEGMENTED */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 13px;
  font-size: 11px; letter-spacing: .08em; color: var(--text); background: rgba(255, 255, 255, .025); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s, filter .15s, box-shadow .2s; }
.btn:hover { background: rgba(255, 255, 255, .06); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--hl); border-color: transparent; color: var(--hl-ink); font-weight: 600;
  box-shadow: 0 0 0 1px rgba(var(--hl-rgb), .4), 0 6px 22px -8px rgba(var(--hl-rgb), .7); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(var(--hl-rgb), .6), 0 8px 26px -8px rgba(var(--hl-rgb), .9); }
.btn.danger { color: var(--critical); }
.btn.danger-solid { background: var(--critical); border-color: transparent; color: #fff; font-weight: 600; }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: none; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .25; pointer-events: none; animation: ripple .55s ease-out; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; font-size: 12.5px; font-family: var(--mono); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; min-height: 34px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hl); box-shadow: 0 0 0 3px rgba(var(--hl-rgb), .2); }
input:disabled { opacity: .45; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11px; font-weight: 500; color: var(--text-2); }
.field small { color: var(--text-2); font-size: 12px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label.toggle { display: flex; gap: 12px; align-items: center; font-size: 13px; cursor: pointer; }
input.switch { appearance: none; -webkit-appearance: none; position: relative; width: 38px; height: 22px; margin: 0; flex: none; cursor: pointer;
  border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background-color .25s; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
input.switch:checked { background: var(--hl); border-color: transparent; }
input.switch:checked::after { transform: translateX(16px); }
input.switch.big:checked { background: var(--good); }   /* a master on/off that means "service is live" is green, not amber */
input.switch:disabled { opacity: .4; cursor: default; }

.seg { position: relative; display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255, 255, 255, .025); }
.seg button { position: relative; z-index: 1; border: 0; background: none; color: var(--text-2); padding: 5px 12px; min-height: 28px; font-size: 11px; letter-spacing: .08em; cursor: pointer; border-radius: 2px; transition: color .2s; }
.seg button[aria-pressed="true"] { color: var(--hl); font-weight: 600; background: rgba(var(--hl-rgb), .12); box-shadow: inset 0 0 0 1px rgba(var(--hl-rgb), .45); }
.seg.mini { padding: 2px; } .seg.mini button { padding: 3px 9px; min-height: 24px; font-size: 12px; }

/* ------------------------------------------------------------------------------------------------ STATUS: pills, banners, toasts */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; padding: 2px 9px; border-radius: 3px; border: 1px solid var(--border); color: var(--text-2); }
.pill.good { color: var(--good); border-color: rgba(var(--good-rgb), .4); }
.pill.warn { color: var(--warning); border-color: rgba(250, 178, 25, .4); }
.pill.bad { color: var(--critical); border-color: rgba(230, 103, 103, .4); }
.pill.admin { color: var(--text); border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .05); }   /* a role: neutral */
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: var(--gap); border-radius: var(--radius);
  background: var(--warn-wash); border: 1px solid var(--warning); animation: rise .3s ease both; }
.banner.bad { background: rgba(230, 103, 103, .1); border-color: var(--critical); }
.toast { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: var(--radius); background: #0e0e0f; border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 13px; animation: toast-in .35s var(--ease-pop); }
.toast.out { animation: toast-out .3s ease forwards; }
.toast.err { border-color: var(--critical); } .toast.ok .dot { background: var(--good); } .toast.err .dot { background: var(--critical); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 20; max-width: calc(100vw - 32px); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ------------------------------------------------------------------------------------------------ TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-size: 10.5px; font-weight: 500; }
td.num, th.num { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: rgba(255, 255, 255, .03); }
tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 rgba(255, 255, 255, .45); }   /* neutral: rows aren't actions */
tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--border-strong); font-size: 12.5px; }
tr.idle td { color: var(--text); background: color-mix(in srgb, var(--idle) 14%, transparent); }
tr.idle td:first-child { font-weight: 600; }
.empty { color: var(--text-2); padding: 22px 10px; text-align: center; border-bottom: 0; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; flex: none; }
.sw.idle { background: repeating-linear-gradient(135deg, var(--idle) 0 2px, var(--idle-stripe) 2px 3.5px); }
code.inline { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 3px; word-break: break-all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 12px 14px; align-items: start; }
.kv > .k { color: var(--muted); font-size: 10.5px; min-height: 26px; display: flex; align-items: center; }
.kv > span:not(.k) { min-height: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }

/* ------------------------------------------------------------------------------------------------ GAUGES + METERS
   Colour = LEVEL. orionGauge() / orionMeter() in orion-hud.js set --g to the band's rgb. */
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gauge svg { width: 96px; height: 96px; overflow: visible; }
.gauge .track { fill: none; stroke: var(--surface-3); stroke-width: 6; }
.gauge .bar { fill: none; stroke: rgb(var(--g, 150, 150, 156)); stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset .8s var(--ease), stroke .4s; filter: drop-shadow(0 0 5px rgba(var(--g, 150, 150, 156), .5)); }
.gauge .bands { transform: rotate(-90deg); transform-origin: 50% 50%; }
.gauge .band { fill: none; stroke-width: 2.5; opacity: .5; }          /* the whole scale, faint, behind the bar */
.gauge .mark { stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; opacity: .85; transform-origin: 50px 50px; transition: transform .6s var(--ease); }
.gauge text { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; fill: color-mix(in srgb, rgb(var(--g, 150, 150, 156)) 72%, white); }
.gauge .glabel { color: var(--muted); font-size: 10.5px; }
.gauge .gsub { font-size: 11px; font-variant-numeric: tabular-nums; color: color-mix(in srgb, rgb(var(--g, 150, 150, 156)) 45%, var(--muted)); }
.gauge:hover .bar { filter: drop-shadow(0 0 9px rgba(var(--g, 150, 150, 156), .85)); }
.meter { margin-bottom: 12px; }
.meter .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.meter .top b { font: 600 13px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.meter .track { position: relative; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: rgb(var(--g, 150, 150, 156));
  box-shadow: 0 0 12px rgba(var(--g, 150, 150, 156), .45); transition: width .6s var(--ease), background-color .3s; }
.meter .why { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, rgba(255, 255, 255, .5), var(--good)); transition: width .6s var(--ease); }
.livebar { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; padding: 10px 0 12px; border-top: 1px solid var(--grid); }
.livebar .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.livebar .lbl { color: var(--muted); font-size: 10.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; }

/* ------------------------------------------------------------------------------------------------ DIALOG */
dialog { position: fixed; overflow: visible; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0; background: #0e0e0f; color: var(--text);
  box-shadow: var(--shadow); width: min(440px, calc(100vw - 32px)); }
dialog[open] { animation: pop .25s var(--ease-pop); }
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
.dlg { padding: 22px; }
.dlg h2 { margin-bottom: 8px; }
.dlg p { margin: 0 0 14px; color: var(--text-2); }
.dlg .row { justify-content: flex-end; margin-top: 20px; }

/* ------------------------------------------------------------------------------------------------ ORION MARK + FOOTER
   The constellation is drawn by orionSVG(). Keep it SMALL and quiet: "Powered by Orion" is the only Orion element. */
.orion line { stroke: currentColor; stroke-width: .9; stroke-linecap: round; opacity: .45; }
.orion circle { fill: currentColor; }
.orion .glow { opacity: .22; }
.orion .betelgeuse { fill: var(--betelgeuse); } .orion .rigel { fill: var(--rigel); }
.orion.draw line { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw-line .9s cubic-bezier(.6, 0, .2, 1) forwards; }
.orion.draw circle { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: star-pop .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.orion.twinkle circle:not(.glow) { animation: twinkle 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.orion.twinkle circle:nth-of-type(3n) { animation-delay: -1.1s; } .orion.twinkle circle:nth-of-type(3n+1) { animation-delay: -2.2s; }
@keyframes draw-line { to { stroke-dashoffset: 0; } } @keyframes star-pop { to { transform: scale(1); } } @keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
footer.orion-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; text-align: center; padding: 32px 0 6px; }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font: 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.keys span { display: inline-flex; align-items: center; gap: 7px; }
.powered { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin: 0 auto; padding: 6px 10px; background: none; border: 0; cursor: default;
  font: 8.5px var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.powered svg { width: 15px; height: 15px; color: var(--muted); }
.powered b { font-family: var(--display); font-size: 8.5px; font-weight: 700; letter-spacing: .4em; margin-right: -.4em; color: var(--text-2); }
.powered .zw { font-size: 0; letter-spacing: 0; }   /* the hidden watermark characters must not inherit letter-spacing or the label drifts off-centre */
#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--page); transition: opacity .6s ease, visibility .6s; }
#splash.gone { opacity: 0; visibility: hidden; }
#splash .inner { text-align: center; }
#splash svg { width: 120px; height: 120px; color: #fff; filter: drop-shadow(0 0 16px rgba(140, 185, 255, .45)); }
#splash .title { margin-top: 16px; font: 700 20px var(--display); letter-spacing: .24em; text-transform: uppercase; opacity: 0; animation: rise .6s .7s ease forwards; }
#splash .by { margin-top: 6px; font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); opacity: 0; animation: rise .6s .9s ease forwards; }
#splash .by b { font-family: var(--display); letter-spacing: .38em; color: var(--text-2); }

/* ------------------------------------------------------------------------------------------------ RESPONSIVE + MOTION */
@media (max-width: 560px) {
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .gauge svg { width: 76px; height: 76px; }
  nav kbd, .keys { display: none; }                       /* phones have no keyboard */
  header { gap: 12px; padding-top: 12px; }
  .head-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
  .head-actions > * { justify-content: center; min-height: 34px; }
  nav { margin: 0 -16px; padding: 0 16px;                 /* tabs scroll sideways and fade at the edge */
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent); }
  nav button { padding: 8px 10px 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
