:root {
  --bg: #071014;
  --bg2: #09181d;
  --panel: #0d1b20;
  --panel2: #10252c;
  --panel3: #132f38;
  --border: #1f4650;
  --text: #e8f4f2;
  --muted: #93aaa7;
  --accent: #34d399;
  --accent2: #38bdf8;
  --danger: #fb7185;
  --warn: #facc15;
  --terminal: #020617;
  --terminal-border: #14532d;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(52,211,153,0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(56,189,248,0.09), transparent 32%),
    var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.topbar {
  height: 62px;
  border-bottom: 1px solid var(--border);
  background: rgba(7,16,20,0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-weight: 900;
  letter-spacing: .4px;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav a {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 14px;
}

.nav a.active {
  background: var(--accent);
  color: #042015;
  border-color: var(--accent);
  font-weight: 800;
}

.lab-shell {
  height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
}

.main-pane {
  min-width: 0;
  overflow: hidden;
  padding: 18px;
}

.side-pane {
  border-left: 1px solid var(--border);
  background: rgba(13,27,32,0.98);
  height: calc(100vh - 62px);
  overflow-y: auto;
  padding: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(16,37,44,.96), rgba(13,27,32,.98));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  margin-bottom: 16px;
}

.side-title {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 4px;
}

.step-count {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.side-objective {
  color: var(--muted);
  line-height: 1.48;
  margin-bottom: 14px;
}

.command-box {
  position: relative;
}

.codeblock {
  font-family: Consolas, "Courier New", monospace;
  color: #bbf7d0;
  background: #020617;
  border: 1px solid #14532d;
  padding: 36px 13px 13px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow: auto;
  margin: 10px 0 14px;
  font-size: 13px;
  line-height: 1.45;
  min-height: 58px;
}

.copy-mini {
  position: absolute;
  top: 18px;
  right: 8px;
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 8px;
  background: var(--panel3);
  color: var(--text);
  border: 1px solid var(--border);
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

button,
.button {
  border: 0;
  background: var(--accent);
  color: #042015;
  font-weight: 900;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

button.secondary,
.button.secondary {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.terminal-frame {
  height: 100%;
  background: #020617;
  border: 1px solid #14532d;
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(0,0,0,.35);
}

.terminal-titlebar {
  height: 42px;
  background: #07111f;
  border-bottom: 1px solid #14532d;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64748b;
}

.dot.red {
  background: #fb7185;
}

.dot.yellow {
  background: #facc15;
}

.dot.green {
  background: #34d399;
}

.terminal-title {
  color: #d1fae5;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  margin-left: 8px;
}

.terminal-body {
  overflow-y: auto;
  padding: 16px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.45;
  color: #d1fae5;
  white-space: pre-wrap;
  cursor: text;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 20px;
}

.prompt {
  color: #34d399;
  white-space: nowrap;
}

.terminal-editable {
  flex: 1;
  min-width: 2px;
  outline: none;
  color: #d1fae5;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-output-text {
  white-space: pre-wrap;
}

.help-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.badge {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--panel2);
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.checklist {
  padding-left: 18px;
  color: var(--muted);
}

.checklist li {
  margin: 8px 0;
}

.hospital-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.hospital-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.copy-feedback {
  color: var(--accent);
  font-size: 12px;
  margin-top: 8px;
  min-height: 16px;
}

.browser-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.browser-bar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background: rgba(13,27,32,0.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.browser-url {
  width: 100%;
  background: #020617;
  color: #d1fae5;
  border: 1px solid #14532d;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: Consolas, "Courier New", monospace;
  outline: none;
}

.browser-btn,
.browser-open {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.browser-btn {
  background: var(--panel2);
  color: var(--text);
}

.browser-open {
  background: var(--accent);
  color: #042015;
}

.browser-frame {
  height: 100%;
}

@media (max-width: 980px) {
  .lab-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .main-pane {
    height: 65vh;
  }

  .side-pane {
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .browser-bar {
    grid-template-columns: 1fr 1fr;
  }

  .browser-url {
    grid-column: 1 / -1;
  }
}


.mission-progress-box {
  margin-top: 12px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

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

.mission-complete {
  width: 100%;
  margin-top: 12px;
}

.final-message {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(52,211,153,.35);
  background: rgba(52,211,153,.10);
  color: #bbf7d0;
  line-height: 1.45;
}

.final-message.show {
  display: block;
}

.mission-status {
  display: inline-block;
  margin: 8px 0 12px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel2);
}

.mission-status.done {
  color: #bbf7d0;
  border-color: rgba(52,211,153,.45);
  background: rgba(52,211,153,.12);
}

/* Hospital app */
.hospital-body {
  background: #eef4f7;
  color: #17212b;
  min-height: 100vh;
}

.hospital-top {
  background: #0f3a4a;
  color: #fff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hospital-brand {
  font-weight: 900;
  letter-spacing: .3px;
}

.hospital-container {
  width: min(1180px, 94%);
  margin: 24px auto;
}

.hospital-card {
  background: #ffffff;
  border: 1px solid #d7e2e7;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15,58,74,.10);
  margin-bottom: 18px;
}

.hospital-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}

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

.hospital-input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #c8d6dc;
  border-radius: 10px;
  margin: 7px 0 14px;
  color: #17212b;
  background: #fff;
}

.hospital-button {
  border: 0;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
  padding: 11px 15px;
  border-radius: 10px;
  cursor: pointer;
}

.hospital-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hospital-tabs a {
  background: #e5eef2;
  color: #17313a;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid #c8d6dc;
}

.hospital-tabs a.active {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}

.hospital-table-wrap {
  overflow: auto;
  border: 1px solid #d7e2e7;
  border-radius: 12px;
}

.hospital-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.hospital-table th,
.hospital-table td {
  border-bottom: 1px solid #e2ebef;
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.hospital-table th {
  background: #eff7f8;
  color: #0f3a4a;
}

.hospital-table td {
  color: #24333c;
}

.hospital-muted {
  color: #60717b;
  line-height: 1.5;
}

.hospital-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  padding: 11px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.hospital-query {
  background: #10252c;
  color: #d1fae5;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  padding: 13px;
  border-radius: 10px;
  overflow: auto;
  font-size: 12px;
}
