:root {
  --bg: #0b0f14;
  --bg-elev: #121821;
  --bg-card: #17202b;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f5f8;
  --muted: #9aa7b5;
  --faint: #6b7785;
  --accent: #3dff9a;
  --accent-dim: rgba(61, 255, 154, 0.14);
  --accent-ink: #052416;
  --warn: #ffb020;
  --danger: #ff5c6a;
  --danger-dim: rgba(255, 92, 106, 0.14);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(61, 255, 154, 0.09), transparent 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(50, 120, 255, 0.06), transparent 50%),
    var(--bg);
}

#app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 20px calc(24px + var(--safe-b));
  position: relative;
}

.view {
  display: none;
  animation: fadeIn 0.28s ease;
}

.view.active { display: block; }

.view-active.active {
  position: fixed;
  inset: 0;
  max-width: none;
  z-index: 50;
  padding: 0;
  background: #000;
}

/* Ensure [hidden] always wins over display rules (critical for cam-error) */
[hidden],
.view[hidden],
.cam-error[hidden],
.countdown-flash[hidden],
.timer-block[hidden],
.rec-pill[hidden],
.toast[hidden],
.stats-card[hidden],
.result-card[hidden],
.recording-box[hidden],
.hint[hidden],
.empty-state[hidden],
.progress-card[hidden],
.custom-goal[hidden],
.goal-baseline-note[hidden],
.btn-ghost[hidden],
.free-talk-note[hidden],
.prompt-card[hidden],
.prep-note[hidden],
.btn-new-prompt[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  min-height: 44px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  border: 1px solid rgba(61, 255, 154, 0.25);
}

.view-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.icon-btn:active { transform: scale(0.96); }
.icon-btn:hover { border-color: rgba(255,255,255,0.16); }
.icon-btn.ghost { visibility: hidden; pointer-events: none; }

.hero { margin: 28px 0 28px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.logo {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 10vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.pitch {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 34ch;
}

.stats-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 8px;
  margin-bottom: 28px;
}

.stat {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-divider {
  width: 1px;
  background: var(--line);
  margin: 4px 0;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta-stack.tight { margin-top: 24px; }

.btn {
  appearance: none;
  border: none;
  border-radius: 16px;
  min-height: 56px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s, opacity 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  touch-action: manipulation;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(61,255,154,0.3), 0 12px 40px rgba(61,255,154,0.18);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }

.btn-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 106, 0.3);
}

.btn-stop {
  background: var(--danger);
  color: #1a0508;
  min-height: 64px;
  font-size: 1.15rem;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(255, 92, 106, 0.35);
  position: relative;
  z-index: 6;
  pointer-events: auto;
}

.btn-text, .btn-text-light {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  min-height: auto;
  touch-action: manipulation;
}

.btn-text-light { color: var(--muted); }

.hint {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.foot-note {
  margin-top: 36px;
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 1rem;
}

.field-help {
  color: var(--faint);
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-row.wrap {
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 999px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
  min-height: 44px;
}

.chip.active {
  background: var(--accent-dim);
  border-color: rgba(61, 255, 154, 0.45);
  color: var(--accent);
}

.category-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.danger-zone {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-date {
  font-weight: 600;
  font-size: 0.95rem;
}

.history-ex {
  color: var(--faint);
  font-size: 0.82rem;
  text-transform: capitalize;
}

.history-dur {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}

.empty-state {
  color: var(--faint);
  text-align: center;
  line-height: 1.5;
  padding: 40px 12px;
  margin: 0;
}

.prep {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.prep-badge {
  align-self: flex-start;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(61, 255, 154, 0.3);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prep h3 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.prep p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.02rem;
}

.prep-list {
  margin: 4px 0 8px;
  padding: 0 0 0 1.15rem;
  color: var(--muted);
  line-height: 1.7;
}

.prep-note {
  font-size: 0.95rem !important;
}

.target-hero {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}

.target-label {
  display: block;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.target-num {
  font-family: var(--mono);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.prompt-card {
  background: linear-gradient(160deg, rgba(61,255,154,0.08), transparent 60%), var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.prompt-label {
  display: block;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.prompt-text {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

/* ACTIVE CAMERA VIEW */
#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  background: #111;
}

.cam-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 28%),
    linear-gradient(0deg, rgba(0,0,0,0.72) 0%, transparent 36%);
  pointer-events: none;
  z-index: 1;
}

.active-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-t)) 20px calc(28px + var(--safe-b));
  z-index: 2;
  pointer-events: none;
}

.active-ui .btn,
.active-ui .btn-new-prompt,
.active-ui button {
  pointer-events: auto;
}

.active-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.active-top-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.active-mode {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
}

.live-timestamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 3.2vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 7px 11px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  max-width: min(92vw, 340px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-canvas {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: 0;
}

.rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 40, 60, 0.22);
  border: 1px solid rgba(255, 80, 100, 0.5);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b4e;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.countdown-flash {
  flex: 1;
  display: grid;
  place-items: center;
}

.countdown-flash span {
  font-family: var(--mono);
  font-size: clamp(7rem, 32vw, 10rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 8px 48px rgba(0,0,0,0.55);
  animation: pop 0.45s ease;
}

@keyframes pop {
  from { transform: scale(0.7); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

.timer-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 0 8px;
}

.overlay-category {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.overlay-prompt {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.45rem, 6vw, 1.95rem);
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
  transition: transform 0.35s ease, color 0.35s ease, text-shadow 0.35s ease;
}

.overlay-prompt.prompt-flash {
  animation: promptPulse 0.85s ease;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(61, 255, 154, 0.55), 0 2px 16px rgba(0,0,0,0.7);
}

@keyframes promptPulse {
  0% { transform: scale(0.92); opacity: 0.55; }
  40% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.big-timer {
  font-family: var(--mono);
  font-size: clamp(5.2rem, 24vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 6px 40px rgba(0,0,0,0.55);
}

.timer-caption {
  margin: 0;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.btn-new-prompt {
  appearance: none;
  margin-top: 14px;
  min-height: 52px;
  min-width: min(88vw, 280px);
  padding: 14px 28px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  z-index: 6;
}

.btn-new-prompt:active {
  transform: scale(0.97);
  background: rgba(61, 255, 154, 0.22);
  border-color: var(--accent);
}

.active-actions {
  display: flex;
  justify-content: center;
  padding-top: 12px;
  position: relative;
  z-index: 6;
}

.cam-error {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(11, 15, 20, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
  pointer-events: auto;
}

.cam-error p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 32ch;
}

.cam-error .btn {
  width: 100%;
  max-width: 280px;
  min-height: 52px;
}

/* RESULT */
.result {
  text-align: center;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.result-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-time {
  font-family: var(--mono);
  font-size: 4.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.result-msg {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 34ch;
}

.result-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.recording-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin-top: 8px;
}

.recording-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

#playback {
  width: 100%;
  border-radius: 14px;
  background: #000;
  max-height: 220px;
  object-fit: cover;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(12px);
  background: #1e2936;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: min(90vw, 360px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 440px) {
  #app { padding-left: 24px; padding-right: 24px; }
}

/* Progress toward goal */
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-card.compact {
  margin-bottom: 0;
  width: 100%;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label {
  font-size: 0.72rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.progress-pct {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(61, 255, 154, 0.55), var(--accent));
  box-shadow: 0 0 16px rgba(61, 255, 154, 0.35);
  transition: width 0.55s ease;
}

.progress-meta {
  margin: 0;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.4;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  min-height: 48px;
  font-size: 0.95rem;
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(61, 255, 154, 0.35);
  color: var(--accent);
}

.goal-baseline-note {
  background: var(--accent-dim);
  border: 1px solid rgba(61, 255, 154, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.goal-baseline-note strong {
  color: var(--accent);
  font-family: var(--mono);
}

.text-input {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
}

.text-input:focus {
  outline: none;
  border-color: rgba(61, 255, 154, 0.5);
  box-shadow: 0 0 0 3px rgba(61, 255, 154, 0.12);
}

.custom-goal {
  margin-top: 4px;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.result-badge.goal-hit {
  background: rgba(61, 255, 154, 0.22);
  box-shadow: 0 0 24px rgba(61, 255, 154, 0.25);
}


/* Reminder settings */
.reminder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--text);
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toggle-ui {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #2a3440;
  border: 1px solid var(--line);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.toggle input:checked + .toggle-ui {
  background: var(--accent-dim);
  border-color: rgba(61, 255, 154, 0.45);
}

.toggle input:checked + .toggle-ui::after {
  transform: translateX(18px);
  background: var(--accent);
}

.toggle-label { font-size: 0.95rem; }

.time-input {
  width: auto;
  min-width: 8.5rem;
  max-width: 10rem;
  padding: 10px 12px;
  font-family: var(--mono);
  font-weight: 600;
}

.reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.9rem;
  border-radius: 12px;
}

.field-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}

.field-status.ok { color: var(--accent); }
.field-status.warn { color: var(--warn); }

.ios-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 176, 32, 0.1);
  border: 1px solid rgba(255, 176, 32, 0.28);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.history-date {
  font-variant-numeric: tabular-nums;
}

/* Streak calendar */
.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  margin-bottom: 20px;
}

.streak-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.streak-count-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.streak-count {
  font-family: var(--mono);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

.streak-count-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.streak-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.streak-month {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 7.5rem;
  text-align: center;
}

.streak-nav-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  text-align: center;
}

.cal-weekdays span {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.cal-day.empty {
  visibility: hidden;
  pointer-events: none;
}

.cal-day.done {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(61, 255, 154, 0.28);
}

.cal-day.today {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
}

.cal-day.done.today {
  box-shadow: 0 0 0 1px rgba(61, 255, 154, 0.45);
}

.streak-meta {
  margin: 12px 2px 0;
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.4;
}

.free-talk-note {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(61, 255, 154, 0.22);
  border-radius: 14px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

#history-streak {
  margin-bottom: 18px;
}

/* --- Trusted Circle --- */
.privacy-banner {
  margin: 0 0 8px;
  padding: 14px 16px;
  background: rgba(50, 120, 255, 0.1);
  border: 1px solid rgba(50, 120, 255, 0.22);
  border-radius: 14px;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.privacy-banner strong { color: #8eb7ff; }

.invite-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.invite-code {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-result {
  margin-top: 12px;
  padding-top: 4px;
}

#circle-invite-name {
  margin: 8px 0 12px;
  width: 100%;
}

.circle-people,
.circle-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.person-card,
.checkin-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px;
}

.person-card {
  align-items: center;
}

.person-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.person-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.role-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(50, 120, 255, 0.14);
  color: #8eb7ff;
  border: 1px solid rgba(50, 120, 255, 0.25);
}

.role-tag[data-role="Coach"] { background: rgba(61, 255, 154, 0.12); color: var(--accent); border-color: rgba(61, 255, 154, 0.28); }
.role-tag[data-role="Therapist"] { background: rgba(180, 120, 255, 0.14); color: #c9a6ff; border-color: rgba(180, 120, 255, 0.28); }
.role-tag[data-role="Trainer"] { background: rgba(255, 176, 32, 0.14); color: var(--warn); border-color: rgba(255, 176, 32, 0.28); }
.role-tag[data-role="Buddy"] { background: rgba(50, 120, 255, 0.14); color: #8eb7ff; border-color: rgba(50, 120, 255, 0.25); }

.person-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}

.btn-icon-danger {
  border: none;
  background: var(--danger-dim);
  color: var(--danger);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.btn-icon-danger:active { transform: scale(0.96); }

.checkin-thumb {
  width: 56px;
  height: 72px;
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(61, 255, 154, 0.18), transparent 55%),
    var(--bg-elev);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  position: relative;
  overflow: hidden;
}

.checkin-thumb::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px;
  opacity: 0.85;
}

.checkin-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkin-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.checkin-dur {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.02rem;
}

.checkin-when {
  font-size: 0.75rem;
  color: var(--faint);
}

.checkin-meta {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: capitalize;
}

.checkin-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.flag-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--muted);
  border: 1px solid var(--line);
}

.flag-pill.brain {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(61, 255, 154, 0.25);
}

.checkin-note {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}

.empty-state.compact {
  padding: 18px 8px;
  font-size: 0.88rem;
}

.share-card {
  margin: 8px 0 4px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}

.share-toggle {
  width: 100%;
  justify-content: flex-start;
}

.share-help {
  margin: 8px 0 0;
}

.tight-field {
  margin-top: 12px;
}

.share-note {
  width: 100%;
  margin-top: 6px;
  resize: vertical;
  min-height: 64px;
  font-family: var(--font);
}

#result-share-extra .btn {
  margin-top: 10px;
}

#result-share-status {
  margin-top: 8px;
  min-height: 1.2em;
}

.privacy-banner[hidden],
.invite-result[hidden],
#result-share-extra[hidden],
.share-card[hidden] {
  display: none !important;
}


/* Account / API circle */
.account-card .text-input { margin-top: 0.5rem; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.account-line {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}
.account-line strong { color: var(--accent); }
.checkin-thumb.has-video {
  background: linear-gradient(135deg, #1a2a22, #0d3d28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.checkin-thumb.has-video::after {
  content: "▶";
  color: var(--accent);
  font-size: 1.1rem;
}
.checkin-owner {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.api-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(61, 255, 154, 0.15);
  color: var(--accent);
  margin-left: 0.35rem;
  vertical-align: middle;
}
.api-badge.off {
  background: rgba(255, 180, 60, 0.15);
  color: var(--warn, #ffb43c);
}
.person-card .status-pending {
  font-size: 0.75rem;
  color: var(--warn, #ffb43c);
}

/* —— EMOM cue —— */
.hold-cue-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.5rem;
  z-index: 5;
  position: relative;
}
.cue-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.cue-chip[aria-pressed="true"] {
  background: rgba(61, 255, 154, 0.25);
  border-color: var(--accent, #3dff9a);
  color: var(--accent, #3dff9a);
}
.cue-chip.muted-on {
  opacity: 0.65;
  border-color: rgba(255, 180, 60, 0.5);
  color: #ffb43c;
}
.emom-next {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}
.emom-flash {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  background: radial-gradient(circle at center, rgba(61, 255, 154, 0.45), rgba(61, 255, 154, 0.08) 45%, transparent 70%);
  animation: emomPulse 0.7s ease-out;
}
@keyframes emomPulse {
  0% { opacity: 0; transform: scale(0.96); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.04); }
}
.big-timer.emom-tick {
  animation: emomTimerFlash 0.55s ease-out;
}
@keyframes emomTimerFlash {
  0% { color: var(--accent, #3dff9a); text-shadow: 0 0 24px rgba(61, 255, 154, 0.8); transform: scale(1.06); }
  100% { color: inherit; text-shadow: none; transform: scale(1); }
}

/* —— Retention / account —— */
.retention-banner,
.retention-nudge {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 180, 60, 0.12);
  border: 1px solid rgba(255, 180, 60, 0.35);
  color: var(--text, #f2f2f2);
  font-size: 0.82rem;
  line-height: 1.35;
}
.retention-nudge.urgent,
.checkin-expiry.urgent {
  background: rgba(255, 90, 90, 0.14);
  border-color: rgba(255, 90, 90, 0.4);
}
.checkin-expiry {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffb43c;
}
.checkin-expiry.expired {
  color: var(--muted, #9aa0a6);
  font-weight: 500;
}
.checkin-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}
.checkin-actions .btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}
.btn-row.wrap {
  flex-wrap: wrap;
  gap: 0.4rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#local-download-hint {
  margin-top: 0.4rem;
}


/* ===================== v2: account bar, sheets, Circle today ===================== */

[hidden].account-bar,
.ab-pill[hidden],
.ab-login[hidden],
.soft-card[hidden],
.circle-today[hidden],
.sheet-overlay[hidden],
.auth-field[hidden],
.auth-error[hidden],
.circle-main[hidden],
.ct-empty[hidden],
.ct-error[hidden] {
  display: none !important;
}

.account-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -20px 8px;
  padding: calc(8px + var(--safe-t)) 20px 8px;
  background: rgba(11, 15, 20, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 440px) {
  .account-bar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
}

body.hold-active .account-bar { display: none; }

.ab-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: var(--text);
  font-family: inherit;
  padding: 4px 0;
  min-height: 44px;
  cursor: pointer;
}

.ab-word {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.btn.ab-login {
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.98rem;
  border-radius: 999px;
}

.ab-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 62%;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(61, 255, 154, 0.28);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.ab-pill:active { transform: scale(0.98); }

.ab-avatar,
.acct-avatar,
.ct-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.ab-avatar { width: 36px; height: 36px; font-size: 1rem; }

.ab-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.ab-small {
  font-size: 0.68rem;
  color: var(--faint);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ab-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-pill.offline .ab-small::after { content: " · offline"; color: var(--warn); }

.top-bar-spacer { flex: 1; }

/* Welcome */
.welcome { padding: 8vh 0 24px; }
.welcome-title {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 9vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.welcome-title span { color: var(--accent); }
.welcome .pitch { margin-bottom: 36px; }
.welcome-login { align-self: center; padding: 14px 0; }

/* Soft cards (save prompt, guest nudge, donation) */
.soft-card {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(61, 255, 154, 0.22);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 22px;
  text-align: left;
}
.result .soft-card { margin: 4px 0 0; }
.soft-card-title { margin: 0 0 6px; font-weight: 700; font-size: 1.02rem; }
.soft-card-body { margin: 0 0 14px; color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.soft-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.soft-card-actions .btn-sm { min-height: 48px; }
.soft-card-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 1.5rem;
  cursor: pointer;
}
.donate-card { border-color: rgba(255, 176, 32, 0.28); }
.donate-card .soft-card-title { padding-right: 30px; }

/* Circle today */
.circle-today {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  margin: 24px 0 24px;
}
.ct-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.ct-title { font-weight: 700; font-size: 1.02rem; }
.ct-date { color: var(--faint); font-size: 0.8rem; }
.ct-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ct-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
}
.ct-row:first-child { border-top: 0; }
.ct-avatar { width: 40px; height: 40px; font-size: 1rem; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(61, 255, 154, 0.25); }
.ct-row.me .ct-avatar { background: var(--accent); color: var(--accent-ink); }
.ct-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ct-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-sub { color: var(--faint); font-size: 0.8rem; }
.ct-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.ct-status.done { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(61, 255, 154, 0.35); }
.ct-status.pending { background: rgba(255, 255, 255, 0.04); color: var(--faint); border: 1px dashed rgba(255, 255, 255, 0.18); }
.ct-empty, .ct-error { margin: 2px 0 10px; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.ct-error { color: var(--warn); }
.ct-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ct-actions .btn-sm { min-height: 46px; }

/* Sheets */
body.sheet-open { overflow: hidden; }
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.62);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(16px + var(--safe-t)) 14px calc(24px + var(--safe-b));
  animation: fadeIn 0.18s ease;
}
.sheet {
  position: relative;
  max-width: 420px;
  margin: 4vh auto 0;
  background: var(--bg-elev);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 22px 20px 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.sheet-title { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -0.02em; padding-right: 40px; }
.sheet-sub { margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.seg-btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.active { background: var(--bg-card); color: var(--text); box-shadow: 0 0 0 1px rgba(61, 255, 154, 0.3); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.auth-hint { font-weight: 400; color: var(--faint); }
.text-input.auth-input {
  font-family: var(--font);
  font-size: 1.06rem; /* >=16px so iOS doesn't zoom */
  font-weight: 500;
}
.pw-wrap { position: relative; display: block; }
.pw-wrap .auth-input { padding-right: 76px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 40px;
  min-width: 60px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-dim);
  border: 1px solid rgba(255, 92, 106, 0.3);
  color: #ff9aa3;
  font-size: 0.92rem;
  line-height: 1.4;
}
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { align-self: center; padding: 10px 0; }
.auth-fine { margin: 0; color: var(--faint); font-size: 0.8rem; line-height: 1.4; text-align: center; }
.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-right: 40px; }
.acct-avatar { width: 56px; height: 56px; font-size: 1.4rem; }
.acct-id { min-width: 0; }
.acct-id .sheet-title { padding-right: 0; margin: 0; }
.acct-email { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; word-break: break-all; }
.acct-actions { display: flex; flex-direction: column; gap: 10px; }
.acct-actions .btn-danger { margin-top: 8px; align-self: center; min-height: 44px; }

/* ===================== v2: collapsible sections, settings groups, invites ===================== */
.fold[hidden], .invite-result[hidden] { display: none !important; }

.fold {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.fold-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 46px 0 18px;
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.fold-summary::-webkit-details-marker { display: none; }
.fold-summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s;
}
.fold[open] > .fold-summary::after { transform: translateY(-30%) rotate(-135deg); }
.fold-title { font-weight: 600; font-size: 1rem; }
.fold-meta {
  color: var(--faint);
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.fold-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 18px 18px;
}
.fold-body .field { gap: 8px; margin-top: 8px; }
.fold-body .danger-zone, .fold-body.danger-zone { border-top: 0; padding-top: 4px; }
#invite-details[open] { border-color: rgba(61, 255, 154, 0.28); }

.fold-inline { background: transparent; border: 0; border-radius: 0; margin-top: 4px; }
.fold-inline .fold-summary { min-height: 48px; padding-left: 0; }
.fold-inline .fold-title { font-size: 0.92rem; color: var(--muted); }
.fold-inline .fold-body { padding: 0 0 4px; }

.settings-panel { gap: 22px; }
.settings-group { display: flex; flex-direction: column; gap: 10px; }
.settings-group-title {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.settings-card .reminder-row { margin-top: 0; justify-content: space-between; }
.settings-card .field-status { margin-top: 0; }

.invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.invite-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.invite-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.invite-who { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-status {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.invite-status.pending { color: var(--warn); border-color: rgba(255, 176, 32, 0.35); background: rgba(255, 176, 32, 0.1); }
.invite-status.accepted { color: var(--accent); border-color: rgba(61, 255, 154, 0.35); background: var(--accent-dim); }
.invite-status.expired { color: var(--faint); }
.invite-meta { color: var(--faint); font-size: 0.8rem; }
.invite-link {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-actions .btn-sm { min-height: 44px; flex: 1 1 auto; }
.invite-actions .btn-revoke { flex: 0 0 auto; background: transparent; color: var(--danger); border: 1px solid rgba(255, 92, 106, 0.3); }

/* Share the app (distinct from Circle invites) */
.share-app-row { margin-top: 28px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.share-app-btn { width: 100%; }
.share-app-note { margin: 0; text-align: center; color: var(--faint); font-size: 0.78rem; }
.circle-main { display: flex; flex-direction: column; gap: 14px; }
.circle-main > .field { margin-top: 8px; }

/* Skip-baseline path: choice cards, steppers, quick start */
.start-lead { margin: 8px 0 18px; color: var(--muted); font-size: 1.05rem; }
.choice-stack { display: flex; flex-direction: column; gap: 14px; }
.choice-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
  min-height: 112px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.choice-card:first-child { border-color: rgba(61, 255, 154, 0.35); }
.choice-card:active { transform: scale(0.99); }
.choice-title { font-size: 1.15rem; font-weight: 700; }
.choice-body { color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.setup-panel { gap: 24px; }
.stepper {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 10px;
}
.stepper-btn {
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.stepper-btn:active { transform: scale(0.96); background: var(--bg-card); }
.stepper-val {
  text-align: center;
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.quick-start { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.quick-start[hidden], .qs-picker[hidden] { display: none !important; }
.quick-start-btn { justify-content: space-between; width: 100%; }
.qs-time { font-family: var(--mono); color: var(--accent); }
.qs-change { align-self: center; padding: 10px 0; font-size: 0.9rem; }
.qs-picker { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--line); }
.btn-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Exercise picker (built-ins + Free workout) ---------- */
.ex-picker { display: flex; flex-direction: column; gap: 10px; }
.ex-picker .chip.ex-free::before { content: "✦ "; opacity: 0.8; }
.free-ex { display: flex; flex-direction: column; gap: 8px; }
.free-ex[hidden] { display: none; }
.free-ex-label { font-size: 0.82rem; color: var(--muted); }
.free-ex-recent-label { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.free-ex-recent .chip { text-transform: none; }
.prep-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  max-width: 100%;
}
.prep-badge-btn #session-exercise-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.85rem;
}
.prep-badge-change {
  font-size: 0.68rem;
  opacity: 0.75;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.session-ex-wrap[hidden] { display: none; }

/* ---------- Custom prompts: My prompts + What's on your mind ---------- */
.mind-slot { margin: 4px 0; }
.mind-card .fold-body { display: flex; flex-direction: column; gap: 10px; }
.mind-form, .mp-add { display: flex; gap: 8px; align-items: stretch; }
.mind-form .text-input, .mp-add .text-input { flex: 1; min-width: 0; }
.mind-form .btn, .mp-add .btn { flex: 0 0 auto; width: auto; padding-left: 14px; padding-right: 14px; }
.mind-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; line-height: 1.35; }
.mind-result[hidden] { display: none; }
.mind-result { display: flex; flex-direction: column; gap: 10px; }
.my-prompts-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.my-prompts-hint[hidden] { display: none; }
.care-note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  border-left: 3px solid rgba(61, 255, 154, 0.35);
  padding: 6px 0 6px 10px;
  margin: 2px 0;
}
.care-note[hidden] { display: none; }
.care-note a { color: var(--accent); font-weight: 600; }
.care-note.urgent { color: var(--text); border-left-color: #ffb547; background: rgba(255, 181, 71, 0.08); border-radius: 0 10px 10px 0; padding-right: 10px; }
#prompts-sheet .sheet { display: flex; flex-direction: column; gap: 12px; max-height: 88vh; overflow-y: auto; }
.mp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mp-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-elev); }
.mp-text { font-size: 0.95rem; line-height: 1.4; overflow-wrap: anywhere; }
.mp-actions { display: flex; gap: 16px; justify-content: flex-end; }
.mp-edit-form { display: flex; flex-direction: column; gap: 6px; }
.mp-empty, .mp-sync { font-size: 0.85rem; color: var(--muted); margin: 0; }
.mp-empty[hidden], #mp-use[hidden] { display: none; }
