/* Light theme: white. Dark theme: black and greys. NVIDIA green (#76b900) is the accent in both. */
:root {
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f6f6f6; --header: #ffffff; --text: #111111; --muted: #6b6b6b; --line: #e2e2e2;
  --accent: #76b900; --accent-ink: #4b7a00; --accent-soft: rgba(118, 185, 0, .12);
  --ok: #3f8f00; --warn: #b87400; --bad: #d03b3b;
  --code: #f3f3f3; --hover: #f4f7ee; --shadow: 0 1px 2px rgba(0,0,0,.05);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --chart-grid: #ececec; --chart-axis: #898781;
  --chassis: #2a2a2a; --chassis-edge: #141414; --cage: #0e0e0e; --port-up: #76b900; --port-down: #4a4a4a; --port-admin: #8a3b3b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --panel: #161616; --panel-2: #1f1f1f; --header: #000000; --text: #ededed; --muted: #9b9b9b; --line: #2c2c2c;
    --accent: #76b900; --accent-ink: #8fd61a; --accent-soft: rgba(118, 185, 0, .14);
    --ok: #76b900; --warn: #e9a23b; --bad: #f06a6a;
    --code: #1f1f1f; --hover: #1d2117; --shadow: none;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --chart-grid: #2a2a2a; --chart-axis: #898781;
    --chassis: #222222; --chassis-edge: #0a0a0a; --cage: #050505; --port-down: #3d3d3d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --panel: #161616; --panel-2: #1f1f1f; --header: #000000; --text: #ededed; --muted: #9b9b9b; --line: #2c2c2c;
  --accent: #76b900; --accent-ink: #8fd61a; --accent-soft: rgba(118, 185, 0, .14);
  --ok: #76b900; --warn: #e9a23b; --bad: #f06a6a;
  --code: #1f1f1f; --hover: #1d2117; --shadow: none;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --chart-grid: #2a2a2a; --chart-axis: #898781;
  --chassis: #222222; --chassis-edge: #0a0a0a; --cage: #050505; --port-down: #3d3d3d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* classes that set display must not un-hide elements */
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---- header: brand + status + user menu on top, tabs on their own row */
header { background: var(--header); border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 5; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 8px 16px; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .logo { height: 26px; width: auto; display: block; border-radius: 3px; }
.brand b { font-weight: 700; color: var(--accent-ink); }
.right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
#chips { display: flex; gap: 6px; }
@media (max-width: 900px) { #chips { display: none; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; background: var(--panel-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.ok .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); } .chip.bad .dot { background: var(--bad); }
input[type=checkbox] { accent-color: var(--accent); }
.iconbtn { font: inherit; font-size: 17px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer; }
.iconbtn:hover, .userbtn:hover { border-color: var(--accent); }
nav { display: flex; align-items: stretch; gap: 0; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted);
  padding: 9px 10px 8px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 500; margin-bottom: -2px; white-space: nowrap; }
nav button:hover { color: var(--text); }
nav button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.navgroup { align-self: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); opacity: .7;
  padding: 0 6px 0 4px; white-space: nowrap; }
.navgroup + button { padding-left: 4px; }
.navgroup:not(:first-child) { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
/* user menu */
.menuwrap { position: relative; }
.userbtn { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; padding: 3px 10px 3px 3px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #0b1400; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.caret { color: var(--muted); font-size: 11px; }
@media (max-width: 700px) { .uname { display: none; } }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 6px; z-index: 20; }
.dd-who { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 13px; cursor: default; }
.dd-row .seg button { padding: 3px 8px; font-size: 12px; }
.dd-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); cursor: pointer; }
.dd-item:hover { background: var(--hover); }
#um-out { color: var(--bad); }

main { padding: 16px; max-width: 1700px; margin: 0 auto; }
#banner { padding: 10px 16px; background: #fff4d6; color: #5d4300; border-bottom: 1px solid #f0d58a; }
@media (prefers-color-scheme: dark) { #banner { background: #3a2f12; color: #f3d98b; border-color: #5c4a1a; } }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 11.5px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; box-shadow: var(--shadow); }
.card.wide { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---- tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; background: var(--panel); }
tr:hover td { background: var(--hover); }
td.wrap { white-space: normal; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.group { text-align: center; border-bottom: 2px solid var(--accent); color: var(--text); }
tr.diff td { background: rgba(214, 69, 69, .07); }
tr.diff td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); font-weight: 600; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.up, .ok { color: var(--ok); font-weight: 600; }
.down, .bad { color: var(--bad); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.muted { color: var(--muted); }
pre, code { background: var(--code); border-radius: 6px; font: 12px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; }
code { padding: 1px 4px; }
pre { padding: 10px 12px; overflow: auto; max-height: 70vh; margin: 0; }
pre.cmds { color: var(--accent-ink); }

/* ---- controls */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--muted); padding: 5px 11px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--hover); color: var(--text); font-weight: 600; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 0; }
button.primary, button.secondary, button.danger, button.small { font: inherit; border-radius: 6px; padding: 6px 13px;
  cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
button.primary { background: var(--accent); border-color: var(--accent); color: #0f1f00; font-weight: 600; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
button.small { padding: 2px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.error { color: var(--bad); }
.loading { color: var(--muted); padding: 20px 0; }

/* ---- modal */
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text);
  width: min(960px, 94vw); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.5); }
.form { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; }
.form .hint { grid-column: 2; color: var(--muted); font-size: 12px; margin-top: -4px; }
.form .sect { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } main { padding: 10px; } }
.big { font-size: 22px; font-weight: 700; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 6px 0 12px; }

/* ---- overview */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.sum { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.sum b { font-size: 17px; }
.sum.good { border-left: 4px solid var(--accent); }
.sum.badbox { border-left: 4px solid var(--bad); }
.sw-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); min-width: 0;
  display: flex; flex-direction: column; gap: 12px; }
.sw-head { display: flex; align-items: baseline; gap: 10px; }
.sw-head b { font-size: 18px; }
.sw-head .role { margin-left: auto; text-transform: uppercase; letter-spacing: .6px; font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.sw-head .role.primary { background: var(--accent); border-color: var(--accent); color: #0b1400; }
.sw-head .role.secondary { border-color: var(--accent); color: var(--accent-ink); }
.sw-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sw-stats > div { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.sw-stats span { font-size: 11.5px; }
.sw-stats b { font-size: 15px; }
@media (max-width: 1100px) { .sw-stats { grid-template-columns: repeat(2, 1fr); } }
.meter { display: grid; grid-template-columns: 70px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.meter .bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter .num { text-align: right; font-variant-numeric: tabular-nums; }
.kv.small { font-size: 13px; }
table.compact { width: auto; min-width: 50%; }
table.cc { table-layout: fixed; width: 100%; }
table.cc td { white-space: normal; overflow-wrap: anywhere; }
details summary { cursor: pointer; }

/* ---- status LEDs, fans, mini bars */
.led { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px;
  background: #6b6b6b; border: 1px solid rgba(0,0,0,.25); }
.led.big { width: 16px; height: 16px; margin: 0; }
.led.green { background: radial-gradient(circle at 35% 35%, #c8f56b, #76b900 60%); box-shadow: 0 0 8px rgba(118,185,0,.8); }
.led.amber { background: radial-gradient(circle at 35% 35%, #ffe08a, #f5a623 60%); box-shadow: 0 0 8px rgba(245,166,35,.8); }
.led.red { background: radial-gradient(circle at 35% 35%, #ff9b8a, #e84118 60%); box-shadow: 0 0 8px rgba(232,65,24,.8); }
.ledrow { display: flex; gap: 10px; flex-wrap: wrap; }
.ledtile { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; min-width: 110px; }
.fanwrap { display: inline-flex; width: 20px; height: 20px; margin-right: 8px; vertical-align: -5px; color: var(--accent); }
.fanwrap svg { width: 100%; height: 100%; fill: currentColor; animation: spin var(--spin, 1s) linear infinite; transform-origin: 50% 50%; }
.fanwrap.stopped { color: var(--muted); }
.fanwrap.stopped svg { animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fanwrap svg, .led.green, .led.red { animation: none; } }
.minibar { display: inline-block; width: 110px; height: 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.minibar i { display: block; height: 100%; background: var(--accent); }
.minibar.warn i { background: var(--warn); } .minibar.bad i { background: var(--bad); }
.rtype { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); }
.rtype.t-default { background: var(--accent); border-color: var(--accent); color: #0b1400; }
.rtype.t-conn { color: var(--accent-ink); border-color: var(--accent); }
.rtype.t-ospf { color: var(--s1); border-color: var(--s1); }
.rtype.t-static { color: var(--s4); border-color: var(--s4); }
.rtype.t-local { color: var(--muted); }

/* ---- charts */
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .grid text { fill: var(--chart-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart path.series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart-empty { color: var(--muted); padding: 40px 0; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.chart-tip, .floating-tip { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); pointer-events: none; z-index: 10; min-width: 150px; }
.chart-tip b { margin-left: 10px; float: right; font-variant-numeric: tabular-nums; }
.floating-tip { position: fixed; max-width: 320px; }
.floating-tip .row { display: flex; justify-content: space-between; gap: 14px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }

/* ---- front panel */
.faceplate { background: linear-gradient(180deg, var(--chassis), var(--chassis-edge)); border-radius: 8px; padding: 14px 16px;
  display: flex; gap: 18px; align-items: center; color: #c9ced6; overflow-x: auto; border: 1px solid #000; }
.fp-group { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; gap: 6px 5px; background: var(--cage);
  padding: 7px; border-radius: 4px; }
.fp-port { position: relative; width: 46px; height: 30px; border-radius: 3px; background: #0a0b0d; border: 1px solid #3a3f47;
  cursor: pointer; display: flex; align-items: flex-end; justify-content: center; font-size: 10px; color: #aeb4bd; padding-bottom: 2px; }
.fp-port.qsfp { width: 62px; height: 34px; }
.fp-port::before { content: ""; position: absolute; top: 4px; left: 6px; right: 6px; height: 4px; border-radius: 2px; background: var(--port-down); }
.fp-port.up::before { background: var(--port-up); box-shadow: 0 0 6px var(--port-up); }
.fp-port.admin-down::before { background: var(--port-admin); }
.fp-port.empty { opacity: .55; }
.fp-port .util { position: absolute; left: 6px; right: 6px; top: 11px; height: 3px; background: #23262c; border-radius: 2px; overflow: hidden; }
.fp-port .util i { display: block; height: 100%; background: var(--s1); }
.fp-port.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.fp-port:hover { border-color: #8a929e; }
.fp-right { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.fp-leds { display: grid; grid-template-columns: auto auto; gap: 3px 6px; font-size: 10px; align-items: center; }
.fp-leds i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #555; }
.fp-leds i.green { background: #4cd137; box-shadow: 0 0 5px #4cd137; }
.fp-leds i.amber, .fp-leds i.yellow, .fp-leds i.orange { background: #f5a623; box-shadow: 0 0 5px #f5a623; }
.fp-leds i.red { background: #e84118; box-shadow: 0 0 5px #e84118; }
.fp-mgmt { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 10px; }
.fp-rj45 { width: 34px; height: 26px; background: #0a0b0d; border: 1px solid #3a3f47; border-radius: 2px; position: relative; }
.fp-rj45.up { box-shadow: inset 0 -3px 0 var(--port-up); }
.fp-name { font-size: 12px; font-weight: 600; color: #e6e9ef; writing-mode: horizontal-tb; min-width: 70px; }
.fp-name .logo { height: 16px; display: block; margin-top: 6px; }
.fp-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 8px 0 18px; flex-wrap: wrap; }
.fp-legend span::before { content: ""; display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--c); }
.portinfo { margin-top: 14px; }
a.btnlink { display: inline-block; text-decoration: none; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-size: 12px; background: var(--panel); }
a.btnlink:hover { border-color: var(--accent); }
.portpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 10px; font-size: 13px; }
.portpick label { display: flex; align-items: center; gap: 4px; }
.vnigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; font-size: 13px; }

/* ---- login page */
body.loginpage { min-height: 100vh; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 12px; padding: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand .logo { height: 36px; border-radius: 4px; }
.login-brand b { font-size: 18px; color: var(--accent-ink); }
#lf { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
#lf label { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
#lf input { padding: 9px 10px; }
button.wide { width: 100%; padding: 10px; }
#lerr { margin: 0 0 12px; }
.userchip { font-size: 12px; display: inline-flex; gap: 8px; align-items: center; }
.userchip b { color: var(--text); }
tr.applied td { background: var(--accent-soft); }
.split.users { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .split.users { grid-template-columns: 1fr; } }
.live { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.savebtn { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; }
.savebtn.dirty { border-color: var(--warn); color: var(--warn); }
.savebtn.clean { color: var(--muted); }
.savebtn:hover { border-color: var(--accent); }
ol.steps { padding-left: 20px; margin: 6px 0; } ol.steps li { margin-bottom: 8px; }
.small { font-size: 12px; }

.savebtn svg { width: 15px; height: 15px; margin-right: 6px; flex: none; }
.savebtn.clean svg { color: var(--ok); }
.check { color: var(--ok); font-weight: 700; margin-right: 6px; }
/* front-panel link lights blink every two seconds, like port activity LEDs */
.fp-port.up::before { animation: fp-blink 2s steps(1) infinite; }
@keyframes fp-blink { 50% { background: #2f4a00; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .fp-port.up::before { animation: none; } }

/* front panel: compact faceplates, side by side when there is room */
.fp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(700px, 1fr)); gap: 14px; margin-bottom: 4px; }
.fp-card { padding: 12px 14px; }
.fp-card h2 { margin-bottom: 8px; }
.faceplate { width: max-content; max-width: 100%; gap: 10px; padding: 10px 12px; }
.fp-group { gap: 4px; padding: 5px; }
.fp-port { width: 38px; height: 27px; }
.fp-port.qsfp { width: 52px; height: 30px; }
.fp-right { margin-left: 6px; gap: 10px; }
.fp-name { min-width: 0; }
/* fill the card: taller ports, faceplate stretched to the card width */
.faceplate { width: 100%; justify-content: space-between; gap: 6px; padding: 12px 14px; }
.fp-group { gap: 6px 4px; padding: 6px; }
.fp-port { width: 40px; height: 36px; font-size: 11px; }
.fp-port.qsfp { width: 56px; height: 40px; }
.fp-right { margin-left: 0; }
.fp-leds { gap: 5px 6px; font-size: 11px; }
.fp-rj45 { width: 38px; height: 30px; }
.navgroup { color: var(--accent-ink); opacity: 1; font-weight: 700; }
.logo-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.logo-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 120px; padding: 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; font-size: 12px; }
.logo-opt img { height: 34px; max-width: 96px; object-fit: contain; }
.logo-opt .muted { height: 34px; display: flex; align-items: center; }
.logo-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---- browser CLI */
.cli { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 360px; }
.cli-head { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cli-target { margin-left: auto; font-size: 13px; }
.cli-out { flex: 1; overflow: auto; padding: 10px 14px; background: #050505; color: #d7e3c7; font: 12.5px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre-wrap; }
:root[data-theme="light"] .cli-out { background: #0b0b0b; }
.cli-out .cli-echo { color: var(--accent); margin-top: 6px; }
.cli-out .cli-sw { color: #8fd61a; font-weight: 700; margin-top: 4px; }
.cli-out .muted { color: #8a8f86; }
.cli-out .bad { color: #ff7a6b; font-weight: 400; }
.cli-out .ok { color: #8fd61a; font-weight: 400; }
.cli-in { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #0a0a0a; border-top: 1px solid #222; }
.cli-prompt { color: var(--accent); font: 13px ui-monospace, Consolas, monospace; white-space: nowrap; }
.cli-in input { flex: 1; background: transparent; border: 0; color: #f0f0f0; font: 13px ui-monospace, "Cascadia Code", Consolas, monospace; outline: none; }
