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


/* ── FONTS ────────────────────────────────────────────────────── */
@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;
}


/* ── TOKENS ───────────────────────────────────────────────────── */
:root {
  --bg:      #0a0a0c;
  --bg1:     #0d0d11;
  --bg2:     #1b1b22;
  --bg3:     #1d1d1f;
  --text:    #ffffff;
  --text2:   #ebebf1;
  --text3:   #d8d8e4;
  --accent:  #e05c35;
  --accent2: #ff8660;
  --green:   #2bf060;
  --yellow:  #efdc65;
  --blue:    #6abdf5;
  --red:     #ff6a70;
  --border2: rgba(255,255,255,0.16);
  --greenb:  #2bf060;
  --chat-in:  #6abdf5;
  --chat-out: #efdc65;

  --font-ui:   'Arial', 'Helvetica Neue', sans-serif;
  --font-mono: 'Courier New', monospace;
  --font-lcd:  "NV Bitcount Single", monospace;

  --pad:    8px;
  --gap:    4px;
  --radius: 3px;
  --border: rgba(255,255,255,0.08);

  --h-header:    104px;
  --h-lcd:       58px;
  --h-door:      clamp(106px, 13vh, 136px);
  --h-transport: 72px;
}


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

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}


/* ── APP SHELL / MAJOR LAYOUT ─────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
  overflow: hidden;
}

#left {
  --middle-y: var(--h-header);

  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto;

  width: 100%;
  height: 100vh;
  overflow: hidden;

  background: var(--bg1);
  border-right: 1px solid var(--border);
  padding: var(--pad) 0;
  gap: 0;
}

#header,
.Console-Cx,
.Lowerframe-Cx {
  min-height: 0;
  min-width: 100%;
  overflow: hidden;
}

.TopStack-Bx {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: var(--verbatim-bg-panel, url('/assets/studiobgpanel.png')) center top / 100% 100% no-repeat;
}

.TopStack-Bx #header,
.TopStack-Bx .Console-Cx,
.TopStack-Bx #deck-controls {
  background: transparent;
}

#deck-top-stack #header {
  flex: 0 0 var(--middle-y);
  height: var(--middle-y);
}

#deck-top-stack .Console-Cx {
  flex: 0 0 auto;
}

#header {
  position: relative;
  padding: 0 var(--pad);
  overflow: hidden;
  background: var(--verbatim-bg-panel, url('/assets/studiobgpanel.png')) center top / 100% 100% no-repeat;
}

.Console-Cx {
  position: relative;
  display: flex;
  flex-direction: column;

  width: 100%;
  max-width: 100%;
  height: auto;

  background: var(--verbatim-bg-panel, url('/assets/studiobgpanel.png')) center top / 100% 100% no-repeat;
  overflow: visible;
  margin: 0 auto;
}

.Lowerframe-Cx {
  min-height: 0;
  overflow: hidden;
}

#right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#project-info {
  flex: 0 0 auto;
}

#workview {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

#workview > .Panel.Dx {
  position: absolute;
  inset: 0;
  display: none;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: var(--bg);
}

#workview > .Panel.Dx.active {
  display: block;
}

#workview > #panel-editor.Panel.Dx,
#workview > #panel-visualizer.Panel.Dx {
  overflow: hidden;
}

#tabs {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
}

#input-field {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--pad);
  background: var(--bg1);
  border-top: 1px solid var(--border);
}


/* ── HEADER INTERNALS ─────────────────────────────────────────── */
#logo {
  position: absolute;
  left: 16px;
  right: 24px;
  top: 34%;
  transform: translateY(-50%);
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  opacity: .78;
}

#logo-image {
  width: 94%;
  max-height: 48px;
  height: auto;
  object-fit: contain;
  object-position: left center;
  filter: brightness(.9) contrast(.92);
}

#header-project-controls {
  position: absolute;
  top: 75%;
  left: var(--pad);
  right: var(--pad);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 11px;
}

#project-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text3);
  text-transform: uppercase;
}

#project-select,
#project-create-btn {
  height: 22px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
}

#project-select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  letter-spacing: 1px;
}

#project-create-btn {
  flex: 0 0 24px;
  width: 24px;
}

.launch-sign-in-btn {
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255,255,255,.08);
  color: white;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}

.launch-sign-in-btn:hover {
  background: rgba(255,255,255,.16);
}

body:not(.auth-signed-out) #nv-launch-sign-in-btn {
  display: none;
}

/* ── STACK INTERNALS / SCREW ──────────────────────────────────── */
#screw-adjustment {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 999;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210,170,255,0.72);
  border-radius: 50%;
  background: rgba(18,10,26,0.72);
  color: rgba(230,205,255,0.9);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: ns-resize;
  box-shadow: 0 0 8px rgba(210,120,255,0.35);
  user-select: none;
}

#screw-adjustment::before {
  content: "";
  position: absolute;
  inset: -10px;
}



/* ── STACK INTERNALS / LCD ────────────────────────────────────── */

.LCD-Dx,
.Controls-Dx {
  width: 100%;
  flex: 0 0 auto;
  justify-content: center;
 }

#project-bar {
  position: relative;
  height: var(--h-lcd);
  display: grid;
  grid-template-rows: 24px 1fr;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  padding: 7px var(--pad) 8px;
  width: 88%;
  margin: 0 auto;
  font-family: var(--font-lcd);
  background: var(--verbatim-lcd-panel, url('/assets/studiopanel.png')) center / 100% 100% no-repeat;
  border-top: 0;
  border-bottom: 0;
  overflow: hidden;
}

#connected-port-display {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: start;
  position: relative;
  display: inline-block;
  visibility: visible;
  opacity: 1;
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  height: 20px;
  line-height: 20px;
  padding-left: 6px;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-lcd);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-align: left;
  text-transform: uppercase;
  transform: none;
  animation: none;
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,0.56), 0 0 16px var(--project-accent-glow, rgba(43,240,96,0.34));
  z-index: 5;
}

#monitor-message {
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  min-width: 100%;
  font-family: var(--font-lcd);
  font-size: 12px;
  letter-spacing: 1.7px;
  color: #fff;
  white-space: nowrap;
  padding-right: 42px;
  text-shadow: 0 0 8px rgba(255,255,255,0.66), 0 0 16px var(--project-accent-glow, rgba(43,240,96,0.36));
  will-change: transform, opacity, filter;
  animation: msg-slide 15s linear infinite;
}

@keyframes msg-slide {
  from { transform: translateX(97%); }
  to   { transform: translateX(-97%); }
}

@keyframes msg-glow-breathe {
  0%, 100% { opacity: .88; filter: brightness(.94); }
  18%      { opacity: .94; filter: brightness(1.06); }
  43%      { opacity: .90; filter: brightness(.98); }
  67%      { opacity: .97; filter: brightness(1.12); }
  86%      { opacity: .91; filter: brightness(1.01); }
}


/* ── STACK INTERNALS / DOOR ───────────────────────────────────── */
.Monitor-Display-Dx {
  position: relative;
  width: fit-content;
  max-width: 100%;
  height: auto;
  background: #000;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
}

.Monitor-Display-Dx::before {
  content: none;
}

.Frame-Eo {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.StudioLevels-Eo {
  display: none;
}

.StudioNeedles-Dx {
  display: none;
}

#monitor-label,
#monitor-status {
  position: absolute;
  top: 28%;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text3);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 4;
}

#monitor-label { left: 12%; }
#monitor-status { right: 12%; }

.Equalizer-Ex {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  height: 74%;
  min-height: 34px;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
  background: #020306;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(34,90,48,0.82), inset 0 0 18px rgba(0,0,0,0.92), 0 0 10px rgba(43,240,96,0.18);
  z-index: 3;
}


/* ── STACK INTERNALS / TRANSPORT ──────────────────────────────── */
.Controls-Dx {
  height: var(--h-transport);
}

#deck-controls {
  position: relative;
  overflow: hidden;
  background: #000;
  justify-content: center;
}

#deck-controls::before {
  content: "";
  position: absolute;
  justify-content: center;
  inset: 0;
  z-index: 0;
  display: block;
  background: var(--verbatim-button-frame, url('/assets/studiobuttonframe.png')) center / 100% 100% no-repeat;
  pointer-events: none;
}

#deck-fullbar {
  position: absolute;
  justify-content: center;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.Buttons-Ex {
  position: relative;
  justify-content: center;
  height: var(--h-transport);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, #000 40%);
  border-bottom: 1px solid var(--border);
}

.Buttons-Ex::before {
  content: none;
}

.Buttons-Ex > button {
  position: relative;
  justify-content: center;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  transform: translateY(0) perspective(180px) rotateX(0deg);
  transform-origin: center bottom;
  transition: transform 120ms ease, filter 120ms ease;
}

.Buttons-Ex > button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 0%;
  background: linear-gradient(0deg, rgba(0,0,0,0.86) 0%, rgba(0,0,0,0.54) 48%, rgba(0,0,0,0) 100%);
  opacity: 0;
  pointer-events: none;
  transition: height 150ms ease, opacity 120ms ease;
}

.Buttons-Ex > button:active {
  transform: translateY(2px) perspective(180px) rotateX(-7deg);
  filter: brightness(0.68);
}

.Buttons-Ex > button:active::after {
  height: 100%;
  opacity: 1;
}


/* ── STACK INTERNALS / LEDS ───────────────────────────────────── */
#record-Eo,
#play-Eo {
  position: relative;
}

#deck-status-dot,
#play-led {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 32px;
  height: 5px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.85);
  opacity: 0.25;
  z-index: 4;
}

#deck-status-dot.active,
#deck-status-dot.record {
  background: url('/assets/red.png') center / 100% 100% no-repeat;
  box-shadow: 0 0 8px rgba(255,60,48,0.72), 0 0 16px rgba(224,92,53,0.42);
  opacity: 1;
  animation: none;
}

#deck-status-dot.pause {
  background: url('/assets/blue.png') center / 100% 100% no-repeat;
  box-shadow: 0 0 8px rgba(80,165,255,0.62), 0 0 16px rgba(0,163,251,0.34);
  opacity: 1;
  animation: none;
}

#play-led.active {
  background: url('/assets/green.png') center / 100% 100% no-repeat;
  box-shadow: 0 0 8px rgba(170,255,96,0.72), 0 0 16px rgba(94,216,122,0.34);
  opacity: 1;
  animation: none;
}

@keyframes tab-light-flash {
  from {
    opacity: 0.38;
    filter: brightness(0.72);
  }
  to {
    opacity: 1;
    filter: brightness(1.42);
  }
}

/* steady deck motion: ticker scroll only, no flashing */
#monitor-message {
  animation: msg-slide 15s linear infinite;
}

#deck-status-dot,
#play-led,
#deck-status-dot.active,
#deck-status-dot.record,
#deck-status-dot.pause,
#play-led.active {
  animation: none;
}

#deck-controls,
#deck-fullbar,
.Buttons-Ex,
.Buttons-Ex > button,
.Buttons-Ex > button::after {
  animation: none;
}

/* Invisible transport hit boxes */
.Buttons-Ex {
  background: transparent;
}

.Buttons-Ex > button {
  background: transparent;
  box-shadow: none;
}

.Buttons-Ex > button::after {
  background: transparent;
  opacity: 0;
}

.Buttons-Ex > button:active {
  filter: none;
}

/* ── LOG INTERNALS ────────────────────────────────────────────── */
#l-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px var(--pad);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--text3);
}

#l-header h3 {
  font-size: 14px;
}

#log-clear {
  font-size: 12px;
}

#log-clear:hover {
  color: var(--accent);
}

#system-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #060608;
  padding: var(--gap) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

.log-line {
  padding: 2px var(--pad);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text3);
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line:hover {
  background: var(--bg2);
  color: var(--text2);
}

.log-line.pass {
  color: var(--greenb);
}

.log-line.fail {
  color: #ff6a70;
}

.log-line.chat-out {
  color: var(--chat-out);
  font-weight: bold;
  text-shadow: 0 0 6px rgba(239,220,101,0.35);
}

.log-line.chat-in {
  color: var(--chat-in);
  font-weight: bold;
  text-shadow: 0 0 6px rgba(106,189,245,0.35);
}

/* ── SYSTEM LOG FORMAT RESTORE ───────────────────────────────── */
#log-wrap.Lowerframe-Cx {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: var(--bg1);
}

#l-header.Header.Dx {
  padding: 6px 14px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--text3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

#l-header h3 {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 3px;
}

#log-clear {
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  color: var(--text3);
  padding: 0 2px;
}

#log-clear:hover {
  color: var(--accent);
}

#system-log.Display.Dx {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
  background: #060608;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
  font-family: "Courier New", Courier, monospace;
}

#log-window {
  min-height: 100%;
  font-family: "Courier New", Courier, monospace;
}

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

#system-log .log-line {
  padding: 2px 12px;
  line-height: 1.4;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  color: var(--text3);
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 2px solid transparent;
  opacity: .78;
}

#system-log .log-line:hover {
  background: var(--bg2);
  opacity: 1;
}

#system-log .log-line.pass {
  color: var(--greenb);
  border-left-color: var(--greenb);
  opacity: .86;
}

#system-log .log-line.fail {
  color: var(--red);
  border-left-color: var(--red);
  opacity: .9;
}

#system-log .log-line.neutral {
  color: var(--text3);
}

#system-log .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,.28);
}

#system-log .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,.3);
}

#system-log .log-line.task-log-line {
  color: var(--text2);
  opacity: 1;
  font-weight: 700;
}

#system-log .log-task-prefix {
  color: var(--text);
  font-weight: 900;
  letter-spacing: 1px;
}

#system-log .log-task-name {
  color: #fff;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255,255,255,.18);
}

#system-log .log-file-path {
  color: var(--greenb);
  font-weight: 900;
  text-shadow: 0 0 8px rgba(43,240,96,.22);
}

#system-log .log-line.fail .log-file-path,
#system-log .log-error-detail {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255,70,76,.25);
}

#system-log .log-line.pass .log-task-prefix {
  color: var(--greenb);
}

#system-log .log-task-at {
  color: var(--text3);
}

#log-placeholder {
  padding: 12px 14px;
  color: var(--text3);
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
}


/* Recorder summaries: use the active project/display accent so execution outcomes are easy to spot */
#system-log .log-line.recorder-note {
  color: var(--project-accent-light, var(--accent2));
  border-left-color: var(--project-accent-secondary, var(--accent));
  font-weight: 900;
  opacity: 1;
  text-shadow: 0 0 8px color-mix(in srgb, var(--project-accent-secondary, var(--accent)) 34%, transparent);
}

#system-log .log-line.recorder-note .log-file-path,
#system-log .log-line.recorder-note .log-task-prefix,
#system-log .log-line.recorder-note .log-task-name {
  color: inherit;
  font-weight: 900;
  text-shadow: inherit;
}

/* Compact system log source/outcome tones */
#system-log .log-line.log-manifold,
#system-log .log-line.log-eq-soft,
#system-log .log-line.log-typecheck-clear {
  color: var(--text3);
  border-left-color: transparent;
  font-weight: 400;
  opacity: .62;
  text-shadow: none;
}

#system-log .log-line.log-typecheck-error {
  color: var(--yellow);
  border-left-color: var(--yellow);
  font-weight: 800;
  opacity: .95;
  text-shadow: 0 0 8px rgba(239,220,101,.22);
}

#system-log .log-line.recorder-note {
  color: color-mix(in srgb, var(--greenb) 58%, var(--text2));
  border-left-color: color-mix(in srgb, var(--greenb) 72%, var(--text3));
  background: rgba(255,255,255,.018);
  font-weight: 900;
  opacity: .96;
  text-shadow: none;
}

#system-log .log-line.recorder-note.recorder-failed {
  color: color-mix(in srgb, var(--accent2) 74%, var(--text2));
  border-left-color: var(--accent2);
  background: color-mix(in srgb, var(--accent2) 7%, transparent);
  text-shadow: none;
}

#system-log .log-line.recorder-note .log-file-path,
#system-log .log-line.recorder-note .log-task-prefix,
#system-log .log-line.recorder-note .log-task-name {
  color: inherit;
  font-weight: 900;
  text-shadow: inherit;
}

/* ── PROJECT DISPLAY + SELECTOR CARDS ─────────────────────────── */
#right > #project-display.Project.Cx {
  --banner-primary: rgba(224, 92, 53, .88);
  --banner-secondary: #d66f2b;
  --banner-light: #f4f4f0;
  --banner-screen: #020203;

  position: relative;
  display: grid;
  grid-template-rows: 116px minmax(132px, auto);
  gap: 10px;
  flex: 0 0 auto;
  min-height: 264px;
  padding: 14px 18px 12px;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 42%, rgba(255,255,255,.052), transparent 38%),
    radial-gradient(circle at 82% 32%, rgba(255,255,255,.036), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018) 62%, rgba(0,0,0,.035));
  background-size: 120% 120%, 130% 120%, 100% 100%;
  animation: projectDisplayAmbientLight 22s ease-in-out infinite;
}
body[data-project-accent="0"] #project-display,
body[data-project-accent="1"] #project-display {
  --banner-primary: rgba(224, 92, 53, .88);
  --banner-secondary: #d66f2b;
  --banner-light: #f4f4f0;
}

body[data-project-accent="2"] #project-display {
  --banner-primary: rgba(220, 184, 82, .88);
  --banner-secondary: #d7ad31;
  --banner-light: #fff0b2;
}

body[data-project-accent="3"] #project-display {
  --banner-primary: rgba(116, 214, 122, .86);
  --banner-secondary: #78d77e;
  --banner-light: #d9ffe1;
}

body[data-project-accent="4"] #project-display {
  --banner-primary: rgba(0, 191, 255, .88);
  --banner-secondary: #35c7f0;
  --banner-light: #d7f6ff;
}

#project-info.Header.Dx {
  position: relative;
  z-index: 2;
  min-height: 116px;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px;
  padding: 18px 24px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 9% 72%, color-mix(in srgb, var(--banner-primary) 7%, transparent), transparent 34%),
    radial-gradient(ellipse at 92% 7%, rgba(255,255,255,.07), transparent 13%),
    linear-gradient(180deg, #020202 0%, #000 54%, #000 100%);
  box-shadow:
    inset 0 16px 24px rgba(255,255,255,.014),
    inset 0 -18px 30px rgba(0,0,0,.94);
  animation: projectPanelLowGlow 18s ease-in-out infinite;
}
#project-info.Header.Dx::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 9px;
  height: 1px;
  pointer-events: none;
  background: rgba(190,190,190,.32);
  box-shadow: 0 1px 2px rgba(255,255,255,.035);
}

#project-info.Header.Dx::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 6px;
  width: min(275px, 24vw);
  height: 70px;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0%, rgba(255,255,255,.07) 46%, rgba(255,255,255,.22) 70%, transparent 100%);
  opacity: .42;
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 64% 100%);
}
#project-title.Title.Eo {
  position: relative;
  z-index: 1;
  max-width: 100%;
  color: var(--banner-light);
  font-family: var(--font-lcd);
  font-size: clamp(13px, 3.5vw, 25px);
  line-height: .95;
  letter-spacing: .08em;
  text-transform: none;
  white-space: normal;
  overflow: visible;
  overflow-wrap: normal;
  text-overflow: clip;
  text-shadow: 0 1px 0 rgba(0,0,0,.95);
}

#project-title.Title.Eo::after {
  content: none;
}
#project-summary.Summary.Eo {
  position: relative;
  z-index: 1;
  max-width: 100%;
  color: var(--banner-secondary);
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.5vw, 15px);
  line-height: 1.16;
  letter-spacing: .04em;
  white-space: normal;
  overflow: visible;
  overflow-wrap: normal;
  text-overflow: clip;
  text-shadow: 0 1px 0 rgba(0,0,0,.95);
}

#project-summary.Summary.Eo::after {
  content: none;
}
#project-carousel.Selection.Dx,
#project-card-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
  gap: 12px;
  min-height: 132px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

.project-card {
  --card-primary: rgba(255, 126, 42, .96);
  --card-light: #fff4df;
  --card-dark: rgba(76, 47, 32, .54);
  --card-screen: #18110d;

  position: relative;
  min-height: 132px;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) 18px;
  align-items: start;
  padding: 15px 15px 13px;
  border-radius: 8px;
  border: 1px solid var(--card-primary);
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--card-primary) 38%, transparent), transparent 48%),
    radial-gradient(circle at 82% 76%, color-mix(in srgb, var(--card-light) 22%, transparent), transparent 42%),
    radial-gradient(circle at 50% 116%, color-mix(in srgb, var(--card-primary) 18%, transparent), transparent 54%),
    linear-gradient(180deg, color-mix(in srgb, var(--card-primary) 14%, transparent), rgba(0,0,0,.25)),
    linear-gradient(90deg, color-mix(in srgb, var(--card-primary) 5%, transparent), transparent 18%, color-mix(in srgb, var(--card-primary) 10%, transparent) 82%, transparent),
    var(--card-screen);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--card-light) 16%, transparent),
    0 0 18px color-mix(in srgb, var(--card-primary) 18%, transparent),
    0 0 22px color-mix(in srgb, var(--card-primary) 28%, transparent),
    inset 0 0 22px color-mix(in srgb, var(--card-primary) 7%, transparent),
    inset 0 0 34px color-mix(in srgb, var(--card-primary) 18%, transparent),
    inset 0 0 42px rgba(0,0,0,.42);
  text-align: left;
  cursor: pointer;
  color: #fff4df;
  overflow: hidden;
  animation: projectCardScreenPulse 12s ease-in-out infinite;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, filter .22s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(circle at 50% 54%, color-mix(in srgb, var(--card-primary) 34%, transparent), transparent 38%),
    radial-gradient(circle at 50% 76%, color-mix(in srgb, var(--card-primary) 16%, transparent), transparent 46%),
    linear-gradient(115deg, transparent 34%, color-mix(in srgb, var(--card-light) 10%, transparent) 50%, transparent 66%);
  transform: scale(.92);
  opacity: .18;
  pointer-events: none;
  animation: projectCardGlowBloom 14s ease-in-out infinite;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.035);
  pointer-events: none;
}

.project-card:hover,
.project-card.active,
.project-card.selected-project-unit {
  transform: translateY(-2px);
  border-color: var(--card-light);
  filter: brightness(1.08);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 0 28px color-mix(in srgb, var(--card-primary) 42%, transparent),
    0 10px 28px rgba(0,0,0,.34),
    inset 0 0 22px rgba(255,255,255,.028);
}

.project-card-title,
.project-card-task,
.project-card-date {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.project-card-title,
.project-card-date {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.project-card-task {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.9px;
  color: #fff4df;
  margin-bottom: 0;
  text-transform: uppercase;
  text-shadow: 0 0 14px color-mix(in srgb, var(--card-primary) 72%, transparent), 0 0 2px rgba(255,255,255,.7);
}

.project-card-task {
  font-size: 14px;
  color: color-mix(in srgb, var(--card-light) 78%, var(--card-primary));
  line-height: 1.28;
  text-shadow: 0 0 10px color-mix(in srgb, var(--card-primary) 46%, var(--card-primary));
}

.project-card-date {
  align-self: end;
  margin-top: 0;
  font-size: 12px;
  color: rgba(255, 244, 223, .74);
  letter-spacing: .1em;
  text-shadow: 0 0 8px color-mix(in srgb, var(--card-primary) 28%, transparent);
}

.create-project-card {
  --card-primary: rgba(106,189,245,.62);
  --card-light: #a8e7ff;
  --card-dark: rgba(0,130,190,.16);
}

.locked-project-card {
  --card-primary: rgba(120,120,135,.38);
  --card-light: #c8c8d0;
  --card-dark: rgba(60,60,72,.18);
  opacity: .68;
}

.project-card[data-project-accent="1"] {
  --card-primary: rgba(224, 92, 53, .78);
  --card-light: #ffb39e;
  --card-dark: rgba(224, 92, 53, .16);
}
.project-card[data-project-accent="2"] {
  --card-primary: rgba(220, 184, 82, .78);
  --card-light: #ffe895;
  --card-dark: rgba(220, 184, 82, .14);
}
.project-card[data-project-accent="3"] {
  --card-primary: rgba(116, 214, 122, .76);
  --card-light: #a4f0b8;
  --card-dark: rgba(35, 130, 60, .16);
}
.project-card[data-project-accent="4"] {
  --card-primary: rgba(0, 191, 255, .82);
  --card-light: #a8e7ff;
  --card-dark: rgba(0, 130, 190, .17);
}

.project-card:nth-child(1) {
  animation-delay: -1.2s;
  animation-duration: 12.6s;
}
.project-card:nth-child(2) {
  animation-delay: -5.1s;
  animation-duration: 14.2s;
}
.project-card:nth-child(3) {
  animation-delay: -8.7s;
  animation-duration: 13.4s;
}
.project-card:nth-child(4) {
  animation-delay: -11.9s;
  animation-duration: 15.1s;
}
.project-card:nth-child(1)::before { animation-delay: -2.2s; animation-duration: 14.8s; }
.project-card:nth-child(2)::before { animation-delay: -6.6s; animation-duration: 16.1s; }
.project-card:nth-child(3)::before { animation-delay: -9.9s; animation-duration: 15.2s; }
.project-card:nth-child(4)::before { animation-delay: -13.4s; animation-duration: 17.3s; }
body[data-project-accent="0"] {
  --project-accent-border: var(--border);
  --project-accent-primary: rgba(224, 92, 53, .78);
  --project-accent-secondary: #d66f2b;
  --project-accent-light: #ffb39e;
  --project-accent-glow: rgba(224, 92, 53, .28);
}
body[data-project-accent="1"] {
  --project-accent-border: rgba(224, 92, 53, .48);
  --project-accent-primary: rgba(224, 92, 53, .78);
  --project-accent-secondary: #d66f2b;
  --project-accent-light: #ffb39e;
  --project-accent-glow: rgba(224, 92, 53, .28);
}
body[data-project-accent="2"] {
  --project-accent-border: rgba(220, 184, 82, .48);
  --project-accent-primary: rgba(220, 184, 82, .78);
  --project-accent-secondary: #d7ad31;
  --project-accent-light: #ffe895;
  --project-accent-glow: rgba(220, 184, 82, .28);
}
body[data-project-accent="3"] {
  --project-accent-border: rgba(116, 214, 122, .48);
  --project-accent-primary: rgba(116, 214, 122, .76);
  --project-accent-secondary: #78d77e;
  --project-accent-light: #a4f0b8;
  --project-accent-glow: rgba(116, 214, 122, .28);
}
body[data-project-accent="4"] {
  --project-accent-border: rgba(0, 191, 255, .58);
  --project-accent-primary: rgba(0, 191, 255, .82);
  --project-accent-secondary: #35c7f0;
  --project-accent-light: #a8e7ff;
  --project-accent-glow: rgba(0, 191, 255, .28);
}

@keyframes projectDisplayAmbientLight {
  0%, 100% {
    background-position: 0 0, 0 0, 0 0;
  }
  48% {
    background-position: 18px 0, -14px 0, 0 0;
  }
}

@keyframes projectPanelLowGlow {
  0%, 100% {
    background-position: 0 0, 0 0, 0 0;
    filter: brightness(.92);
  }
  48% {
    background-position: -10px 0, 8px 0, 0 0;
    filter: brightness(.985);
  }
}
@keyframes projectCardScreenPulse {
  0%, 100% {
    filter: brightness(.86) saturate(.92);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--card-light) 6%, transparent),
      0 0 14px color-mix(in srgb, var(--card-primary) 13%, transparent),
      inset 0 0 20px color-mix(in srgb, var(--card-primary) 6%, transparent),
      inset 0 0 42px rgba(0,0,0,.44);
  }
  48% {
    filter: brightness(1.05) saturate(1.12);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--card-light) 11%, transparent),
      0 0 26px color-mix(in srgb, var(--card-primary) 28%, transparent),
      inset 0 0 30px color-mix(in srgb, var(--card-primary) 12%, transparent),
      inset 0 0 44px rgba(0,0,0,.36);
  }
}

@keyframes projectCardGlowBloom {
  0%, 100% { transform: scale(.88); opacity: .10; }
  46% { transform: scale(1.04); opacity: .28; }
}

#tabs,
#workview,
.section-head,
.field-input,
.field-textarea,
.project-list-section,
#editor-sidebar,
#editor-head,
#editor-findbar,
#editor-stage {
  border-color: var(--project-accent-border, var(--border));
}
/* ── RIGHT NAV INTERNALS ──────────────────────────────────────── */
#tabs button {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 0.12s, border-color 0.12s;
  top:75%;
  
}

#tabs button:hover {
  color: var(--text2);
}

#tabs button.active {
  color: var(--text);
  border-bottom-color: var(--project-accent-secondary, var(--accent));
}

/* ── DUBS QUICK UNDO ──────────────────────────────────────────── */
#panel-dubs { position: relative; }

#dubs-review-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

#dubs-review-head .section-head {
  flex: 1 1 auto;
}

.dubs-undo-toggle {
  min-width: 96px;
  color: var(--accent2);
  border-color: rgba(224, 92, 53, .55);
  background: linear-gradient(180deg, rgba(224,92,53,.12), rgba(18,12,10,.72));
  text-transform: none;
}

.dubs-undo-toggle.active,
.dubs-undo-toggle:hover {
  color: #ffd2bd;
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(224,92,53,.22);
}

#dubs-undo-panel {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 80;
  width: min(330px, calc(100% - 24px));
  max-height: min(66vh, 560px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid rgba(224,92,53,.42);
  border-radius: 0 0 28px 28px;
  background:
    radial-gradient(circle at 20% 10%, rgba(224,92,53,.18), transparent 34%),
    linear-gradient(180deg, rgba(22,20,24,.98), rgba(13,13,17,.98));
  box-shadow: 0 18px 44px rgba(0,0,0,.48), inset 0 0 18px rgba(224,92,53,.08);
  overflow: auto;
}

#dubs-undo-panel[hidden] { display: none; }

#dubs-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 14px;
  align-items: start;
}

#dubs-list-wrap {
  min-width: 0;
}

#dubs-issues-panel {
  min-height: 180px;
  max-height: min(62vh, 520px);
  overflow: hidden;
  border: 1px solid var(--project-accent-border, rgba(255,255,255,.14));
  background:
    radial-gradient(circle at 15% 8%, color-mix(in srgb, var(--project-accent-primary, rgba(224,92,53,.78)) 18%, transparent), transparent 36%),
    linear-gradient(180deg, rgba(17,17,22,.96), rgba(7,7,9,.98));
  box-shadow: inset 0 0 18px rgba(255,255,255,.03), 0 0 18px color-mix(in srgb, var(--project-accent-primary, rgba(224,92,53,.78)) 12%, transparent);
}

#dubs-issues-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--project-accent-border, rgba(255,255,255,.1));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
}

#dubs-issues-list {
  max-height: calc(min(62vh, 520px) - 46px);
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.dub-issue-item {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--project-accent-border, rgba(255,255,255,.1)) 65%, transparent);
  color: var(--text2);
  font-family: var(--font-mono);
  line-height: 1.32;
}

.dub-issue-path {
  margin-bottom: 4px;
  color: var(--project-accent-light, var(--yellow));
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dub-issue-text {
  color: var(--red);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dub-issue-empty {
  padding: 22px 12px;
  color: var(--text3);
  font-family: var(--font-mono);
  text-align: center;
}

@media (max-width: 1080px) {
  #dubs-workspace { grid-template-columns: 1fr; }
  #dubs-issues-panel { max-height: 280px; }
  #dubs-issues-list { max-height: 232px; }
}

/* ── DUBS CURRENT ISSUES / REFINED LAYOUT ─────────────────────── */
#dubs-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.dub-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--project-accent-border, var(--border2));
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.18));
  box-shadow: inset 0 0 12px rgba(255,255,255,.018);
  font-family: var(--font-mono);
  font-size: 12px;
}

#dubs-workspace {
  grid-template-columns: minmax(420px, 1fr) minmax(280px, 360px);
  min-height: 0;
}

#dubs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dubs-empty {
  padding: 18px 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.025);
  color: var(--text3);
  font-family: var(--font-mono);
  text-align: center;
}

#dubs-issues-panel {
  position: sticky;
  top: 0;
  min-height: 190px;
  max-height: min(64vh, 560px);
  border-radius: 2px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--project-accent-primary, rgba(224,92,53,.78)) 5%, transparent), transparent 22%),
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--project-accent-primary, rgba(224,92,53,.78)) 14%, transparent), transparent 32%),
    linear-gradient(180deg, rgba(18,18,24,.96), rgba(7,7,10,.98));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.025),
    inset 3px 0 0 color-mix(in srgb, var(--project-accent-primary, var(--accent)) 74%, transparent),
    0 0 20px color-mix(in srgb, var(--project-accent-primary, rgba(224,92,53,.78)) 10%, transparent);
}

#dubs-issues-head {
  padding: 10px 12px 9px 14px;
  font-size: 15px;
  letter-spacing: .04em;
}

#dubs-issues-copy-btn {
  padding: 3px 7px;
  font-size: 11px;
  color: var(--text2);
  border-color: var(--project-accent-border, var(--border2));
}

#dubs-issues-copy-btn:hover {
  color: var(--project-accent-light, var(--accent2));
  box-shadow: 0 0 12px color-mix(in srgb, var(--project-accent-primary, var(--accent)) 18%, transparent);
}

#dubs-issues-list {
  max-height: calc(min(64vh, 560px) - 45px);
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

.dub-issue-item {
  padding: 9px 12px 10px 14px;
  line-height: 1.35;
  background: rgba(0,0,0,.12);
}

.dub-issue-item:hover {
  background: color-mix(in srgb, var(--project-accent-primary, var(--accent)) 7%, rgba(255,255,255,.025));
}

.dub-issue-path {
  font-size: 11px;
  letter-spacing: .02em;
}

.dub-issue-empty {
  padding: 28px 12px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  #dubs-workspace { grid-template-columns: 1fr; }
  #dubs-issues-panel { position: relative; max-height: 300px; }
  #dubs-issues-list { max-height: 255px; }
}

/* DUBS layout: issues + intake first, recent tape list last */
#panel-dubs #dubs-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#panel-dubs #dubs-issues-panel {
  position: relative;
  width: 100%;
  max-height: 260px;
}

#panel-dubs #dubs-issues-list {
  max-height: 215px;
}

#dubs-manifest-intake {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

#dubs-manifest-intake #manifest-input {
  height: 32px;
  min-height: 32px;
  font-family: var(--font-mono);
  color: var(--text2);
  border-color: var(--project-accent-border, var(--border2));
  background: rgba(255,255,255,.035);
}

#dubs-manifest-intake #manifest-input:focus {
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--project-accent-primary, var(--accent)) 55%, transparent), 0 0 14px color-mix(in srgb, var(--project-accent-primary, var(--accent)) 14%, transparent);
}

#dubs-manifest-intake #run-now-btn {
  height: 32px;
  min-width: 72px;
}

#panel-dubs #dubs-list-wrap {
  width: 100%;
  min-width: 0;
}

/* DUBS dashboard layout: controls left, issues/intake right, records bottom */
#panel-dubs #dubs-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 38%) minmax(320px, 1fr);
  grid-template-areas:
    "status issues"
    "status intake"
    "list list";
  gap: 14px 18px;
  align-items: start;
}

#dubs-status-column {
  grid-area: status;
  min-width: 0;
}

#panel-dubs #dubs-categories {
  display: grid;
  grid-template-columns: minmax(190px, 260px);
  gap: 10px;
  margin: 0;
  max-width: 260px;
}

#panel-dubs .dub-cat {
  min-height: 36px;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 14px;
}

#panel-dubs .dub-cat span {
  min-width: 34px;
  text-align: right;
  color: inherit;
}

#panel-dubs #dubs-issues-panel {
  grid-area: issues;
  width: 100%;
  max-height: 190px;
  min-height: 154px;
}

#panel-dubs #dubs-issues-list {
  max-height: 145px;
}

#panel-dubs #dubs-manifest-intake {
  grid-area: intake;
  width: 100%;
  max-width: none;
  align-self: start;
}

#panel-dubs #dubs-list-wrap {
  grid-area: list;
  width: 100%;
  min-width: 0;
  margin-top: 16px;
}

@media (max-width: 980px) {
  #panel-dubs #dubs-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "issues"
      "intake"
      "status"
      "list";
  }

  #panel-dubs #dubs-categories {
    max-width: none;
  }
}

.dub-undo-note {
  padding: 2px 8px 8px;
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  font-style: italic;
  text-align: center;
}

.dub-undo-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dub-undo-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border-left: 3px solid var(--greenb);
  background: rgba(6,6,9,.74);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.dub-undo-card-main { min-width: 0; }

.dub-undo-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10px;
}

.dub-undo-arrow {
  color: #ffcc00;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255,204,0,.42);
}

.dub-undo-kind {
  color: var(--greenb);
  font-weight: 700;
  text-transform: uppercase;
}

.dub-undo-file,
.dub-undo-time {
  min-width: 0;
  color: var(--text3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dub-undo-time { margin-left: auto; }

.dub-undo-task {
  margin-top: 3px;
  color: var(--text2);
  font-size: 11px;
  line-height: 1.28;
}

.dub-undo-diff {
  max-height: 86px;
  margin-top: 5px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text3);
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.04);
  padding: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.25;
}

.dub-undo-item-btn {
  align-self: center;
  padding: 5px 8px;
  border: 1px solid rgba(224,92,53,.55);
  color: var(--accent2);
  background: rgba(224,92,53,.08);
  font-size: 11px;
}

.dub-undo-item-btn:hover {
  color: #ffd2bd;
  background: rgba(224,92,53,.18);
}

.dub-undo-empty {
  padding: 18px 10px;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}


/* ── INPUT INTERNALS ──────────────────────────────────────────── */
#chat-input {
  width: 100%;
  height: 48px;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 6px var(--pad);
  resize: none;
}

#chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

#chat-input::placeholder {
  color: var(--text3);
}

#send-manifest {
  align-self: flex-end;
  padding: 2px 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
}

.SkinToggle-Eo {
  position: fixed;
  left: 10px;
  bottom: 8px;
  z-index: 2000;
  width: 44px;
  height: 22px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  border: 1px solid rgba(90,104,116,.30);
  border-radius: 999px;
  background: rgba(255,255,255,.56);
  color: rgba(20,24,28,.84);
  box-shadow: inset 0 0 8px rgba(255,255,255,.18), 0 0 10px rgba(0,0,0,.18);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
}

.SkinToggle-Eo::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(235,168,55,.92);
  box-shadow: 0 0 8px rgba(235,168,55,.36);
  transform: translateX(21px);
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}

.SkinToggle-Eo span {
  position: relative;
  z-index: 1;
  line-height: 1;
  opacity: .82;
}

#app[data-skin="cruise"] .SkinToggle-Eo {
  border-color: rgba(156,84,214,.32);
  background: rgba(0,0,0,.52);
  color: rgba(255,255,255,.86);
  box-shadow: inset 0 0 8px rgba(255,255,255,.05), 0 0 10px rgba(0,0,0,.34);
}

#app[data-skin="cruise"] .SkinToggle-Eo::before {
  transform: translateX(0);
  background: rgba(156,84,214,.86);
  box-shadow: 0 0 8px rgba(156,84,214,.48);
}

/* ── STUDIO SKIN / LIGHT VERBATIM PALETTE ─────────────────────── */
#app[data-skin="studio"] {
  --bg: #f0eee9;
  --bg1: #e9e7e1;
  --bg2: #f8f7f3;
  --bg3: #d9d8d2;
  --text: #30343a;
  --text2: #5e646a;
  --text3: #8a8d8e;
  --accent: #ec6c2e;
  --accent2: #5aa7df;
  --greenb: #5aa7df;
  --chat-in: #5aa7df;
  --chat-out: #ec6c2e;
  --border: rgba(74,82,88,.18);
  --border2: rgba(74,82,88,.24);
  --project-accent-border: rgba(74,146,205,.36);
  --project-accent-primary: rgba(74,146,205,.34);
  --project-accent-secondary: #4e91c8;
  --project-accent-light: #d8eefb;
  --project-accent-glow: rgba(74,146,205,.14);
}

#app[data-skin="studio"] {
  background: #f0eee9;
  color: var(--text);
}

#app[data-skin="studio"] #left {
  background: #e7e5df;
  border-right-color: rgba(92,94,92,.28);
}

#app[data-skin="studio"] #right,
#app[data-skin="studio"] #workview,
#app[data-skin="studio"] #workview > .Panel.Dx {
  background: #f4f3ee;
  color: var(--text);
}

#app[data-skin="studio"] #logo {
  opacity: .92;
}

#app[data-skin="studio"] #logo-image {
  filter: brightness(1.03) contrast(.96) saturate(.98);
}

#app[data-skin="studio"] #project-label {
  color: #7f8588;
}

#app[data-skin="studio"] #project-select,
#app[data-skin="studio"] #project-create-btn,
#app[data-skin="studio"] #chat-input,
#app[data-skin="studio"] #send-manifest {
  background: rgba(255,255,255,.72);
  border-color: rgba(77,85,88,.28);
  color: #3b3e42;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 1px 2px rgba(0,0,0,.08);
}

#app[data-skin="studio"] #project-select:focus,
#app[data-skin="studio"] #project-create-btn:focus-visible,
#app[data-skin="studio"] #chat-input:focus,
#app[data-skin="studio"] #send-manifest:focus-visible {
  border-color: var(--project-accent-secondary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--project-accent-secondary) 28%, transparent), inset 0 1px 0 rgba(255,255,255,.8);
}

#app[data-skin="studio"] #project-bar {
  background: var(--verbatim-lcd-panel, url('/assets/studiopanel.png')) center / 100% 100% no-repeat;
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
}

#app[data-skin="studio"] #connected-port-display,
#app[data-skin="studio"] #monitor-message {
  color: #f4fbff;
  text-shadow: 0 0 7px rgba(255,255,255,.68), 0 0 16px color-mix(in srgb, var(--project-accent-secondary) 36%, transparent);
}

#app[data-skin="studio"] #monitor-label,
#app[data-skin="studio"] #monitor-status {
  color: #525a5d;
  text-shadow: 0 1px 0 rgba(255,255,255,.72);
}

#app[data-skin="studio"] #monitor-label,
#app[data-skin="studio"] #monitor-status {
  top: 16%;
  z-index: 4;
}

#app[data-skin="studio"] #deck-controls,
#app[data-skin="studio"] .Monitor-Display-Dx {
  background: transparent;
}

#app[data-skin="studio"] .Frame-Eo {
  z-index: 6;
}

#app[data-skin="studio"] .StudioLevels-Eo {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] .Equalizer-Ex {
  display: none;
}

#app[data-skin="studio"] .StudioNeedles-Dx {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] .StudioNeedle-Eo {
  position: absolute;
  top: 52.82%;
  width: 1px;
  height: 37.7%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(24,27,29,.9), rgba(76,58,42,.82));
  box-shadow: 0 0 1px rgba(255,255,255,.58), 0 0 2px rgba(0,0,0,.2);
  transform-origin: 50% 94%;
  transition: transform 90ms linear;
}

#app[data-skin="studio"] .StudioNeedle-Eo::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(44,40,36,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 0 2px rgba(0,0,0,.18);
  transform: translateX(-50%);
}

#app[data-skin="studio"] .needle-left {
  left: 28%;
  transform: rotate(var(--studio-needle-left, -34deg));
}

#app[data-skin="studio"] .needle-right {
  left: 72%;
  transform: rotate(var(--studio-needle-right, -32deg));
}

#app[data-skin="studio"] .Buttons-Ex {
  background: transparent;
  border-bottom-color: rgba(77,85,88,.18);
}

#app[data-skin="studio"] .Frame-Eo {
  position: relative;
  z-index: 12;
}

#app[data-skin="studio"] .StudioLevels-Eo {
  z-index: 7;
}

#app[data-skin="studio"] .StudioNeedles-Dx {
  z-index: 8;
}

#app[data-skin="studio"] .StudioNeedle-Eo {
  z-index: 9;
}

#app[data-skin="studio"] .StudioLevels-Eo,
#app[data-skin="studio"] .StudioNeedles-Dx {
  transform: translateY(-10px);
}

#app[data-skin="studio"] #deck-controls::before {
  z-index: 1;
}

#app[data-skin="studio"] #deck-fullbar {
  z-index: 3;
}

#app[data-skin="studio"] #deck-fullbar {
  transform: scale(.98);
  transform-origin: center center;
}

#app[data-skin="studio"] .Buttons-Ex {
  position: relative;
  z-index: 4;
}

#app[data-skin="studio"] .Buttons-Ex > button {
  z-index: 5;
}
#app[data-skin="studio"] .Monitor-Display-Dx {
  width: 96%;
  max-width: 96%;
  margin: 0 auto;
  background: transparent;
}

#app[data-skin="studio"] .Frame-Eo {
  display: none;
}

#app[data-skin="studio"] .StudioLevels-Eo {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  margin: 0 auto;
  transform: none;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] .StudioNeedles-Dx {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  transform: none;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] .StudioNeedle-Eo {
  z-index: 3;
}

#app[data-skin="studio"] #deck-controls::before {
  content: none;
}

#app[data-skin="studio"] #deck-fullbar {
  left: 50%;
  right: auto;
  width: 96%;
  height: 100%;
  transform: translateX(-50%);
  transform-origin: center center;
  z-index: 1;
}

#app[data-skin="studio"] .Buttons-Ex {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0 auto;
  background: transparent;
  border-bottom-color: rgba(77,85,88,.18);
}

#app[data-skin="studio"] .Buttons-Ex > button {
  z-index: 3;
}

#app[data-skin="studio"] #deck-controls {
  height: auto;
  flex: 0 0 auto;
  overflow: hidden;
  background: transparent;
}

#app[data-skin="studio"] #deck-fullbar {
  position: relative;
  display: block;
  left: auto;
  right: auto;
  inset: auto;
  width: 96%;
  height: auto;
  margin: 0 auto;
  transform: none;
  object-fit: contain;
  z-index: 1;
}

#app[data-skin="studio"] .Buttons-Ex {
  position: absolute;
  inset: 0;
  left: 50%;
  width: 96%;
  height: 100%;
  margin: 0;
  transform: translateX(-50%);
  z-index: 2;
  background: transparent;
  border-bottom: 0;
}

/* Studio artwork sizing: graphics own their spacing */
#app[data-skin="studio"] .Monitor-Display-Dx {
  width: 100%;
  max-width: 100%;
  margin: 4px 0 0;
  background: transparent;
}

#app[data-skin="studio"] .StudioLevels-Eo {
  display: block;
  position: relative;
  inset: auto;
  z-index: 1;
  width: 100%;
  height: auto;
  margin: 0;
  transform: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] .StudioNeedles-Dx {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  transform: none;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] #deck-controls {
  height: auto;
  flex: 0 0 auto;
  overflow: hidden;
  background: transparent;
}

#app[data-skin="studio"] #deck-fullbar {
  position: relative;
  display: block;
  left: auto;
  right: auto;
  inset: auto;
  width: 100%;
  height: auto;
  margin: 0;
  transform: none;
  object-fit: contain;
  z-index: 1;
}

#app[data-skin="studio"] .Buttons-Ex {
  position: absolute;
  inset: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  transform: none;
  z-index: 2;
  background: transparent;
  border-bottom: 0;
}

/* Studio cap containment layer */
.StudioCap-Eo {
  display: none;
}

#app[data-skin="studio"] .StudioCap-Eo {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: auto;
  margin: 0;
  transform: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

#app[data-skin="studio"] .StudioNeedles-Dx {
  z-index: 2;
}

#app[data-skin="studio"] #log-wrap.Lowerframe-Cx,
#app[data-skin="studio"] #input-field {
  background: #f4f2ed;
  border-color: rgba(74,82,88,.18);
}

#app[data-skin="studio"] #l-header.Header.Dx {
  color: #8b8580;
  border-bottom-color: rgba(74,82,88,.14);
}

#app[data-skin="studio"] #system-log.Display.Dx {
  background: rgba(255,255,255,.42);
  scrollbar-color: #d0cec7 transparent;
}

#app[data-skin="studio"] #system-log .log-line {
  color: #72797d;
  opacity: .86;
}

#app[data-skin="studio"] #system-log .log-line:hover {
  background: rgba(74,146,205,.07);
  color: #4f5960;
}

#app[data-skin="studio"] #system-log .log-line.pass,
#app[data-skin="studio"] #system-log .log-line.chat-in,
#app[data-skin="studio"] #system-log .log-file-path {
  color: #4e91c8;
  border-left-color: rgba(74,146,205,.38);
  text-shadow: none;
}

#app[data-skin="studio"] #system-log .log-line.chat-out {
  color: #ec6c2e;
  border-left-color: rgba(236,108,46,.36);
  text-shadow: none;
}

#app[data-skin="studio"] #right > #project-display.Project.Cx {
  --banner-primary: rgba(74,146,205,.32);
  --banner-secondary: #4e91c8;
  --banner-light: #f7fbff;
  --banner-screen: #071f22;
  gap: 10px;
  background:
    radial-gradient(circle at 16% 6%, rgba(255,255,255,.62), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.52), rgba(232,230,224,.62));
  border-bottom: 1px solid rgba(74,82,88,.16);
  animation: none;
}

#app[data-skin="studio"] #project-info.Header.Dx {
  background:
    radial-gradient(circle at 18% 70%, color-mix(in srgb, var(--project-accent-secondary) 18%, transparent), transparent 34%),
    linear-gradient(180deg, #092729 0%, #061a1d 58%, #041114 100%);
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.36),
    inset 0 -18px 28px rgba(0,0,0,.34),
    0 1px 2px rgba(0,0,0,.18);
  animation: none;
}

#app[data-skin="studio"] #project-info.Header.Dx::before {
  background: rgba(255,255,255,.44);
  box-shadow: 0 1px 2px rgba(255,255,255,.12);
}

#app[data-skin="studio"] #project-info.Header.Dx::after {
  opacity: .22;
}

#app[data-skin="studio"] #project-title.Title.Eo {
  color: #f4fbff;
  text-shadow: 0 0 5px rgba(255,255,255,.8), 0 0 16px rgba(151,220,255,.34);
}

#app[data-skin="studio"] #project-summary.Summary.Eo {
  color: color-mix(in srgb, var(--project-accent-secondary) 62%, #eaf7ff);
  text-shadow: 0 0 8px color-mix(in srgb, var(--project-accent-secondary) 18%, transparent);
}

#app[data-skin="studio"] #project-carousel.Selection.Dx,
#app[data-skin="studio"] #project-card-strip {
  scrollbar-color: #c9c7c0 transparent;
}

#app[data-skin="studio"] .project-card {
  --card-primary: rgba(74,146,205,.36);
  --card-light: #fdfdf9;
  --card-dark: rgba(74,146,205,.08);
  --card-screen: #f7f6f1;
  color: #343a3f;
  border: 1px solid rgba(76,82,86,.18);
  background:
    radial-gradient(circle at 92% 82%, color-mix(in srgb, var(--card-primary) 18%, transparent), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(242,241,236,.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 1px 2px rgba(0,0,0,.13);
  animation: none;
  filter: none;
}

#app[data-skin="studio"] .project-card::before {
  opacity: 0;
  animation: none;
}

#app[data-skin="studio"] .project-card::after {
  inset: 0;
  border-color: rgba(255,255,255,.42);
}

#app[data-skin="studio"] .project-card:hover,
#app[data-skin="studio"] .project-card.active,
#app[data-skin="studio"] .project-card.selected-project-unit {
  transform: none;
  border-color: color-mix(in srgb, var(--card-primary) 62%, rgba(72,80,86,.24));
  filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.88),
    0 0 0 1px color-mix(in srgb, var(--card-primary) 30%, transparent),
    0 2px 5px rgba(0,0,0,.14);
}

#app[data-skin="studio"] .project-card.active::after,
#app[data-skin="studio"] .project-card.selected-project-unit::after {
  border-color: color-mix(in srgb, var(--card-primary) 58%, rgba(255,255,255,.32));
}

#app[data-skin="studio"] .project-card-title {
  color: var(--card-accent-text, #5aa7df);
  text-shadow: 0 1px 0 rgba(255,255,255,.78), 0 0 6px color-mix(in srgb, var(--card-accent-text, #5aa7df) 22%, transparent);
}

#app[data-skin="studio"] .project-card-task {
  color: #6b7176;
  text-shadow: none;
}

#app[data-skin="studio"] .project-card-date {
  color: color-mix(in srgb, var(--card-accent-text, #5aa7df) 82%, #5e646a);
  text-shadow: 0 1px 0 rgba(255,255,255,.62), 0 0 5px color-mix(in srgb, var(--card-accent-text, #5aa7df) 16%, transparent);
}

#app[data-skin="studio"] .project-card.active,
#app[data-skin="studio"] .project-card.selected-project-unit {
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.86), transparent 46%),
    radial-gradient(circle at 92% 82%, color-mix(in srgb, var(--card-primary) 28%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--card-primary) 10%, rgba(255,255,255,.90)), rgba(242,246,248,.82));
  border-color: color-mix(in srgb, var(--card-primary) 48%, rgba(255,255,255,.78));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    inset 0 0 22px rgba(255,255,255,.42),
    0 0 0 1px color-mix(in srgb, var(--card-primary) 22%, transparent),
    0 0 18px color-mix(in srgb, var(--card-primary) 20%, transparent),
    0 2px 5px rgba(0,0,0,.12);
}

#app[data-skin="studio"] .project-card.active .project-card-title,
#app[data-skin="studio"] .project-card.selected-project-unit .project-card-title {
  color: var(--card-accent-text, #5aa7df);
  text-shadow:
    0 1px 0 rgba(255,255,255,.92),
    0 0 8px color-mix(in srgb, var(--card-accent-text, #5aa7df) 36%, transparent),
    0 0 14px rgba(255,255,255,.48);
}

#app[data-skin="studio"] .project-card.active .project-card-date,
#app[data-skin="studio"] .project-card.selected-project-unit .project-card-date {
  color: color-mix(in srgb, var(--card-accent-text, #5aa7df) 88%, #ffffff);
  text-shadow: 0 0 7px color-mix(in srgb, var(--card-accent-text, #5aa7df) 28%, transparent);
}

#app[data-skin="studio"] #tabs {
  background: #ebe9e3;
  border-top: 1px solid rgba(255,255,255,.52);
  border-bottom-color: rgba(74,82,88,.18);
}

#app[data-skin="studio"] #tabs button {
  color: #7a7e81;
}

#app[data-skin="studio"] #tabs button:hover {
  color: #4c565d;
}

#app[data-skin="studio"] #tabs button.active {
  color: var(--project-accent-secondary);
  border-bottom-color: color-mix(in srgb, var(--project-accent-secondary) 70%, transparent);
}

#app[data-skin="studio"] .section-head,
#app[data-skin="studio"] .field-input,
#app[data-skin="studio"] .field-textarea,
#app[data-skin="studio"] .project-list-section,
#app[data-skin="studio"] #editor-sidebar,
#app[data-skin="studio"] #editor-head,
#app[data-skin="studio"] #editor-findbar,
#app[data-skin="studio"] #editor-stage {
  border-color: rgba(74,82,88,.18);
}

#app[data-skin="studio"] #panel-dubs #dubs-issues-panel,
#app[data-skin="studio"] #panel-editor .EditorIconbar-Dx {
  background: #eeeeea;
}

#app[data-skin="studio"] #panel-editor .EditorIconbar-Dx {
  border-right-color: rgba(74,82,88,.18);
}

#app[data-skin="studio"][data-project-accent="1"] {
  --project-accent-border: rgba(236,108,46,.28);
  --project-accent-primary: rgba(236,108,46,.24);
  --project-accent-secondary: #d86b34;
  --project-accent-light: #fff0e8;
  --project-accent-glow: rgba(236,108,46,.10);
}

#app[data-skin="studio"][data-project-accent="2"] {
  --project-accent-border: rgba(190,151,54,.28);
  --project-accent-primary: rgba(190,151,54,.22);
  --project-accent-secondary: #a97b24;
  --project-accent-light: #fff7d8;
  --project-accent-glow: rgba(190,151,54,.10);
}

#app[data-skin="studio"][data-project-accent="3"] {
  --project-accent-border: rgba(72,154,98,.28);
  --project-accent-primary: rgba(72,154,98,.22);
  --project-accent-secondary: #438a62;
  --project-accent-light: #e7f8eb;
  --project-accent-glow: rgba(72,154,98,.10);
}

#app[data-skin="studio"][data-project-accent="4"] {
  --project-accent-border: rgba(74,146,205,.32);
  --project-accent-primary: rgba(74,146,205,.24);
  --project-accent-secondary: #4e91c8;
  --project-accent-light: #e4f5ff;
  --project-accent-glow: rgba(74,146,205,.12);
}

#app[data-skin="studio"] .project-card[data-project-accent="1"] {
  --card-primary: rgba(236,108,46,.30);
  --card-light: #fff0e8;
  --card-accent-text: #e8793d;
}

#app[data-skin="studio"] .project-card[data-project-accent="2"] {
  --card-primary: rgba(190,151,54,.28);
  --card-light: #fff7d8;
  --card-accent-text: #c58c28;
}

#app[data-skin="studio"] .project-card[data-project-accent="3"] {
  --card-primary: rgba(72,154,98,.28);
  --card-light: #e7f8eb;
  --card-accent-text: #4c9d6e;
}

#app[data-skin="studio"] .project-card[data-project-accent="4"] {
  --card-primary: rgba(74,146,205,.32);
  --card-light: #e4f5ff;
  --card-accent-text: #5aa7df;
}