:root {
  --bg: #0a0e0c;
  --panel: #121814;
  --border: #223028;
  --fg: #eef7f0;
  --dim: #8aa398;
  --accent: #2fd88f;
  --accent-fg: #04140c;
  --danger: #ff6b6b;
  --danger-fg: #200404;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b));
}

#app { width: 100%; max-width: 460px; margin: auto 0; }

.screen { display: flex; flex-direction: column; gap: 18px; }
.hidden { display: none !important; }

.brand {
  text-align: center;
  margin-bottom: 4px;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.brand .tag {
  color: var(--dim);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* --- buttons: every .big button gets real styling by default --- */
.big {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 22px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.08s ease;
}

.big:active { transform: scale(0.97); }

/* Start/Stop must be unmissable and easy to hit without looking — driving. */
.start,
.stop {
  border-color: transparent;
  font-size: 2.2rem;
  font-weight: 800;
  padding: 0;
  min-height: 34vh;
  min-height: 34dvh;
  border-radius: 28px;
}

.start { background: var(--accent); color: var(--accent-fg); }
.stop { background: var(--danger); color: var(--danger-fg); }

/* --- inputs: 16px+ so iOS Safari doesn't auto-zoom on focus --- */
input, textarea {
  font-size: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  width: 100%;
  font-family: inherit;
}

input#passcode { text-align: center; letter-spacing: 0.2em; }
input::placeholder, textarea::placeholder { color: var(--dim); }

.error { color: var(--danger); text-align: center; min-height: 1.2em; font-size: 0.9rem; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--dim);
  font-size: 0.95rem;
  min-height: 1.4em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}

.status-dot.active { background: var(--accent); box-shadow: 0 0 0 4px rgba(47, 216, 143, 0.15); }

.boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.boxes .box {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--dim);
}

.boxes .box.on { background: var(--accent); color: var(--accent-fg); border-color: transparent; font-weight: 700; }

.box-caption { text-align: center; color: var(--dim); font-size: 0.78rem; margin-top: -8px; }

.card-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 20px;
  min-height: 5.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.5;
}

.card-panel:empty::before {
  content: "Tap Start, then just listen and speak.";
  color: var(--dim);
  font-size: 1rem;
}

.controls { display: flex; flex-direction: column; gap: 14px; }

details {
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}

details[open] { padding-bottom: 16px; }

summary { cursor: pointer; font-size: 0.95rem; }

textarea { margin-top: 12px; resize: vertical; }

#importBox .big { margin-top: 10px; padding: 16px; font-size: 1rem; }

#importMsg { color: var(--dim); font-size: 0.85rem; margin-top: 8px; text-align: center; }
