:root {
  --bg: #0b0b0f;
  --panel: #15151c;
  --panel-2: #1d1d27;
  --border: #2a2a36;
  --text: #ececf1;
  --muted: #9a9aae;
  --accent: #6c5ce7;
  --accent-2: #00d2a8;
  --a: #4f8cff;
  --b: #ff6b8b;
  --ok: #2ecc71;
  --warn: #f1c40f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1a2e 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 16px var(--accent-2);
}
.brand h1 { font-size: 19px; margin: 0; letter-spacing: .2px; }
.brand .sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.pill {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
}
.pill-idle { color: var(--muted); }
.pill-ok { color: var(--ok); border-color: rgba(46,204,113,.4); }
.pill-rec { color: var(--b); border-color: rgba(255,107,139,.5); }
.pill-err { color: #ff6b6b; border-color: rgba(255,107,107,.5); }

.tabs { display: flex; gap: 8px; padding: 18px 28px 0; }
.tab {
  background: var(--panel); color: var(--muted); border: 1px solid var(--border);
  padding: 9px 18px; border-radius: 10px 10px 0 0; cursor: pointer; font-size: 14px;
}
.tab.active { color: var(--text); background: var(--panel-2); border-bottom-color: var(--panel-2); }

.mode { display: none; padding: 22px 28px 40px; max-width: 980px; margin: 0 auto; }
.mode.active { display: block; }

.controls {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; margin-bottom: 20px;
}
.lang-row { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.controls label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.voice-label { flex: 1; min-width: 200px; }
select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; min-width: 130px;
}
.swap {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; width: 40px; height: 40px; font-size: 17px; cursor: pointer;
}
.handsfree { flex-direction: row !important; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); }

.ptt {
  width: 100%; padding: 30px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(180deg, var(--accent), #5a4bd6);
  border: none; color: #fff; display: flex; flex-direction: column; gap: 6px; align-items: center;
  transition: transform .06s ease, filter .12s ease; user-select: none;
  box-shadow: 0 10px 30px rgba(108,92,231,.25);
}
.ptt:active, .ptt.active { transform: scale(.99); filter: brightness(1.15); }
.ptt.active { box-shadow: 0 0 0 4px rgba(0,210,168,.4), 0 10px 30px rgba(108,92,231,.3); }
.ptt:disabled { opacity: .45; cursor: not-allowed; }
.ptt-label { font-size: 19px; font-weight: 650; }
.ptt-hint { font-size: 12.5px; opacity: .85; }
.ptt kbd { background: rgba(255,255,255,.18); padding: 1px 6px; border-radius: 5px; }
.ptt-a { background: linear-gradient(180deg, var(--a), #3a6fd8); box-shadow: 0 10px 30px rgba(79,140,255,.25); }
.ptt-b { background: linear-gradient(180deg, var(--b), #e0506f); box-shadow: 0 10px 30px rgba(255,107,139,.25); }

.captions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.caption {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; min-height: 120px;
}
.caption.out { border-color: rgba(0,210,168,.3); }
.caption h3 { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.said { font-size: 17px; line-height: 1.5; margin: 0; color: var(--text); }
.translation { font-size: 18px; line-height: 1.5; margin: 0; color: var(--accent-2); font-weight: 500; }
.playing { display: none; color: var(--accent-2); font-size: 11px; margin-left: 8px; }
.playing.on { display: inline; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.duo-controls { display: flex; gap: 18px; flex-wrap: wrap; }
.duo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.person { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.person h2 { margin: 0 0 14px; font-size: 15px; }
.person .caption { background: var(--panel-2); margin-top: 14px; min-height: 80px; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 20px 30px; }
.foot strong { color: var(--accent-2); }

@media (max-width: 760px) {
  .captions, .duo-grid { grid-template-columns: 1fr; }
}
