/* HelpMe vanilla-a — warm charcoal · diya-glow · 375px mobile-first */
:root {
  --bg: #1a1714;
  --bg-elev: #24201c;
  --cream: #f3e6d0;
  --cream-dim: #c9b89a;
  --gold: #e8c47a;
  --gold-soft: #d4a84b;
  --diya: #ffd27a;
  --strip: #2e2822;
  --danger: #c43c2c;
  --safe: #3d6b4f;
  --chip: #3a342c;
  --gap: 16px;
  --hit: 80px;
  --hit-min: 72px;
  --radius: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--cream);
  font-family: var(--font); font-size: 18px; line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--gold); }

.app {
  max-width: 375px; min-height: 100vh; margin: 0 auto;
  display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 28%, #2a2218 0%, var(--bg) 62%);
  position: relative;
}

/* Honesty strip — permanent, non-dismissible */
.demo-strip {
  position: sticky; top: 0; z-index: 50;
  background: var(--strip); color: var(--cream);
  padding: 10px 12px; text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  border-bottom: 1px solid #4a4034;
  display: flex; flex-direction: column; gap: 2px;
}
.demo-strip .sim-speed { font-weight: 500; font-size: 11px; color: var(--cream-dim); }

.main {
  flex: 1; display: flex; flex-direction: column;
  padding: 12px 16px 8px; min-height: 0;
}

/* Orb */
.orb-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  min-height: 220px;
}
.orb {
  width: 148px; height: 148px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff6df 0%, var(--diya) 28%, var(--gold-soft) 58%, #8a5a20 100%);
  box-shadow:
    0 0 28px rgba(255, 210, 122, 0.45),
    0 0 64px rgba(212, 168, 75, 0.25),
    inset 0 -8px 20px rgba(80, 40, 10, 0.35);
  position: relative; touch-action: none;
  transition: box-shadow 0.4s ease, transform 0.3s ease;
}
.orb::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 3px solid transparent;
}
.orb.listening { animation: breathe 3.6s ease-in-out infinite; }
.orb.idle { animation: breathe 4.8s ease-in-out infinite; opacity: 0.92; }
.orb.connecting { box-shadow: 0 0 36px rgba(255, 210, 122, 0.55); }
.orb.thinking {
  animation: pulse 1.4s ease-in-out infinite;
  background: radial-gradient(circle at 40% 35%, #ffe8b0 0%, #c9a05a 55%, #6a4818 100%);
}
.orb.speaking {
  box-shadow: 0 0 40px rgba(255, 220, 140, 0.65), 0 0 80px rgba(232, 196, 122, 0.3);
}
.orb.error {
  background: radial-gradient(circle at 40% 35%, #f0c0a0 0%, #a05040 60%, #4a2018 100%);
  box-shadow: 0 0 24px rgba(196, 60, 44, 0.35);
}
.orb.holding::after {
  border-color: var(--gold);
  animation: ring 2s linear forwards;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 28px rgba(255, 210, 122, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 0 48px rgba(255, 210, 122, 0.55); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(0.96); opacity: 1; }
}
@keyframes ring {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .orb.listening, .orb.idle, .orb.thinking { animation: none; }
}

.orb-status {
  text-align: center; color: var(--cream-dim); font-size: 15px; min-height: 2.6em;
  max-width: 300px;
}
.spoken-line {
  text-align: center; color: var(--cream); font-size: 17px; max-width: 300px;
  min-height: 1.4em;
}

/* Bottom nav — ≤3 home */
.nav {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: var(--bg-elev); border-top: 1px solid #3a342c;
}
.nav button {
  min-height: var(--hit); border-radius: var(--radius);
  background: var(--chip); color: var(--cream);
  font-size: 15px; font-weight: 650; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.nav button.active { outline: 2px solid var(--gold); background: #3f362c; }
.nav button.help-nav {
  background: linear-gradient(180deg, #5a3028 0%, #3a1e1a 100%);
  color: #ffe8e0; outline: 1px solid #8a4034;
}
.nav .hi { font-size: 12px; font-weight: 500; color: var(--cream-dim); }

/* Settings gear — caregiver door */
.settings-btn {
  position: absolute; top: 58px; right: 10px; z-index: 40;
  width: 44px; height: 44px; border-radius: 12px;
  background: transparent; color: var(--cream-dim); font-size: 20px;
}

/* Panels */
.panel { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: auto; }
.panel.active { display: flex; }

.disclosure {
  background: #3a2a18; border: 1px solid var(--gold-soft); border-radius: 12px;
  padding: 12px; margin-bottom: 12px; font-size: 15px; text-align: center;
}

.help-actions {
  display: flex; flex-direction: column; gap: var(--gap); margin-top: auto; padding-top: 12px;
}
.btn {
  min-height: var(--hit); border-radius: var(--radius); padding: 12px 16px;
  font-size: 18px; font-weight: 700; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.btn .hi { font-size: 14px; font-weight: 500; opacity: 0.85; }
.btn-primary { background: var(--chip); color: var(--cream); border: 1px solid #564a3c; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-safe { background: var(--safe); color: #e8f5ec; }
.btn-ghost { background: transparent; border: 1px solid #564a3c; color: var(--cream-dim); min-height: var(--hit-min); }
.btn:disabled { opacity: 0.45; }

.scenario-list { display: flex; flex-direction: column; gap: 12px; }
.scenario-card {
  min-height: var(--hit-min); border-radius: 16px; padding: 14px 16px;
  background: var(--bg-elev); border: 1px solid #3a342c; text-align: left;
}
.scenario-card strong { display: block; font-size: 18px; }
.scenario-card .meta { font-size: 13px; color: var(--cream-dim); margin-top: 4px; }

.gate-timer {
  font-size: 42px; font-weight: 700; text-align: center; color: var(--gold);
  margin: 12px 0;
}
.progress-bar {
  height: 8px; background: #3a342c; border-radius: 4px; overflow: hidden; margin: 8px 0 16px;
}
.progress-bar > i { display: block; height: 100%; background: var(--gold); width: 0%; transition: width 0.2s linear; }

.intake label { display: block; margin: 8px 0 4px; font-size: 15px; color: var(--cream-dim); }
.intake textarea, .intake input, .pin-input, .settings-panel input {
  width: 100%; min-height: 56px; border-radius: 12px; border: 1px solid #564a3c;
  background: #12100e; color: var(--cream); padding: 12px; margin-bottom: 12px;
}
.intake textarea { min-height: 88px; resize: vertical; }

.card {
  background: var(--bg-elev); border: 1px solid #3a342c; border-radius: 16px;
  padding: 14px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 8px; font-size: 18px; color: var(--gold); }
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  background: #4a3a20; color: var(--gold); padding: 3px 8px; border-radius: 999px;
  margin: 2px 4px 2px 0; text-transform: uppercase;
}
.agency-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid #2e2822; font-size: 15px;
}
.agency-row:last-child { border-bottom: none; }

.board-thin {
  margin-top: 8px; padding: 10px 12px; border-radius: 12px;
  background: #141210; border: 1px dashed #4a4034; font-size: 13px;
}
.board-thin h3 { margin: 0 0 8px; font-size: 14px; color: var(--cream-dim); font-weight: 600; }
.board-thin li { margin: 6px 0; color: var(--cream-dim); }
.board-thin li.done { color: var(--cream); }

.coach { font-size: 16px; margin: 10px 0; padding: 10px; background: #221c16; border-radius: 12px; }

.people-list { display: flex; flex-direction: column; gap: 12px; }
.person {
  background: var(--bg-elev); border-radius: 16px; padding: 14px; border: 1px solid #3a342c;
}
.person .rel { font-size: 13px; color: var(--cream-dim); }
.person .plan { font-size: 14px; margin-top: 8px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%; max-width: 375px; background: var(--bg-elev);
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
}
.modal h2 { margin: 0 0 12px; font-size: 20px; }
.footer-proto {
  text-align: center; font-size: 11px; color: #7a6e5e; padding: 8px 12px 4px;
}

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
