:root {
  color-scheme: dark;
  --surface-base: #0c1016;
  --surface-raised: rgba(16, 22, 32, 0.86);
  --surface-overlay: rgba(23, 32, 45, 0.92);
  --surface-elevated: rgba(33, 43, 56, 0.96);
  --surface-window: rgba(11, 16, 24, 0.9);
  --accent: #c7ff58;
  --accent-soft: rgba(199, 255, 88, 0.12);
  --success: #67c28f;
  --warning: #e4be70;
  --error: #f07f5c;
  --text-primary: #f2f5f8;
  --text-secondary: #aab3c1;
  --text-tertiary: #718096;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-soft: 0 18px 44px rgba(2, 6, 14, 0.36);
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 12% 18%, rgba(199, 255, 88, 0.12), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(54, 108, 73, 0.12), transparent 20%),
    linear-gradient(180deg, #101720 0%, #0c1016 48%, #090d12 100%);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 72%);
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p,
pre,
ol {
  margin: 0;
}

code,
pre,
.terminal-input,
.terminal-prompt {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.muted,
.system-note,
.mission-card span {
  color: var(--text-secondary);
}

.panel,
.boot-card {
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.button,
.ghost-button,
.dock-button {
  border-radius: 12px;
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.walkthrough-active-button {
  border-color: rgba(199, 255, 88, 0.35);
  background: rgba(199, 255, 88, 0.14);
  color: #efffd0;
}

.button:hover,
.ghost-button:hover,
.dock-button:hover {
  transform: translateY(-1px);
}

.button {
  background: var(--accent);
  color: #0a0d12;
  border-color: transparent;
  font-weight: 700;
}

.ghost-button {
  background: var(--surface-overlay);
  color: var(--text-primary);
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.boot-card {
  width: min(880px, 100%);
  padding: 2rem;
}

.boot-card h1 {
  margin-top: 0.6rem;
  max-width: 12ch;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(3rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.boot-copy {
  margin-top: 1rem;
  max-width: 44rem;
  color: var(--text-secondary);
}

.boot-steps {
  margin-top: 1.4rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.boot-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.boot-hint {
  color: var(--text-tertiary);
  font-size: 0.92rem;
}

.boot-log {
  margin-top: 1rem;
  min-height: 132px;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: #080b10;
  color: #d2ffd2;
  white-space: pre-wrap;
}

.vm-shell {
  min-height: 100vh;
  padding: 1rem;
}

.vm-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(199, 255, 88, 0.18), rgba(199, 255, 88, 0.08));
  border: 1px solid rgba(199, 255, 88, 0.18);
  color: var(--accent);
  font-weight: 800;
}

.topbar-label {
  color: var(--text-tertiary);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.topbar-brand h1 {
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.topbar-center {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 16px rgba(103, 194, 143, 0.32);
}

.topbar-actions {
  display: flex;
  gap: 0.7rem;
}

.system-note {
  font-size: 0.86rem;
  text-align: center;
}

.desktop-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.app-dock {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
  background: rgba(10, 15, 24, 0.86);
}

.dock-button {
  min-height: 78px;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.dock-button.is-active,
.dock-button:hover {
  border-color: rgba(199, 255, 88, 0.22);
  background: rgba(199, 255, 88, 0.1);
  color: var(--text-primary);
}

.dock-glyph {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dock-text {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-core {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.explorer-panel,
.ops-panel,
.editor-panel,
.terminal-panel {
  padding: 1rem;
}

.panel-window {
  background: var(--surface-window);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: -0.15rem -0.15rem 0.9rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.window-controls span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.window-controls span:first-child {
  background: rgba(240, 127, 92, 0.85);
}

.window-controls span:nth-child(2) {
  background: rgba(228, 190, 112, 0.85);
}

.window-controls span:nth-child(3) {
  background: rgba(103, 194, 143, 0.85);
}

.window-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.main-stack {
  display: grid;
  gap: 1rem;
}

.panel-head {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}

.panel-head h2,
.ops-section h2,
.editor-head h2 {
  font-size: 1.1rem;
  letter-spacing: -0.04em;
}

.file-tree {
  display: grid;
  gap: 0.85rem;
}

.tree-group {
  display: grid;
  gap: 0.35rem;
}

.tree-group-title {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tree-file {
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.78rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
}

.tree-file:hover {
  background: var(--surface-overlay);
  color: var(--text-primary);
}

.tree-file-active {
  background: rgba(199, 255, 88, 0.1);
  border-color: rgba(199, 255, 88, 0.22);
  color: var(--text-primary);
}

.editor-head,
.editor-meta,
.editor-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.editor-actions {
  display: flex;
  gap: 0.7rem;
}

.editor-meta {
  margin: 0.75rem 0;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.editor-mode,
.editor-dirty {
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.file-editor {
  width: 100%;
  min-height: 520px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: #090d14;
  color: var(--text-primary);
  padding: 1rem;
  line-height: 1.7;
  resize: vertical;
}

.terminal-output {
  min-height: 210px;
  max-height: 300px;
  overflow: auto;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: #070b11;
  color: #dbf6ff;
  white-space: pre-wrap;
}

.terminal-form {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.terminal-prompt {
  color: var(--accent);
}

.terminal-input {
  flex: 1;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: #0a0f16;
  color: var(--text-primary);
  padding: 0 0.85rem;
}

.quick-commands {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.command-chip {
  min-height: 34px;
  padding: 0 0.8rem;
  font-size: 0.84rem;
}

.ops-panel {
  display: grid;
  gap: 0.9rem;
}

.ops-section {
  display: grid;
  gap: 0.55rem;
}

.mission-grid {
  display: grid;
  gap: 0.6rem;
}

.mission-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.82rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.checklist {
  display: grid;
  gap: 0.55rem;
}

.check-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-overlay);
  color: var(--text-secondary);
}

.check-item.done {
  border-color: rgba(103, 194, 143, 0.3);
  background: rgba(103, 194, 143, 0.12);
  color: var(--text-primary);
}

.check-item.active {
  border-color: rgba(199, 255, 88, 0.28);
  background: rgba(199, 255, 88, 0.1);
  color: var(--text-primary);
}

.check-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.readiness-grid,
.scenario-results {
  display: grid;
  gap: 0.7rem;
}

.status-card,
.scenario-card {
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-overlay);
}

.status-card {
  display: grid;
  gap: 0.3rem;
}

.status-card span {
  color: var(--text-secondary);
}

.scenario-card h3 {
  margin-top: 0.45rem;
  font-size: 0.95rem;
}

.scenario-card p {
  margin-top: 0.3rem;
  color: var(--text-secondary);
}

.scenario-verdict {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scenario-pass .scenario-verdict {
  background: rgba(103, 194, 143, 0.15);
  color: #d9ffea;
}

.scenario-fail .scenario-verdict {
  background: rgba(240, 127, 92, 0.16);
  color: #ffe0d6;
}

.scenario-warn .scenario-verdict {
  background: var(--accent-soft);
  color: #f4ffd8;
}

.panel-focus {
  border-color: rgba(199, 255, 88, 0.32) !important;
  box-shadow:
    0 0 0 1px rgba(199, 255, 88, 0.16),
    0 10px 24px rgba(199, 255, 88, 0.1) !important;
}

.walkthrough-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.walkthrough-veil {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 12, 0.58);
}

.walkthrough-highlight {
  position: fixed;
  border-radius: 18px;
  border: 2px solid rgba(199, 255, 88, 0.96);
  box-shadow:
    0 0 0 2px rgba(199, 255, 88, 0.16),
    0 0 36px rgba(199, 255, 88, 0.22);
  transition:
    top 180ms ease,
    left 180ms ease,
    width 180ms ease,
    height 180ms ease;
}

.walkthrough-active-target {
  position: relative !important;
  z-index: 10000 !important;
  outline: 2px solid rgba(199, 255, 88, 0.96);
  outline-offset: 3px;
}

.walkthrough-popover {
  position: fixed;
  width: min(360px, calc(100vw - 24px));
  border-radius: 24px;
  border: 1px solid rgba(199, 255, 88, 0.2);
  background: rgba(10, 13, 18, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 18px 18px 16px;
  pointer-events: auto;
}

.walkthrough-step {
  margin: 0;
  color: #d7e6ff;
  font-size: 13px;
  font-weight: 700;
}

.walkthrough-title {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.walkthrough-copy,
.walkthrough-hint {
  margin: 10px 0 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.walkthrough-hint {
  color: #d7e6ff;
  font-size: 13px;
}

.walkthrough-snippet {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: #dff4ff;
  font: 12px/1.6 "JetBrains Mono", monospace;
  white-space: pre-wrap;
}

.walkthrough-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 1240px) {
  .desktop-grid {
    grid-template-columns: 1fr;
  }

  .app-dock {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workspace-core {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .vm-topbar {
    grid-template-columns: 1fr;
  }

  .topbar-center {
    justify-items: start;
  }

  .topbar-actions,
  .editor-head,
  .editor-footer,
  .terminal-form {
    display: grid;
  }

  .vm-shell {
    padding: 0.75rem;
  }

  .boot-card,
  .explorer-panel,
  .editor-panel,
  .terminal-panel,
  .ops-panel,
  .app-dock {
    padding: 0.85rem;
  }

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