:root {
  --bg: #06080f;
  --card: #0f172a;
  --border: #1e293b;
  --cyan: #38bdf8;
  --gold: #f59e0b;
  --green: #22c55e;
  --red: #f87171;
  --ink: #f1f5f9;
  --dim: #94a3b8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.top a { color: var(--cyan); font-size: 0.8rem; text-decoration: none; }
h1 { color: var(--gold); font-size: 1.35rem; margin: 0 0 0.25rem; }
.cert { color: var(--gold); font-size: 0.78rem; font-weight: 600; margin-bottom: 0.75rem; }
.dim { color: var(--dim); font-size: 0.88rem; margin: 0 0 1rem; }
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.panel h2 { font-size: 0.95rem; color: var(--cyan); margin: 0 0 0.5rem; }
.terminal {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: #86efac;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow: auto;
}
input, textarea, select, button {
  font: inherit;
}
input[type=text], textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #020617;
  color: var(--ink);
  margin: 0.5rem 0;
}
.btn {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--cyan);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}
.btn.primary { background: var(--gold); color: #000; border-color: var(--gold); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.status { min-height: 1.25rem; font-size: 0.85rem; margin-top: 0.5rem; }
.status.ok { color: var(--green); }
.status.bad { color: var(--red); }
.canvas-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #020617;
}
canvas { display: block; width: 100%; max-width: 480px; margin: 0 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: #1e293b;
  color: var(--cyan);
  border: 1px solid #334155;
}
.badge.done { color: var(--green); border-color: #166534; }
.engine-tag { font-size: 0.78rem; color: var(--dim); margin-bottom: 0.75rem; }
.engine-tag strong { color: var(--cyan); }
.progress-bar-wrap { height: 6px; background: #1e293b; border-radius: 999px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); transition: width 0.3s ease; }
.progress-text { font-size: 0.82rem; color: var(--dim); margin: 0 0 1rem; }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.mission-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; background: #0b1220; }
.mission-card.done { border-color: #166534; }
.mission-title { font-size: 0.85rem; color: #fff; font-weight: 600; margin-bottom: 0.35rem; }
.mission-meta { font-size: 0.75rem; color: var(--dim); margin-bottom: 0.5rem; }
.mission-launch { width: 100%; }
.scenario-ui { margin-top: 0.75rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; background: #020617; }
.scenario-head { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.scenario-observe { font-size: 0.85rem; color: var(--ink); margin-bottom: 0.75rem; line-height: 1.55; }
.scenario-opts { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.scenario-opt { text-align: left; white-space: normal; line-height: 1.4; }
.scenario-bar { height: 4px; background: #1e293b; border-radius: 999px; overflow: hidden; }
.scenario-bar div { height: 100%; background: var(--gold); transition: width 0.2s linear; }
.scenario-result { margin-top: 0.5rem; font-size: 0.82rem; }
.scenario-result.ok { color: var(--green); }
.scenario-result.bad { color: var(--red); }
.links-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.links-panel .btn { text-decoration: none; }
.hunt-embed {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #020617;
  min-height: 280px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.hunt-embed .hunt-screen {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  color: #86efac;
  white-space: pre-wrap;
}
.hunt-embed .hunt-row {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.hunt-embed .hunt-caret { color: var(--cyan); }
.hunt-embed .hunt-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  outline: none;
}
.terminal.ok { color: var(--green); border-color: #166534; }
.agent-status { max-height: 180px; font-size: 0.75rem; }
