/* ── RESET & BASE ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: "NV Bitcount Double";
  src: url("/assets/Bitcount_Grid_Double/static/BitcountGridDouble_Roman-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "NV Bitcount Single";
  src: url("/assets/Bitcount_Single/static/BitcountSingle_Roman-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg:        #0a0a0c;
  --bg1:       #0d0d11;
  --bg2:       #1b1b22;
  --bg3:       #1d1d1f;
  --border:    transparent;
  --border2:   #2a2a3d;
  --text:      #ffffff;
  --text2:     #cdcdcf;
  --text3:     #646473;
  --accent:    #e05c35;
  --accent2:   #ff8660;
  --green:     #35a152;
  --greenb:     #2bf060;
  --greend:     #073313; 
  --red:       #873e47;
  --blue:      #3c72ef;
  --blueb:      #00a3fb;
  --blued:      #000d87;
  --yellow:    #fd9a10;
  --chat-in:   #6abdf5;
  --chat-out:  #efdc65;
  --eq1:       #e05c35;
  --eq2:       #ff8660;
  --eq3:       #ffb380;

  --font-ui:   'Courier New', 'Courier', monospace;
  --font-head: 'Georgia', serif;
  --radius:    3px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  overflow: hidden;
}

button {
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:focus-visible { outline: 1px solid var(--accent); }

/* ── LAYOUT: TWO COLUMNS ──────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── LEFT COLUMN ──────────────────────────────────────────────── */
#left {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg1);
}

/* HEADER */
#header {
  padding: 12px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#logo {
  width: 100%;
  height: 66px;
  display: flex;
  align-items: center;
}

#logo-image {
  display: block;
  width: 100%;
  object-fit: contain;
  object-position: left center;
}

#tagline {
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--text3);
  margin-top: 4px;
  text-transform: uppercase;
}

#connected-port-display {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

#connected-port-display:hover {
  color: var(--text2);
}

/* PROJECT SELECTOR */
#project-bar {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

#project-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text3);
  text-transform: uppercase;
  white-space: nowrap;
}

#project-select {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 3px 6px;
  border-radius: var(--radius);
  min-width: 0;
}

/* DECK CONTROLS */
#deck-controls {
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #000;
}

#deck-transport-panel {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 0;
  padding: 8px 0 6px;
  background:
    linear-gradient(180deg,
      rgba(255,255,255,0.16) 0%,
      rgba(255,255,255,0.07) 8%,
      rgba(10,18,30,0.24) 18%,
      rgba(0,0,0,0.96) 34%,
      rgba(0,0,0,1) 56%,
      rgba(4,6,10,0.92) 78%,
      rgba(0,0,0,1) 100%);
  box-shadow: inset 0 18px 24px rgba(255,255,255,0.05), inset 0 -10px 14px rgba(0,0,0,0.9);
}

#deck-transport-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/assets/backplate.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 0;
}

#auto-btn {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text2);
  text-transform: uppercase;
  line-height: 1;
}

#auto-btn.active {
  color: #5ed87a;
  text-shadow: 0 0 6px rgba(94,216,122,0.18);
}

.transport-compact-strip {
  position: relative;
  width: 100%;
  padding: 0 0 2px;
}

.transport-compact-strip,
.transport-overlay-row,
.transport-row.transport-row-six {
  position: relative;
  z-index: 1;
}

.transport-overlay-row,
.transport-row.transport-row-six {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: 100%;
}

.transport-overlay-row {
  position: relative;
  z-index: 2;
  gap: 0.5px;
  margin-bottom: -4px;
}

.transport-overlay-slot {
  min-height: 12px;
  display: flex;
  align-items: end;
  justify-content: center;
  position: relative;
}

.transport-overlay-slot-record,
.transport-overlay-slot-play {
  flex-direction: column;
  gap: 0;
  align-items: center;
  justify-content: flex-end;
}

#deck-state-label {
  min-width: 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text2);
  text-transform: uppercase;
  line-height: 1;
}

.transport-row.transport-row-six {
  position: relative;
  z-index: 2;
  gap: 0.5px;
  align-items: end;
  padding: 0;
}

.deck-btn {
  position: relative;
  min-width: 0;
  height: 92px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.deck-btn-graphic {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  pointer-events: none;
}

#deck-status-dot,
.deck-btn-led {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1a1d24;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.55);
  z-index: 3;
}

#deck-status-dot {
  border: 1px solid #5a1c1c;
}

.deck-btn-led {
  border: 1px solid #1f4a24;
}

#deck-status-dot.stop { background: #2e323a; }
#deck-status-dot.pause { background: #6b7280; }
#deck-status-dot.record,
.deck-btn-record.busy #deck-status-dot {
  background: radial-gradient(circle at 40% 35%, #ffe08a 0%, #f0c040 35%, #e05c35 72%, #8c2318 100%);
  box-shadow:
    0 0 0 1px rgba(80, 12, 12, 0.7),
    0 0 8px rgba(240, 192, 64, 0.7),
    0 0 16px rgba(224, 92, 53, 0.5),
    0 0 26px rgba(224, 92, 53, 0.24);
  animation: record-led-pulse 0.9s ease-in-out infinite;
}

.deck-btn-play.pending #play-led,
#play-led.active {
  background: radial-gradient(circle at 40% 35%, #e7ffb3 0%, #9cff66 38%, #2ed66d 72%, #116927 100%);
  box-shadow:
    0 0 0 1px rgba(9, 58, 16, 0.72),
    0 0 8px rgba(170,255,96,0.65),
    0 0 16px rgba(94,216,122,0.45),
    0 0 26px rgba(94,216,122,0.18);
}

@keyframes record-led-pulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    filter: brightness(0.95);
  }
  50% {
    transform: translateX(-50%) scale(1.12);
    filter: brightness(1.14);
  }
}



/* MONITOR - EQ DISPLAY */
#monitor-wrap {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  height: 122px;
  background: var(--bg);
}

#monitor-label {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--text3);
  text-transform: uppercase;
  z-index: 3;
}

#monitor-status {
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 14px;
  color: var(--text3);
  letter-spacing: 1px;
  z-index: 3;
}

#monitor-message-wrap {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}

#monitor-message {
  font-size: 14px;
  letter-spacing: 1px;
  color: #e8e8ee;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.55);
  opacity: 0.96;
}

#eq-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* SYSTEM LOG */
#system-log-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#system-log-header {
  padding: 6px 14px;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--text3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#log-clear-btn {
  font-size: 14px;
  color: var(--text3);
  padding: 0 2px;
}
#log-clear-btn:hover { color: var(--accent); }

#system-log {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

#system-log.inactive .log-line {
  transition: opacity 0.8s ease;
}

.log-line {
  padding: 2px 12px;
  line-height: 1.4;
  font-size: 14px;
  color: var(--text3);
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 2px solid transparent;
  opacity: 0.78;
}
.log-line:hover { background: var(--bg2); opacity: 1; }
.log-line.pass  { color: var(--green); border-left-color: var(--green); opacity: 0.82; }
.log-line.fail  { color: var(--red);   border-left-color: var(--red);   opacity: 0.86; }
.log-line.neutral { color: var(--text3); }
.log-line.chat-out {
  color: var(--chat-out);
  border-left-color: var(--chat-out);
  opacity: 1;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 231, 74, 0.28);
}
.log-line.chat-in {
  color: var(--chat-in);
  border-left-color: var(--chat-in);
  opacity: 1;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(41, 168, 255, 0.3);
}
.log-line.task-log-line {
  color: var(--text2);
  opacity: 1;
  font-weight: 700;
}
.log-task-prefix {
  color: var(--text);
  font-weight: 900;
  letter-spacing: 1px;
}
.log-task-name {
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255,255,255,0.18);
}
.log-file-path {
  color: var(--greenb);
  font-weight: 900;
  text-shadow: 0 0 8px rgba(43,240,96,0.22);
}
.log-line.fail .log-file-path,
.log-error-detail {
  color: #ff6a70;
  text-shadow: 0 0 8px rgba(255,70,76,0.25);
}
.log-line.pass .log-task-prefix {
  color: var(--greenb);
}
.log-task-at {
  color: var(--text3);
}

#log-placeholder {
  padding: 12px 14px;
  color: var(--text3);
  font-size: 14px;
}

/* TEXT INPUT */
#input-wrap {
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#chat-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 6px 11px;
  border-radius: var(--radius);
  resize: none;
  height: 54px;
}
#chat-input:focus { outline: none; border-color: var(--accent); }
#chat-input::placeholder { color: var(--text3); }

#input-actions {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.inp-btn {
  padding: 3px 12px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 13px;
  letter-spacing: 1px;
}
.inp-btn:hover { border-color: var(--accent); color: var(--accent); }
.inp-btn.primary { border-color: var(--accent); color: var(--accent); }
.inp-btn.primary:hover { background: var(--accent); color: #fff; }

.project-identity-warning {
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--yellow);
  background: rgba(240, 192, 64, 0.08);
  color: var(--yellow);
  font-size: 13px;
  line-height: 1.35;
}

.project-location-control {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.project-location-control .field-input {
  flex: 1;
}

.project-location-picker {
  margin: -6px 0 12px 112px;
  padding: 8px;
  border: 1px solid var(--border2);
  background: var(--bg1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-location-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 13px;
}

.project-location-option:hover {
  border-color: var(--accent);
  color: var(--text);
}

.project-location-option-meta {
  color: var(--text3);
  font-size: 12px;
  white-space: nowrap;
}

/* ── RIGHT COLUMN ─────────────────────────────────────────────── */
#right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* PROJECT INFO BAR */
#project-info {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg1);
}

#project-title {
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--text3);
  text-transform: uppercase;
}

#project-summary {
  font-size: 14px;
  color: var(--text2);
  margin-top: 3px;
}

#project-info {
  --active-project-primary: #aeb8bf;
  --active-project-dark: rgba(130, 145, 150, .22);
  --active-project-light: #eef6f8;
  margin: 12px 16px 8px;
  padding: 22px 26px;
  border: 1px solid color-mix(in srgb, var(--active-project-primary) 72%, #000 28%);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.12)),
    var(--active-project-dark);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.035),
    0 0 24px color-mix(in srgb, var(--active-project-primary) 22%, transparent),
    inset 0 0 18px rgba(255,255,255,.025);
}

#project-info.backstage {
  --active-project-primary: #aeb8bf;
  --active-project-dark: rgba(130, 145, 150, .22);
  --active-project-light: #eef6f8;
}

#project-info #project-title {
  color: var(--active-project-light);
  font-family: "NV Bitcount Double", "Courier New", monospace;
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: none;
}

#project-info #project-summary {
  color: var(--text2);
  font-family: "NV Bitcount Single", "Courier New", monospace;
  font-size: 15px;
  letter-spacing: 1px;
  margin-top: 8px;
  max-width: 920px;
}



/* QUICK CONTROLS */
#quick-controls {
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg1);
}

.qc-btn {
  padding: 3px 12px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text2);
  letter-spacing: 1px;
}
.qc-btn:hover { border-color: var(--accent); color: var(--accent); }


/* TABS */
#tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg1);
  overflow-x: auto;
}

.tab-btn {
  padding: 11px 14px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* MAIN WORKVIEW */
#workview {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}
.tab-panel.active { display: block; }


/* ── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

/* ── TOAST ────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 999;
}
#toast.show { opacity: 1; }

/* ── COMPACT EDITOR LAYOUT ───────────────────────────────────── */
#panel-editor { padding: 0; overflow: hidden; }
.EditorCompact-Cx { position: relative; height: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); background: var(--bg); overflow: hidden; }
.EditorIconbar-Dx { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 5px; border-right: 1px solid var(--border2); background: #08090d; z-index: 5; }
.EditorIcon-Eo { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border2); border-radius: 6px; background: var(--bg2); color: var(--text2); font-size: 16px; line-height: 1; }
.EditorIcon-Eo:hover { border-color: var(--accent); color: var(--accent); }
.EditorIcon-Eo.primary { margin-top: auto; color: var(--accent); border-color: var(--accent); }
.EditorTreeDrawer-Dx { position: absolute; top: 0; bottom: 0; left: 42px; width: min(340px, 42vw); transform: translateX(-105%); transition: transform .18s ease; z-index: 4; background: rgba(11,13,19,.98); border-right: 1px solid var(--border2); box-shadow: 16px 0 34px rgba(0,0,0,.38); }
#panel-editor.tree-open .EditorTreeDrawer-Dx { transform: translateX(0); }
#editor-sidebar { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 9px; gap: 8px; }
#editor-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text3); letter-spacing: 3px; text-transform: uppercase; font-size: 12px; }
.EditorTreeTools-Eo { display: flex; gap: 4px; }
#editor-tree { min-height: 0; overflow: auto; padding: 7px; border: 1px solid var(--border2); border-radius: 8px; background: linear-gradient(180deg, #11141d, #0d1017); }
.editor-tree-row { display: grid; grid-template-columns: 12px 14px minmax(0, 1fr); gap: 4px; align-items: center; min-width: 0; padding: 3px 6px; border-radius: 6px; color: var(--text2); letter-spacing: 1px; }
.editor-tree-row:hover, .editor-tree-row.active { background: rgba(224,92,53,.12); color: var(--text); }
.editor-tree-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-tree-children { margin-left: 12px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.06); }
.EditorMain-Dx { position: relative; min-width: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 10px 12px 12px; gap: 10px; }
.EditorHead-Dx { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto auto; gap: 8px; align-items: center; min-height: 34px; }
#editor-file-path { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor-file-status { color: var(--text3); font-size: 13px; }

#editor-file-status {
  display: none !important;
}

#editor-section-select { min-width: 0; background: var(--bg2); border: 1px solid var(--border2); color: var(--text2); border-radius: var(--radius); padding: 4px 6px; font-family: var(--font-ui); }
.EditorFindPopover-Dx { position: fixed; width: min(560px, calc(100vw - 96px)); display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr); gap: 7px; padding: 8px; border: 1px solid rgba(105,86,52,.55); border-radius: var(--radius); background: rgba(35,35,51,.94); box-shadow: 0 0 0 1px rgba(224,92,53,.06), 0 8px 22px rgba(0,0,0,.34); backdrop-filter: blur(6px); z-index: 9000; color: #b9bcc8; font-family: var(--font-ui); }
#editor-stage { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--border2); border-radius: 8px; background: #111116; }
#editor-highlight, #editor-textarea, #editor-collapsed-view { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 14px; border: 0; background: transparent; color: var(--text2); font-family: var(--font-ui); font-size: 14px; line-height: 1.55; tab-size: 2; overflow: auto; white-space: pre; }
#editor-textarea { resize: none; caret-color: var(--accent2); color: transparent; -webkit-text-fill-color: transparent; z-index: 2; }
#editor-highlight { z-index: 1; pointer-events: none; }
#editor-textarea:focus { outline: none; }
#editor-stage.collapsed-mode #editor-textarea, #editor-stage.collapsed-mode #editor-highlight { display: none; }
#editor-collapsed-view { position: absolute; z-index: 3; background: #111116; }
.editor-collapsed-item { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr); gap: 8px; padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; }
.editor-collapsed-item:hover, .editor-collapsed-item.selected { background: rgba(224,92,53,.12); }
.tok-comment { color: #6f778a; }.tok-string { color: #efdc65; }.tok-keyword { color: #ff8660; }.tok-type { color: #6abdf5; }.tok-number { color: #35a152; }.tok-punct { color: #cdcdcf; }.tok-prop, .tok-tag, .tok-attr { color: #e05c35; }

/* ── LAUNCH GATE / PROJECT SELECT ─────────────────────────────── */

.launch-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(circle at 50% 18%, rgba(30, 46, 60, .24), transparent 42%),
    linear-gradient(180deg, #050507 0%, #09090c 48%, #050507 100%);
  color: var(--text);
  font-family: var(--font-ui);
  overflow: auto;
}

.launch-gate[hidden] {
  display: none !important;
}

.launch-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 28px clamp(18px, 4vw, 58px);
  gap: 28px;
}

.launch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.launch-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.launch-logo {
  width: 190px;
  max-width: 34vw;
  object-fit: contain;
}

.launch-title {
  font-size: 16px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
}

.launch-subtitle {
  margin-top: 5px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text3);
  text-transform: uppercase;
}

.launch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.launch-link-btn {
  color: var(--text2);
  border: 1px solid rgba(86, 86, 108, .42);
  background: rgba(255, 255, 255, .025);
  padding: 8px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.launch-link-btn:hover {
  color: var(--text);
  border-color: var(--project-accent-border, var(--accent));
}

.launch-panel {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  align-self: start;
}

.launch-panel[hidden] {
  display: none !important;
}

.launch-message-card {
  width: min(760px, 92vw);
  margin: 8vh auto 0;
  padding: 32px;
  border-radius: 16px;
  background: rgba(18, 18, 24, .92);
  border: 1px solid rgba(86, 86, 108, .56);
  box-shadow: 0 0 0 1px rgba(255,255,255,.025), 0 26px 70px rgba(0,0,0,.42);
  text-align: center;
}

.launch-message-card h1,
.launch-select-head h1 {
  margin: 0 0 12px;
  font-size: 21px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
}

.launch-message-card p,
.launch-select-head p {
  margin: 0 0 12px;
  color: var(--text2);
  line-height: 1.45;
}

.launch-muted {
  color: var(--text3) !important;
}

.launch-create-row,
.launch-create-inline {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.launch-create-inline {
  grid-template-columns: minmax(180px, 340px) auto auto;
  margin: 20px 0 0;
  padding: 16px;
  border: 1px solid rgba(86, 86, 108, .42);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.launch-input {
  min-height: 38px;
  padding: 8px 12px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid rgba(86, 86, 108, .62);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
}

.launch-input:focus {
  outline: none;
  border-color: var(--accent);
}

.launch-primary-btn,
.launch-secondary-btn,
.launch-system-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-ui);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.launch-primary-btn {
  color: #f8f8ff;
  border: 1px solid var(--project-accent-border, var(--accent));
  background: rgba(224, 92, 53, .18);
}

.launch-primary-btn:hover {
  background: rgba(224, 92, 53, .28);
}

.launch-secondary-btn {
  color: var(--text2);
  border: 1px solid rgba(86, 86, 108, .52);
  background: rgba(255, 255, 255, .025);
}

.launch-system-btn {
  color: #d7ecff;
  border: 1px solid rgba(0, 163, 251, .58);
  background: rgba(0, 70, 120, .22);
}

.launch-error {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--accent2);
  font-size: 13px;
}

.launch-select-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 24px;
}

.launch-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.launch-project-card {
  --card-primary: var(--accent);
  --card-dark: rgba(224, 92, 53, .16);
  --card-light: rgba(255, 134, 96, .92);

  position: relative;
  min-height: 126px;
  padding: 20px 22px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.08)),
    var(--card-dark);
  border: 1px solid color-mix(in srgb, var(--card-primary) 72%, #000 28%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.025),
    0 0 22px color-mix(in srgb, var(--card-primary) 22%, transparent),
    inset 0 0 16px rgba(255,255,255,.025);
  color: var(--text2);
  text-align: left;
  overflow: hidden;
}

.launch-project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 28% 20%, color-mix(in srgb, var(--card-primary) 26%, transparent), transparent 42%);
  pointer-events: none;
}

.launch-project-card:hover {
  transform: translateY(-1px);
  border-color: var(--card-light);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 0 28px color-mix(in srgb, var(--card-primary) 34%, transparent);
}

.launch-project-card-title {
  position: relative;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--card-light);
  margin-bottom: 12px;
  font-weight: 700;
}

.launch-project-card-summary {
  position: relative;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text2);
  min-height: 34px;
}

.launch-project-card-meta {
  position: relative;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text3);
}

.launch-project-card[data-color="1"] {
  --card-primary: #e05c35;
  --card-dark: rgba(224, 92, 53, .19);
  --card-light: #ffb39e;
}

.launch-project-card[data-color="2"] {
  --card-primary: #c9db00;
  --card-dark: rgba(180, 190, 0, .18);
  --card-light: #efff7a;
}

.launch-project-card[data-color="3"] {
  --card-primary: #00a3fb;
  --card-dark: rgba(0, 130, 190, .20);
  --card-light: #a8e7ff;
}

.launch-project-card[data-color="4"] {
  --card-primary: #35a152;
  --card-dark: rgba(35, 130, 60, .20);
  --card-light: #a4f0b8;
}

.launch-backstage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(86, 86, 108, .38);
  color: var(--text3);
  font-size: 13px;
}

body.launch-active #left,
body.launch-active #right {
  filter: grayscale(.4) brightness(.56);
  pointer-events: none;
  user-select: none;
}

body.launch-active #launch-gate {
  pointer-events: auto;
}


/* ── BITCOUNT DISPLAY FONT OVERRIDES ─────────────────────────── */
.launch-project-card,
#project-card-strip > * {
  font-family: "NV Bitcount Double", "Courier New", monospace;
}

.launch-project-card-title,
#project-card-strip .project-card-title,
#project-card-strip .project-name,
#project-card-strip [data-project-title] {
  font-family: "NV Bitcount Double", "Courier New", monospace;
  font-size: 18px;
}

.launch-project-card-summary,
.launch-project-card-meta,
#project-card-strip .project-card-summary,
#project-card-strip .project-summary,
#project-card-strip [data-project-summary] {
  font-family: "NV Bitcount Single", "Courier New", monospace;
  font-size: 14px;
}

#monitor-label,
#monitor-status,
#monitor-message {
  font-family: "NV Bitcount Single", "Courier New", monospace;
  font-size: 15px;
}

/* ── DIFF COLORS ──────────────────────────────────────────────── */
.diff-plus { color: var(--green); }
.diff-minus { color: var(--red); }
.diff-ctx   { color: var(--text3); }

.log-stream-line.chat-out {
  color: var(--chat-out);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 231, 74, 0.22);
}

.log-stream-line.chat-in {
  color: var(--chat-in);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(41, 168, 255, 0.24);
}

/* ── TOP PROJECT MENU CARDS ───────────────────────────────────── */
#project-card-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
  flex-shrink: 0;
}

#project-card-strip > * {
  --card-primary: var(--accent);
  --card-dark: rgba(224, 92, 53, .16);
  --card-light: rgba(255, 134, 96, .92);

  position: relative;
  min-height: 92px;
  padding: 18px 20px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.08)),
    var(--card-dark) !important;
  border: 1px solid color-mix(in srgb, var(--card-primary) 72%, #000 28%) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.025),
    0 0 18px color-mix(in srgb, var(--card-primary) 20%, transparent),
    inset 0 0 14px rgba(255,255,255,.025);
  color: var(--text2);
  text-align: left;
  overflow: hidden;
}

#project-card-strip > *::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 28% 20%, color-mix(in srgb, var(--card-primary) 24%, transparent), transparent 42%);
  pointer-events: none;
}

#project-card-strip > *:hover,
#project-card-strip > *.active,
#project-card-strip > *[aria-selected="true"] {
  transform: translateY(-1px);
  border-color: var(--card-light) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 0 26px color-mix(in srgb, var(--card-primary) 32%, transparent);
}

#project-card-strip > *:nth-child(4n+1) {
  --card-primary: #e05c35;
  --card-dark: rgba(224, 92, 53, .19);
  --card-light: #ffb39e;
}

#project-card-strip > *:nth-child(4n+2) {
  --card-primary: #c9db00;
  --card-dark: rgba(180, 190, 0, .18);
  --card-light: #efff7a;
}

#project-card-strip > *:nth-child(4n+3) {
  --card-primary: #35a152;
  --card-dark: rgba(35, 130, 60, .20);
  --card-light: #a4f0b8;
}

#project-card-strip > *:nth-child(4n+4) {
  --card-primary: #00a3fb;
  --card-dark: rgba(0, 130, 190, .20);
  --card-light: #a8e7ff;
}

#project-card-strip .project-card-title,
#project-card-strip .project-name,
#project-card-strip [data-project-title] {
  position: relative;
  color: var(--card-light);
  font-size: 16px;
  letter-spacing: 1px;
  font-weight: 700;
}

#project-card-strip .project-card-summary,
#project-card-strip .project-summary,
#project-card-strip [data-project-summary] {
  position: relative;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 8px;
}

/* Project card strip: exactly four visible, extras carousel off-screen */
#project-card-strip {
  --project-strip-gap: 10px;
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: calc((100% - (var(--project-strip-gap) * 3)) / 4) !important;
  grid-template-columns: none !important;
  gap: var(--project-strip-gap) !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 8px 12px !important;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

#project-card-strip::-webkit-scrollbar {
  display: none;
}

#project-card-strip > * {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 74px !important;
  padding: 13px 16px !important;
  border-radius: 10px !important;
  scroll-snap-align: start;
}

#project-card-strip .project-card-title,
#project-card-strip .project-name,
#project-card-strip [data-project-title] {
  font-size: 14px !important;
  line-height: 1.15 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#project-card-strip .project-card-summary,
#project-card-strip .project-summary,
#project-card-strip [data-project-summary] {
  font-size: 11px !important;
  line-height: 1.25 !important;
  margin-top: 7px !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── PROJECT SWITCH LOADING SCREEN ───────────────────────────── */
#project-switch-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(0, 163, 251, .12), transparent 34%),
    radial-gradient(circle at 50% 72%, rgba(224, 92, 53, .10), transparent 46%),
    rgba(3, 4, 7, .92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

#project-switch-splash.active {
  opacity: 1;
  pointer-events: auto;
}

.project-splash-stage {
  width: min(420px, 86vw);
  min-height: 280px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
  border: 1px solid rgba(174, 184, 191, .24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.01)),
    rgba(10, 12, 16, .88);
  box-shadow:
    0 24px 72px rgba(0,0,0,.56),
    0 0 32px rgba(0,163,251,.12),
    inset 0 0 28px rgba(255,255,255,.025);
}

.project-splash-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.035);
  box-shadow: 0 0 22px rgba(255,255,255,.08);
}

.project-splash-mark img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  opacity: .96;
}

.project-splash-eq {
  height: 70px;
  display: flex;
  align-items: end;
  gap: 7px;
}

.project-splash-eq span {
  --bar-min: 18px;
  --bar-max: 64px;
  width: 9px;
  height: var(--bar-min);
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, #ffb39e, #e05c35 52%, #35a152 100%);
  box-shadow: 0 0 12px rgba(224,92,53,.35);
  transform-origin: bottom;
  animation: project-splash-eq-rise var(--bar-speed, .82s) ease-in-out infinite alternate;
  animation-delay: var(--bar-delay, 0s);
  opacity: .88;
}

.project-splash-eq span:nth-child(1) { --bar-max: 38px; --bar-speed: .74s; --bar-delay: -.12s; }
.project-splash-eq span:nth-child(2) { --bar-max: 61px; --bar-speed: .91s; --bar-delay: -.38s; }
.project-splash-eq span:nth-child(3) { --bar-max: 44px; --bar-speed: .69s; --bar-delay: -.21s; }
.project-splash-eq span:nth-child(4) { --bar-max: 67px; --bar-speed: 1.04s; --bar-delay: -.57s; }
.project-splash-eq span:nth-child(5) { --bar-max: 51px; --bar-speed: .79s; --bar-delay: -.31s; }
.project-splash-eq span:nth-child(6) { --bar-max: 63px; --bar-speed: .96s; --bar-delay: -.66s; }
.project-splash-eq span:nth-child(7) { --bar-max: 35px; --bar-speed: .72s; --bar-delay: -.44s; }
.project-splash-eq span:nth-child(8) { --bar-max: 57px; --bar-speed: .88s; --bar-delay: -.18s; }

@keyframes project-splash-eq-rise {
  0% { height: var(--bar-min); filter: brightness(.82); }
  38% { height: calc((var(--bar-min) + var(--bar-max)) / 2); filter: brightness(1.08); }
  100% { height: var(--bar-max); filter: brightness(1.24); }
}

#project-splash-text {
  color: var(--text2);
  font-family: "NV Bitcount Single", "Courier New", monospace;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}
