/* Voice Studio — broadcast console.
   Slate panel metal, amber lamp glow, on-air red. Mono is the display face:
   this is an engineering console and nearly every value on screen is an
   identifier, a latency or a sample rate. */

:root {
  --ink:    #0E1419;
  --panel:  #161E25;
  --raise:  #1D2831;
  --line:   #26333D;
  --text:   #D8E0E6;
  --muted:  #7C8C99;
  --amber:  #E8A33D;
  --live:   #FF5A4D;
  --ok:     #6FCF97;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --rail: 208px;
  --r: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- utility type ---------- */

.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

h1 {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

h2 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- shell ---------- */

.shell { display: flex; min-height: 100vh; }

.nav {
  width: var(--rail);
  flex: 0 0 var(--rail);
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand b {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand span { display: block; margin-top: 2px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--text); background: var(--raise); text-decoration: none; }
.nav a.on { color: var(--text); border-left-color: var(--amber); background: var(--raise); }
.nav .group { padding: 16px 20px 5px; }
.nav .spacer { flex: 1; }

.main { flex: 1; min-width: 0; }

.head {
  padding: 22px 32px 16px;
  border-bottom: 1px solid var(--line);
}
.head p { color: var(--muted); margin: 0; max-width: 60ch; }

.body { padding: 26px 32px 60px; max-width: 1180px; }

/* ---------- signal rail: the one thing that runs through every page ---------- */

.rail {
  height: 34px;
  width: 100%;
  display: block;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 18px;
}

.panel > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.panel > header .label { margin-right: auto; }
.panel .pad { padding: 16px; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- LED status dot ---------- */

.led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}
.led.ok   { background: var(--ok);    box-shadow: 0 0 7px rgba(111,207,151,.55); }
.led.warn { background: var(--amber); box-shadow: 0 0 7px rgba(232,163,61,.55); }
.led.err  { background: var(--live);  box-shadow: 0 0 7px rgba(255,90,77,.55); }
.led.live { background: var(--live);  box-shadow: 0 0 9px rgba(255,90,77,.8);
            animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: .35; } }

/* ---------- controls ---------- */

label.field { display: block; margin-bottom: 14px; }
label.field > .label { display: block; margin-bottom: 6px; }

input, select, textarea, button {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 11px;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); outline: none; }

input[type=range] { width: 100%; accent-color: var(--amber); }

button, .btn {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 16px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button:disabled { opacity: .4; cursor: not-allowed; }

button.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #14100A;
  font-weight: 600;
}
button.primary:hover { background: #F0B255; border-color: #F0B255; }

button.danger { color: var(--live); border-color: rgba(255,90,77,.3); }
button.danger:hover { border-color: var(--live); }

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

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}
td { padding: 9px 16px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }

/* ---------- misc ---------- */

.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
}
.tag.done { color: var(--ok); border-color: rgba(111,207,151,.3); }
.tag.failed { color: var(--live); border-color: rgba(255,90,77,.3); }
.tag.running { color: var(--amber); border-color: rgba(232,163,61,.3); }

.reveal {
  background: var(--ink);
  border: 1px solid var(--amber);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.reveal code {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  word-break: break-all;
  user-select: all;
}

.note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.err { color: var(--live); font-family: var(--mono); font-size: 12.5px; }

.meter {
  height: 4px;
  background: var(--ink);
  border-radius: 2px;
  overflow: hidden;
}
.meter > i { display: block; height: 100%; background: var(--amber); transition: width .3s; }

.drop {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  cursor: pointer;
}
.drop.over { border-color: var(--amber); color: var(--text); }

.transcript {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  max-height: 340px;
  overflow-y: auto;
}
.turn { padding: 9px 0; border-bottom: 1px solid var(--line); }
.turn:last-child { border-bottom: none; }
.turn .who {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}
.turn.you .who { color: var(--amber); }

/* ---------- login ---------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login .panel { width: 100%; max-width: 340px; margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }
  .nav {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; overflow-x: auto; padding: 0; align-items: center;
  }
  .brand, .nav .group, .nav .spacer { display: none; }
  .nav a { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .nav a.on { border-left: none; border-bottom-color: var(--amber); }
  .head, .body { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
