/* ESSIE fullscreen desktop · tab row · Start top-left · wallpaper · no taskbar */

@import url("spv.css");

:root {
  --bg: var(--bgs-bg2, #0a0c0b);
  --ink: var(--bgs-ink, #e8e4df);
  --mute: var(--bgs-mute, #8a9188);
  --line: var(--bgs-line, #1e2822);
  --g: var(--spv-g, #05f2a0);
  --r: var(--spv-r, #ff2a6d);
  --b: var(--spv-b, #2de2e6);
  --y: var(--spv-y, #f9f871);
  --grin: var(--spv-grin, #e8c547);
  --sdf: var(--spv-sdf, #c4788a);
  /* interface ×1.5 · font ×2 (user OS desktop scale) */
  --ui-scale: 1.5;
  --font-scale: 2;
  --tab-h: calc(40px * var(--ui-scale));
  --chat-w: calc(260px * var(--ui-scale));
  --start-w: calc(240px * var(--ui-scale));
  --icon: calc(88px * var(--ui-scale));
  --icon-gap: calc(18px * var(--ui-scale));
  --pad: calc(12px * var(--ui-scale));
  --font-ui-sz: calc(14px * var(--font-scale));
  --font-sm: calc(12px * var(--font-scale));
  --font-xs: calc(11px * var(--font-scale));
  --font-lg: calc(18px * var(--font-scale));
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: #030405; }

body.desk-fullscreen {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: var(--font-ui-sz);
  line-height: 1.35;
  background: transparent;
}

/* ========== SDF exclusive shells (no flat chrome) ========== */
.raised-sdf,
.sdf-shell {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #121816 0%, #0c100e 55%, #0a0c0b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

/* wallpaper full viewport · no browser chrome */
#wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 10% 90%, rgba(5, 242, 160, 0.09), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(232, 197, 71, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 42, 109, 0.04), transparent 60%),
    linear-gradient(165deg, #07090a 0%, #0a0c0b 40%, #050607 100%);
}
body.mode-offline #wallpaper {
  filter: saturate(0.5) brightness(0.9);
}

/* ========== TAB BAR · full width · only chrome ========== */
.tabbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--tab-h);
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: stretch;
  background: #0a0c0b;
  border-bottom: 1px solid #2a322c;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Start button · top left */
.start-btn {
  appearance: none;
  flex: 0 0 var(--tab-h);
  width: var(--tab-h);
  border: 0;
  border-right: 1px solid var(--line);
  background: #0c100e;
  color: var(--grin);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.start-btn:hover,
.start-btn.on {
  background: rgba(232, 197, 71, 0.12);
  box-shadow: inset 0 -2px 0 var(--grin);
}
.start-mark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  font-family: var(--font-ui, system-ui, sans-serif);
}

/* tabs all the way */
.tab-row {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  scrollbar-width: none;
}
.tab-row::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 1 auto;
  max-width: 180px;
  min-width: 88px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px 0 10px;
  border-right: 1px solid rgba(30, 40, 34, 0.85);
  cursor: pointer;
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  user-select: none;
  background: transparent;
}
.tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
}
.tab.on {
  color: var(--ink);
  background: rgba(18, 22, 20, 0.95);
  box-shadow: inset 0 -2px 0 var(--grin);
}
.tab-icon {
  flex: 0 0 auto;
  opacity: 0.9;
  font-size: 12px;
}
.tab-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tab-x {
  appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  padding: 0;
  opacity: 0.5;
}
.tab:hover .tab-x { opacity: 0.85; }
.tab-x:hover {
  background: rgba(255, 42, 109, 0.25);
  color: var(--r);
  opacity: 1;
}

.tabbar-end {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
}
.hud-pill {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--g);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.net-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mute);
  padding: 3px 8px;
  font-size: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.net-toggle.on { border-color: var(--g); color: var(--g); }
.net-toggle:not(.on) { border-color: var(--r); color: var(--r); }

/* right-click context flyout · mouse position */
.ctx-menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: min(280px, 90vw);
  max-height: min(70vh, 520px);
  display: none;
  flex-direction: column;
  background: rgba(10, 12, 11, 0.97);
  border: 1px solid var(--line);
  box-shadow: 8px 12px 36px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.ctx-menu.open {
  display: flex;
}
.ctx-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--grin);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.ctx-list {
  overflow: auto;
  padding: 4px;
  max-height: min(62vh, 480px);
}
.ctx-section {
  padding: 6px 10px 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
}
.ctx-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--line);
}
.ctx-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  padding: 7px 10px;
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
}
.ctx-item:hover {
  border-color: var(--line);
  background: rgba(5, 242, 160, 0.08);
  color: var(--g);
}
.ctx-item.danger:hover {
  background: rgba(255, 42, 109, 0.12);
  color: var(--r);
  border-color: rgba(255, 42, 109, 0.35);
}
.ctx-icon {
  flex: 0 0 22px;
  width: 22px;
  text-align: center;
  color: var(--g);
  font-size: 12px;
}
.ctx-item.danger .ctx-icon { color: var(--r); }
.ctx-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* tab · middle-click friendly */
.tab { cursor: pointer; }
.tab:active { background: rgba(232, 197, 71, 0.06); }

/* Start menu · under Start · top left */
.start-menu {
  position: fixed;
  top: var(--tab-h);
  left: 0;
  z-index: 110;
  width: var(--start-w);
  max-height: min(72vh, 560px);
  display: none;
  flex-direction: column;
  background: #0c100e;
  border: 1px solid var(--line);
  border-top: 0;
  box-shadow: 8px 14px 40px rgba(0, 0, 0, 0.65);
}
.start-menu.open {
  display: flex !important;
  pointer-events: auto;
}
.fly-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.fly-head strong {
  display: block;
  color: var(--grin);
  letter-spacing: 0.14em;
  font-size: 11px;
  text-transform: uppercase;
}
.fly-head span {
  color: var(--mute);
  font-size: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.fly-plugs {
  flex: 1;
  overflow: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fly-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  padding: 7px 8px;
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
}
.fly-item:hover {
  border-color: var(--line);
  background: rgba(5, 242, 160, 0.06);
}
.fly-item.on {
  border-color: rgba(232, 197, 71, 0.4);
  color: var(--grin);
  background: rgba(232, 197, 71, 0.08);
  box-shadow: inset 2px 0 0 var(--grin);
}
.fly-icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #0a0e0c;
  font-size: 11px;
  color: var(--g);
}
.fly-item.on .fly-icon {
  border-color: var(--grin);
  color: var(--grin);
}
.fly-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* desk body under tabs · on wallpaper */
.desk-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr var(--chat-w);
  height: 100vh;
  padding-top: var(--tab-h);
  max-height: 100vh;
}
.desk-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.stage-surface {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 20px;
  min-height: 0;
}
.empty-desk {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
  gap: 8px;
}
.empty-desk p {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  color: var(--grin);
}

/* chat right · no taskbar */
.desk-chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(30, 40, 34, 0.85);
  background: rgba(5, 7, 6, 0.55);
  backdrop-filter: blur(8px);
  min-height: 0;
  padding: 8px;
}
.chat-log {
  flex: 1;
  overflow: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--ink);
  padding: 6px;
  min-height: 0;
}
.chat-line { margin: 0 0 6px; line-height: 1.35; word-break: break-word; }
.chat-line b { color: var(--g); margin-right: 6px; font-weight: 600; }
.chat-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.chat-form input {
  flex: 1;
  background: rgba(5, 8, 7, 0.9);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 7px 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
}
.chat-form button {
  appearance: none;
  background: #121816;
  border: 1px solid var(--line);
  color: var(--grin);
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
}

/* no footer / taskbar */

/* plug buttons inside stages */
button.plug-btn {
  appearance: none;
  background: #121816;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
}
button.plug-btn:hover { border-color: var(--g); color: var(--g); }
button.plug-btn.on {
  border-color: var(--grin) !important;
  color: var(--grin) !important;
}

/* JS Engine SPV · commands light-up */
.spv-jseng .jseng-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.jseng-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
  max-height: 28vh;
  overflow: auto;
  padding: 4px 0;
}
.js-cmd-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #0a0e0c;
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  padding: 5px 9px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.js-cmd-chip:hover {
  border-color: var(--b);
  color: var(--ink);
}
.js-cmd-chip.run {
  border-color: var(--y);
  color: var(--y);
  box-shadow: 0 0 10px rgba(249, 248, 113, 0.35);
}
.js-cmd-chip.pass {
  border-color: var(--g);
  color: var(--g);
  background: rgba(5, 242, 160, 0.1);
  box-shadow: 0 0 12px rgba(5, 242, 160, 0.25);
}
.js-cmd-chip.fail {
  border-color: var(--r);
  color: var(--r);
  background: rgba(255, 42, 109, 0.1);
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.25);
}
.jseng-src {
  display: block;
  width: 100%;
  min-height: 120px;
  margin-top: 4px;
  background: #030504;
  border: 1px solid var(--line);
  color: var(--g);
  padding: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  tab-size: 2;
}
.jseng-out {
  min-height: 6rem;
  max-height: 40vh;
  overflow: auto;
  color: var(--y) !important;
  margin-top: 10px;
}
.spv-jseng .spv-title {
  color: var(--spv-phi, #7aa2ff);
}
#jseng-run-tests {
  border-color: var(--grin) !important;
  color: var(--grin) !important;
}

/* The Fox · QWERTY typing teacher */
.spv-fox .spv-title {
  color: #e8a54b;
  text-shadow: 0 0 12px rgba(232, 165, 75, 0.35);
}
.fox-lesson {
  margin: 8px 0 12px;
}
.fox-prompt {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.15rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  background: rgba(3, 5, 4, 0.9);
  border: 1px solid var(--line);
  min-height: 3.2rem;
  margin-bottom: 10px;
  word-break: break-word;
}
.fox-ch {
  color: var(--mute);
  border-bottom: 2px solid transparent;
}
.fox-ch.ok {
  color: var(--g);
}
.fox-ch.bad {
  color: var(--r);
  background: rgba(255, 42, 109, 0.15);
}
.fox-ch.cur {
  color: var(--ink);
  border-bottom-color: var(--grin);
  background: rgba(232, 197, 71, 0.12);
}
.fox-input {
  display: block;
  width: 100%;
  background: #050807;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.05rem;
  padding: 10px 12px;
  letter-spacing: 0.04em;
}
.fox-input:focus {
  outline: none;
  border-color: var(--grin);
  box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.35);
}
.fox-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--mute);
}
.fox-stats code {
  color: var(--y);
}
.fox-board {
  margin: 14px 0;
  user-select: none;
}
.fox-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 5px;
}
.fox-row-1 {
  padding-left: 14px;
}
.fox-row-2 {
  padding-left: 28px;
}
.fox-key {
  min-width: 28px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #0c100e;
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  text-transform: uppercase;
  padding: 0 6px;
}
.fox-space {
  min-width: 180px;
  text-transform: none;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.fox-key.hit {
  border-color: var(--g);
  color: var(--g);
  background: rgba(5, 242, 160, 0.15);
  box-shadow: 0 0 10px rgba(5, 242, 160, 0.35);
}
.fox-key.miss {
  border-color: var(--r);
  color: var(--r);
  background: rgba(255, 42, 109, 0.15);
}
.fox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
#fox-js-once {
  border-color: #e8a54b !important;
  color: #e8a54b !important;
}
.fox-js-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 8px;
}
.fox-js-cmds .js-cmd-chip.used {
  opacity: 0.45;
  text-decoration: line-through;
}
.spv-fox.fox-done .fox-prompt {
  border-color: rgba(5, 242, 160, 0.45);
  box-shadow: 0 0 16px rgba(5, 242, 160, 0.2);
}

/* terminal */
.spv-term-out {
  height: min(48vh, 400px);
  overflow: auto;
  background: rgba(3, 5, 4, 0.92);
  border: 1px solid var(--line);
  padding: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--g);
  margin: 10px 0;
}
.spv-term-line { margin: 0 0 3px; white-space: pre-wrap; word-break: break-word; }
.spv-term-line.cmd { color: var(--ink); }
.spv-term-line.ok { color: var(--g); }
.spv-term-line.err { color: var(--r); }
.spv-term-line.mute { color: var(--mute); }
.spv-term-form { display: flex; align-items: center; gap: 8px; }
.spv-term-ps1 {
  color: var(--grin);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}
.spv-term-form input {
  flex: 1;
  background: #050807;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}

/* player */
.spv-player-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.spv-player-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}
.spv-player-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin: 8px 0;
}
.spv-player-more {
  margin-top: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.22);
}
.spv-player-more summary {
  cursor: pointer;
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* stage plugs on glass */
#stage > .spv-dom,
#stage > article.spv-article {
  background: rgba(12, 16, 14, 0.88);
  backdrop-filter: blur(6px);
}

/* ========== ICON MENU · standard program launch · SDF shells ========== */
.icon-desk {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--icon), 1fr));
  gap: var(--icon-gap);
  padding: calc(24px * var(--ui-scale));
  max-width: 1100px;
  margin: 0 auto;
  align-content: start;
}
.icon-desk .desk-icon {
  appearance: none;
  width: var(--icon);
  height: calc(var(--icon) + 28px * var(--font-scale) / 2);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
  font-size: var(--font-sm);
  letter-spacing: 0.04em;
}
.icon-desk .desk-icon .glyph {
  width: calc(var(--icon) * 0.72);
  height: calc(var(--icon) * 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  /* SDF exclusive tile */
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #141a18, #0c100e 60%, #090b0a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.4);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  overflow: hidden;
}
.icon-desk .desk-icon .glyph img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: auto;
}
.icon-desk .desk-icon .glyph .glyph-fallback {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--font-lg);
  color: var(--g);
  font-weight: 600;
}
.icon-desk .desk-icon .label {
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  text-shadow: 0 1px 2px #000;
}
.icon-desk .desk-icon:hover .glyph {
  border-color: var(--grin);
  box-shadow:
    inset 0 1px 0 rgba(232, 197, 71, 0.15),
    0 0 0 1px rgba(232, 197, 71, 0.25),
    0 8px 22px rgba(0, 0, 0, 0.45);
}
.icon-desk .desk-icon:focus-visible {
  outline: 2px solid var(--g);
  outline-offset: 3px;
}
.empty-desk.icon-home {
  min-height: calc(100vh - var(--tab-h) - 48px);
  display: block;
  padding-top: calc(12px * var(--ui-scale));
}
.empty-desk.icon-home > .home-title {
  text-align: center;
  margin: calc(8px * var(--ui-scale)) 0 calc(4px * var(--ui-scale));
  font-size: var(--font-lg);
  color: var(--grin);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.empty-desk.icon-home > .home-sub {
  text-align: center;
  color: var(--mute);
  font-size: var(--font-sm);
  margin-bottom: calc(16px * var(--ui-scale));
}

/* scale tab titles with font×2 */
.tab-title { font-size: var(--font-sm); }
.tab-icon { font-size: var(--font-ui-sz); }
.start-btn { font-size: var(--font-lg); }
.fly-item { font-size: var(--font-sm); padding: calc(8px * var(--ui-scale)) calc(12px * var(--ui-scale)); }
.chat-line { font-size: var(--font-sm); }

/* Start · SPV app list + search */
.fly-search {
  width: calc(100% - 16px);
  margin: 8px;
  padding: calc(8px * var(--ui-scale));
  border: 1px solid var(--line);
  background: #0a0c0b;
  color: var(--ink);
  font-size: var(--font-sm);
  font-family: var(--font-mono, ui-monospace, monospace);
}
.fly-search:focus {
  outline: 1px solid var(--g);
  border-color: var(--g);
}
.fly-count,
.fly-empty {
  padding: 6px 12px;
  color: var(--mute);
  font-size: var(--font-xs);
  font-family: var(--font-mono, ui-monospace, monospace);
}
.fly-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.fly-item .fly-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fly-item .fly-icon img.fly-glyph {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.fly-item .fly-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fly-item .fly-id {
  flex: 0 0 auto;
  color: var(--mute);
  font-size: var(--font-xs);
  font-family: var(--font-mono, ui-monospace, monospace);
  opacity: 0.75;
}
.start-menu {
  max-height: min(70vh, 640px);
  overflow: auto;
}
.start-menu .fly-plugs {
  max-height: none;
}

@media (max-width: 820px) {
  .desk-body { grid-template-columns: 1fr; }
  .desk-chat {
    position: fixed;
    right: 0;
    top: var(--tab-h);
    bottom: 0;
    width: min(100%, var(--chat-w));
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.2s ease;
  }
  body.chat-open .desk-chat { transform: translateX(0); }
}

/* ========== MULTI-SEAT SPV · concurrent tabs · SDF bus ========== */
.tab-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-left: 1px solid var(--line);
}
.hud-pill { max-width: 220px; }

/* SDF bus mode + lane selector */
.bus-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.bus-label {
  color: var(--sdf, #c4788a);
  font-weight: 700;
  margin-right: 2px;
}
.bus-sep { color: var(--mute); opacity: 0.5; margin: 0 2px; }
.bus-mode-btn,
.bus-lane-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  padding: 2px 6px;
  font: inherit;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bus-mode-btn:hover,
.bus-lane-btn:hover {
  color: var(--ink);
  border-color: var(--g);
}
.bus-mode-btn.on {
  color: var(--g);
  border-color: var(--g);
  background: rgba(5, 242, 160, 0.1);
  box-shadow: 0 0 8px rgba(5, 242, 160, 0.2);
}
body.bus-mode-secure .bus-mode-btn.on {
  color: var(--b);
  border-color: var(--b);
  background: rgba(45, 226, 230, 0.1);
}
body.bus-mode-broadcast .bus-mode-btn.on {
  color: var(--y);
  border-color: var(--y);
  background: rgba(249, 248, 113, 0.1);
}
.bus-lane-btn.on {
  color: var(--grin);
  border-color: var(--grin);
  background: rgba(232, 197, 71, 0.1);
}
.net-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mute);
  padding: 3px 8px;
  font-size: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.net-btn.on { border-color: var(--g); color: var(--g); }

/* stage hosts many seat panes; only .on is visible */
#stage.stage,
#stage.stage-surface {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.seat-home,
.seat-pane {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.seat-pane[hidden],
.seat-home[hidden] {
  display: none !important;
}
.seat-pane.on,
.seat-home.on {
  display: flex;
}
.seat-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 2px 8px;
}
.seat-bus-ribbon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-top: 1px solid var(--line);
  background: rgba(5, 8, 7, 0.75);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--mute);
}
.seat-bus-id {
  color: var(--g);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.seat-bus-hdr {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40%;
}
.seat-bus-msg {
  margin-left: auto;
  color: var(--sdf, #c4788a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
}

/* designer header face on desk icons */
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: var(--icon);
  min-height: calc(var(--icon) + 28px);
  padding: 8px 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-ui, system-ui, sans-serif);
}
.desk-icon:hover {
  border-color: var(--line);
  background: rgba(5, 242, 160, 0.05);
}
.desk-icon .glyph {
  width: calc(var(--icon) * 0.62);
  height: calc(var(--icon) * 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(18px * var(--font-scale) * 0.55);
  font-weight: 700;
  color: var(--grin);
  overflow: hidden;
}
.desk-icon .glyph img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.desk-icon .label {
  font-size: var(--font-xs);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desk-icon .sublabel {
  font-size: 9px;
  color: var(--mute);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.designer-header-face {
  /* header-as-icon: raised SDF tile */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.35);
}
.icon-desk {
  display: flex;
  flex-wrap: wrap;
  gap: var(--icon-gap);
  justify-content: center;
  max-width: 920px;
  margin: 12px auto 0;
  padding: 8px;
}
.home-title {
  margin: 0;
  font-size: var(--font-lg);
  letter-spacing: 0.2em;
  color: var(--grin);
  text-transform: uppercase;
}
.home-sub {
  margin: 4px 0 0;
  font-size: var(--font-sm);
  color: var(--mute);
  font-family: var(--font-mono, ui-monospace, monospace);
  text-align: center;
  max-width: 48rem;
}
.bus-home-hint {
  margin-top: 8px;
  font-size: 10px;
  color: var(--sdf, #c4788a);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
}
.fly-sub {
  display: block;
  font-size: 9px;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.start-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.start-head strong {
  display: block;
  color: var(--grin);
  letter-spacing: 0.12em;
  font-size: 11px;
  text-transform: uppercase;
}
.start-head span {
  color: var(--mute);
  font-size: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
}

/* body bus mode tint (subtle) */
body.bus-mode-secure #wallpaper {
  background:
    radial-gradient(ellipse 90% 60% at 10% 90%, rgba(45, 226, 230, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(232, 197, 71, 0.08), transparent 50%),
    linear-gradient(165deg, #07090a 0%, #0a0c0b 40%, #050607 100%);
}
body.bus-mode-broadcast #wallpaper {
  background:
    radial-gradient(ellipse 90% 60% at 10% 90%, rgba(249, 248, 113, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(5, 242, 160, 0.08), transparent 50%),
    linear-gradient(165deg, #07090a 0%, #0a0c0b 40%, #050607 100%);
}
