:root {
  --bg: #0e1116;
  --panel: #161b23;
  --panel-2: #1d232d;
  --line: #2a323e;
  --fg: #e8edf4;
  --muted: #92a0b3;
  --brand: #3ba3ff;
  --brand-dim: #1d5f9e;
  --ok: #3ddc97;
  --warn: #ffc857;
  --bad: #ff6b6b;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap-narrow { max-width: 620px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px;
}
.brand { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.brand span { color: var(--brand); }

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 28px 0 12px; letter-spacing: -0.01em; }
p.sub { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #04121f; border: 0;
  border-radius: 10px; padding: 12px 18px; min-height: 46px;
}
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.danger { background: var(--bad); color: #250505; }
button:disabled { opacity: .45; cursor: not-allowed; }

input, select, textarea {
  font: inherit; width: 100%; background: var(--panel-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

.grid { display: grid; gap: 12px; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tile {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; font-size: 17px; font-weight: 600;
  cursor: pointer; min-height: 84px; display: flex; align-items: center; justify-content: center;
}
.tile:hover { border-color: var(--brand-dim); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.ok { background: rgba(61,220,151,.15); color: var(--ok); }
.pill.warn { background: rgba(255,200,87,.15); color: var(--warn); }
.pill.bad { background: rgba(255,107,107,.15); color: var(--bad); }
.pill.mute { background: var(--panel-2); color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }

.meter { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); transition: width .15s linear; }
.meter.ok > i { background: var(--ok); }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }

.timer { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.speaking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 0 rgba(61,220,151,.6); animation: pulse 1.4s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 14px rgba(61,220,151,0); } }

.transcript { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.bubble { padding: 10px 14px; border-radius: 12px; max-width: 85%; line-height: 1.45; font-size: 15px; }
.bubble.agent { background: var(--panel-2); align-self: flex-start; }
.bubble.student { background: var(--brand-dim); color: #eaf4ff; align-self: flex-end; }

.err { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 18px; }
.muted { color: var(--muted); }
.score { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.hidden { display: none !important; }
.quote { border-left: 3px solid var(--brand-dim); padding-left: 12px; color: var(--muted); font-style: italic; }
