/* Still Here — calm, mobile-first */
:root {
  --bg: #f4f1ea;
  --bg-card: #fffcf6;
  --ink: #2c2a26;
  --ink-muted: #6b6560;
  --ok: #2d6a4f;
  --ok-bg: #d8f3dc;
  --waiting: #b08900;
  --waiting-bg: #fff3cd;
  --missed: #9b2226;
  --missed-bg: #fde8e8;
  --asleep: #3d5a80;
  --asleep-bg: #e0e7ef;
  --call: #7c2d12;
  --call-bg: #ffedd5;
  --urgent: #b42318;
  --urgent-bg: #fee4e2;
  --soft-call: #176b87;
  --soft-call-bg: #d9f0f4;
  --btn-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem calc(1.5rem + var(--safe-bottom));
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

header.app-header {
  text-align: center;
  padding-top: 0.5rem;
}

header.app-header .brand {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

header.app-header h1 {
  margin: 0.35rem 0 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  align-self: center;
}

.status-pill .dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: currentColor;
}

.status-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.status-waiting {
  background: var(--waiting-bg);
  color: var(--waiting);
}
.status-missed {
  background: var(--missed-bg);
  color: var(--missed);
}
.status-asleep {
  background: var(--asleep-bg);
  color: var(--asleep);
}
.status-needs_call {
  background: var(--urgent-bg);
  color: var(--urgent);
  border: 2px solid currentColor;
}
.status-wants_call {
  background: var(--soft-call-bg);
  color: var(--soft-call);
}
.status-calling {
  background: var(--soft-call-bg);
  color: var(--soft-call);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta {
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.meta strong {
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex: 1;
  justify-content: center;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 18px;
  padding: 1.35rem 1.25rem;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.08s ease, filter 0.15s;
  width: 100%;
  text-align: center;
  color: #fff;
  min-height: 4.5rem;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-ok {
  background: var(--ok);
  font-size: 1.75rem;
  min-height: 5.5rem;
  padding: 1.6rem 1.25rem;
}

.btn-bed {
  background: var(--asleep);
}

.btn-awake {
  background: var(--ok);
  font-size: 1.75rem;
  min-height: 5.5rem;
}

.btn-call {
  background: var(--call);
  font-size: 1.25rem;
  min-height: 3.75rem;
}

.btn-call-soft {
  background: var(--soft-call);
  font-size: 1.15rem;
  min-height: 3.5rem;
}

.btn-secondary {
  background: #5c574f;
  font-size: 1rem;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  box-shadow: none;
  font-size: 0.95rem;
  min-height: auto;
  padding: 0.6rem;
  text-decoration: underline;
}

.flash {
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.flash.show {
  opacity: 1;
}

.flash.call {
  background: var(--call-bg);
  color: var(--call);
}

.call-confirmation {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--urgent);
  border-radius: 14px;
  background: var(--urgent-bg);
  color: var(--urgent);
  font-size: 1rem;
  line-height: 1.35;
}

.call-confirmation.soft {
  border-color: var(--soft-call);
  background: var(--soft-call-bg);
  color: var(--soft-call);
}

[hidden] {
  display: none !important;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  padding-top: 0.5rem;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--ink-muted);
}

.watcher-status-big {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  margin: 0.25rem 0;
}

.watcher-status-big .label {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.watcher-status-big .sub {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  opacity: 0.9;
}

.watcher-status-big.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.watcher-status-big.waiting {
  background: var(--waiting-bg);
  color: var(--waiting);
}
.watcher-status-big.missed {
  background: var(--missed-bg);
  color: var(--missed);
}
.watcher-status-big.asleep {
  background: var(--asleep-bg);
  color: var(--asleep);
}
.watcher-status-big.needs_call {
  background: var(--urgent-bg);
  color: var(--urgent);
  border: 3px solid currentColor;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.watcher-status-big.wants_call {
  background: var(--soft-call-bg);
  color: var(--soft-call);
  border: 3px solid currentColor;
  box-shadow: 0 0 0 4px rgba(23, 107, 135, 0.12);
}

.watcher-status-big.calling-soft {
  background: var(--soft-call-bg);
  color: var(--soft-call);
  border: 3px solid currentColor;
  box-shadow: 0 0 0 4px rgba(23, 107, 135, 0.12);
}

.watcher-status-big.calling-urgent {
  background: var(--urgent-bg);
  color: var(--urgent);
  border: 3px solid currentColor;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.watcher-status-big.calling {
  background: var(--soft-call-bg);
  color: var(--soft-call);
  border: 3px solid currentColor;
  box-shadow: 0 0 0 4px rgba(23, 107, 135, 0.12);
}

.call-alert {
  padding: 1.25rem;
  border: 3px solid var(--urgent);
  border-radius: var(--radius);
  background: var(--urgent-bg);
  color: var(--urgent);
  box-shadow: 0 5px 0 rgba(180, 35, 24, 0.18);
}

.call-alert-heading {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.call-alert p {
  margin: 0.45rem 0 1rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.call-alert.soft {
  border-color: var(--soft-call);
  background: var(--soft-call-bg);
  color: var(--soft-call);
  box-shadow: 0 5px 0 rgba(23, 107, 135, 0.18);
}

.call-alert-actions {
  display: grid;
  gap: 0.65rem;
}

.ack-state {
  display: block;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
}

.call-alert-actions .btn {
  min-height: 3.6rem;
  padding: 1rem;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
}

.event-list li:last-child {
  border-bottom: none;
}

.event-list .time {
  color: var(--ink-muted);
  white-space: nowrap;
  font-size: 0.85rem;
}

.schedule-form {
  display: grid;
  gap: 0.75rem;
}

.schedule-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.schedule-form input,
.schedule-form select {
  font-size: 1.1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ddd6c8;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 1rem;
}

@media (min-width: 480px) {
  .shell {
    padding-top: 2rem;
  }
}
/* Still Here soft-call asset refresh: 2026-09-18 */

/* Pilot: calm check-in hint */
.calm-hint {
  margin: 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.watcher-status-big.wake-overdue {
  background: var(--missed-bg);
  color: var(--missed);
  border: 3px solid currentColor;
  box-shadow: 0 0 0 4px rgba(155, 34, 38, 0.12);
}

.alert-arm {
  border: 2px solid #ddd6c8;
}

.alert-arm.armed {
  border: 2px solid #a7c4a0;
  background: #f3f8f2;
}

.alert-arm.alarming {
  border: 3px solid var(--urgent);
  background: var(--urgent-bg);
}

.alert-arm.alarming h2,
.alert-arm.alarming .meta {
  color: var(--urgent);
}

.btn-alert-arm {
  background: var(--urgent);
  font-size: 1.2rem;
  min-height: 3.6rem;
  margin-top: 0.35rem;
}

.alert-arm.alarming .btn-alert-arm {
  font-size: 1.45rem;
  min-height: 4.5rem;
}


/* Phase-1 alerts: emergency / attention / Call now */
.btn-emergency {
  background: var(--urgent);
  font-size: 1.35rem;
  min-height: 4.25rem;
  border: 3px solid #7f1d1d;
  box-shadow: 0 5px 0 rgba(127, 29, 29, 0.35);
}

.call-alert.emergency {
  border-color: var(--urgent);
  background: var(--urgent-bg);
  color: var(--urgent);
  animation: emergency-pulse 1.4s ease-in-out infinite;
}

.call-alert.attention {
  border-color: var(--missed);
  background: var(--missed-bg);
  color: var(--missed);
  box-shadow: 0 5px 0 rgba(155, 34, 38, 0.18);
}

@keyframes emergency-pulse {
  0%, 100% { box-shadow: 0 5px 0 rgba(180, 35, 24, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.22), 0 5px 0 rgba(180, 35, 24, 0.18); }
}

.btn-call-now,
.call-alert-actions .btn-call {
  font-size: 1.45rem;
  min-height: 4.5rem;
  font-weight: 800;
  order: -1;
}

.btn-call-now-urgent,
.call-alert.emergency .btn-call-now {
  background: var(--urgent);
  border: 3px solid #7f1d1d;
  animation: call-now-glow 1.2s ease-in-out infinite;
}

@keyframes call-now-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.call-alert-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.call-confirmation.emergency {
  border-color: var(--urgent);
  background: var(--urgent-bg);
  color: var(--urgent);
  border-width: 3px;
}

/* Still Here phase-1 alerts: 2026-09-30 */

/* v0.3.0 — role switch; arm banner stays hidden (alerts auto-start) */
.alert-arm {
  display: none !important;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--bg-card);
  border: 2px solid #d9d3c7;
  border-radius: 999px;
}

.role-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
  background: transparent;
}

.role-switch-btn.active {
  background: var(--ok);
  color: #fff;
}

.role-switch[data-role="watcher"] .role-switch-btn.active {
  background: var(--asleep);
  color: #fff;
}

.setup-divider {
  margin: 1.25rem 0 0.75rem;
  border-top: 1px solid #e7e1d4;
  padding-top: 1rem;
}
.push-card .actions { flex: 0; margin-top: 0.5rem; }
.paywall-links { margin-top: 1rem; }
.paywall-links input { width: 100%; }

/* 0.6.1 permanent push control ("Turn on alerts" / "Turn on reminders") */
.push-card { border-left: 4px solid var(--asleep, #2d6a4f); }
.push-card[data-state="on"] { border-left-color: var(--ok, #2d6a4f); }
.push-card[data-state="denied"],
.push-card[data-state="error"],
.push-card[data-state="unavailable"] { border-left-color: #b42318; }
.push-card .push-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.push-card .push-error { color: #b42318; font-weight: 600; word-break: break-word; margin-top: 0.25rem; }
.push-card .push-warn { color: #8a4b00; font-weight: 600; margin-top: 0.25rem; }
.push-card .btn-linkish { background: none; border: 0; color: #6b705c; text-decoration: underline; font: inherit; padding: 0.5rem; cursor: pointer; }
.push-card.push-compact { padding-top: 0.6rem; padding-bottom: 0.6rem; }
.push-card.push-compact h2 { font-size: 1rem; margin-bottom: 0.25rem; }
