/* Car Channel — dark night-driving theme, giant car-UI targets. */
:root {
  --bg: #000000;
  --panel: #131313;
  --panel2: #1d1d1d;
  --amber: #f59e0b;
  --amber-dim: #b45309;
  --text: #f5f5f4;
  --muted: #a8a29e;
  --green: #22c55e;
  --red: #ef4444;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.view { height: 100dvh; display: flex; flex-direction: column; }

/* ── Setup ── */
#setup { align-items: center; justify-content: center; padding: 24px; }
.setup-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.brand { font-size: 32px; font-weight: 700; color: var(--amber); }
.setup-hint { color: var(--muted); }
#setup input, .modal-box input {
  width: 100%; padding: 16px; font-size: 18px; border-radius: 14px;
  border: 1px solid #333; background: var(--panel); color: var(--text);
}
.btn-primary {
  padding: 18px; font-size: 20px; font-weight: 700; border: none; border-radius: 14px;
  background: var(--amber); color: #000; min-height: 56px;
}
.setup-status { min-height: 24px; font-size: 16px; }
.setup-status.ok { color: var(--green); }
.setup-status.err { color: var(--red); }

/* ── Status strip ── */
.strip {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--sat)) 14px 10px;
  background: var(--panel); border-bottom: 1px solid #262626;
  position: relative; z-index: 50; /* stays above the START overlay so ⚙︎ is always reachable */
}
.onair {
  font-weight: 800; font-size: 16px; letter-spacing: 1px;
  color: #000; background: var(--green); border-radius: 8px; padding: 4px 10px;
}
.onair.off { background: #52525b; color: #d4d4d8; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #52525b; }
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }
.pill {
  background: var(--amber-dim); color: #fff; font-size: 13px;
  padding: 4px 10px; border-radius: 999px; max-width: 46vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thinking { color: var(--amber); font-size: 14px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.gear {
  margin-left: auto; background: none; border: none; color: var(--muted);
  font-size: 26px; min-width: 48px; min-height: 48px;
}

/* ── Thread ── */
.thread { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--muted); text-align: center; margin-top: 30%; padding: 0 24px; }
.bubble-row { display: flex; }
.bubble-row.me { justify-content: flex-end; }
.bubble-row.claude { justify-content: flex-start; }
.bubble { max-width: 86%; padding: 12px 14px; border-radius: 18px; }
.bubble.me { background: var(--amber-dim); border-bottom-right-radius: 6px; }
.bubble.claude { background: var(--panel2); border-bottom-left-radius: 6px; }
.bubble.queued { opacity: 0.65; border: 1px dashed var(--amber); }
.bubble .body { white-space: pre-wrap; word-break: break-word; }
.bubble .time { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 6px; }

/* ── Speech controls ── */
.controls {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 8px 12px; background: var(--panel); border-top: 1px solid #262626;
}
.ctl {
  min-height: 60px; border: 1px solid #333; border-radius: 14px;
  background: var(--panel2); color: var(--text); font-size: 22px; line-height: 1.1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.ctl small { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.ctl.attention { border-color: var(--amber); animation: pulse 1s infinite; color: var(--amber); }

/* ── Composer ── */
.composer {
  display: flex; gap: 10px; padding: 10px 12px calc(12px + var(--sab));
  background: var(--panel);
}
#msg {
  flex: 1; padding: 14px; font-size: 19px; border-radius: 14px; resize: none;
  border: 1px solid #333; background: var(--panel2); color: var(--text);
}
.btn-send {
  min-width: 108px; min-height: 64px; border: none; border-radius: 16px;
  background: var(--amber); color: #000; font-size: 22px; font-weight: 800; letter-spacing: 1px;
}
.btn-send:active { background: var(--amber-dim); color: #fff; }

/* ── START overlay ── */
.start-overlay {
  position: absolute; inset: 0; top: 0;
  background: rgba(0,0,0,0.88); display: flex; align-items: center; justify-content: center;
  z-index: 40;
}
#main { position: relative; }
.btn-start {
  width: 74vw; max-width: 340px; aspect-ratio: 1; border-radius: 50%;
  border: 4px solid var(--amber); background: #1a1206; color: var(--amber);
  font-size: 40px; font-weight: 800; line-height: 1.3;
}
.btn-start small { display: block; font-size: 15px; font-weight: 400; color: var(--muted); margin-top: 6px; }
.btn-start:active { background: var(--amber); color: #000; }

/* ── Settings modal ── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  width: 100%; max-width: 420px; background: var(--panel); border: 1px solid #333;
  border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.modal-box h2 { font-size: 20px; }
.modal-box label { color: var(--muted); font-size: 14px; }
.modal-box hr { border: none; border-top: 1px solid #333; }
.btn-danger {
  padding: 14px; border: 1px solid var(--red); background: none; color: var(--red);
  border-radius: 12px; font-size: 17px; min-height: 52px;
}
.btn-plain { padding: 14px; border: none; background: var(--panel2); color: var(--text); border-radius: 12px; font-size: 17px; min-height: 52px; }
.version { color: var(--muted); font-size: 12px; text-align: center; }
