:root {
  --bg: #0F1115;
  --surface: #171A21;
  --surface-raised: #1F232C;
  --border: #262B36;
  --text: #EDEFF3;
  --text-muted: #9AA3B2;
  --accent: #34D399;
  --accent-dim: #1E3A2F;
  --accent-text: #062015;
  --streak: #F59E0B;
  --danger-muted: #B4656F;
  --radius: 14px;
  --radius-btn: 12px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

body.app {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.col {
  width: 100%;
  max-width: 560px;
  padding: 24px 20px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Typography */
.title { font-size: 24px; font-weight: 600; line-height: 32px; margin-bottom: 16px; }
.display { font-size: 32px; font-weight: 700; line-height: 40px; }

/* Landing page cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
}
.benefit-title { font-size: 20px; font-weight: 600; line-height: 28px; margin-bottom: 8px; }
.benefit-body { font-size: 17px; line-height: 26px; color: var(--text-muted); }

/* Inputs */
.textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 16px;
  min-height: 120px;
  resize: vertical;
  width: 100%;
}
.textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.textarea::placeholder { color: var(--text-muted); }

.clarify {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: 17px;
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 17px;
  font-weight: 600;
  height: 56px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:active { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 17px;
  font-weight: 600;
  height: 56px;
  width: 100%;
  cursor: pointer;
}
.btn-secondary:active { background: var(--surface); }
.btn-secondary:disabled { opacity: 0.4; }

.btn-ghost {
  background: none;
  border: none;
  color: var(--danger-muted);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  padding: 8px 0;
  width: 100%;
  text-align: center;
}

/* Session screen */
.session-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 16px;
}

.step-label {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.step-text {
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  max-width: 480px;
}

.timer {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.session-buttons {
  width: 100%;
  max-width: 560px;
  padding: 0 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: max(32px, env(safe-area-inset-bottom, 16px));
}

/* Stuck overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-raised);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-content {
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.overlay-message {
  font-size: 17px;
  line-height: 26px;
}

.overlay-action {
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  color: var(--accent);
}

.overlay-split-note {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

/* Wrap screen */
.wrap-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 20px;
  text-align: center;
}

.wrap-title { font-size: 24px; font-weight: 600; line-height: 32px; }
.wrap-stats { font-size: 17px; color: var(--text-muted); }

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--streak);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Login screen */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.email-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 0 16px;
  height: 56px;
  width: 100%;
  max-width: 360px;
}
.email-input:focus {
  outline: none;
  border-color: var(--accent);
}
.email-input::placeholder { color: var(--text-muted); }

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
