/* VoiceToDo PWA — dark, minimal, mobile-first. */
* { box-sizing: border-box; }
:root {
  --bg: #0d0d0f;
  --surface: #17171b;
  --surface-2: #202027;
  --text: #eaeaef;
  --muted: #9a9aa6;
  --accent: #4f8cff;
  --accent-press: #3a6fd6;
  --danger: #ff5c5c;
  --ok: #43c47a;
  --radius: 14px;
}
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body { min-height: 100dvh; }

.view { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
[hidden] { display: none !important; }

/* Build strip — subtle; keeps the build tag + force-update available for deploys. */
#build-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--surface); color: var(--muted); text-align: center;
  font-size: .7rem; padding: .25rem .5rem; border-bottom: 1px solid var(--surface-2);
}
#build-banner button {
  background: var(--surface-2); color: var(--muted); border: none;
  border-radius: 6px; padding: .1rem .5rem; font-size: .7rem; cursor: pointer;
}
body { padding-top: 1.5rem; }  /* room for the fixed banner */

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: .5rem;
  padding: 1rem 1rem .5rem; position: sticky; top: 0;
  background: var(--bg);
}
.topbar h1 { font-size: 1.25rem; margin: 0; flex: 0 0 auto; }
.topbar-actions { margin-left: auto; display: flex; gap: .25rem; }
.spacer, .topbar .spacer { flex: 1; }
.topbar h1 + .spacer { margin-left: 0; }

.icon-btn {
  background: none; border: none; color: var(--text);
  font-size: 1.4rem; width: 44px; height: 44px; border-radius: 10px;
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.talk-back, #settings-back, #talk-back { margin-right: auto; }

/* Topic list */
#topics { flex: 1; padding: .25rem 1rem 6rem; }
.topic {
  background: var(--surface); border-radius: var(--radius);
  margin: .6rem 0; padding: .8rem 1rem;
}
.topic-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .15rem; }
.topic-summary { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.point {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .5rem .2rem; cursor: pointer; min-height: 44px;
}
.point + .point { border-top: 1px solid var(--surface-2); }
.point .box {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid var(--muted); border-radius: 6px;
  display: grid; place-items: center; font-size: .9rem;
}
.point.done .box { background: var(--ok); border-color: var(--ok); color: #04210f; }
.point.done .txt { color: var(--muted); text-decoration: line-through; }
.point .txt { line-height: 1.35; }
.empty { color: var(--muted); text-align: center; margin-top: 3rem; }

/* Floating mic button */
.fab {
  position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom));
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff;
  font-size: 1.7rem; box-shadow: 0 6px 18px rgba(0,0,0,.5); cursor: pointer;
}
.fab:active { background: var(--accent-press); }

/* Talk view */
.talk-panel { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1.5rem 1.2rem; }
.mic-big {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff; font-size: 3rem;
  cursor: pointer; margin: 1.5rem 0 .5rem; transition: transform .1s;
}
.mic-big.listening { background: var(--danger); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,92,92,.5);} 50% { box-shadow: 0 0 0 18px rgba(255,92,92,0);} }
.hint { color: var(--muted); text-align: center; }
.transcript {
  width: 100%; min-height: 4rem; margin: 1rem 0; padding: .8rem 1rem;
  background: var(--surface); border-radius: var(--radius); line-height: 1.4;
}
.transcript .interim { color: var(--muted); }

/* Proposal */
.proposal-heading { font-size: 1.1rem; font-weight: 600; margin: .5rem 0 1rem; text-align: center; }
.proposal-heading .name { color: var(--accent); }
.proposal-transcript {
  width: 100%; background: var(--surface); border-radius: var(--radius);
  padding: .7rem 1rem; margin-bottom: 1rem; font-size: .9rem;
}
.proposal-transcript .label { color: var(--muted); display: block; margin-bottom: .2rem; font-size: .8rem; }
.points-edit { list-style: none; padding: 0; margin: 0 0 1.2rem; width: 100%; }
.points-edit li {
  display: flex; align-items: flex-start; gap: .7rem;
  background: var(--surface); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .5rem;
}
.points-edit input[type=checkbox] { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.points-edit label { line-height: 1.35; }

/* Action cards (proposal with an actions[] list) */
.action-card {
  display: block; background: var(--surface); border-radius: 10px;
  padding: .7rem .9rem; margin-bottom: .6rem;
}
.action-card .action-head { display: flex; align-items: flex-start; gap: .7rem; }
.action-card .action-include { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.action-card .action-head label { line-height: 1.35; font-weight: 600; }
.action-card .name { color: var(--accent); }
.action-card .muted { color: var(--muted); font-weight: 400; font-size: .85rem; }
.action-complete .action-head label { color: var(--text); }
.action-points { list-style: none; padding: 0; margin: .5rem 0 0 2rem; }
.action-points li { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .35rem; }
.action-points input[type=checkbox] { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.action-points label { line-height: 1.3; font-weight: 400; }
.proposal-empty { color: var(--muted); text-align: center; padding: .8rem; }

.row-actions { display: flex; gap: .7rem; width: 100%; }
.primary, .ghost {
  flex: 1; padding: .9rem 1rem; border-radius: 12px; font-size: 1rem;
  border: none; cursor: pointer; min-height: 48px;
}
.primary { background: var(--accent); color: #fff; }
.primary:active { background: var(--accent-press); }
.primary:disabled { opacity: .5; }
.ghost { background: var(--surface-2); color: var(--text); }

.error-box { width: 100%; text-align: center; }
.error-box p { color: var(--danger); }

/* Settings */
.settings-body { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.settings-body label { font-weight: 600; }
.settings-body input {
  padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--surface-2);
  background: var(--surface); color: var(--text); font-size: 1rem;
}
.settings-body input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* Status lines */
.status { color: var(--muted); padding: .5rem 1rem; text-align: center; }
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }
