/* Teresa: homepage chat panel, mobile-first, Grok-style composer */
.teresa { background: transparent; border: 0; padding: 0; }
.teresa-band {
  background: var(--navy);
  color: var(--cream);
  padding: 3.4rem 0;
}
.teresa-card { display: grid; grid-template-columns: 148px 1fr; gap: 1.5rem; align-items: center; max-width: 860px; margin: 0 auto; }
.teresa-portrait { width: 148px; height: 148px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28); background: var(--cream); }
.teresa-intro h2 { font-family: "Fraunces", Georgia, serif; font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.15; margin: 0 0 .45rem; color: var(--cream); }
.teresa-sub { margin: 0 0 .35rem; color: var(--cream); font-size: 1.05rem; }
.teresa-disclosure { margin: 0 0 .9rem; color: var(--gold-soft); font-size: .88rem; display: flex; align-items: center; gap: .4rem; }
.teresa-disclosure::before { content: none; display: none; font-size: .68rem; font-weight: 800; letter-spacing: .05em; background: var(--gold); color: var(--navy); border-radius: 999px; padding: .1rem .45rem; }
.teresa-start[aria-expanded="true"] { display: none; }
.teresa-chat-slot:has(#teresa-panel:not([hidden])) { padding: 1.25rem 0 1.75rem; }
.teresa-player { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

.teresa-panel {
  max-width: 860px;
  margin: 1.4rem auto 0;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 740px);
  min-height: 28rem;
}
.teresa-panel[hidden] { display: none; }
.teresa-head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: var(--navy); color: #fff; flex: 0 0 auto; }
.teresa-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-soft); }
.teresa-head strong { font-size: .98rem; }
.teresa-head span { font-size: .78rem; color: var(--gold-soft); display: block; line-height: 1.2; }
.teresa-close { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; }
.teresa-close:focus-visible, .teresa-plus:focus-visible, .teresa-mic:focus-visible, .teresa-send:focus-visible, .teresa-talk:focus-visible, .teresa-quick button:focus-visible, .teresa-voice button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.teresa-log {
  flex: 1 1 auto;
  min-height: 12rem;
  overflow-y: auto;
  padding: 1rem .9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: var(--cream);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.teresa-msg {
  max-width: 86%;
  padding: .7rem 1rem;
  border-radius: 20px;
  line-height: 1.5;
  font-size: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.teresa-msg.bot { background: #fff; color: var(--ink); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 6px; }
.teresa-msg.user { background: var(--gold); color: var(--navy); align-self: flex-end; border-bottom-right-radius: 6px; }
.teresa-msg.story { border-left: 4px solid var(--gold); font-size: 1.04rem; line-height: 1.65; }
.teresa-msg.typing { color: var(--muted); font-style: italic; background: #fff; }
.teresa-links { display: flex; flex-wrap: wrap; gap: .5rem; align-self: flex-start; padding: 0 .15rem; }
.teresa-links a { font-size: .9rem; padding: .5rem .9rem; }

.teresa-dock {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(247,241,228,0) 0%, var(--cream) 12px);
  padding: .45rem .7rem calc(.55rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.teresa-suggest { margin: 0 0 .45rem; padding: .55rem .65rem .5rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.teresa-suggest[hidden] { display: none; }
.teresa-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.teresa-quick button { font: inherit; font-size: .86rem; border: 1px solid var(--gold); background: var(--paper); color: var(--navy); border-radius: 999px; padding: .32rem .75rem; cursor: pointer; }
.teresa-quick button:hover { background: var(--gold-soft); }
.teresa-voice { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .5rem; font-size: .82rem; }
.teresa-voice-label { font-weight: 700; color: var(--navy); margin-right: .15rem; }
.teresa-voice button { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: var(--paper); color: var(--navy); border-radius: 999px; padding: .25rem .65rem; cursor: pointer; }
.teresa-voice button[aria-pressed="true"] { background: var(--navy); color: var(--gold-soft); border-color: var(--navy); }
.teresa-voicepick { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .4rem; font-size: .82rem; }
.teresa-voicepick[hidden] { display: none; }
.teresa-voicepick button { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: var(--paper); color: var(--navy); border-radius: 999px; padding: .25rem .65rem; cursor: pointer; }
.teresa-voicepick button[aria-pressed="true"] { background: var(--navy); color: var(--gold-soft); border-color: var(--navy); }
.teresa-voice-note { flex-basis: 100%; color: var(--muted); font-size: .76rem; min-height: 0; }
.teresa-voice-note:empty { display: none; }

.teresa-talk-note { margin: 0 0 .4rem; min-height: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.teresa-talk-note:empty { display: none; }

.teresa-composer { display: flex; align-items: flex-end; gap: .45rem; }
.teresa-form {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  gap: .15rem;
  padding: .22rem .28rem .22rem .22rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(27, 42, 34, 0.08);
  min-width: 0;
}
.teresa-form textarea {
  flex: 1 1 auto;
  resize: none;
  font: inherit;
  font-size: 1rem;
  border: 0;
  border-radius: 0;
  padding: .55rem .35rem;
  min-height: 2.45rem;
  max-height: 7.5rem;
  background: transparent;
  color: var(--ink);
  line-height: 1.35;
}
.teresa-form textarea:focus { outline: none; }
.teresa-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.28); }

.teresa-plus, .teresa-mic, .teresa-send, .teresa-talk {
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  color: var(--navy);
}
.teresa-plus { font-size: 1.45rem; font-weight: 500; line-height: 1; color: var(--muted); }
.teresa-plus[aria-expanded="true"] { background: var(--gold-soft); color: var(--navy); }
.teresa-mic { color: var(--navy); }
.teresa-mic[hidden] { display: none; }
.teresa-mic.on, .teresa-talk.on { background: #d7263d; color: #fff; animation: teresa-pulse 1.2s ease-in-out infinite; }
.teresa-send { background: var(--gold); color: var(--navy); }
.teresa-send:hover { background: var(--gold-hover); }
.teresa-send:disabled { opacity: .45; cursor: default; }
.teresa-talk {
  background: var(--navy);
  color: var(--gold-soft);
  flex-direction: column;
  width: auto;
  min-width: 3.1rem;
  height: auto;
  padding: .35rem .55rem .28rem;
  border-radius: 1.15rem;
  gap: .12rem;
  box-shadow: 0 4px 12px rgba(27, 42, 34, 0.22);
}
.teresa-talk-caption { font-size: .62rem; font-weight: 700; letter-spacing: .03em; line-height: 1; }
.teresa-talk:hover { background: var(--navy-mid); }
.teresa-talk[hidden] { display: none; }
.teresa-talk.soon { background: var(--paper); color: var(--muted); border: 1px solid var(--line); box-shadow: none; cursor: default; }
.teresa-talk.voice-on:not(.on) { box-shadow: 0 0 0 2px var(--gold), 0 4px 12px rgba(27, 42, 34, 0.22); }
@keyframes teresa-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(215,38,61,.45); } 50% { box-shadow: 0 0 0 8px rgba(215,38,61,0); } }

.teresa-fine { margin: .45rem 0 0; color: var(--muted); font-size: .74rem; text-align: center; }
.teresa .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .teresa-band { padding: 2.6rem 0; }
  .teresa-card { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 1.05rem; }
  .teresa-portrait { width: 124px; height: 124px; }
  .teresa-disclosure { justify-content: center; }
  .teresa-start { width: 100%; max-width: 22rem; }
  .teresa-panel { margin-top: 1rem; border-radius: 18px; max-height: min(82vh, 760px); min-height: 24rem; }
  .teresa-msg { max-width: 92%; font-size: .98rem; }
  .teresa-dock { padding: .4rem .55rem calc(.5rem + env(safe-area-inset-bottom, 0px)); }
}

.teresa-capture {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .5rem;
  margin: .15rem 0 .4rem;
  padding: .7rem .8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 92%;
}
.teresa-capture label { font-size: .8rem; font-weight: 700; color: var(--navy); flex: 0 0 100%; }
.teresa-capture input[type="email"] {
  flex: 1 1 12rem;
  font: inherit;
  font-size: .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem .85rem;
  min-width: 0;
  background: var(--cream);
  color: var(--ink);
}
.teresa-capture button { flex: 0 0 auto; font-size: .9rem; padding: .5rem .95rem; }
.teresa-capture-error { flex: 0 0 100%; margin: 0; color: #8a2b2b; font-size: .8rem; }
.teresa-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.teresa-notice { display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 .5rem; padding: .5rem .65rem; border: 1px solid var(--line); border-left: 3px solid var(--gold, #c9a54a); background: var(--paper); color: var(--navy); border-radius: 10px; font-size: .82rem; line-height: 1.35; }
.teresa-notice span { flex: 1; }
.teresa-notice-x { font: inherit; font-size: 1rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 .15rem; }

/* Chat bar component replaces the old composer / Talk / Voice controls */
.teresa-legacy{display:none!important}
.teresa-dock .cb{margin:0}
.teresa-dock .cb-status{bottom:calc(100% + 1px)}
