:root {
  /* Dustin-approved Talk It Out palette */
  --blue: #0a2744;          /* deep blue — trust, steadiness, safety */
  --blue2: #123a5c;
  --blue3: #1a4d73;
  --amber: #f0a020;         /* warm amber — Talk button, hope */
  --amber2: #d4890a;
  --amber-ink: #1a1200;
  --emerald: #1f9a6a;       /* emerald — growth, renewal accents */
  --emerald2: #157a54;
  --black: #0a0a0a;         /* depth underneath */
  --cream: #f5f0e6;
  --ink: #0a0a0a;
  --red: #b91c1c;           /* crisis only */
  --card: #0d2036;
  --outline: #000000;
  --shadow: 4px 4px 0 #000;
  --shadow-lg: 6px 6px 0 #000;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: "Arial Black", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle, transparent 45%, rgba(0,0,0,0.18) 46%) 0 0 / 6px 6px,
    linear-gradient(180deg, var(--blue3) 0%, var(--blue) 45%, var(--black) 100%);
  background-attachment: fixed;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
body {
  /* softer body text readable over brutalist display face */
  font-family: Montserrat, system-ui, sans-serif;
}
a { color: var(--amber); font-weight: 700; }
h1, h2 {
  font-family: "Arial Black", Impact, Haettenschweiler, sans-serif;
  color: var(--amber);
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000;
}

.app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

/* Always-visible crisis bar — high contrast, big taps */
.crisis {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--red);
  border-bottom: 4px solid #000;
  margin: 0 -16px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 0 #000;
}
.crisis a {
  color: #fff;
  text-decoration: none;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: #000;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  white-space: nowrap;
}
.crisis a:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0,0,0,0.35); }
.crisis span { color: #fff; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 10px;
}
.brand img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 3px solid #000;
  box-shadow: var(--shadow);
  background: var(--blue2);
}
.brand h1 {
  font-size: 1.45rem;
  line-height: 1.05;
}
.brand small {
  display: block;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--emerald);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: none;
  margin-top: 4px;
}

.disclaimer {
  font-family: Montserrat, sans-serif;
  font-size: 0.8rem;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 3px solid #000;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.disclaimer strong { color: var(--amber); }

/* Home / idle */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 10px 0 24px;
}
.home .tag {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  margin: 0;
  color: var(--cream);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 0.02em;
}
.home .sub {
  font-family: Montserrat, sans-serif;
  opacity: 0.95;
  margin: 0;
  font-size: 1rem;
  max-width: 320px;
  font-weight: 600;
}
.home .privacy {
  font-family: Montserrat, sans-serif;
  font-size: 0.82rem;
  opacity: 0.85;
  margin: 4px 0 10px;
  max-width: 340px;
}

/* Comic slab Talk button */
.talk-btn {
  width: 180px;
  height: 180px;
  border-radius: 18px;
  border: 4px solid #000;
  background:
    radial-gradient(circle, transparent 40%, rgba(0,0,0,0.12) 41%) 0 0 / 5px 5px,
    linear-gradient(160deg, #ffb84d 0%, var(--amber) 45%, var(--amber2) 100%);
  color: var(--amber-ink);
  font-family: "Arial Black", Impact, sans-serif;
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.talk-btn:hover, .talk-btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #000;
  outline: none;
}
.talk-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}
.talk-btn[disabled] { opacity: 0.6; cursor: wait; }

.install-hint {
  font-family: Montserrat, sans-serif;
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 8px;
}

.wfp-link {
  font-family: Montserrat, sans-serif;
  font-size: 0.82rem;
  margin-top: 12px;
}
.wfp-link a {
  color: var(--emerald);
  border-bottom: 2px solid var(--emerald);
  text-decoration: none;
}

/* Session screen */
.session {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding-bottom: 8px;
}
.session.active { display: flex; }
.home.hidden { display: none; }

.status {
  text-align: center;
  font-family: Montserrat, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--amber);
  min-height: 1.4em;
  text-shadow: 1px 1px 0 #000;
}
.status.listening { color: #5dffb0; }
.status.thinking { color: var(--amber); }
.status.speaking { color: #7ec8ff; }

.pulse {
  width: 76px;
  height: 76px;
  margin: 4px auto;
  border-radius: 12px;
  border: 3px solid #000;
  background:
    radial-gradient(circle, transparent 40%, rgba(0,0,0,0.2) 41%) 0 0 / 4px 4px,
    var(--blue2);
  position: relative;
  box-shadow: var(--shadow);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 8px;
  background: var(--emerald);
  border: 2px solid #000;
  opacity: 0.85;
}
.session.listening .pulse::after {
  background: #5dffb0;
  animation: pulse 1.2s ease-in-out infinite;
}
.session.speaking .pulse::after {
  background: #7ec8ff;
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.88); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.transcript {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 3px solid #000;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  min-height: 160px;
  max-height: 42vh;
  -webkit-overflow-scrolling: touch;
}
.bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: Montserrat, sans-serif;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
}
.bubble.you {
  align-self: flex-end;
  background: var(--blue3);
}
.bubble.them {
  align-self: flex-start;
  background: #0f2f22;
  border-color: #000;
}
.bubble .who {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bubble.them .who { color: var(--emerald); }

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border: 3px solid #000;
  border-radius: 10px;
  padding: 14px 20px;
  min-height: 48px;
  font-family: "Arial Black", Impact, sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}
.btn-gold {
  background: linear-gradient(160deg, #ffb84d, var(--amber));
  color: var(--amber-ink);
}
.btn-outline {
  background: var(--blue2);
  color: var(--cream);
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fallback {
  display: none;
  gap: 8px;
  margin-top: 4px;
}
.fallback.show { display: flex; }
.fallback input {
  flex: 1;
  padding: 14px;
  min-height: 48px;
  border-radius: 10px;
  border: 3px solid #000;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.footer-note {
  text-align: center;
  font-family: Montserrat, sans-serif;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 8px;
}

/* Emerald accent chip */
.accent-chip {
  display: inline-block;
  background: var(--emerald);
  color: #fff;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 #000;
}
