/* ═══════════════════════════════════════════════════════════
   TalkStory v1 — voice Q&A FAB + modal
   Scoped to .hg-ts-* so nothing leaks into page content.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Brand greens — canonical Kauai green from the site palette so the
     pill reads as native Hawaii Guide chrome rather than a bolted-on widget.
     (Variable kept named --hg-ts-ocean so the rest of the file stays untouched
     during the recolor; rename in a follow-up cleanup if it bothers anyone.) */
  --hg-ts-ocean: #1D9771;
  --hg-ts-ocean-dark: #156d52;
  --hg-ts-ocean-light: #3eb293;
  --hg-ts-accent: #F27A24;
  --hg-ts-ink: #1a1d21;
  --hg-ts-muted: #67707a;
  --hg-ts-panel: #ffffff;
  --hg-ts-panel-soft: #f4f6f9;
  --hg-ts-border: #dde3ea;
}

/* ── FAB launcher (right-side, sits where the Shaka FAB used to live —
   the Shaka FAB has been bumped up to 230px to make room) ───────────── */
.hg-ts-fab {
  position: fixed;
  bottom: 160px;
  right: 16px;
  z-index: 9992;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  min-height: 52px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hg-ts-ocean) 0%, var(--hg-ts-ocean-dark) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.hg-ts-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.32);
}
.hg-ts-fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.hg-ts-fab-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  flex: 0 0 auto;
}
.hg-ts-fab-icon svg { width: 14px; height: 14px; fill: #fff; }
.hg-ts-fab-label { white-space: nowrap; }

/* Subtle breathing pulse so the button draws the eye without being annoying. */
.hg-ts-fab::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(29, 151, 113, 0.5);
  opacity: 0;
  pointer-events: none;
  animation: hg-ts-breathe 3s ease-in-out infinite;
}
@keyframes hg-ts-breathe {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.hg-ts-fab.is-open::before { animation: none; }

/* ── Backdrop ─────────────────────────────────────────────────────── */
.hg-ts-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  /* Max-int z-index so the backdrop covers the site nav toolbar
     (geo-toolbar sits at ~10000) and the Raptive sticky footer ad. */
  z-index: 2147483646;
}
.hg-ts-backdrop.is-active { opacity: 1; pointer-events: auto; }

/* ── Modal ────────────────────────────────────────────────────────── */
/* Centered both axes so it reads as a focused tool rather than an
   ad-adjacent popup. Mobile media query below pins it to the bottom
   sheet pattern, which is the right native behavior on small screens. */
.hg-ts-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 20px));
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  background: var(--hg-ts-panel);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  /* Max-int z-index so the modal stacks above the site nav toolbar
     and the Raptive/Varicent sticky footer ad on mobile. Matches the
     Concierge modal (.hgcm-overlay) which uses the same value. */
  z-index: 2147483647;
  /* Bumped from 16 → 17 px for older readers — site CLAUDE.md target is
     17-19px body text. Headings and bubbles bumped proportionally below. */
  font-size: 17px;
  color: var(--hg-ts-ink);
  line-height: 1.5;
}
.hg-ts-modal.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

/* ── Header ───────────────────────────────────────────────────────── */
/* Two-row layout: top row pairs the parent-brand HawaiiGuide logo on the
   left with the modal controls (voice toggle, hands-free, close) on the
   right. Title + sub get their own breathing room below, so the product
   name "Talk Story" is the visual focal point of the modal header. */
.hg-ts-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 14px;
  background: linear-gradient(135deg, var(--hg-ts-ocean) 0%, var(--hg-ts-ocean-dark) 100%);
  color: #fff;
}
.hg-ts-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hg-ts-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.hg-ts-header-logo {
  flex: 0 0 auto;
  height: 28px;
  width: auto;
  display: block;
}
@media (max-width: 480px) {
  .hg-ts-header-logo { height: 24px; }
}
.hg-ts-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hg-ts-header-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
}
.hg-ts-header-sub {
  display: block;
  font-size: 14px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 1px;
}
.hg-ts-voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 3px 3px 3px 10px;
  margin-right: 4px;
}
.hg-ts-voice-toggle-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-right: 2px;
  white-space: nowrap;
}
.hg-ts-voice-toggle button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.hg-ts-voice-toggle button.is-active {
  background: #fff;
  color: var(--hg-ts-ocean-dark);
}
@media (max-width: 420px) {
  .hg-ts-voice-toggle { padding-left: 6px; }
  .hg-ts-voice-toggle-label { display: none; }
}
.hg-ts-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.hg-ts-close:hover { background: rgba(255,255,255,0.18); }

/* ── Hands-free toggle ───────────────────────────────────────────── */
/* Sits between the voice toggle and the close X. Off by default. When on,
   the modal auto-restarts the mic 1.5s after each answer finishes playing
   (with a visible countdown the user can cancel). */
.hg-ts-handsfree-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
}
.hg-ts-handsfree-btn:hover { background: rgba(255,255,255,0.26); }
.hg-ts-handsfree-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  opacity: 0.85;
}
.hg-ts-handsfree-btn[aria-pressed="true"] {
  background: #fff;
}
.hg-ts-handsfree-btn[aria-pressed="true"] svg {
  fill: var(--hg-ts-ocean-dark);
  opacity: 1;
}
/* Pulse the active state subtly so users notice it's on. */
.hg-ts-handsfree-btn[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  animation: hg-ts-hf-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
.hg-ts-handsfree-btn { position: relative; }
@keyframes hg-ts-hf-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.18); opacity: 0; }
}

/* ── Transcript (scrolling chat area) ─────────────────────────────── */
.hg-ts-transcript {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background: var(--hg-ts-panel-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 50vh;
}
.hg-ts-transcript:empty::before {
  content: attr(data-empty-hint);
  display: block;
  text-align: center;
  color: var(--hg-ts-muted);
  font-size: 16px;
  padding: 24px 12px;
  margin: auto;
}
.hg-ts-bubble {
  max-width: 92%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 17px;
  line-height: 1.55;
  word-wrap: break-word;
}
.hg-ts-bubble.is-user {
  align-self: flex-end;
  background: var(--hg-ts-ocean);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.hg-ts-bubble.is-assistant {
  align-self: flex-start;
  background: #fff;
  color: var(--hg-ts-ink);
  border: 1px solid var(--hg-ts-border);
  border-bottom-left-radius: 4px;
}
.hg-ts-bubble.is-error {
  background: #fff5f5;
  border-color: #f7c9c9;
  color: #8a1f1f;
}
.hg-ts-bubble-audio {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--hg-ts-border);
}
.hg-ts-bubble-audio audio {
  width: 100%;
  height: 32px;
}
.hg-ts-citations {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.hg-ts-citation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--hg-ts-panel-soft);
  border: 1px solid var(--hg-ts-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--hg-ts-ink);
  font-size: 14px;
  transition: border-color 0.15s;
}
.hg-ts-citation:hover { border-color: var(--hg-ts-ocean-light); }
.hg-ts-citation-title {
  flex: 1 1 auto;
  font-weight: 600;
  line-height: 1.3;
}
.hg-ts-citation-meta {
  font-size: 11px;
  color: var(--hg-ts-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.hg-ts-citation-badge {
  background: var(--hg-ts-ocean);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ── Status row (the always-visible progress indicator) ───────────── */
.hg-ts-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--hg-ts-border);
  background: #fff;
  font-size: 15px;
  color: var(--hg-ts-muted);
  min-height: 44px;
}
.hg-ts-status-indicator {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hg-ts-status-text { line-height: 1.3; }

/* ── Animation — LISTENING (pulse rings around mic) ───────────────── */
.hg-ts-state-listening .hg-ts-status { color: var(--hg-ts-ocean-dark); font-weight: 600; }
.hg-ts-state-listening .hg-ts-status-indicator::before,
.hg-ts-state-listening .hg-ts-status-indicator::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--hg-ts-ocean);
  animation: hg-ts-listen-ring 1.2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.hg-ts-state-listening .hg-ts-status-indicator::after { animation-delay: 0.4s; }
.hg-ts-state-listening .hg-ts-status-indicator {
  background: radial-gradient(circle, var(--hg-ts-ocean) 0%, var(--hg-ts-ocean) 40%, transparent 50%);
}
@keyframes hg-ts-listen-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── Animation — THINKING / TRANSCRIBING (conic-gradient spinner) ─── */
.hg-ts-state-thinking .hg-ts-status,
.hg-ts-state-transcribing .hg-ts-status { color: var(--hg-ts-ocean-dark); font-weight: 600; }
.hg-ts-state-thinking .hg-ts-status-indicator,
.hg-ts-state-transcribing .hg-ts-status-indicator {
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--hg-ts-ocean) 280deg, transparent 360deg);
  animation: hg-ts-spin 0.9s linear infinite;
  mask: radial-gradient(closest-side, transparent 60%, #000 62%);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 62%);
}
@keyframes hg-ts-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Animation — SPEAKING (audio equalizer bars) ──────────────────── */
.hg-ts-state-speaking .hg-ts-status { color: var(--hg-ts-accent); font-weight: 600; }
.hg-ts-state-speaking .hg-ts-status-indicator {
  display: inline-flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2px;
  width: 22px;
  height: 18px;
}
.hg-ts-state-speaking .hg-ts-status-indicator::before,
.hg-ts-state-speaking .hg-ts-status-indicator::after,
.hg-ts-state-speaking .hg-ts-status-indicator .hg-ts-bar {
  content: '';
  flex: 1 1 auto;
  background: var(--hg-ts-accent);
  border-radius: 2px;
  animation: hg-ts-eq 0.9s ease-in-out infinite;
}
.hg-ts-state-speaking .hg-ts-status-indicator::after { animation-delay: 0.3s; }
.hg-ts-state-speaking .hg-ts-status-indicator .hg-ts-bar { animation-delay: 0.15s; }
@keyframes hg-ts-eq {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}

/* ── Animation — ERROR (static dot) ───────────────────────────────── */
.hg-ts-state-error .hg-ts-status { color: #b22020; font-weight: 600; }
.hg-ts-state-error .hg-ts-status-indicator {
  border-radius: 50%;
  background: #b22020;
  width: 10px;
  height: 10px;
}

/* Idle / done — hide the indicator entirely. */
.hg-ts-state-idle .hg-ts-status-indicator,
.hg-ts-state-done .hg-ts-status-indicator { display: none; }
.hg-ts-state-idle .hg-ts-status { color: var(--hg-ts-muted); }

/* ── Voice activity orb (OpenAI-advanced-voice-style indicator) ─────
   Sits at the top of the modal body, below the header. Collapsed to
   zero height when idle/done so the modal reads as a text-first chat
   tool when nothing is happening. Expands and animates the moment the
   user starts speaking or TalkStory starts thinking / replying — so the
   reader always knows whether the mic is hot, we're still thinking, or
   the answer is being read out loud.
   The core element is a radial-gradient blob; ::before and ::after are
   two more offset blobs that rotate at different speeds and blend via
   mix-blend-mode: screen to produce the shifting highlight you see on
   OpenAI's advanced-voice orb. Per-state animation tweaks the outer
   wrapper's pulse speed / scale so the same orb morphs from a slow
   breathing disc (listening) through a faster breath (speaking) to a
   tight scale-in-out (thinking).
   Uses a CSS variable so we can adjust pulse speed per state without
   redefining the keyframes. */
.hg-ts-voice-orb {
  --hg-ts-orb-pulse: 2.4s;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  margin: 12px auto 2px;
  border-radius: 50%;
  position: relative;
  display: none;
  animation: hg-ts-orb-breathe var(--hg-ts-orb-pulse) ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(29, 151, 113, 0.25));
}
.hg-ts-voice-orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* Saturated Kauai-green orb. Earlier recipe used a pale mint highlight
     (#c7f0de) that read as gray on iOS OLED screens once the screen
     blend swirl laid on top — swap to a brighter green highlight and
     a deeper green base so the orb reads as unambiguously green. */
  background:
    radial-gradient(circle at 32% 30%, #6fdcb4 0%, transparent 44%),
    radial-gradient(circle at 70% 65%, var(--hg-ts-ocean-light) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, var(--hg-ts-ocean) 0%, var(--hg-ts-ocean-dark) 90%);
  overflow: hidden;
}
.hg-ts-voice-orb-core::before,
.hg-ts-voice-orb-core::after {
  content: '';
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(111, 220, 180, 0.85) 0%, transparent 38%),
    radial-gradient(circle at 65% 70%, rgba(62, 178, 147, 0.7) 0%, transparent 45%);
  mix-blend-mode: screen;
  animation: hg-ts-orb-swirl 7s linear infinite;
}
.hg-ts-voice-orb-core::after {
  animation-duration: 11s;
  animation-direction: reverse;
  opacity: 0.75;
}

/* Only reveal the orb during active states. */
.hg-ts-state-listening .hg-ts-voice-orb,
.hg-ts-state-transcribing .hg-ts-voice-orb,
.hg-ts-state-thinking .hg-ts-voice-orb,
.hg-ts-state-speaking .hg-ts-voice-orb {
  display: block;
}

/* Per-state pulse cadence. */
.hg-ts-state-listening .hg-ts-voice-orb    { --hg-ts-orb-pulse: 1.6s; }
.hg-ts-state-transcribing .hg-ts-voice-orb { --hg-ts-orb-pulse: 2.2s; }
.hg-ts-state-thinking .hg-ts-voice-orb     { --hg-ts-orb-pulse: 2.0s; }
.hg-ts-state-speaking .hg-ts-voice-orb     { --hg-ts-orb-pulse: 0.7s; }

@keyframes hg-ts-orb-breathe {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 4px 10px rgba(29, 151, 113, 0.25)); }
  50%      { transform: scale(1.08); filter: drop-shadow(0 6px 14px rgba(29, 151, 113, 0.45)); }
}
@keyframes hg-ts-orb-swirl {
  0%   { transform: rotate(0deg)   translate(0, 0); }
  50%  { transform: rotate(180deg) translate(2%, -2%); }
  100% { transform: rotate(360deg) translate(0, 0); }
}

/* Reduced-motion users get a static orb instead of the swirl. */
@media (prefers-reduced-motion: reduce) {
  .hg-ts-voice-orb,
  .hg-ts-voice-orb-core::before,
  .hg-ts-voice-orb-core::after {
    animation: none !important;
  }
}

/* ── Input row ────────────────────────────────────────────────────── */
.hg-ts-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  background: #fff;
}
.hg-ts-mic-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--hg-ts-ocean);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.hg-ts-mic-btn:hover { background: var(--hg-ts-ocean-dark); }
.hg-ts-mic-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hg-ts-mic-btn.is-recording {
  background: #b22020;
  animation: hg-ts-mic-pulse 1s ease-in-out infinite;
}
@keyframes hg-ts-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(178, 32, 32, 0.5); }
  50%      { box-shadow: 0 0 0 10px rgba(178, 32, 32, 0); }
}
.hg-ts-mic-btn svg { width: 18px; height: 18px; fill: #fff; }

.hg-ts-text-input {
  flex: 1 1 auto;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 14px;
  border: 1px solid var(--hg-ts-border);
  border-radius: 22px;
  background: var(--hg-ts-panel-soft);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.45;
  color: var(--hg-ts-ink);
  outline: none;
}
.hg-ts-text-input:focus {
  border-color: var(--hg-ts-ocean-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24,102,180,0.15);
}
.hg-ts-send-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--hg-ts-accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.hg-ts-send-btn:hover:not(:disabled) { background: #d46b1c; }
.hg-ts-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hg-ts-send-btn svg { width: 18px; height: 18px; fill: #fff; }

/* ── Footer disclaimer ────────────────────────────────────────────── */
.hg-ts-footer-note {
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--hg-ts-muted);
  text-align: center;
  line-height: 1.4;
  background: #fff;
}

/* ── Mobile refinements ───────────────────────────────────────────── */
@media (max-width: 560px) {
  .hg-ts-fab {
    /* Mobile: drop the pill closer to the bottom edge so it doesn't
       crowd the Shaka FAB stacked above it. Standard mobile sticky ads
       max out around 90px tall, so 110px keeps a 20px gap above any ad
       while opening up ~80px of clear space between this pill and Shaka
       (which sits at bottom: 250px on mobile). */
    bottom: 110px;
    padding: 10px 14px 10px 12px;
    font-size: 15px;
  }
  /* True fullscreen on mobile — matches the Concierge modal pattern
     (inset:0, 100vw × 100dvh, no border-radius). The old bottom-sheet
     with `bottom: 100px` + `max-height: calc(100vh - 120px)` left a
     ~120px dead zone below the input row and a large empty band in
     the middle of the modal; fullscreen gives the transcript the
     full viewport to breathe.
     `dvh` (dynamic viewport) keeps the input row visible on iOS
     Safari when the bottom chrome collapses on scroll. */
  .hg-ts-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    transform: translate(0, 100%);
  }
  .hg-ts-modal.is-active { transform: translate(0, 0); }
  .hg-ts-transcript { max-height: none; flex: 1 1 auto; }
  .hg-ts-header-title { font-size: 20px; }
  .hg-ts-header-sub   { font-size: 13px; }
}

/* Print + no-JS: hide entirely. */
@media print {
  .hg-ts-fab, .hg-ts-modal, .hg-ts-backdrop { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   Voice-first overrides — site-wide.

   Talk Story is voice-only. Concierge (/concierge) handles text. The
   modal hides the running chat transcript, text input, send button,
   hands-free toggle, and modal footer disclaimer. The latest answer
   is mirrored into .hg-ts-answer below the mic. A "Prefer to type?"
   link drops readers into /concierge.
   ═══════════════════════════════════════════════════════════════════ */

/* Hide the chat log, text input, send button, and legacy hands-free
   toggle. They stay in the DOM so talkstory-v1.js keeps working. */
.hg-ts-transcript,
.hg-ts-text-input,
.hg-ts-send-btn,
.hg-ts-handsfree-btn,
.hg-ts-footer-note { display: none !important; }

/* Modal becomes a flex column so orb+status+mic floats to visual
   centre. The alt-link flows naturally at the bottom. */
.hg-ts-modal {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

/* Orb gets the only margin-top:auto — pushes it (plus status, mic,
   answer) to the vertical centre. Alt-link sits naturally at the
   end of the flow so there's no dead band between mic and alt-link. */
.hg-ts-voice-orb { margin-top: auto !important; }

/* Input row: now just a centred mic. */
.hg-ts-input-row {
  justify-content: center;
  padding: 6px 16px 4px;
  background: transparent;
  flex: 0 0 auto;
}

/* Mic button: big, central, with a subtle resting glow that intensifies
   while recording. Replaces the small 44px tertiary button. */
.hg-ts-mic-btn {
  width: 84px;
  height: 84px;
  background: linear-gradient(135deg, var(--hg-ts-ocean) 0%, var(--hg-ts-ocean-dark) 100%);
  box-shadow: 0 10px 30px rgba(29,151,113,0.35),
              0 0 0 0 rgba(29,151,113,0.55);
  transition: transform 0.15s ease, box-shadow 0.3s ease, background 0.15s;
}
.hg-ts-mic-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 34px rgba(29,151,113,0.5),
              0 0 0 10px rgba(29,151,113,0.14);
}
.hg-ts-mic-btn:active { transform: scale(0.97); }
.hg-ts-mic-btn svg { width: 34px; height: 34px; }
.hg-ts-mic-btn.is-recording {
  background: linear-gradient(135deg, var(--hg-ts-accent) 0%, #d46b1c 100%);
  animation: hg-ts-mic-pulse-voice 1.1s ease-in-out infinite;
}
@keyframes hg-ts-mic-pulse-voice {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(242,122,36,0.45),
                0 0 0 0 rgba(242,122,36,0.55);
  }
  50% {
    box-shadow: 0 10px 30px rgba(242,122,36,0.55),
                0 0 0 16px rgba(242,122,36,0);
  }
}

/* Mic during audio playback: orange gradient + pulse + a white
   stop-square overlay, so the button reads as "tap to stop". The
   mic svg is faded out and a rounded square is painted over it via
   the ::after pseudo-element — no markup change needed. */
.hg-ts-mic-btn { position: relative; }
.hg-ts-state-speaking .hg-ts-mic-btn {
  background: linear-gradient(135deg, var(--hg-ts-accent) 0%, #d46b1c 100%);
  animation: hg-ts-mic-pulse-voice 1.3s ease-in-out infinite;
}
.hg-ts-state-speaking .hg-ts-mic-btn svg { opacity: 0; }
.hg-ts-state-speaking .hg-ts-mic-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 4px;
  transform: translate(-50%, -50%);
}

/* Voice-first status row: centre the copy, ditch the top border. */
.hg-ts-status {
  border-top: none;
  justify-content: center;
  padding: 4px 16px 2px;
  background: transparent;
  font-size: 16px;
}

/* Enlarge the orb and keep it visible in every state so the modal
   never looks empty. Idle/done stays softly alive (70% opacity, not
   washed out); listening/thinking/speaking pump to full. */
.hg-ts-voice-orb {
  width: 104px;
  height: 104px;
  display: block !important;   /* override "display:none" when idle */
  opacity: 0.72;                /* vivid enough to read as green, still restful */
  transition: opacity 0.3s ease;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 6px;
  /* Warm tropical halo — a faint sunset-orange ring outside the green
     core so the orb reads as Hawaii-coded (lagoon + sunset), not just
     a generic green ball. */
  filter: drop-shadow(0 6px 16px rgba(29, 151, 113, 0.35))
          drop-shadow(0 0 24px rgba(242, 122, 36, 0.18));
}
/* Saturate the core gradient so the orb reads as a deep lagoon
   rather than pale mint. Anchored in ocean-teal with Kauai-green
   shadows and a bright turquoise highlight. */
.hg-ts-voice-orb-core {
  background:
    radial-gradient(circle at 30% 28%, #a0ecd0 0%, transparent 42%),
    radial-gradient(circle at 70% 62%, #2bb995 0%, transparent 58%),
    radial-gradient(circle at 50% 55%, #0e8065 0%, #0a5c4a 92%) !important;
}
.hg-ts-state-listening .hg-ts-voice-orb,
.hg-ts-state-transcribing .hg-ts-voice-orb,
.hg-ts-state-thinking .hg-ts-voice-orb,
.hg-ts-state-speaking .hg-ts-voice-orb { opacity: 1; }
/* Pause the breathing animation in idle/done so static readers
   aren't watching a constant shimmer. */
.hg-ts-state-idle .hg-ts-voice-orb,
.hg-ts-state-done .hg-ts-voice-orb { animation-play-state: paused; }

/* ── Latest answer mirror ──────────────────────────────────────── */
.hg-ts-answer {
  margin: 4px 16px 12px;
  background: var(--hg-ts-panel-soft);
  border: 1px solid var(--hg-ts-border);
  border-radius: 14px;
  padding: 14px 16px 12px;
  max-height: 38vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.hg-ts-answer[hidden] { display: none; }
.hg-ts-answer-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--hg-ts-ink);
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.hg-ts-answer-text:empty { display: none; }
.hg-ts-answer-text.is-error { color: #9a2020; }
.hg-ts-answer-cites:empty { display: none; }

/* ── Alt link (Concierge) ──────────────────────────────────────── */
.hg-ts-alt-link {
  margin: 0 0 14px;
  padding: 0 16px;
  text-align: center;
  font-size: 13px;
  color: var(--hg-ts-muted);
}
.hg-ts-alt-link a {
  color: var(--hg-ts-ocean-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.hg-ts-alt-link a:hover { color: var(--hg-ts-ocean); }

/* ── Mobile refinements for voice-first ───────────────────────── */
@media (max-width: 560px) {
  .hg-ts-mic-btn { width: 76px; height: 76px; }
  .hg-ts-mic-btn svg { width: 30px; height: 30px; }
  .hg-ts-voice-orb { width: 84px; height: 84px; }
  .hg-ts-answer { max-height: 45vh; font-size: 15px; }
  .hg-ts-answer-text { font-size: 15px; }
}
