/* SFA Suite: a hardware tool. Near-black, metallic purple and copper set inside the surfaces, fine grain, almost no borders. */
:root {
  --bg: #120c28; --s1: #1a1336; --s2: #211a42; --s3: #2a2250; --s4: #352c61;
  --ink: #ece6f6; --ink2: #b5abcf; --ink3: #8579a6; --on: #0c0a0e;
  --pur: #9577e8; --pur2: #6a52b8; --pur3: #43347a;
  --cop: #ff6b3d; --cop2: #d9532c; --cop3: #7a2e18;
  --good: #58d68d; --warn: #f0b84a; --bad: #ef5b6b;
  --hi: inset 0 1px 0 rgba(255,255,255,.045), inset 0 -1px 0 rgba(0,0,0,.55);
  --pit: inset 0 1px 2px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.35);
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace; --r: 2px;
}
:root[data-density="compact"] { --pad: 6px; --fs: 12px; --row: 24px; }
:root, :root[data-density="normal"] { --pad: 8px; --fs: 12.5px; --row: 28px; }
:root[data-density="roomy"] { --pad: 12px; --fs: 13.5px; --row: 34px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(1100px 650px at 12% -8%, rgba(120,80,230,.30), transparent 62%), radial-gradient(900px 600px at 100% 105%, rgba(255,107,61,.14), transparent 60%), var(--bg) fixed; color: var(--ink); font: var(--fs)/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 99; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.1 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
h2 { font-size: 13px; } h3 { font-size: 11px; color: var(--ink2); } h4 { font-size: 10.5px; color: var(--ink3); }
a { color: var(--cop); } p { margin: 0 0 6px; } code, .num, output { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); } .dim { color: var(--ink3); } .small { font-size: 11px; } .sp { flex: 1; }
.row { display: flex; align-items: center; gap: var(--pad); flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.nw { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: var(--pad); }

/* shell */
#app { display: grid; height: 100%; grid-template-columns: 1fr 272px; grid-template-rows: 38px 1fr 46px; grid-template-areas: "top top" "main dock" "bar bar"; }
#top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 10px; background: linear-gradient(#17131c, #1a1336); box-shadow: var(--hi); }
.brand { display: flex; align-items: center; gap: 7px; } .brand b { letter-spacing: .14em; font-size: 13px; } .brand .sub { color: var(--cop); letter-spacing: .2em; font-size: 10px; text-transform: uppercase; font-weight: 700; }
#mark { width: 26px; height: 26px; display: block; } #mark svg { width: 100%; height: 100%; display: block; }
#nav { display: flex; gap: 1px; height: 100%; overflow-x: auto; }
#nav a { display: flex; align-items: center; gap: 6px; padding: 0 11px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; position: relative; white-space: nowrap; }
#nav a:hover { color: var(--ink); background: rgba(255,255,255,.03); }
#nav a.on { color: #fff; background: linear-gradient(#3e2f82, #2c2260); box-shadow: var(--hi); }
#nav a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--cop2), var(--cop)); }
#nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
#who { color: var(--ink3); font-size: 11px; }
#main { grid-area: main; overflow: auto; background: transparent; padding: var(--pad); min-width: 0; }
#dock { grid-area: dock; background: var(--s1); box-shadow: inset 1px 0 0 rgba(0,0,0,.6), inset 2px 0 0 rgba(255,255,255,.025); display: flex; flex-direction: column; min-height: 0; }
#bar { grid-area: bar; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: linear-gradient(#251d4a, #1c1540); box-shadow: var(--hi); }

/* surfaces */
.panel { background: linear-gradient(#241b48, #1d1639); box-shadow: var(--hi), 0 0 0 1px rgba(0,0,0,.5); border-radius: var(--r); padding: var(--pad); }
.panel > h3, .panel > .hd { margin: -2px 0 var(--pad); display: flex; align-items: center; gap: 8px; }
.panel.pit { background: #160f2f; box-shadow: var(--pit); }
.grid { display: grid; gap: var(--pad); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) { #app { grid-template-columns: 1fr; grid-template-rows: 38px 1fr 150px 46px; grid-template-areas: "top" "main" "dock" "bar"; } .g2 { grid-template-columns: 1fr; } }

/* controls */
.btn { font: 600 11px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: linear-gradient(#2b2535, #1d1926); border: 0; border-radius: var(--r); padding: 0 10px; height: var(--row); cursor: pointer; box-shadow: var(--hi), 0 0 0 1px rgba(0,0,0,.6); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: linear-gradient(#352d42, #231e2e); } .btn:active { background: #17131e; box-shadow: var(--pit); }
.btn.sm { height: 22px; padding: 0 7px; font-size: 10px; } .btn.pri { color: #1a0d04; background: linear-gradient(#ff9066, #d9532c); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.35), 0 0 0 1px #5e2012; } .btn.pri:hover { background: linear-gradient(#ff9d7a, #e5602f); }
.btn.pur { color: #fff; background: linear-gradient(#7762b4, #51407f); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 0 rgba(0,0,0,.4), 0 0 0 1px #2a2048; }
.btn.on { color: #1a0d04; background: linear-gradient(#ff9066, #d9532c); } .btn.bad { color: #ffd9de; background: linear-gradient(#7a2c37, #561d26); }
.btn:disabled { opacity: .4; cursor: not-allowed; } .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 1px solid var(--cop); outline-offset: 1px; }
input[type=text], input[type=number], input[type=search], input[type=password], select, textarea { font: inherit; color: var(--ink); background: #150f2e; border: 0; border-radius: var(--r); box-shadow: var(--pit); padding: 0 7px; height: var(--row); min-width: 0; }
textarea { height: auto; padding: 6px 7px; resize: vertical; } select { padding-right: 4px; }
input[type=range] { appearance: none; height: 16px; background: transparent; flex: 1; min-width: 60px; } input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #150f2e; box-shadow: var(--pit); border-radius: 1px; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 10px; height: 16px; margin-top: -6px; background: linear-gradient(#a58de0, #6a55a8); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 0 1px #20183a; border-radius: 1px; }
input[type=range]::-moz-range-track { height: 4px; background: #150f2e; } input[type=range]::-moz-range-thumb { width: 10px; height: 16px; background: #7a64b8; border: 0; border-radius: 1px; }
input[type=checkbox] { accent-color: var(--cop); }
.sl { display: grid; grid-template-columns: 74px 1fr 52px; align-items: center; gap: 8px; min-height: 20px; } .sl span { color: var(--ink2); font-size: 11px; } .sl output { text-align: right; color: var(--ink); font-size: 11.5px; }
.sel { display: inline-flex; align-items: center; gap: 6px; } .sel span { color: var(--ink2); font-size: 11px; }
.seg { display: inline-flex; box-shadow: var(--pit); border-radius: var(--r); padding: 1px; background: #150f2e; } .seg button { all: unset; cursor: pointer; padding: 0 9px; height: calc(var(--row) - 4px); display: flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.seg button.on { color: #1a0d04; background: linear-gradient(#ff9066, #d9532c); } .seg button:hover:not(.on) { color: var(--ink); }
.tag { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; color: var(--ink2); background: #211c29; box-shadow: var(--hi); border-radius: 1px; white-space: nowrap; }
.tag.cop { color: #2a1305; background: linear-gradient(#ff875d, #c4502a); } .tag.pur { color: #fff; background: linear-gradient(#6f5aa8, #4a3b78); } .tag.good { color: #07200f; background: #58d68d; } .tag.warn { color: #2a1c00; background: var(--warn); } .tag.bad { color: #fff; background: #a53746; }
.led { width: 7px; height: 7px; border-radius: 50%; background: #3a3342; display: inline-block; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); } .led.on { background: var(--cop); } .led.g { background: var(--good); } .led.r { background: var(--bad); }

/* tables */
table { border-collapse: collapse; width: 100%; } th { text-align: left; font: 700 10px system-ui; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); padding: 3px 6px; position: sticky; top: 0; background: #1d1639; z-index: 1; white-space: nowrap; }
td { padding: 0 6px; height: var(--row); border-top: 1px solid rgba(255,255,255,.035); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; } tr:hover td { background: rgba(255,255,255,.025); } tr.on td { background: #2e2260; box-shadow: inset 2px 0 0 var(--cop); }
td.num, th.num { text-align: right; } td.wrap { white-space: normal; }
.tw { overflow: auto; max-height: 100%; }

/* dock (library) */
#dock .hd { padding: 8px 8px 4px; display: flex; flex-direction: column; gap: 6px; }
#dock .list { flex: 1; overflow: auto; min-height: 0; }
.it { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; padding: 4px 8px; cursor: pointer; border-top: 1px solid rgba(255,255,255,.03); }
.it:hover { background: rgba(255,255,255,.03); } .it.on { background: #2e2260; box-shadow: inset 2px 0 0 var(--cop); }
.it b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .it .m { color: var(--ink3); font-size: 10.5px; font-family: var(--mono); grid-column: 1 / -1; display: flex; gap: 8px; }
.it canvas { grid-column: 1 / -1; width: 100%; height: 16px; display: block; margin-top: 2px; }
.prog { height: 3px; background: #150f2e; margin: 2px 0; } .prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--cop2), var(--cop)); }
#drop { position: fixed; inset: 0; z-index: 50; background: rgba(8,7,10,.86); display: grid; place-items: center; } #drop div { padding: 40px 60px; font: 700 13px system-ui; letter-spacing: .16em; text-transform: uppercase; color: var(--cop); box-shadow: inset 0 0 0 1px var(--cop2); }

/* misc */
.kv { background: #160f2f; box-shadow: var(--pit); padding: 5px 8px; border-radius: var(--r); min-width: 0; } .kv label { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); font-weight: 700; }
.kv output { font-size: 19px; color: #fff; display: block; line-height: 1.15; } .kv output.cop { color: var(--cop); } .kv small { color: var(--ink3); font-size: 10px; }
canvas.plot { display: block; width: 100%; background: #150f2e; box-shadow: var(--pit); border-radius: var(--r); }
.legend { display: flex; gap: 10px; font-size: 10.5px; color: var(--ink2); } .legend i { display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; }
.drop-zone { text-align: center; padding: 14px 8px; color: var(--ink2); box-shadow: inset 0 0 0 1px #2e2838; border-radius: var(--r); cursor: pointer; font-size: 11px; } .drop-zone:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--cop2); }
.empty { padding: 18px; color: var(--ink3); text-align: center; }
.banner { padding: 6px 9px; font-size: 11.5px; box-shadow: inset 2px 0 0 var(--warn); background: #1a150a; color: #ecd9a3; border-radius: var(--r); } .banner.bad { box-shadow: inset 2px 0 0 var(--bad); background: #1d0e11; color: #f1b9c0; } .banner.info { box-shadow: inset 2px 0 0 var(--pur); background: #14101d; color: #cfc4ee; }
#toast { position: fixed; left: 50%; bottom: 58px; transform: translate(-50%, 8px); background: #1c1724; color: var(--ink); padding: 8px 14px; box-shadow: var(--hi), 0 0 0 1px #000; opacity: 0; pointer-events: none; z-index: 120; max-width: 80vw; font-size: 12px; } #toast.on { opacity: 1; transform: translate(-50%, 0); } #toast.bad { box-shadow: inset 2px 0 0 var(--bad), 0 0 0 1px #000; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100; display: grid; place-items: center; } .modal { background: #241b48; box-shadow: var(--hi), 0 0 0 1px #000; padding: 14px; min-width: 340px; max-width: 92vw; max-height: 88vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
#login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg); } #login form { width: 300px; display: flex; flex-direction: column; gap: 8px; } #login .brand { justify-content: center; margin-bottom: 8px; } #login .brand #mark { width: 54px; height: 54px; }
.wave { display: block; width: 100%; height: 40px; background: #150f2e; box-shadow: var(--pit); cursor: pointer; }
.sec-hd { display: flex; align-items: center; gap: 10px; padding: 0 2px var(--pad); } .sec-hd h2 { color: #fff; } .sec-hd .muted { font-size: 11.5px; }
.fill-h { height: 100%; } .scroll { overflow: auto; min-height: 0; }
.roll { position: relative; overflow: auto; background: #150f2e; box-shadow: var(--pit); }
.roll canvas { display: block; }
.st-pending { color: var(--ink2); } .eng-card { display: flex; flex-direction: column; gap: 4px; }
