/* Tour of Rove & WebAssembly Studio - Clean Engineering Theme */
:root {
  --bg-app: #080b11;
  --bg-header: #0c1018;
  --bg-left-pane: #0f1420;
  --bg-card: #131b2b;
  --bg-editor: #0a0e16;
  --bg-terminal: #07090e;
  --bg-elevated: #182236;
  --bg-hover: rgba(255, 255, 255, 0.05);

  --border-subtle: #1c2638;
  --border-strong: #27374f;
  --border-focus: #00f0ff;

  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #00f0ff;
  --accent-cyan-dim: rgba(0, 240, 255, 0.12);
  --accent-green: #10b981;
  --accent-green-dim: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --header-height: 52px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 50;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050811;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.mode-nav {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.mode-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.mode-btn.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.mode-mark,
.panel-mark {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.progress-bar-wrap {
  width: 70px;
  height: 5px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-green);
  transition: width 0.3s ease;
}

/* Common Buttons */
.btn-primary, .btn-secondary, .btn-run, .btn-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary.btn-sm {
  padding: 3px 8px;
  font-size: 11.5px;
}

.btn-run {
  background: #00d26a;
  border: 1px solid #00b359;
  color: #051a0e;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-run:hover {
  background: #10e078;
}

.btn-run kbd {
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: normal;
  margin-left: 2px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.btn-icon:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

/* Workbench (2 Columns) */
.workbench {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Left Pane: 42% width (max 520px) */
.left-pane {
  width: 440px;
  min-width: 320px;
  max-width: 540px;
  background: var(--bg-left-pane);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Curriculum Drawer (Slide-over inside Left Pane) */
.curriculum-drawer {
  position: absolute;
  inset: 0;
  background: var(--bg-header);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.curriculum-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-search {
  flex: 1;
}

.search-input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.exercise-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.topic-group {
  margin-bottom: 4px;
}

.topic-header {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.exercise-item {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  text-align: left;
  padding: 6px 14px 6px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12.5px;
  transition: all 0.1s ease;
  user-select: none;
}

.exercise-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.exercise-item.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  padding-left: 19px;
  font-weight: 600;
}

.exercise-item.completed .exercise-check {
  display: inline;
  color: var(--accent-green);
}

.exercise-check {
  display: none;
  font-size: 11px;
  font-weight: bold;
}

/* Lesson Card */
.lesson-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lesson-card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.lesson-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge-topic {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.badge-status {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-status.solved {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}

.lesson-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.lesson-card-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lesson-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
}

.box-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lesson-text {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.6;
}

.expected-output-box {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5f3fc;
  background: var(--bg-terminal);
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.15);
  white-space: pre-wrap;
  word-break: break-all;
}

.drawer-buttons {
  display: flex;
  gap: 8px;
}

.btn-hint {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 4px 10px;
}

.btn-hint:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.hint-box {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 4px;
  font-size: 12px;
  color: #fde68a;
  line-height: 1.5;
}

.hint-box.show {
  display: block;
}

.lesson-card-footer {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Right Pane: Editor & Terminal */
.right-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-editor);
}

.editor-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  position: relative;
}

.editor-toolbar {
  height: 38px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.editor-tabs {
  display: flex;
  align-items: center;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  padding: 4px 10px;
  background: var(--bg-editor);
  border-radius: 4px 4px 0 0;
  border-top: 2px solid var(--accent-cyan);
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.target-control,
.template-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.target-control select,
.template-control select {
  max-width: 150px;
  min-height: 28px;
  padding: 3px 24px 3px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-editor);
  color: var(--text-secondary);
  font: 11px var(--font-sans);
  cursor: pointer;
}

.target-control select:focus-visible,
.template-control select:focus-visible {
  border-color: var(--border-focus);
}

.ace-editor-container {
  flex: 1;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono) !important;
}

/* Pane Resizer */
.pane-resizer {
  height: 5px;
  background: var(--border-subtle);
  cursor: row-resize;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.pane-resizer:hover, .pane-resizer:active {
  background: var(--accent-cyan);
}

/* Terminal Section */
.terminal-section {
  height: 220px;
  min-height: 90px;
  max-height: 70%;
  background: var(--bg-terminal);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.terminal-toolbar {
  height: 34px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.panel-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}

.panel-tab {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font: 11px var(--font-mono);
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.panel-tab:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.panel-tab.active {
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border-color: rgba(0, 240, 255, .22);
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.status-badge.passed {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.terminal-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.term-console {
  position: absolute;
  inset: 0;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.term-line {
  margin-bottom: 2px;
}

.term-info {
  color: #38bdf8;
}

.term-success {
  color: #4ade80;
  font-weight: 600;
}

.term-error {
  color: #f87171;
  font-weight: 600;
}

.term-hint {
  color: #fde047;
  font-size: 11.5px;
}

.studio-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 18px 20px;
  background: var(--bg-terminal);
}

.studio-view[hidden] {
  display: none;
}

.studio-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.studio-view-header h3 {
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.35;
}

.view-kicker {
  margin-bottom: 5px;
  color: var(--accent-cyan);
  font: 10px var(--font-mono);
  letter-spacing: .08em;
}

.source-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.source-stat {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--bg-card);
}

.source-stat-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font: 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.source-stat-value {
  display: block;
  color: var(--text-main);
  font: 600 16px var(--font-mono);
}

.pipeline-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font: 11px var(--font-mono);
}

.pipeline-mini span {
  padding: 4px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-main);
}

.pipeline-mini i {
  color: var(--accent-cyan);
  font-style: normal;
}

.view-note {
  max-width: 780px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.view-note code,
.build-command-box code {
  font-family: var(--font-mono);
}

.build-command-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 780px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-editor);
}

.build-command-box code {
  overflow-wrap: anywhere;
  color: #a5f3fc;
  font-size: 12px;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: 90%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.install-cmd-box {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.install-cmd-box code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
}

.btn-copy {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-copy:hover {
  color: var(--text-main);
}

.preview-notice { padding: 10px 16px; background: #282318; color: #f3d8a0; font-size: 12px; flex-shrink: 0; }
.preview-notice a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 3px; }
.btn-run:disabled { opacity: .6; cursor: wait; }
@media (max-width: 800px) {
  body { height: auto; min-height: 100vh; overflow: auto; }
  .header { height: auto; padding: 12px; flex-wrap: wrap; gap: 12px; }
  .header-left, .header-right { flex-wrap: wrap; gap: 10px; }
  .workbench { flex-direction: column; overflow: visible; }
  .left-pane { width: 100%; min-width: 0; max-width: none; max-height: 520px; }
  .right-pane { min-height: 650px; width: 100%; }
  .lesson-card-body { max-height: 340px; }
  .editor-toolbar { height: auto; min-height: 38px; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 10px; }
  .editor-tabs { min-height: 26px; }
  .editor-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .target-control select, .template-control select { max-width: 130px; }
  .terminal-toolbar { height: auto; min-height: 34px; padding: 6px 10px; flex-wrap: wrap; gap: 6px; }
  .terminal-status { flex-wrap: wrap; }
  .source-stats { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .install-cmd-box { align-items: flex-start; gap: 8px; }
  .install-cmd-box code { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Rove Studio visual system: quiet surfaces, explicit hierarchy, no neon effects. */
:root {
  --bg-app: #0b1016;
  --bg-header: #101720;
  --bg-left-pane: #121a24;
  --bg-card: #17212d;
  --bg-editor: #0d141c;
  --bg-terminal: #090e14;
  --bg-elevated: #1d2a38;
  --bg-hover: rgba(191, 228, 255, 0.07);
  --border-subtle: #263544;
  --border-strong: #3a4e63;
  --border-focus: #a9d8ff;
  --text-main: #edf4fa;
  --text-secondary: #b5c4d1;
  --text-muted: #8293a3;
  --accent-cyan: #a9d8ff;
  --accent-cyan-dim: rgba(169, 216, 255, 0.12);
  --accent-green: #8bd3ad;
  --accent-green-dim: rgba(139, 211, 173, 0.13);
  --accent-amber: #e9c681;
  --accent-red: #f19a9a;
}

body {
  font-size: 14px;
  background: var(--bg-app);
}

.header {
  min-height: 64px;
  height: auto;
  padding: 10px 20px;
  background: var(--bg-header);
}

.header-left,
.header-right {
  gap: 12px;
}

.brand {
  gap: 10px;
  font-size: 18px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: #bfe4ff;
  border: 1px solid #d8efff;
  border-radius: 6px;
  color: #0b141d;
}

.version-badge {
  padding: 4px 8px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .035);
}

.mode-nav {
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
}

.mode-btn {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.mode-btn.active {
  background: #1a2a39;
  border-color: #3a566f;
  color: var(--text-main);
}

.progress-pill {
  padding: 6px 10px;
  background: #141e29;
  border-radius: 6px;
}

.btn-primary,
.btn-secondary,
.btn-run,
.btn-hint {
  min-height: 34px;
}

.btn-secondary {
  background: #1a2632;
  border-color: #304154;
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #223242;
  border-color: #4a6279;
}

.btn-run {
  background: #91d5b0;
  border-color: #a7e5c3;
  color: #0b1b13;
  box-shadow: none;
}

.btn-run:hover {
  background: #a3e2bd;
}

.preview-notice {
  padding: 11px 20px;
  background: #161f29;
  border-bottom: 1px solid var(--border-subtle);
  color: #c3d0db;
  font-size: 12px;
}

.preview-notice strong {
  color: var(--text-main);
}

.preview-notice a {
  color: var(--accent-cyan);
}

.left-pane {
  width: 380px;
  background: var(--bg-left-pane);
}

.lesson-card-header {
  padding: 20px;
  background: #151f2b;
}

.lesson-title {
  font-size: 19px;
}

.lesson-card-body {
  padding: 20px;
  gap: 12px;
}

.lesson-box {
  padding: 14px;
  background: #17222e;
  border-color: #2b3a4b;
  border-radius: 7px;
}

.box-label {
  color: #91a5b7;
}

.lesson-text {
  color: #d5e0e8;
}

.lesson-card-footer {
  padding: 14px 20px;
  background: #151f2b;
}

.right-pane {
  background: var(--bg-editor);
}

.editor-toolbar {
  min-height: 52px;
  height: auto;
  padding: 9px 14px;
  gap: 12px;
  background: #121b25;
}

.editor-tab {
  padding: 7px 10px;
  border-top: 0;
  border-bottom: 2px solid var(--accent-cyan);
  background: #0d141c;
  color: var(--text-main);
}

.tab-icon {
  width: 7px;
  height: 9px;
  display: inline-block;
  border: 1px solid var(--accent-cyan);
  border-radius: 1px;
}

.target-control select,
.template-control select {
  min-height: 34px;
  background: #0d141c;
  border-color: #304154;
  color: var(--text-main);
}

.target-control select:hover,
.template-control select:hover {
  border-color: #4a6279;
}

.terminal-section {
  height: 250px;
  background: var(--bg-terminal);
  border-top-color: #2b3a4b;
}

.terminal-toolbar {
  height: 46px;
  padding: 0 14px;
  background: #121b25;
}

.terminal-title {
  color: var(--text-main);
}

.panel-tab {
  min-height: 32px;
  padding: 5px 9px;
}

.status-badge {
  padding: 4px 8px;
  color: var(--text-secondary);
}

.studio-view {
  padding: 20px 22px;
}

.studio-view-header {
  margin-bottom: 20px;
}

.source-stat {
  padding: 13px;
  background: #131d27;
  border-color: #2b3a4b;
}

.source-stat-value {
  color: var(--text-main);
}

.pipeline-mini {
  padding: 14px;
  background: #131d27;
  border-color: #2b3a4b;
}

.pipeline-mini span {
  background: #1a2734;
  border-color: #3b5167;
}

.build-command-box {
  padding: 14px;
  background: #0d141c;
  border-color: #3a4e63;
}

@media (max-width: 1000px) {
  .header {
    align-items: flex-start;
  }

  .header-left,
  .header-right {
    flex-wrap: wrap;
  }

  .editor-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .editor-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 800px) {
  body {
    font-size: 16px;
  }

  .header {
    padding: 10px 12px;
  }

  .header-right {
    width: 100%;
  }

  .progress-pill {
    flex: 1;
  }

  .left-pane {
    width: 100%;
  }

  .editor-actions {
    align-items: stretch;
  }

  .target-control,
  .template-control,
  .target-control select,
  .template-control select,
  .editor-actions .btn-secondary,
  .editor-actions .btn-run {
    min-height: 40px;
  }

  .target-control select,
  .template-control select {
    max-width: none;
  }

  .source-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Rove workbench: editorial lessons beside a high-contrast code surface. */
:root {
  --bg-app: #0b1219;
  --bg-header: #0e1821;
  --bg-left-pane: #131e28;
  --bg-card: #15212c;
  --bg-editor: #101923;
  --bg-terminal: #0b141c;
  --bg-elevated: #1b2a37;
  --bg-hover: rgba(173, 214, 231, 0.09);
  --border-subtle: #30414e;
  --border-strong: #4b6271;
  --border-focus: #a9d8ff;
  --text-main: #f2f7fa;
  --text-secondary: #c4d2dc;
  --text-muted: #9aafbc;
  --accent-cyan: #a9d8ff;
  --accent-cyan-dim: rgba(169, 216, 255, 0.12);
  --accent-green: #9de0bc;
  --accent-green-dim: rgba(157, 224, 188, 0.13);
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

body { font-size: 15px; }

.header {
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.brand { gap: 11px; font-size: 22px; letter-spacing: -.04em; }
.brand-icon {
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  border-radius: 8px;
}
.version-badge { font-size: 11px; padding: 6px 9px; }
.mode-nav {
  padding: 3px;
  background: #0b141c;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.mode-btn { min-height: 38px; padding: 7px 13px; font-size: 13px; }
.mode-btn.active { background: #233746; border-color: #56758b; }
.progress-pill { padding: 8px 11px; font-size: 12px; }
.header-right .btn-secondary { min-height: 38px; font-size: 13px; }

.preview-notice {
  padding: 12px 24px;
  background: #142330;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.left-pane { width: 360px; background: var(--bg-left-pane); }
.lesson-card-header { padding: 24px; background: transparent; }
.lesson-meta-bar { margin-bottom: 14px; }
.badge-topic { font-size: 11.5px; letter-spacing: .1em; }
.badge-status { padding: 5px 9px; font-size: 11px; }
.lesson-title { font-size: 24px; line-height: 1.18; letter-spacing: -.025em; }
.jump-editor { display: none; }
.lesson-card-body { padding: 0 24px; gap: 0; }
.lesson-box {
  padding: 22px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}
.lesson-box:last-child { border-bottom: 0; }
.box-label { margin-bottom: 10px; font-size: 11.5px; letter-spacing: .11em; }
.lesson-text { font-size: 16px; line-height: 1.55; }
.expected-output-box {
  padding: 13px 15px;
  background: #0b141c;
  border-color: var(--border-subtle);
  color: #b9e3f5;
  font-size: 13px;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: anywhere;
}
.btn-hint { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.lesson-card-footer { padding: 15px 24px; background: #111b25; }
.lesson-card-footer .btn-secondary { min-height: 38px; font-size: 13px; }
.lesson-counter { font-size: 12px; }

.editor-toolbar { min-height: 64px; padding: 10px 16px; }
.editor-tab { font-size: 13px; padding: 9px 12px; }
.target-control, .template-control { font-size: 11.5px; }
.target-control select, .template-control select { min-height: 38px; font-size: 12.5px; }
.editor-actions .btn-secondary { min-height: 38px; font-size: 13px; }
.btn-run { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.ace-dracula { background: var(--bg-editor) !important; color: #e9f2f7 !important; }
.ace-dracula .ace_gutter { background: #0c151e !important; color: #8195a5 !important; }
.ace-dracula .ace_gutter-active-line,
.ace-dracula .ace_marker-layer .ace_active-line { background: #1b2b38 !important; }

.terminal-section { height: 210px; background: var(--bg-terminal); }
.terminal-toolbar { height: 48px; padding: 0 16px; }
.terminal-title { font-size: 13px; }
.panel-tab { min-height: 34px; font-size: 12px; }
.term-console {
  padding: 15px 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
  word-break: normal;
}
.term-line { margin-bottom: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-info { color: #b9d4e3; }

@media (max-width: 800px) {
  .header { padding: 12px 16px; }
  .preview-notice { padding: 12px 16px; }
  .left-pane { width: 100%; max-height: none; overflow: visible; }
  .lesson-card, .lesson-card-body { max-height: none; overflow: visible; }
  .lesson-card-header { padding: 18px; }
  .lesson-card-body { padding: 0 18px; }
  .lesson-card-footer { padding: 12px 18px; }
  .editor-toolbar { padding: 10px 12px; }
  .terminal-toolbar { padding: 8px 12px; }
  .jump-editor {
    display: inline-flex;
    margin-top: 14px;
    color: var(--accent-cyan);
    font-size: 13px;
    font-weight: 600;
    text-underline-offset: 3px;
  }
}
