:root {
  --bg: #0d0f12;
  --panel: #15191f;
  --line: #252b33;
  --text: #e8edf3;
  --muted: #8b96a5;
  --accent: #7cc4ff;
  --accent-2: #4f9e7f;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; justify-content: center;
}
.app {
  width: min(760px, 100%);
  min-height: 100%;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
header { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
h1 { font-size: 18px; letter-spacing: 0.18em; margin: 0; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #4b5563; box-shadow: 0 0 0 3px #1f242b; }
.dot.on { background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.dot.busy { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.status {
  color: var(--muted); font-size: 13px; min-height: 18px;
}
.talk { display: flex; gap: 12px; align-items: stretch; }
.ptt {
  flex: 1; min-height: 150px; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #1a2029, #12161c); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
  transition: transform .08s, border-color .15s, background .15s;
}
.ptt:active, .ptt.live { transform: scale(0.985); border-color: var(--accent); background: linear-gradient(180deg, #17324a, #12161c); }
.ptt:disabled { opacity: .45; cursor: default; }
.ptt-main { font-size: 20px; letter-spacing: .12em; font-weight: 600; }
.ptt-sub { font-size: 12px; color: var(--muted); }
.stop {
  width: 78px; border-radius: 18px; border: 1px solid var(--line); background: #1a1416;
  color: var(--danger); font-weight: 700; letter-spacing: .08em; cursor: pointer;
}
.stop:disabled { opacity: .4; cursor: default; }
.text-row { display: flex; gap: 8px; }
input, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 15px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.text-row input { flex: 1; }
button { font: inherit; }
.text-row button, .primary {
  border: 1px solid var(--line); background: var(--accent); color: #08121b;
  border-radius: 12px; padding: 0 18px; font-weight: 700; cursor: pointer;
}
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.msg { padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.msg.user { border-color: #24435c; background: #101c26; align-self: flex-end; max-width: 88%; }
.msg.roger { border-color: #234436; background: #101d17; max-width: 92%; }
.msg.meta { color: var(--muted); font-size: 12px; background: transparent; border: 0; padding: 0 4px; }
.msg.error { color: var(--danger); border-color: #4a2226; background: #1d1114; }
dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); width: min(440px, 92vw); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.6); }
.settings-form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.settings-form h2 { margin: 0 0 4px; font-size: 18px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; margin-top: 4px; }
.row button { padding: 10px 14px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
@media (max-width: 520px) {
  .ptt { min-height: 120px; }
  .stop { width: 64px; }
}
