@charset "utf-8";
/* Vos Imperium portal v4: tactical HUD.
   Built on the group's Second Life HUD: machined chassis lit from the top left, recessed modules with a
   broken red frame (gaps at top and bottom centre, two opposite corners rounded), engraved captions,
   triangular rivet plates, black display strips.
   Rules:
   - Light comes from the top left: top/left edges are bright, bottom/right edges dark.
   - Red is the backlight of things you can press and of the selected state. Orange is caution and
     secondary functions. Green is operational. Violet is technical information. Each also carries text.
   - Every horizontal inset inside a panel is --x; vertical steps are multiples of 8px.
   Contents: tokens, base, chassis, rail, command bar, system bar, page, panels, readouts, tables,
   lights and tags, buttons, forms, messages, filters, armory, records, dialog, legacy, motion, responsive. */

@font-face { font-family: "Barlow"; src: url("/fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Big Shoulders Display"; src: url("/fonts/big-shoulders-display-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ================================================================ tokens */
:root {
  /* palette */
  --carbon: #0A0A0A;
  --carbon-2: #121212;
  --steel: #1C1C1C;
  --steel-2: #292929;
  --metal: #383838;
  --edge: #505050;
  --glint: #686868;
  --red: #E50909;
  --red-deep: #780909;
  --red-lit: #FF3333;
  --red-glow: #FF7777;
  --orange: #EF7800;
  --green: #24F02C;
  --violet: #9696FF;
  --ink: #D5D5D5;
  --ink-2: #999999;
  --ink-off: #606060;
  --bright: #F4F4F4;

  /* roles */
  --bg: var(--carbon);
  --panel: var(--steel);
  --panel-2: var(--steel-2);
  --panel-3: var(--metal);
  --well: #060606;
  --line: #2b2b2b;
  --line-2: #3d3d3d;
  --line-strong: var(--edge);
  --muted: var(--ink-2);
  --icon: var(--ink);
  --friend: var(--green);
  --hostile: var(--red-lit);
  --info: var(--violet);
  --amber: var(--orange);

  /* type */
  --display: "Big Shoulders Display", "Barlow Condensed", "Arial Narrow", sans-serif;
  --label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  /* space and size */
  --x: 16px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ctl: 38px;
  --ctl-sm: 30px;
  --rail: 164px;
  --bar: 60px;
  --gap: 10px;

  /* shape: opposite corners, as on the HUD modules */
  --r: 3px;
  --cut: 9px 2px 9px 2px;
  --cut-sm: 6px 2px 6px 2px;
  --cut-lg: 16px 3px 16px 3px;

  /* depth */
  --bevel: #5c5c5c #202020 #141414 #4a4a4a;                       /* raised: lit top and left */
  --bevel-in: #0c0c0c #2c2c2c #3a3a3a #101010;                    /* recessed: lit bottom and right */
  --recess: 0 0 0 2px #000, 0 1px 0 2px rgba(104,104,104,.32);    /* the black seat a part sits in */
  --drop: 0 8px 18px -6px rgba(0,0,0,.9);
  --in: inset 0 2px 6px rgba(0,0,0,.85), inset 0 0 0 1px rgba(0,0,0,.6);
  --lit: inset 0 0 14px rgba(229,9,9,.42), 0 0 10px rgba(255,51,51,.38);
  --face: linear-gradient(168deg, #3a3a3a 0%, #262626 42%, #191919 100%);
  --face-up: linear-gradient(168deg, #474747 0%, #303030 42%, #202020 100%);
  --face-red: linear-gradient(168deg, #4a0d0d 0%, #2a0808 45%, #140404 100%);
  --face-red-up: linear-gradient(168deg, #7d1212 0%, #480b0b 45%, #200505 100%);
  --scan: repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --rivet-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Cpath d='M0 0l10 10L0 20z' fill='%23860d0d'/%3E%3Cpath d='M0 .7L9.300 10 0 19.300' fill='none' stroke='%23000'/%3E%3Ccircle cx='3.200' cy='10' r='1.700' fill='%23999'/%3E%3Ccircle cx='2.800' cy='9.500' r='.7' fill='%23eee'/%3E%3C/svg%3E");
  --rivet-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Cpath d='M10 0L0 10l10 10z' fill='%23860d0d'/%3E%3Cpath d='M10 .7L.7 10l9.300 9.300' fill='none' stroke='%23000'/%3E%3Ccircle cx='6.800' cy='10' r='1.700' fill='%23999'/%3E%3Ccircle cx='6.400' cy='9.500' r='.7' fill='%23eee'/%3E%3C/svg%3E");
  --screw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Ccircle cx='6' cy='6' r='5.500' fill='%23000'/%3E%3Ccircle cx='6' cy='6' r='4.500' fill='%233a3a3a'/%3E%3Cpath d='M2.500 4.500A4 4 0 0 1 8 2.300' stroke='%23777' fill='none'/%3E%3Cpath d='M3.500 8.500l5-5' stroke='%23000' stroke-width='1.400'/%3E%3C/svg%3E");

  /* motion */
  --t-hover: 150ms;
  --t-press: 90ms;
  --t-open: 220ms;
  --out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
  accent-color: var(--red);
}

/* ================================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--metal) var(--carbon); scrollbar-width: thin; scroll-padding-top: calc(var(--bar) + 24px); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 400 15px/1.5 var(--body); font-variant-numeric: tabular-nums;
  background: var(--grain), radial-gradient(1200px 700px at 8% -10%, #2a2a2a 0%, #141414 45%, transparent 75%), var(--carbon); background-attachment: scroll, fixed, scroll; }
::selection { background: var(--red); color: #fff; }
a { color: var(--red-glow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffb0b0; }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }
main:focus { outline: none; }
img { max-width: 100%; }
p { margin: 0 0 var(--s3); max-width: 72ch; }
h1, h2, h3 { margin: 0; text-transform: uppercase; line-height: 1.1; text-wrap: balance; }
h1 { font: 800 34px/1.05 var(--display); letter-spacing: .035em; color: #c9c9c9; text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255,255,255,.14), 0 3px 6px #000; }
h2 { font: 700 19px/1.1 var(--display); letter-spacing: .07em; }
h3 { font: 600 15px/1.2 var(--label); letter-spacing: .08em; color: var(--ink); }
hr { border: 0; height: 2px; margin: var(--s5) 0; background: linear-gradient(#000 50%, var(--line-2) 50%); }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; color: var(--icon); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 10px 14px; z-index: 60; font-weight: 600; }
.skip:focus { left: 8px; }

/* ================================================================ chassis */
.chassis { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: var(--gap); padding: var(--gap); max-width: 1920px; margin: 0 auto; min-height: 100vh; align-items: start; }
.deck { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; min-height: calc(100vh - 2 * var(--gap)); }

/* ================================================================ rail: the HUD itself */
.rail { position: sticky; top: var(--gap); height: calc(100vh - 2 * var(--gap)); border: 9px solid; border-color: #5a5a5a #232323 #0d0d0d #474747; border-radius: 34px 4px 26px 4px; background: #101010; box-shadow: 0 0 0 1px #000, 0 10px 30px -8px #000; }
.rail-face { position: relative; height: 100%; display: flex; flex-direction: column; align-items: stretch; padding: 12px 0 12px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  border-radius: 25px 2px 18px 2px; background: var(--grain), linear-gradient(180deg, #343434 0%, #262626 30%, #131313 72%, #0c0c0c 100%); box-shadow: inset 0 0 0 1px #000, inset 3px 4px 8px rgba(0,0,0,.65); }
.rail-mark { display: block; width: 56px; height: 56px; margin: 0 auto 8px; }
.rail-mark img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }
.rail nav { flex: 1 0 auto; }
.modules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.modules li { position: relative; padding: 0 18px; background: var(--rivet-l) left 0 bottom 1px / 10px 20px no-repeat, var(--rivet-r) right 0 bottom 1px / 10px 20px no-repeat; }

.triad { display: flex; gap: 4px; justify-content: center; margin: 0 0 12px; }
.led { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid #000; background: #2a2a2a; box-shadow: inset 0 1px 2px #000, 0 1px 0 rgba(255,255,255,.08); transition: background-color 200ms, box-shadow 200ms; }
.led-red { background: #3a0c0c; } .led-violet { background: #23233f; } .led-green { background: #0d3010; }
.led-red.is-on { background: #ff2424; box-shadow: 0 0 8px rgba(255,36,36,.8), inset 0 1px 0 rgba(255,255,255,.55); }
.led-violet.is-on { background: #acacff; box-shadow: 0 0 8px rgba(150,150,255,.7), inset 0 1px 0 rgba(255,255,255,.65); }
.led-green.is-on { background: #27ff27; box-shadow: 0 0 8px rgba(36,240,44,.7), inset 0 1px 0 rgba(255,255,255,.65); }
.triad .led { width: 28px; height: 10px; border-radius: 1px; }
.triad .led:first-child { border-radius: 8px 1px 1px 1px; }
.triad .led:last-child { border-radius: 1px 1px 8px 1px; }

.mod { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); outline-offset: 4px; }
.mod-name { order: 2; padding: 5px 0 1px; text-align: center; font: 800 21px/1 var(--display); letter-spacing: .045em; text-transform: uppercase; color: #9e9e9e; text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255,255,255,.16); transition: color var(--t-hover); }
.mod-frame { order: 1; position: relative; display: block; border: 2px solid #a30b0b; border-radius: var(--cut); background: #0b0b0b; box-shadow: 0 0 0 4px #070707, 0 1px 0 4px rgba(104,104,104,.28), 2px 3px 0 4px rgba(0,0,0,.5); transition: border-color var(--t-hover), box-shadow var(--t-hover), transform var(--t-press) var(--out); }
.mod-frame::before { content: ""; position: absolute; z-index: 2; left: calc(50% - 8px); width: 16px; top: -2px; bottom: -2px; pointer-events: none; background: linear-gradient(#070707, #070707) top / 100% 2px no-repeat, linear-gradient(#070707, #070707) bottom / 100% 2px no-repeat; }
.mod-bay { display: grid; place-items: center; height: 46px; border-radius: 7px 0 0 0; background: linear-gradient(160deg, #4b4b4b 0%, #303030 55%, #232323 100%); box-shadow: inset 0 2px 5px rgba(0,0,0,.6); transition: background-color var(--t-hover); }
.mod-icon { width: 40px; height: 34px; color: #ff6d6d; filter: drop-shadow(0 0 3px rgba(229,9,9,.75)); transition: color var(--t-hover), filter var(--t-hover); }
.mod-strip { display: block; min-height: 23px; padding: 2px 4px; border-top: 2px solid #8a0a0a; border-radius: 0 0 7px 0; text-align: center; font: 500 13px/17px var(--mono); letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; color: var(--bright); background: var(--scan), #090909; text-shadow: 0 0 2px #000, 0 1px 2px #000; transition: border-color var(--t-hover); }
.mod-strip:empty { display: none; }
.mod-frame:has(.mod-strip:empty) .mod-bay { border-radius: 7px 0 7px 0; }
.mod:hover .mod-frame { border-color: var(--red); box-shadow: 0 0 0 4px #070707, 0 1px 0 4px rgba(104,104,104,.28), inset 0 0 10px rgba(229,9,9,.4), 0 0 12px 1px rgba(255,51,51,.35); }
.mod:hover .mod-icon { color: #ffc4c4; }
.mod:hover .mod-name { color: var(--bright); }
.mod:active .mod-frame { transform: translateY(2px); box-shadow: 0 0 0 4px #070707, inset 0 4px 10px #000; }
.mod[aria-current] .mod-frame { border-color: var(--red-lit); box-shadow: 0 0 0 4px #070707, 0 1px 0 4px rgba(104,104,104,.28), 0 0 16px 2px rgba(255,51,51,.5); }
.mod[aria-current] .mod-bay { background: radial-gradient(ellipse at 50% 55%, #7a1414 0%, #3b1212 55%, #271313 100%); }
.mod[aria-current] .mod-icon { color: #ffe1e1; filter: drop-shadow(0 0 5px rgba(255,51,51,1)); }
.mod[aria-current] .mod-strip { border-top-color: var(--red-lit); }
.mod[aria-current] .mod-name { color: var(--bright); text-shadow: 0 0 8px rgba(255,51,51,.75), 0 1px 1px #000; }

/* the orange toggle: secondary function */
.rail-key { position: relative; flex: none; display: flex; align-items: center; justify-content: center; height: 34px; margin: 18px 18px 4px; border: 3px solid var(--orange); border-radius: var(--cut); background: linear-gradient(#2b2b2b, #151515); text-decoration: none; font: 800 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #b4b4b4; text-shadow: 0 1px 1px #000; box-shadow: 0 0 0 3px #070707, inset 0 0 8px rgba(0,0,0,.8); transition: color var(--t-hover), box-shadow var(--t-hover), transform var(--t-press) var(--out); }
.rail-key::before { content: ""; position: absolute; left: calc(50% - 8px); width: 16px; top: -3px; bottom: -3px; background: linear-gradient(#070707, #070707) top / 100% 3px no-repeat, linear-gradient(#070707, #070707) bottom / 100% 3px no-repeat; }
.rail-key:hover { color: #fff; box-shadow: 0 0 0 3px #070707, inset 0 0 12px rgba(239,120,0,.35), 0 0 12px rgba(239,120,0,.4); }
.rail-key:active { transform: translateY(2px); }

/* ================================================================ command bar */
.command { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s4); min-height: var(--bar); padding: 8px 22px; border: 4px solid; border-color: var(--bevel); border-radius: 4px 16px 4px 4px; background: var(--screw) left 5px center no-repeat, var(--screw) right 5px center no-repeat, var(--grain), linear-gradient(180deg, #3a3a3a, #232323 45%, #161616); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 10px 16px -4px rgba(0,0,0,.85); }
.command-mark { display: none; flex: none; }
.command-mark img { display: block; width: 36px; height: 36px; object-fit: contain; }
.wordmark { flex: 1; min-width: 0; padding-left: 4px; font: 800 24px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #8d8d8d; text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255,255,255,.18); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { flex: 1; display: flex; gap: 10px; min-width: 0; padding: 4px; margin: -4px 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; flex: none; display: flex; align-items: center; height: 36px; padding: 0 16px; border: 2px solid #454545; border-radius: var(--cut-sm); background: var(--face); box-shadow: var(--recess); color: var(--ink); text-decoration: none; white-space: nowrap; font: 600 15px/1 var(--label); letter-spacing: .09em; text-transform: uppercase; text-shadow: 0 1px 1px #000; transition: border-color var(--t-hover), color var(--t-hover), box-shadow var(--t-hover), transform var(--t-press) var(--out); }
.tabs a:hover { border-color: var(--red); color: #fff; }
.tabs a:active { transform: translateY(2px); }

.readouts { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.readout { display: inline-flex; align-items: baseline; gap: 7px; height: 36px; padding: 0 11px; border: 2px solid; border-color: var(--bevel-in); border-radius: var(--r); background: var(--scan), var(--well); box-shadow: var(--in); font: 500 18px/32px var(--mono); color: var(--bright); white-space: nowrap; }
.readout small { font: 600 12px/1 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.readout-credits { color: #ffab57; }
.readout-clock { color: #b9b9ff; }

.whoami { position: relative; }
.whoami > summary { list-style: none; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border: 2px solid #4a4a4a; border-radius: var(--cut-sm); background: var(--face); box-shadow: var(--recess); cursor: pointer; font: 600 16px/1 var(--label); letter-spacing: .04em; color: var(--bright); white-space: nowrap; transition: border-color var(--t-hover), box-shadow var(--t-hover); }
.whoami > summary::-webkit-details-marker { display: none; }
.whoami > summary:hover, .whoami[open] > summary { border-color: var(--red); box-shadow: var(--recess), inset 0 0 12px rgba(229,9,9,.35); }
.whoami .name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.whoami .rank { padding: 4px 6px; border: 1px solid #000; background: var(--well); color: var(--ink-2); font: 500 12px/1 var(--mono); }
.whoami-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; min-width: 240px; padding: 6px; border: 4px solid; border-color: var(--bevel); border-radius: var(--cut); background: var(--grain), #191919; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 18px 36px rgba(0,0,0,.85); animation: open var(--t-open) var(--out); }
.whoami-menu a { display: flex; align-items: center; gap: var(--s3); min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r); color: var(--ink); text-decoration: none; font: 600 16px/1 var(--label); letter-spacing: .04em; }
.whoami-menu a:hover, .whoami-menu a:focus-visible { background: #2a0a0a; border-color: var(--red-deep); color: #fff; }
.whoami-menu hr { margin: 6px 0; }

/* ================================================================ system bar */
.sysbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; min-height: 40px; margin-top: auto; padding: 6px 8px; border: 4px solid; border-color: var(--bevel); border-radius: 4px 4px 14px 4px; background: var(--grain), linear-gradient(#222, #131313); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000; font: 400 12.5px/1.4 var(--mono); color: var(--ink-2); }
.sysbar > span { display: inline-flex; align-items: center; gap: 8px; padding: 2px 14px; border-right: 1px solid #000; box-shadow: 1px 0 0 #3a3a3a; }
.sysbar > span:last-child { border-right: 0; box-shadow: none; }
.sysbar-id { font: 700 15px/1.3 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.sysbar-links { margin-left: auto; gap: 16px !important; }
.sysbar-links a { color: var(--ink); padding: 4px 0; }
.sysbar-links a:hover { color: var(--red-glow); }

/* ================================================================ page */
.page { flex: 1; min-width: 0; padding: 14px 6px 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4) var(--s5); margin-bottom: var(--s5); flex-wrap: wrap; min-height: 40px; }
.page-head > div:first-child { min-width: 0; }
.page-sub { margin: 6px 0 0; color: var(--ink-2); font: 400 13px/1.5 var(--mono); max-width: none; }
.page-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin-bottom: 6px; font: 600 14px/1 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; }
.back .icon { width: 14px; height: 14px; color: currentColor; }
.back:hover { color: var(--red-glow); }

/* sign-in pages: one HUD unit on the bench */
body.is-bare { display: grid; place-items: center; padding: 24px 16px; }
.unit { width: 100%; max-width: 500px; border: 12px solid; border-color: #5a5a5a #232323 #0d0d0d #474747; border-radius: 40px 5px 32px 5px; background: #101010; box-shadow: 0 0 0 1px #000, 0 24px 60px -10px #000; }
.unit-face { padding: 26px 24px 8px; border-radius: 28px 2px 20px 2px; background: var(--rivet-l) left 0 top 90px no-repeat, var(--rivet-r) right 0 top 90px no-repeat, var(--rivet-l) left 0 bottom 44px no-repeat, var(--rivet-r) right 0 bottom 44px no-repeat, var(--grain), linear-gradient(180deg, #343434, #1e1e1e 50%, #0e0e0e); box-shadow: inset 0 0 0 1px #000, inset 3px 4px 10px rgba(0,0,0,.65); }
.bare-mark { display: block; width: 88px; margin: 0 auto 12px; }
.bare-mark img { width: 88px; height: 88px; display: block; filter: drop-shadow(0 3px 3px #000); }
body.is-bare .page-head { justify-content: center; text-align: center; }

/* ================================================================ layout */
.board { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: var(--s5); align-items: start; }
.stack { display: grid; gap: var(--s5); align-content: start; min-width: 0; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--s5); align-items: start; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.muted { color: #b4b4b4; }
.faint { color: var(--ink-2); }
.num { font-family: var(--mono); font-size: 13px; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.board > *, .split > *, .stack > * { min-width: 0; }
.stack + .plate, .plate + .plate, .plate + .stack, .board + .plate, .plate + .board, .split + .plate, .plate + .split, .board + .board, .msg + .board { margin-top: var(--s5); }
.board > .plate, .split > .plate, .stack > .plate, .board > .stack, .split > .stack { margin-top: 0; }

/* ================================================================ panels: bezel, black seam, recessed face */
.plate { position: relative; min-width: 0; border: 5px solid; border-color: var(--bevel); border-radius: var(--cut-lg); background: var(--grain), linear-gradient(170deg, #222 0%, #191919 40%, #131313 100%); box-shadow: 0 0 0 1px #000, inset 0 0 0 2px #000, inset 0 0 24px rgba(0,0,0,.55), var(--drop); }
.plate-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: var(--s2) var(--s4); min-height: 46px; margin: 2px 2px 0; padding: 6px calc(var(--x) - 2px); flex-wrap: wrap; border-radius: 9px 1px 0 0; border-bottom: 2px solid #000; background: var(--rivet-l) left 0 center no-repeat, var(--rivet-r) right 0 center no-repeat, linear-gradient(180deg, #3b3b3b, #282828 50%, #1d1d1d); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 0 rgba(104,104,104,.28); }
.plate-head h2 { color: #b9b9b9; text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255,255,255,.14); }
.plate-note { font: 400 12.5px/1.4 var(--mono); color: #b0b0b0; }
a.plate-note { color: var(--red-glow); }
.plate-body { padding: var(--x); }
.plate-body > :last-child { margin-bottom: 0; }
.plate-sep { border-top: 1px solid #000; box-shadow: inset 0 1px 0 var(--line-2); }
.empty { margin: 0; padding: var(--s5) var(--x); color: var(--ink-2); max-width: none; }
.plate > .msg { margin: var(--x); }

/* digital displays: status figures */
.status { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.status div { display: flex; flex-direction: column-reverse; min-width: 92px; padding: 8px 12px 7px; border: 2px solid; border-color: var(--bevel-in); border-radius: var(--cut-sm); background: var(--scan), var(--well); box-shadow: var(--in), 0 0 0 1px #000; }
.page-actions .status div { align-items: flex-end; text-align: right; }
.status dt { font: 600 12px/1.3 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.status dd { margin: 0; font: 500 24px/1.1 var(--mono); color: var(--bright); }
.status dd.is-signal, .credits-figure { color: #ffab57; }
.status dd.is-alert { color: var(--red-lit); text-shadow: 0 0 8px rgba(255,51,51,.6); }
.status dd small { font: 500 13px var(--body); color: var(--red-glow); margin-left: 6px; text-shadow: none; }
.credits-figure { font: 500 13px/1 var(--mono); }

/* segmented gauge */
.segments { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #000; border-radius: 2px; background: var(--well); box-shadow: var(--in), 0 1px 0 rgba(255,255,255,.1); vertical-align: middle; }
.segments i { display: block; width: 8px; height: 12px; background: #2c1010; transform: skewX(-12deg); }
.segments i.on { background: linear-gradient(#ff6a6a, var(--red)); box-shadow: 0 0 4px rgba(229,9,9,.55); }

/* ================================================================ tables: data consoles */
.table-wrap { position: relative; overflow-x: auto; margin: 0 2px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 9px var(--x); text-align: left; vertical-align: middle; border-bottom: 1px solid #0b0b0b; }
table.data td { box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
table.data th { height: 34px; padding-top: 0; padding-bottom: 0; font: 600 13px/1 var(--label); letter-spacing: .09em; text-transform: uppercase; color: #a6a6a6; background: linear-gradient(#2c2c2c, #1c1c1c); border-bottom: 2px solid #000; text-shadow: 0 1px 0 #000; white-space: nowrap; }
table.data th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 30px; }
table.data th a:hover, table.data th[aria-sort] a { color: var(--red-glow); }
table.data th .icon { width: 12px; height: 12px; color: currentColor; }
table.data tbody tr:nth-child(even) { background: rgba(0,0,0,.26); }
table.data tbody tr { transition: background-color var(--t-hover); }
table.data tbody tr:hover { background: #2a0c0c; }
table.data tbody tr:has(input[type="checkbox"]:checked) { background: #380b0b; box-shadow: inset 2px 0 0 var(--red-lit); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; }
table.data td.num { font-family: var(--mono); font-size: 13px; }
table.data td.actions, table.data th.actions { text-align: right; white-space: nowrap; width: 1%; }
table.data td.actions .btn + .btn { margin-left: 10px; }
table.data .name { font-weight: 600; color: var(--bright); text-decoration: none; }
table.data a.name:hover { color: var(--red-glow); text-decoration: underline; }
table.data tr.is-muted td { color: var(--ink-2); }
table.data.compact td { padding-top: 7px; padding-bottom: 7px; }
table.data td:first-child { white-space: nowrap; }

/* roster groups and rank insignia */
table.data td:has(> .rank-badge) { padding-top: 4px; padding-bottom: 4px; }
table.data tbody tr.group-row, table.data tbody tr.group-row:hover { background: none; }
table.data .group-row th { height: 46px; padding-top: 16px; padding-bottom: 8px; background: linear-gradient(180deg, #0d0d0d, #1c1c1c 40%, #2c2c2c); border-top: 2px solid #000; border-bottom: 2px solid #8a0a0a; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); letter-spacing: 0; }
table.data tbody:first-of-type .group-row th { padding-top: 10px; }
.group-row h2 { display: inline-block; font-size: 20px; color: #c4c4c4; text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255,255,255,.14); }
.group-row span { margin-left: 10px; font: 400 13px/1 var(--mono); color: #b0b0b0; }
.rank-badge { display: inline-flex; align-items: center; gap: 8px; min-width: 92px; margin-right: 10px; vertical-align: middle; }
.rank-icon { flex: none; display: grid; place-items: center; width: 40px; height: 36px; }
.rank-icon img { max-width: 100%; max-height: 100%; filter: drop-shadow(0 1px 1px #000); }
.rank-badge + .muted { vertical-align: middle; }
.rank-code { font: 600 14px/1 var(--label); letter-spacing: .05em; color: var(--ink); }
.facts dt:has(+ dd .rank-badge) { padding-top: 9px; }
.about-text { font-size: 16px; overflow-wrap: anywhere; }

/* ================================================================ lights and tags */
.heat { display: inline-block; width: 9px; height: 9px; margin-right: var(--s3); vertical-align: 1px; border: 1px solid #000; border-radius: 2px; background: #262626; box-shadow: 0 1px 0 rgba(255,255,255,.1); }
.heat-5 { background: #ffb057; box-shadow: 0 0 7px rgba(239,120,0,.9); }
.heat-4 { background: var(--orange); box-shadow: 0 0 4px rgba(239,120,0,.6); }
.heat-3 { background: #a85500; }
.heat-2 { background: #6b3a0a; }
.heat-1 { background: #3f2610; }
.heat-0 { background: #202020; }
.heat-legend { display: flex; align-items: center; gap: 3px; font: 400 12px/1 var(--mono); color: #b0b0b0; }
.heat-legend span:first-child { margin-right: var(--s2); }
.heat-legend span:last-child { margin-left: var(--s2); }
.heat-legend i { display: block; width: 9px; height: 9px; border: 1px solid #000; border-radius: 2px; box-shadow: none; }
.heat-text-5, .heat-text-4, .heat-text-3 { color: #ffab57; }

.tag { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 23px; padding: 0 8px; border: 1px solid #454545; border-radius: 4px 1px 4px 1px; background: linear-gradient(#2d2d2d, #1b1b1b); box-shadow: 0 0 0 1px #000; font: 600 13px/1 var(--label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; vertical-align: middle; }
.tag + .tag { margin-left: 6px; }
table.data td .tag { margin: 2px 6px 2px 0; }
table.data td .tag + .tag { margin-left: 0; }
.tag-hostile::before, .tag-friendly::before, .tag-warn::before, .tag-info::before, .tag-active::before, .tag-expiring::before, .tag-permanent::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 1px; background: currentColor; box-shadow: 0 0 5px currentColor; }
.tag-hostile { color: #ff8080; border-color: #a01010; background: #2b0606; }
.tag-hostile::before, .tag-permanent::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; background: var(--red-lit); }
.tag-friendly { color: #6ef573; border-color: #176b1b; background: #07200a; }
.tag-friendly::before { border-radius: 50%; background: var(--green); }
.tag-warn, .tag-expiring { color: #ffab57; border-color: #7d4105; background: #221203; }
.tag-warn::before, .tag-expiring::before { background: var(--orange); transform: rotate(45deg) scale(.85); }
.tag-active { color: #fff; border-color: var(--red-lit); background: var(--face-red-up); }
.tag-active::before { background: #ffb5b5; }
.tag-permanent { color: #ff8080; border-color: #6e0f0f; background: transparent; }
.tag-info { color: #b9b9ff; border-color: #43437d; background: #101024; }
.tag-lifted, .tag-expired { color: var(--ink-2); border-color: #333; background: transparent; box-shadow: none; }
.group-tag { display: inline-flex; align-items: center; min-height: 23px; padding: 0 7px; border: 1px solid #4a4a4a; border-left-width: 4px; border-radius: 2px; background: #141414; font: 600 13px/1 var(--label); letter-spacing: .05em; color: var(--ink); }

/* ================================================================ buttons: backlit keys */
.btn, button, input[type="submit"], input[type="button"], input[type="reset"] {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--ctl); padding: 0 18px; border: 2px solid #565656; border-radius: var(--cut-sm); background: var(--face); box-shadow: var(--recess), inset 0 1px 0 rgba(255,255,255,.12), inset 0 -5px 8px rgba(0,0,0,.35);
  color: var(--bright); font: 600 15px/1 var(--label); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; text-shadow: 0 1px 1px #000; cursor: pointer; white-space: nowrap; vertical-align: middle;
  transition: border-color var(--t-hover), background-color var(--t-hover), box-shadow var(--t-hover), color var(--t-hover), transform var(--t-press) var(--out);
}
.btn:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover { border-color: #8a8a8a; background: var(--face-up); color: #fff; box-shadow: var(--recess), inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 12px rgba(255,51,51,.16); }
.btn:active, button:active, input[type="submit"]:active, input[type="button"]:active { transform: translateY(2px); box-shadow: 0 0 0 2px #000, inset 0 4px 9px rgba(0,0,0,.85); }
.btn .icon { color: currentColor; }

.btn-primary, button.btn-primary, input[type="submit"].btn-primary { border-color: var(--red); background: var(--face-red); color: #fff; box-shadow: var(--recess), inset 0 0 10px rgba(229,9,9,.45), 0 0 8px 2px rgba(229,9,9,.22); }
.btn-primary:hover, button.btn-primary:hover, input[type="submit"].btn-primary:hover { border-color: var(--red-lit); background: var(--face-red-up); color: #fff; box-shadow: var(--recess), inset 0 0 16px rgba(255,51,51,.65), 0 0 14px 2px rgba(255,51,51,.42); }
.btn-primary:active, button.btn-primary:active { box-shadow: 0 0 0 2px #000, inset 0 4px 12px #000, inset 0 0 14px rgba(255,51,51,.5); }
.btn-primary::before, .tabs a[aria-current]::before, .filters [aria-current]::before, .pager [aria-current]::before { content: ""; position: absolute; left: calc(50% - 7px); width: 14px; top: -2px; bottom: -2px; pointer-events: none; background: linear-gradient(#050505, #050505) top / 100% 2px no-repeat, linear-gradient(#050505, #050505) bottom / 100% 2px no-repeat; }

/* caution: orange frame + hazard block */
.btn-danger, button.btn-danger { padding-left: 32px; border-color: var(--orange); background: linear-gradient(168deg, #2d1d0c, #1b1208 45%, #0f0a05); color: #ffc48a; }
.btn-danger::after { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 18px; border-radius: 3px 1px 1px 1px; background: repeating-linear-gradient(135deg, var(--orange) 0 4px, #120a02 4px 8px); opacity: .85; }
.btn-danger:hover, button.btn-danger:hover { border-color: #ff9a2e; background: linear-gradient(168deg, #4a2c0c, #2c1a08 45%, #180e04); color: #fff; box-shadow: var(--recess), inset 0 0 14px rgba(239,120,0,.4), 0 0 12px rgba(239,120,0,.35); }
.btn-ghost, button.btn-ghost { border-color: #444; background: linear-gradient(#202020, #161616); color: var(--ink); }
.btn-small, button.btn-small { height: var(--ctl-sm); padding: 0 12px; font-size: 14px; letter-spacing: .06em; }
.btn-small.btn-danger { padding-left: 24px; }
.btn-small.btn-danger::after { left: 3px; top: 3px; bottom: 3px; width: 13px; }
.btn-small .icon { width: 14px; height: 14px; }
.btn[disabled], button[disabled], .btn.is-disabled, .button-disabled { border-color: #333; background: #161616; color: #8a8a8a; box-shadow: 0 0 0 2px #000; text-shadow: none; cursor: not-allowed; transform: none; transition: none; }
.btn[disabled]:hover, button[disabled]:hover { border-color: #333; background: #161616; color: #8a8a8a; box-shadow: 0 0 0 2px #000; }
.btn[disabled]::before, .btn[disabled]::after { display: none; }

/* ================================================================ forms: recessed entry screens */
label { color: var(--ink); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], input[type="url"], input[type="email"], input[type="file"], select, textarea {
  height: var(--ctl); max-width: 100%; padding: 0 11px; border: 2px solid; border-color: var(--bevel-in); border-radius: var(--r); background-color: var(--well); background-image: var(--scan); box-shadow: var(--in), 0 0 0 1px #000, 0 1px 0 1px rgba(104,104,104,.3);
  color: var(--bright); font: 400 15px/1.4 var(--body); caret-color: var(--red-lit); vertical-align: middle; transition: border-color var(--t-hover), box-shadow var(--t-hover);
}
input[type="date"], input[type="time"], input[type="number"] { font-family: var(--mono); font-size: 14px; }
input[type="number"] { width: 120px; }
textarea { height: auto; width: 100%; min-height: 104px; padding: 9px 11px; resize: vertical; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='34'%3E%3Cpath d='M0 0h26v34H0z' fill='%23262626'/%3E%3Cpath d='M.5 0v34' stroke='%23000'/%3E%3Cpath d='M8 14.500h10l-5 6z' fill='%23ff5555'/%3E%3C/svg%3E"), var(--scan); background-position: right center, 0 0; background-repeat: no-repeat, repeat; }
select[multiple] { height: auto; padding: 4px; background-image: var(--scan); }
option { background: #141414; color: var(--bright); }
input::placeholder, textarea::placeholder { color: #8a8a8a; opacity: 1; }
input[type="text"]:hover, input[type="password"]:hover, input[type="number"]:hover, input[type="search"]:hover, input[type="date"]:hover, input[type="time"]:hover, input[type="url"]:hover, select:hover, textarea:hover { border-color: #2a2a2a #505050 #606060 #2a2a2a; }
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="date"]:focus, input[type="time"]:focus, input[type="search"]:focus, input[type="url"]:focus, input[type="file"]:focus, select:focus, textarea:focus { border-color: var(--red-lit); outline: 2px solid transparent; box-shadow: var(--in), 0 0 0 1px #000, 0 0 0 3px rgba(255,51,51,.35), inset 0 0 10px rgba(229,9,9,.25); }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--orange); }
input[readonly] { color: var(--ink-2); background-color: #101010; }
input[type="file"] { height: auto; padding: 6px; width: 100%; min-width: 0; }
input[type="file"]::file-selector-button { height: 28px; margin-right: 12px; padding: 0 12px; border: 2px solid #565656; border-radius: 4px 1px 4px 1px; background: var(--face); color: var(--bright); font: 600 14px/1 var(--label); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
input[type="color"] { border: 2px solid; border-color: var(--bevel-in); border-radius: var(--r); background: var(--well); }

/* lamp: checkbox and radio */
input[type="checkbox"], input[type="radio"] { appearance: none; flex: none; position: relative; width: 20px; height: 20px; margin: 0; border: 2px solid; border-color: var(--bevel-in); border-radius: 3px; background: var(--well); box-shadow: var(--in), 0 0 0 1px #000, 0 1px 0 1px rgba(104,104,104,.3); vertical-align: -4px; cursor: pointer; transition: box-shadow var(--t-hover), background-color var(--t-hover); }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::after, input[type="radio"]::after { content: ""; position: absolute; inset: 2px; border-radius: 1px; background: #2c1010; transition: background-color var(--t-hover), box-shadow var(--t-hover); }
input[type="radio"]::after { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--red-deep); }
input[type="checkbox"]:checked::after, input[type="radio"]:checked::after { background: var(--red); box-shadow: 0 0 8px rgba(255,51,51,.8), inset 0 1px 0 rgba(255,255,255,.4); }
input[type="checkbox"]:checked::before { content: ""; position: absolute; z-index: 1; left: 5px; top: 1px; width: 6px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; opacity: .5; }

/* mechanical toggle: a checkbox inside .check */
.check { display: flex; align-items: center; gap: var(--s3); min-height: 34px; margin: 0; color: var(--ink); cursor: pointer; }
.check input[type="checkbox"] { width: 46px; height: 22px; border-radius: 4px 1px 4px 1px; }
.check input[type="checkbox"]::before { content: ""; position: absolute; z-index: 1; left: 2px; top: 2px; width: 19px; height: 14px; border: 1px solid #000; border-radius: 2px; background: repeating-linear-gradient(90deg, #7a7a7a 0 1px, #3f3f3f 1px 4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px #000; transform: none; transition: transform 160ms var(--out); }
.check input[type="checkbox"]:checked::before { left: 2px; top: 2px; width: 19px; height: 14px; border: 1px solid #000; transform: translateX(19px); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 var(--s4); }

.field { display: grid; gap: 7px; margin-bottom: var(--s4); min-width: 0; }
.field > input[type="text"], .field > input[type="password"], .field > input[type="url"], .field > input[type="search"], .field > select { width: 100%; }
.field > label, .field-label, .facts dt { font: 600 14px/1.3 var(--label); letter-spacing: .07em; text-transform: uppercase; color: #a6a6a6; }
.field-hint { font-size: 13.5px; color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 var(--s4); }
.form-actions { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; padding-top: var(--x); margin-top: var(--s2); border-top: 1px solid #000; box-shadow: inset 0 1px 0 var(--line-2); }
.plate-body.form-actions { margin: 0 2px; padding: 14px calc(var(--x) - 2px); background: rgba(0,0,0,.28); }
.form-narrow { max-width: 620px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }

/* ================================================================ system messages */
.msg { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; padding: 12px var(--x); margin: 0 0 var(--s5); max-width: 100%; border: 2px solid; border-color: var(--bevel-in); border-radius: var(--cut-sm); background: var(--scan), #101010; box-shadow: var(--in), 0 0 0 1px #000; animation: open var(--t-open) var(--out); }
.msg .icon { align-self: center; color: currentColor; }
.msg > div { flex: 1 1 240px; min-width: 0; }
.msg > div > :last-child { margin-bottom: 0; }
.msg-label { font: 700 17px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.msg-error { border-color: #a01010; background: var(--scan), #220505; color: #ffd0d0; }
.msg-error .msg-label, .msg-error .icon { color: #ff8080; }
.msg-warn { border-color: #8a4a08; background: var(--scan), #1e1003; color: #ffdfb8; }
.msg-warn .msg-label, .msg-warn .icon { color: #ffab57; }
.msg-info { border-color: #176b1b; background: var(--scan), #061a08; color: #d2f5d3; }
.msg-info .msg-label, .msg-info .icon { color: #6ef573; animation: pulse 700ms ease-out 1; }
.msg-hint .msg-label, .msg-hint .icon { color: #b9b9ff; }

.alert-bar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; padding: 12px var(--x); margin-bottom: var(--s5); border: 3px solid var(--red); border-radius: var(--cut); background: repeating-linear-gradient(135deg, rgba(229,9,9,.1) 0 14px, transparent 14px 28px), #1f0404; box-shadow: 0 0 0 3px #000, inset 0 0 20px rgba(229,9,9,.35); color: #ffd0d0; }
.alert-bar > span { flex: 1 1 240px; }
.alert-bar strong { font: 800 21px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 0 8px var(--red-lit); }
.alert-bar .icon { width: 20px; height: 20px; color: var(--red-glow); }

/* ================================================================ filters and pager */
.filters, .pager { display: flex; flex-wrap: wrap; gap: 10px; }
.filters a, .filters > span, .pager a, .pager span { position: relative; display: inline-flex; align-items: center; justify-content: center; height: var(--ctl-sm); padding: 0 12px; border: 2px solid #444; border-radius: 5px 1px 5px 1px; background: var(--face); box-shadow: var(--recess); color: var(--ink); text-decoration: none; font: 600 14px/1 var(--label); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 1px #000; transition: border-color var(--t-hover), color var(--t-hover), transform var(--t-press) var(--out); }
.filters a:hover, .pager a:hover { border-color: var(--red); color: #fff; }
.filters a:active, .pager a:active { transform: translateY(1px); }
.filters [aria-current], .pager [aria-current], .tabs a[aria-current] { border-color: var(--red-lit); background: var(--face-red); color: #fff; box-shadow: var(--recess), inset 0 0 12px rgba(229,9,9,.55), 0 0 10px 2px rgba(255,51,51,.28); }
.filters .count { margin-left: 7px; font: 400 12px/1 var(--mono); letter-spacing: 0; color: #b0b0b0; text-shadow: none; }
.pager { padding: 14px var(--x); border-top: 1px solid #000; box-shadow: inset 0 1px 0 var(--line-2); }
.pager a, .pager span { min-width: 34px; padding: 0 8px; font: 500 13px/1 var(--mono); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px var(--s4); align-items: center; justify-content: space-between; min-height: 52px; margin: 0 2px; padding: 9px calc(var(--x) - 2px); border-bottom: 1px solid #000; box-shadow: 0 1px 0 rgba(104,104,104,.16); background: rgba(0,0,0,.2); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px var(--s5); margin-bottom: var(--s5); }
.gauge { display: inline-flex; align-items: center; gap: 10px; font: 400 13px/1 var(--mono); color: #b0b0b0; }

/* ================================================================ armory: equipment bays */
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 16px; padding: var(--x); }
.cell { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-height: 224px; border: 2px solid #4a4a4a; border-radius: var(--cut); background: linear-gradient(170deg, #2a2a2a, #171717); box-shadow: 0 0 0 3px #070707, 0 1px 0 3px rgba(104,104,104,.26); text-decoration: none; color: var(--ink); overflow: hidden; transition: border-color var(--t-hover), box-shadow var(--t-hover), transform var(--t-press) var(--out); }
.cell:hover { border-color: var(--red); box-shadow: 0 0 0 3px #070707, 0 1px 0 3px rgba(104,104,104,.26), inset 0 0 14px rgba(229,9,9,.35), 0 0 14px rgba(255,51,51,.3); }
.cell:active { transform: translateY(2px); }
.cell:hover .cell-name { color: #fff; }
.cell-img { aspect-ratio: 16 / 10; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; overflow: hidden; padding: var(--s2); border-bottom: 2px solid #000; background: radial-gradient(ellipse at 50% 46%, #868686 0%, #565656 38%, #2b2b2b 76%, #1b1b1b); box-shadow: inset 0 3px 8px rgba(0,0,0,.6); }
.cell-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.7)); }
.cell-img .icon { width: 32px; height: 32px; color: #707070; }
.cell-img:has(> .icon), .item-figure:has(> .icon) { background: radial-gradient(ellipse at 50% 45%, #333, #1c1c1c 70%, #141414); }
.cell-body { padding: 10px 12px 0; }
.cell-id { font: 400 12px/1.4 var(--mono); color: var(--ink-2); }
.cell-name { font-weight: 600; line-height: 1.3; color: var(--bright); }
.cell-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 40px; margin-top: 8px; padding: 6px 12px; border-top: 2px solid #000; background: var(--scan), #0b0b0b; font: 500 12.5px/1 var(--mono); color: #b0b0b0; }
@media (min-width: 861px) { #parts .cells { grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); } }
.part-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.part-list:empty { display: none; }
.part-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 6px 6px 6px 12px; border: 2px solid; border-color: var(--bevel-in); border-radius: var(--cut-sm); background: var(--scan), var(--well); box-shadow: 0 0 0 1px #000; }
.part-list .is-missing { color: #ffab57; }
.cell.is-hidden { border-style: dashed; }
.cell.is-hidden .cell-img { opacity: .5; }

/* orders: selectors on the bays, the bar that follows the selection, the review list */
.cell-box { position: relative; display: grid; }
.cell-pick { position: absolute; z-index: 1; top: 0; left: 0; display: grid; place-items: center; width: 46px; height: 46px; cursor: pointer; }
.cell-pick input[type="checkbox"] { width: 24px; height: 24px; }
.cell-pick input[type="checkbox"]:checked::before { left: 7px; top: 2px; width: 7px; height: 12px; }
.cell-box:has(:checked) .cell { outline: 2px solid var(--red-lit); outline-offset: -2px; border-color: var(--red-lit); box-shadow: 0 0 0 3px #070707, 0 1px 0 3px rgba(104,104,104,.26), inset 0 0 14px rgba(229,9,9,.35), 0 0 12px rgba(255,51,51,.3); }
.order-bar { position: sticky; z-index: 15; bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px var(--s5); margin-top: var(--s5); padding: 12px var(--x); border: 4px solid; border-color: var(--bevel); border-radius: var(--cut); background: var(--grain), linear-gradient(170deg, #2c2c2c, #161616); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 10px 26px #000; }
.plate-head:has([data-order-all]) .plate-note { margin-left: auto; }
.page > .order-bar { animation: none; }
.order-bar[hidden] { display: none; }
.order-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; font: 400 14px/1.4 var(--mono); }
.order-sum strong { font: 600 19px/1.2 var(--label); color: var(--bright); }
.order-left { color: #b0b0b0; }
.order-left.is-short, .order-short { color: #ffab57; }
.order-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.order-actions [hidden] { display: none; }
.order-list { list-style: none; margin: 0 2px; padding: 0; }
.order-list li + li { border-top: 1px solid #0b0b0b; box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.order-row { display: flex; align-items: center; gap: 14px; min-height: 64px; margin: 0; padding: 8px var(--x); color: var(--ink); text-transform: none; letter-spacing: 0; font: 400 16px/1.35 var(--body); }
label.order-row { cursor: pointer; }
label.order-row:hover { background: rgba(255,255,255,.03); }
label.order-row:not(:has(:checked)) > :not(input) { opacity: .5; }
.order-thumb { flex: none; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; width: 74px; height: 46px; padding: 4px; border: 1px solid #000; border-radius: 3px; background: radial-gradient(ellipse at 50% 46%, #868686 0%, #565656 38%, #2b2b2b 76%, #1b1b1b); overflow: hidden; }
.order-thumb img { width: 100%; height: 100%; object-fit: contain; }
.order-thumb:has(> .icon) { background: #1c1c1c; }
.order-name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--bright); overflow-wrap: anywhere; }
.order-meta { display: block; font: 400 13px/1.4 var(--mono); color: #b0b0b0; }
.order-row > .credits-figure, .order-row > .tag { flex: none; }
.order-total { position: sticky; top: calc(var(--bar) + 24px); }
.order-short { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s4); }
.order-short[hidden] { display: none; }
.order-total .facts { margin-bottom: var(--s4); }
.kit { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid #0b0b0b; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.kit .btn { width: 100%; height: auto; min-height: var(--ctl); padding-top: 6px; padding-bottom: 6px; white-space: normal; }

/* ================================================================ records */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px var(--s5); margin: 0; }
.facts dt { padding-top: 2px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd .mono, .uuid { font-family: var(--mono); font-size: 13px; color: #b9b9ff; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.orders .btn { width: 100%; justify-content: flex-start; }
.item-figure { display: grid; place-items: center; width: calc(100% - 4px); margin: 2px; aspect-ratio: 16 / 9; max-height: 420px; padding: var(--s5); overflow: hidden; border-radius: 9px 1px 9px 1px; background: linear-gradient(rgba(150,150,255,.05) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(150,150,255,.05) 1px, transparent 1px) 0 0 / 24px 24px, radial-gradient(ellipse at 50% 46%, #7a7a7a 0%, #4a4a4a 40%, #1f1f1f 78%, #101010); box-shadow: inset 0 4px 16px #000; }
.item-figure img { max-width: 100%; max-height: 372px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0,0,0,.7)); }
.item-figure .icon { width: 48px; height: 48px; color: #707070; }
.prose { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid #000; box-shadow: inset 0 1px 0 var(--line-2); }
.prose p { color: var(--ink); }

/* ================================================================ dialog: command window */
.hud-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 8px solid; border-color: #5a5a5a #232323 #0d0d0d #474747; border-radius: 22px 4px 22px 4px; background: var(--grain), linear-gradient(170deg, #222, #131313); color: var(--ink); box-shadow: 0 0 0 1px #000, inset 0 0 0 2px #000, 0 30px 80px #000; }
.hud-dialog[open] { animation: open 240ms var(--out); }
.hud-dialog::backdrop { background: rgba(0,0,0,.78); }
.hud-dialog .plate-head { border-radius: 12px 1px 0 0; }
.hud-dialog .dialog-close { padding: 0 9px; margin-right: 4px; }
.hud-dialog p { font-size: 16px; overflow-wrap: anywhere; }

/* ================================================================ form editor (kept markup; its script depends on it) */
.form-editor > form { padding: var(--x); border: 5px solid; border-color: var(--bevel); border-radius: var(--cut-lg); background: var(--grain), linear-gradient(170deg, #222, #131313); box-shadow: 0 0 0 1px #000, inset 0 0 0 2px #000; }
.form-editor table.bl td { padding: 5px var(--s3) 5px 0; vertical-align: middle; }
.form-editor table.form-table { width: 100%; }
.form-editor .moveable { padding: var(--s3); margin-bottom: 6px; border: 2px solid #3d3d3d; border-radius: var(--cut-sm); }
.form-editor .moveable svg { fill: var(--icon) !important; cursor: grab; }
.form-editor textarea.wide { width: 100%; min-height: 60px; }
.form-editor .form-field > label, .form-editor .form-field > span.hint-text strong { display: inline-block; margin-bottom: 6px; font: 600 14px var(--label); letter-spacing: .07em; text-transform: uppercase; color: #a6a6a6; border: 0; }
.form-editor .form-field > input[type="checkbox"] + label { min-width: 0; margin: 0 18px 0 8px; text-transform: none; letter-spacing: 0; font: 400 15px var(--body); color: var(--ink); }

/* ================================================================ legacy classes still emitted by some pages */
.container-table { display: block; overflow-x: auto; margin: var(--s3) 0; border: 3px solid; border-color: var(--bevel); background: var(--steel); }
table.bl td, table.form-table td, table.form-table th { padding: 4px var(--s2) 4px 0; border: 0; vertical-align: top; text-align: left; }
table.form-table th { font: 600 14px var(--label); letter-spacing: .07em; text-transform: uppercase; color: #a6a6a6; padding-top: 10px; white-space: nowrap; }
.container-text, .container-edit, .item-description { display: block; padding: var(--x); margin: var(--s3) 0; border: 3px solid; border-color: var(--bevel); background: var(--steel); }
.message { display: block; padding: var(--s3) var(--x); margin: 0 0 var(--s4); border: 2px solid; border-color: var(--bevel-in); border-radius: var(--cut-sm); background: var(--scan), #101010; box-shadow: var(--in), 0 0 0 1px #000; }
.message.error { border-color: #a01010; background: #220505; color: #ffd0d0; }
.message.info { border-color: #176b1b; background: #061a08; color: #d2f5d3; }
.form-field { padding: 6px 0; }
.form-field label { display: inline-block; min-width: 140px; }
.button { margin: 0 var(--s2) var(--s2) 0; }
.button-red { border-color: var(--orange); color: #ffc48a; }
.button-yellow { border-color: #7d4105; color: #ffab57; }
.button-green { border-color: var(--red); background: var(--face-red); color: #fff; }
.button-small { height: var(--ctl-sm); padding: 0 var(--s3); font-size: 14px; }
.hint-text { border-bottom: 1px dotted var(--ink-2); cursor: help; }
.row-hidden td { background: rgba(229, 9, 9, .1); }
.row-locked td { background: rgba(239, 120, 0, .09); }
.list-no-margin { margin: 0; padding: 0 0 0 16px; }
.center { text-align: center; }
.state { display: inline-block; padding: 1px 6px; margin: 2px 4px; border: 1px solid #4a4a4a; border-radius: 3px 1px 3px 1px; font: 600 13px var(--label); letter-spacing: .05em; text-transform: uppercase; }
.s-1, .s-2 { color: #ffab57; border-color: #7d4105; }
.s-3 { color: #6ef573; border-color: #176b1b; }
.s-4 { color: #fff; background: var(--red-deep); border-color: var(--red); }
.s-5 { color: #ff8080; background: #2b0606; border-color: #a01010; }
label.tag-agent { background: #07200a; }
label.tag-group { background: var(--steel-2); }
label.tag-form { background: #221203; }
.moveable:nth-child(odd) { background: #1b1b1b; }
.moveable:nth-child(even) { background: #222; }

/* connection info (demo.php, redirect.php): page without the portal shell */
#wrapper { max-width: 900px; margin: 0 auto; padding: 32px 16px; }
#content { padding: 24px; border: 8px solid; border-color: var(--bevel); border-radius: 26px 4px 22px 4px; background: var(--grain), linear-gradient(170deg, #2a2a2a, #131313); box-shadow: 0 0 0 1px #000, inset 0 0 0 2px #000, var(--drop); }
#content h1 { margin-bottom: 12px; }
#content table { width: 100%; border-collapse: collapse; background: var(--well); }
#content th, #content td { padding: 9px 12px; border: 1px solid #2b2b2b; text-align: left; overflow-wrap: anywhere; }
#content th { font: 600 14px/1 var(--label); letter-spacing: .08em; text-transform: uppercase; color: #a6a6a6; background: linear-gradient(#2c2c2c, #1c1c1c); }

/* ================================================================ motion */
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }
@keyframes pulse { 0% { filter: brightness(2.4); } }
@keyframes power { from { opacity: .85; } }
@media (prefers-reduced-motion: no-preference) {
  .page > .plate, .page > .board, .page > .split, .page > .stack, .page > form { animation: power 260ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active, button:active, .mod:active .mod-frame, .tabs a:active, .cell:active { transform: none; }
}

/* ================================================================ responsive */
/* tall screens: full-size modules */
@media (min-height: 1000px) and (min-width: 1181px) {
  .mod-bay { height: 58px; }
  .mod-icon { width: 48px; height: 42px; }
  .modules { gap: 16px; }
  .rail-mark { width: 72px; height: 72px; }
}
/* short desktop screens: tighter modules so the whole rail stays in view */
@media (max-height: 860px) and (min-width: 861px) {
  .rail-mark { width: 44px; height: 44px; margin-bottom: 6px; }
  .triad { margin-bottom: 9px; }
  .modules { gap: 7px; }
  .mod-bay { height: 36px; }
  .mod-icon { width: 34px; height: 28px; }
  .mod-strip { min-height: 20px; font-size: 12px; line-height: 15px; padding: 1px 4px; }
  .mod-name { font-size: 18px; padding-top: 4px; }
  .rail-key { margin-top: 12px; height: 30px; font-size: 16px; }
}
@media (max-height: 720px) and (min-width: 861px) {
  .rail-mark, .rail-key { display: none; }
  .mod-bay { height: 32px; }
  .mod-icon { width: 30px; height: 25px; }
}
@media (max-width: 1500px) { .split table.data td.num input[type="text"] { width: 200px !important; } }
@media (max-width: 1180px) { .col-xwide { display: none; } }
@media (max-width: 1280px) { .readout-credits small, .whoami .rank { display: none; } }
@media (max-width: 1180px) {
  :root { --rail: 112px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .rail { border-width: 7px; border-radius: 26px 4px 20px 4px; }
  .rail-face { border-radius: 18px 2px 12px 2px; }
  .modules li { padding: 0 12px; background: none; }
  .mod-name { font-size: 17px; letter-spacing: .02em; }
  .mod-strip { font-size: 11px; letter-spacing: -.05em; padding-left: 1px; padding-right: 1px; }
  .rail-key { margin-left: 12px; margin-right: 12px; font-size: 15px; letter-spacing: .02em; }
  .triad .led { width: 20px; }
}
/* phones and small tablets: the rail becomes a key row under the thumb */
@media (max-width: 860px) {
  :root { --ctl: 44px; --ctl-sm: 38px; --gap: 6px; --bar: 56px; }
  body.has-chassis { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .chassis { display: block; }
  .deck { min-height: calc(100vh - 92px); }
  .rail { position: fixed; z-index: 25; top: auto; left: 0; right: 0; bottom: 0; height: auto; border-width: 5px 0 0; border-radius: 14px 4px 0 0; box-shadow: 0 -1px 0 #000, 0 -10px 24px rgba(0,0,0,.8); }
  .rail-face { padding: 7px 6px calc(6px + env(safe-area-inset-bottom)); border-radius: 12px 2px 0 0; overflow: visible; }
  .rail-mark, .triad, .rail-key, .mod-strip { display: none; }
  .modules { display: flex; gap: 8px; }
  .modules li { flex: 1 1 0; min-width: 0; padding: 0; }
  .mod-frame { box-shadow: 0 0 0 2px #070707; border-radius: 7px 2px 7px 2px; }
  .mod-bay { height: 36px; border-radius: 5px 0 5px 0; }
  .mod-icon { width: 30px; height: 25px; }
  .mod-name { padding-top: 5px; font: 600 13px/1 var(--label); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mod:hover .mod-frame, .mod[aria-current] .mod-frame { box-shadow: 0 0 0 2px #070707, 0 0 10px rgba(255,51,51,.45); }

  html { scroll-padding-top: 16px; }
  .command { position: relative; flex-wrap: wrap; gap: 8px 10px; padding: 7px 10px; background: var(--grain), linear-gradient(180deg, #3a3a3a, #232323 45%, #161616); }
  .command-mark { display: block; }
  .wordmark { display: none; }
  .readout-clock { display: none; }
  .readouts { gap: 8px; }
  .readout { height: 38px; font-size: 15px; }
  .whoami > summary { height: 40px; padding: 0 10px; }
  .whoami > summary .icon { display: none; }
  .whoami .name { max-width: 120px; }
  .whoami-menu a { min-height: 44px; }
  .tabs { order: 3; flex: 1 0 100%; margin: 0 -4px; }
  .tabs a { height: 40px; padding: 0 14px; }

  .page { padding: 12px 4px 16px; }
  h1 { font-size: 28px; }
  .page-head { margin-bottom: 18px; }
  .page-actions, .page-actions .status { width: 100%; }
  .page-actions .status div { flex: 1 1 72px; min-width: 0; align-items: flex-start; text-align: left; padding: 7px 9px; }
  .status dd { font-size: 19px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .col-wide { display: none; }
  button.button-small, .btn-small { min-width: 40px; }
  .board, .stack, .field-row, .checks { grid-template-columns: minmax(0, 1fr); }
  .split table.data td { display: block; width: 100%; white-space: normal; text-align: left; }
  .split table.data td.num { padding-top: 0; box-shadow: none; }
  .split table.data td:not(:last-child) { border-bottom: 0; }
  .split table.data td.num input, .split table.data td.num select { width: 100% !important; }
  table.bl td, .form-editor table.form-table td, .form-editor table.form-table th { display: block; width: 100%; }
  table.bl input[type="text"], table.bl select { width: 100% !important; }
  .plate { border-width: 4px; border-radius: 12px 3px 12px 3px; }
  table.data th, table.data td { padding-left: var(--s3); padding-right: var(--s3); }
  table.data td:first-child { white-space: normal; }
  table.data th, table.data td { padding-left: 10px; padding-right: 8px; }
  table.data td.actions, table.data th.actions { white-space: normal; }
  table.data td.actions .btn { display: flex; width: 100%; padding: 0 8px; font-size: 13px; }
  table.data td.actions .btn-danger { padding-left: 22px; }
  table.data td.actions .btn + .btn { margin: 8px 0 0; }
  .rank-badge { min-width: 0; margin-right: 8px; }
  .rank-icon { width: 34px; height: 30px; }
  .status dt { font-size: 11.5px; letter-spacing: 0; white-space: nowrap; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: var(--s2); }
  .cells { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 13px; }
  .check { min-height: 44px; }
  .order-bar { bottom: calc(86px + env(safe-area-inset-bottom)); padding: 10px; }
  .order-actions { width: 100%; gap: 10px; }
  .order-actions .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  .order-row { gap: 10px; padding-left: 10px; padding-right: 10px; flex-wrap: wrap; }
  .order-row .order-name { flex: 1 1 120px; }
  .order-thumb { width: 60px; height: 40px; }
  .order-total { position: static; }
  .form-actions .btn, .form-actions button { flex: 1 1 auto; }
  input, select, textarea { font-size: 16px !important; } /* stops iOS zooming in on focus */
  .sysbar { font-size: 12px; }
  .sysbar > span { padding: 4px 8px; border: 0; box-shadow: none; }
  .sysbar-links { margin-left: 0; flex-basis: 100%; }
  .unit { border-width: 8px; border-radius: 28px 4px 22px 4px; }
  .unit-face { padding: 20px 16px 6px; border-radius: 20px 2px 14px 2px; }
}
@media (max-width: 400px) {
  .modules { gap: 6px; }
  .mod-name { font-size: 12px; }
}
@media print { .rail, .command, .sysbar { display: none; } .chassis { display: block; } }
