:root {
  --bg: #0f172a;               /* deep dark slate */
  --bg-elevated: rgba(30, 41, 59, 0.75); /* elevated panel bg */
  --panel: rgba(15, 23, 42, 0.7);        /* translucent panel */
  --panel-strong: rgba(30, 41, 59, 0.9); /* active panel */
  --ink: #f8fafc;              /* bright clear text */
  --muted: #94a3b8;            /* soft secondary text */
  --line: rgba(255, 255, 255, 0.1);      /* subtle border */
  --line-strong: rgba(255, 255, 255, 0.2); /* active border */
  --accent: #6366f1;           /* vibrant indigo */
  --accent-soft: rgba(99, 102, 241, 0.15); /* soft accent bg */
  --accent-strong: #4f46e5;    /* darker pop */
  --warm: #f59e0b;             /* amber warn/warm */
  --warm-soft: rgba(245, 158, 11, 0.15);
  --success: #10b981;          /* crisp emerald */
  --success-soft: rgba(16, 185, 129, 0.15);
  --error: #ef4444;            /* bright rose/red */
  --error-soft: rgba(239, 68, 68, 0.15);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.3); /* vibrant glow */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-display);
  color: var(--ink);
  background:
    radial-gradient(circle at -10% -10%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 110% 110%, rgba(236, 72, 153, 0.12), transparent 40%),
    #0f172a; /* flat base */
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 20%, transparent 80%);
}

.page-shell {
  position: relative;
  padding: 28px;
}

.topbar,
.hero-card,
.panel {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  position: sticky;
  top: 14px;
  z-index: 40;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 18px 30px rgba(19, 90, 114, 0.2);
}

.brand h1,
.hero-card h2,
.section-heading h3,
.command-copy h3,
.output-header h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.brand h1 {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05); /* dark glass */
  color: var(--ink);
  font-size: 0.9rem;
}

.status-idle {
  background: rgba(255, 255, 255, 0.08); /* faint glass for idle */
}

.status-running {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-error {
  background: var(--error-soft);
  color: var(--error);
}

.chip-muted {
  color: var(--muted);
}

.workspace-shell {
  display: grid;
  gap: 22px;
}

.mode-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 106px;
  z-index: 32;
}

.mode-switch-copy {
  min-width: 0;
}

.mode-switch-meta {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.mode-switch-actions,
.explorer-toggle,
.output-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.jump-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.jump-button:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: var(--shadow-glow);
}

.mode-button {
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05); /* dark button */
  color: var(--muted);
  cursor: pointer;
  transition: all 160ms ease;
}

.mode-button.is-active {
  background: var(--accent-soft);
  color: #a5b4fc; /* subtle indigo glow text */
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.mode-button:disabled,
.ghost-button:disabled,
.primary-button:disabled,
.jump-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.panel,
.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 28px;
  padding: 30px;
}

.hero-card h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 14ch;
}

.hero-text {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.7;
}

.hero-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-flow span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.hero-stats {
  display: grid;
  gap: 14px;
}

.stat-tile {
  display: grid;
  gap: 6px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.stat-tile strong {
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.stat-tile span {
  color: var(--muted);
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
}

.panel {
  padding: 22px;
}

.nav-panel,
.insight-panel {
  position: sticky;
  top: 192px;
  align-self: start;
  max-height: calc(100vh - 214px);
  overflow: auto;
}

.panel-section + .panel-section {
  margin-top: 26px;
}

.section-heading {
  margin-bottom: 14px;
}

.project-summary,
.summary-stack,
.mini-metrics {
  display: grid;
  gap: 12px;
}

.project-summary > div,
.summary-card,
.mini-metrics article {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.summary-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.file-list,
.output-list,
.diagnostic-list {
  display: grid;
  gap: 10px;
}

.output-list,
.diagnostic-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.file-button,
.output-button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.file-button:hover,
.output-button:hover,
.file-button.is-active,
.output-button.is-active {
  transform: translateY(-1px);
  border-color: rgba(19, 90, 114, 0.25);
  background: var(--accent-soft);
}

.output-button.is-dirty {
  border-color: rgba(217, 119, 69, 0.28);
  background: rgba(217, 119, 69, 0.1);
}

.editor-panel {
  display: grid;
  gap: 18px;
}

.upload-card {
  display: grid;
  gap: 18px;
}

.upload-step-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.step-card strong {
  display: block;
  margin-bottom: 6px;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.step-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.upload-command-bar {
  margin-bottom: 0;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: var(--shadow-glow);
}

.dropzone p {
  margin: 0;
  color: var(--muted);
}

.dropzone-note {
  max-width: 34ch;
  font-size: 0.92rem;
}

.upload-detail-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.upload-detail-grid,
.upload-summary-list {
  display: grid;
  gap: 12px;
}

.upload-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.command-bar,
.editor-card,
.output-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.command-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  appearance: none;
  border: none;
  font: inherit;
}

.primary-button,
.ghost-button {
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  box-shadow: var(--shadow-glow);
}

.ghost-button.is-toggled {
  background: var(--warm-soft);
  border-color: rgba(217, 119, 69, 0.28);
  color: #8b4d25;
}

.editor-card {
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab-button.is-active {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--ink);
}

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-frame {
  display: block;
}

.code-editor-shell {
  position: relative;
  isolation: isolate;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
}

.code-highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.code-highlight-line {
  position: absolute;
  left: 12px;
  right: 12px;
  border-left: 3px solid transparent;
  border-radius: 10px;
}

.code-highlight-line.is-error {
  border-left-color: var(--error);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.04));
}

.code-highlight-line.is-warning {
  border-left-color: var(--warm);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.04));
}

textarea,
pre {
  width: 100%;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.93rem;
  line-height: 1.7;
}

textarea {
  min-height: 520px;
  padding: 22px;
  border: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  resize: vertical;
  outline: none;
  position: relative;
  z-index: 2;
}

.diagnostics-panel {
  min-height: 320px;
}

.diagnostic-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.diagnostic-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.diagnostic-item.is-clickable {
  cursor: pointer;
}

.diagnostic-item strong {
  display: block;
  margin-bottom: 8px;
}

.diagnostic-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.diagnostic-item.is-error {
  border-color: rgba(182, 75, 59, 0.24);
  background: var(--error-soft);
}

.diagnostic-item.is-warning {
  border-color: rgba(176, 126, 31, 0.24);
  background: rgba(176, 126, 31, 0.09);
}

.diagnostic-item.is-success {
  border-color: rgba(31, 122, 91, 0.24);
  background: var(--success-soft);
}

.output-panel {
  padding: 22px;
}

.output-header,
.output-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.viewer-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.output-grid {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.explorer-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.search-field {
  display: flex;
  align-items: center;
  width: min(100%, 420px);
}

.search-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
}

.search-field input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

.output-viewer {
  min-height: 420px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.output-editor-shell {
  margin-top: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.output-editor-shell[hidden] {
  display: none;
}

#output-editor {
  width: 100%;
  min-height: 350px;
  max-height: 540px;
  margin-top: 0;
  padding: 18px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  caret-color: #e2e8f0;
  -webkit-text-fill-color: #e2e8f0;
  resize: vertical;
  outline: none;
}

pre {
  min-height: 350px;
  max-height: 540px;
  overflow: auto;
  padding-top: 16px;
  color: #cbd5e1; /* soft blue gray for text code */
  white-space: pre-wrap;
  word-break: break-word;
}

.screenreader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.panel,
.hero-card,
.output-panel,
.editor-card,
.command-bar {
  animation: rise-in 360ms ease;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .hero-card,
  .workbench-grid,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .hero-card h2 {
    max-width: none;
  }

  .topbar,
  .mode-switch,
  .nav-panel,
  .insight-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .upload-step-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
  }

  .topbar,
  .command-bar,
  .mode-switch,
  .output-header,
  .output-viewer-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-switch-meta,
  .explorer-tools {
    width: 100%;
    justify-items: stretch;
  }

  .mode-switch-actions,
  .jump-nav,
  .search-field {
    width: 100%;
  }

  .mode-button,
  .jump-button {
    flex: 1 1 0;
  }

  textarea {
    min-height: 420px;
  }
}

/* IDE shell refresh */

:root {
  --bg: #0b0f12;
  --bg-elevated: rgba(20, 26, 31, 0.94);
  --panel: rgba(14, 18, 23, 0.9);
  --panel-strong: rgba(19, 25, 31, 0.98);
  --ink: #e7f0ee;
  --muted: #8d9c9a;
  --line: rgba(124, 145, 141, 0.18);
  --line-strong: rgba(112, 197, 180, 0.28);
  --accent: #19c6b2;
  --accent-soft: rgba(25, 198, 178, 0.14);
  --accent-strong: #0fa391;
  --warm: #f3b24d;
  --warm-soft: rgba(243, 178, 77, 0.15);
  --success: #5fbf59;
  --success-soft: rgba(95, 191, 89, 0.18);
  --error: #ff6767;
  --error-soft: rgba(255, 103, 103, 0.18);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 26px rgba(25, 198, 178, 0.16);
}

body {
  background:
    radial-gradient(circle at 0% 0%, rgba(25, 198, 178, 0.09), transparent 28%),
    radial-gradient(circle at 100% 100%, rgba(95, 191, 89, 0.08), transparent 24%),
    linear-gradient(180deg, #0b0f12 0%, #10161b 100%);
}

.page-shell {
  padding-bottom: 88px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  background: rgba(10, 13, 17, 0.88);
  border-color: rgba(25, 198, 178, 0.16);
}

.brand-mark {
  color: transparent;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(95, 191, 89, 0.2), rgba(95, 191, 89, 0.06)),
    linear-gradient(145deg, #1a4f2c, #12351f);
  box-shadow:
    inset 0 0 0 1px rgba(95, 191, 89, 0.3),
    0 16px 32px rgba(0, 0, 0, 0.26);
}

.brand-mark::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  background:
    linear-gradient(#79cf73 0 0) 0 0 / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 8px 0 / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 16px 0 / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 0 8px / 8px 8px no-repeat,
    linear-gradient(#4e9c49 0 0) 8px 8px / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 16px 8px / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 0 16px / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 8px 16px / 8px 8px no-repeat,
    linear-gradient(#79cf73 0 0) 16px 16px / 8px 8px no-repeat;
}

.header-mode-cluster {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.header-mode-toggle {
  display: inline-flex;
  padding: 5px;
  border-radius: 16px;
  background: rgba(16, 22, 27, 0.92);
  border: 1px solid rgba(25, 198, 178, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.header-mode-toggle .mode-button {
  min-width: 118px;
}

.topbar-meta {
  align-items: center;
  justify-content: flex-end;
}

.rail-toggle {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.rail-toggle:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.mode-switch {
  display: none;
}

.hero-card {
  background:
    linear-gradient(135deg, rgba(13, 19, 24, 0.94), rgba(16, 24, 29, 0.9)),
    linear-gradient(180deg, rgba(25, 198, 178, 0.05), transparent);
  border-color: rgba(25, 198, 178, 0.12);
}

.hero-flow span {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.stat-tile {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.workbench-grid {
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  align-items: start;
}

.rail-panel,
.center-panel,
.output-panel {
  background: rgba(10, 13, 17, 0.9);
  border-color: rgba(25, 198, 178, 0.12);
}

.rail-panel {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 170px);
  overflow: auto;
}

.page-shell.is-left-rail-collapsed .workbench-grid {
  grid-template-columns: 68px minmax(0, 1fr) 340px;
}

.page-shell.is-right-rail-collapsed .workbench-grid {
  grid-template-columns: 280px minmax(0, 1fr) 68px;
}

.page-shell.is-left-rail-collapsed.is-right-rail-collapsed .workbench-grid {
  grid-template-columns: 68px minmax(0, 1fr) 68px;
}

.page-shell.is-left-rail-collapsed #left-rail .panel-section > :not(.section-heading),
.page-shell.is-right-rail-collapsed #right-rail .panel-section > :not(.section-heading) {
  display: none;
}

.page-shell.is-left-rail-collapsed #left-rail,
.page-shell.is-right-rail-collapsed #right-rail {
  padding-inline: 12px;
}

.page-shell.is-left-rail-collapsed #left-rail .section-heading h3,
.page-shell.is-left-rail-collapsed #left-rail .section-heading .eyebrow,
.page-shell.is-right-rail-collapsed #right-rail .section-heading h3,
.page-shell.is-right-rail-collapsed #right-rail .section-heading .eyebrow {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 0;
}

.page-shell.is-left-rail-collapsed #left-rail .section-heading,
.page-shell.is-right-rail-collapsed #right-rail .section-heading {
  align-items: center;
  justify-items: center;
}

.command-bar,
.editor-card,
.upload-card,
.output-viewer,
.output-list {
  background: rgba(16, 21, 26, 0.82);
  border-color: rgba(25, 198, 178, 0.12);
}

.mode-button,
.jump-button,
.ghost-button,
.primary-button {
  border-radius: 14px;
}

.mode-button.is-active,
.ghost-button.is-toggled,
.primary-button {
  background: linear-gradient(180deg, rgba(25, 198, 178, 0.18), rgba(25, 198, 178, 0.1));
  border-color: rgba(25, 198, 178, 0.34);
  color: #dffcf8;
}

.chip.status-success,
.status-success {
  background: var(--success-soft);
  color: #b7f3b2;
}

.chip.status-running,
.status-running {
  background: var(--warm-soft);
  color: #ffdca2;
}

.chip.status-error,
.status-error {
  background: var(--error-soft);
  color: #ffc0c0;
}

.file-list button::before,
.output-button::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  vertical-align: middle;
  image-rendering: pixelated;
  background:
    linear-gradient(var(--accent) 0 0) 0 0 / 5px 5px no-repeat,
    linear-gradient(var(--accent) 0 0) 5px 0 / 5px 5px no-repeat,
    linear-gradient(var(--accent) 0 0) 0 5px / 5px 5px no-repeat,
    linear-gradient(var(--accent-strong) 0 0) 5px 5px / 5px 5px no-repeat;
}

.output-button.is-dirty::before {
  background:
    linear-gradient(var(--warm) 0 0) 0 0 / 5px 5px no-repeat,
    linear-gradient(var(--warm) 0 0) 5px 0 / 5px 5px no-repeat,
    linear-gradient(var(--warm) 0 0) 0 5px / 5px 5px no-repeat,
    linear-gradient(#8d641b 0 0) 5px 5px / 5px 5px no-repeat;
}

.diagnostic-item.is-error {
  border-color: rgba(255, 103, 103, 0.3);
  background: rgba(255, 103, 103, 0.06);
}

.diagnostic-item.is-warning {
  border-color: rgba(243, 178, 77, 0.26);
  background: rgba(243, 178, 77, 0.07);
}

.diagnostic-item.is-success {
  border-color: rgba(95, 191, 89, 0.24);
  background: rgba(95, 191, 89, 0.07);
}

.output-viewer-header strong,
#active-output-kind,
pre,
textarea {
  font-family: var(--font-mono);
}

.status-strip {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 60;
  height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, auto);
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(25, 198, 178, 0.16);
  background: rgba(8, 11, 14, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.status-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
}

.status-strip-item strong,
.status-strip-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-strip-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.bridge-strip-item {
  min-width: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(95, 191, 89, 0.14);
  flex: 0 0 auto;
}

#bridge-pill {
  color: var(--ink);
}

@media (max-width: 1200px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .header-mode-cluster,
  .topbar-meta {
    justify-items: stretch;
  }

  .workbench-grid,
  .page-shell.is-left-rail-collapsed .workbench-grid,
  .page-shell.is-right-rail-collapsed .workbench-grid,
  .page-shell.is-left-rail-collapsed.is-right-rail-collapsed .workbench-grid {
    grid-template-columns: 1fr;
  }

  .rail-panel {
    position: static;
    max-height: none;
  }

  .page-shell.is-left-rail-collapsed #left-rail .panel-section > :not(.section-heading),
  .page-shell.is-right-rail-collapsed #right-rail .panel-section > :not(.section-heading) {
    display: block;
  }

  .page-shell.is-left-rail-collapsed #left-rail .section-heading h3,
  .page-shell.is-left-rail-collapsed #left-rail .section-heading .eyebrow,
  .page-shell.is-right-rail-collapsed #right-rail .section-heading h3,
  .page-shell.is-right-rail-collapsed #right-rail .section-heading .eyebrow {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .status-strip {
    grid-template-columns: 1fr 1fr;
    height: auto;
    padding-block: 10px;
  }
}

@media (max-width: 720px) {
  .header-mode-toggle {
    width: 100%;
  }

  .header-mode-toggle .mode-button,
  .jump-nav .jump-button,
  .rail-toggle {
    flex: 1 1 0;
    width: 100%;
  }

  .jump-nav,
  .topbar-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .status-strip {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: 1fr;
    height: auto;
    gap: 8px;
    padding: 10px 12px;
  }
}
