:root {
  --bg: #071018;
  --panel: #0e1a24;
  --ink: #e8f4f2;
  --muted: #8aa3a8;
  --line: rgba(94, 234, 212, 0.16);
  --accent: #5eead4;
  --warn: #f5b942;
  --bad: #fb7185;
  --good: #34d399;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(94, 234, 212, 0.12), transparent),
    radial-gradient(900px 400px at 100% 0%, rgba(245, 185, 66, 0.08), transparent),
    var(--bg);
  color: var(--ink);
}
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside {
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  background: rgba(7, 16, 24, 0.8);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 18px var(--accent);
}
.brand small { display: block; color: var(--muted); font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 8px; }
nav button, .ghost, button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
nav button.active, button[type="submit"] {
  background: var(--accent);
  color: #04201c;
  border-color: transparent;
  font-weight: 650;
}
.status { margin-top: auto; font-size: 12px; color: var(--muted); }
main { padding: 32px 40px 64px; }
header { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-size: 11px; margin: 0; }
h1 { margin: 8px 0 0; font-size: 34px; font-weight: 560; letter-spacing: -0.03em; }
h2 { margin: 0 0 8px; font-size: 18px; }
.hidden { display: none; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 28px 0; }
.metric, article {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.metric b { display: block; font-size: 28px; margin-top: 8px; }
.metric span { color: var(--muted); font-size: 12px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
form, .sim-bar { display: grid; gap: 10px; }
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  background: #07141c;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.table-wrap { overflow: auto; max-height: 520px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.pill { padding: 3px 8px; border-radius: 999px; background: rgba(94,234,212,0.12); color: var(--accent); }
.flow { color: var(--muted); padding-left: 18px; }
.flow li { margin: 8px 0; }
.flow li.ok { color: var(--good); }
.flow li.bad { color: var(--warn); }
.setup-card { margin-bottom: 16px; }
.setup-urls { display: grid; gap: 8px; margin-top: 12px; }
.setup-urls code {
  display: block;
  font-size: 12px;
  word-break: break-all;
  padding: 8px 10px;
  border-radius: 10px;
  background: #07141c;
  border: 1px solid var(--line);
  color: var(--accent);
}
a { color: var(--accent); }
.transcript {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #07141c;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble { max-width: 80%; padding: 10px 12px; border-radius: 14px; line-height: 1.45; }
.bubble.assistant { background: rgba(94,234,212,0.12); }
.bubble.user { background: rgba(245,185,66,0.12); margin-left: auto; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#sim-form { grid-template-columns: 1fr auto; }
.sim-bar {
  grid-template-columns: 1fr auto auto;
  align-items: center;
  margin-bottom: 10px;
}
.speak-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}
.speak-toggle input { width: auto; }
#sim-status { margin: 0 0 10px; min-height: 1.2em; }
.chat-panel .transcript { min-height: 360px; max-height: 56vh; }
input:disabled, button:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .metrics, .grid.two { grid-template-columns: 1fr; }
  aside { flex-direction: row; align-items: center; }
  nav { flex-direction: row; flex-wrap: wrap; }
}
