:root{
  color-scheme: dark;
  --bg: #070a12;
  --panel: rgba(18, 26, 49, .58);
  --panel2: rgba(18, 26, 49, .34);
  --border: rgba(148, 163, 184, .16);
  --text: #e5e7eb;
  --muted: #a3adc2;
  --danger: #ffb4b4;
  --brand: #7c3aed;
  --brandHover: #8b5cf6;
  --ok: #22c55e;
  --warn: #f59e0b;
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  background:
    radial-gradient(900px 450px at 20% 10%, rgba(124, 58, 237, .25), transparent 55%),
    radial-gradient(800px 500px at 85% 15%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(34, 197, 94, .10), transparent 60%),
    var(--bg);
  color: var(--text);
}

.container{
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px 42px;
}

.header{
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.brand{
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(124,58,237,.9), rgba(59,130,246,.65));
  box-shadow: 0 12px 40px rgba(124,58,237,.18);
  border: 1px solid rgba(255,255,255,.10);
}

.title{
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.statusRow{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.statusPill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  font-weight: 800;
  font-size: 12px;
}
.statusPill::before{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(245,158,11,.16);
}
.statusPill[data-state="listening"]::before{
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(34,197,94,.16);
}
.statusText{
  color: var(--muted);
  font-size: 13px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,.22);
  margin-top: 12px;
}

.controls{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.formGrid{
  display: grid;
  gap: 12px;
}
.field{ display: grid; gap: 8px; }
.label{
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: rgba(229,231,235,.92);
}
input[type="file"]{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,.18);
  color: var(--text);
}
input[type="file"]::file-selector-button{
  margin-right: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover{
  background: rgba(255,255,255,.10);
}
select{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-weight: 800;
}
.row2{
  display: grid;
  gap: 12px;
}
.row2 .controls{ margin-top: 2px; }

.btn{
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.btn:disabled{
  opacity: .55;
  cursor: not-allowed;
}
.btn-primary{
  background: var(--brand);
  border-color: rgba(255,255,255,.08);
}
.btn-primary:hover{ background: var(--brandHover); }
.btn-outline{
  background: transparent;
  border-color: var(--border);
}
.btn-outline:hover{ background: rgba(255,255,255,.05); }
.btn-ghost{
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover{ background: rgba(255,255,255,.04); color: var(--text); }

.hint{
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 10px;
}
.h2{
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.mini{
  color: var(--muted);
  font-size: 12px;
}

.output{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 220px;
  background: rgba(0,0,0,.18);
  line-height: 1.65;
}
.final{
  white-space: pre-wrap;
  word-break: break-word;
}
.interim{
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(229,231,235,.70);
}

.error{
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
  white-space: pre-wrap;
}

@media (min-width: 640px){
  .card{ padding: 18px; }
  .row2{ grid-template-columns: 1fr 1fr; align-items: end; }
}

