@media (max-width: 880px) {
  body.pepper-mobile-open {
    overflow: hidden;
  }
  .chat-card {
    height: 360px;
  }
  .chat-card.is-mobile-fullscreen {
    position: fixed;
    top: var(--viewport-offset-top, 0);
    left: var(--viewport-offset-left, 0);
    right: auto;
    width: var(--viewport-width, 100vw);
    max-width: var(--viewport-width, 100vw);
    height: var(--viewport-height, 100vh);
    margin-top: 0;
    border-radius: 0;
    border: none;
    z-index: 1000;
    background: #f9fafb;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .chat-card.is-mobile-fullscreen .chat-header {
    padding-top: max(0.9rem, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .chat-card.is-mobile-fullscreen .chat-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }
  .chat-card.is-mobile-fullscreen .chat-input-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    align-items: center;
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
  }
  .chat-card.is-mobile-fullscreen .chat-input-row textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .chat-card.is-mobile-fullscreen .chat-mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chat-voice-actions {
    gap: 0.35rem;
  }
  .chat-voice-button {
    padding: 0;
    font-size: 0;
  }
}

.chat-card {
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  height: 420px;
  border-radius: 16px;
  border: 1px solid #e2e4ea;
  background: #f9fafb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  flex: none;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e2e4ea;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  cursor: pointer;
}

.chat-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-voice-actions {
  margin-left: auto;
  margin-right: 0.55rem;
  display: flex;
  align-items: center;
  min-width: 132px;
  justify-content: flex-end;
}

.chat-action-cluster {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.chat-action-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  justify-content: flex-start;
  width: 58px;
  min-width: 58px;
}

.chat-action-stack:first-child {
  margin-left: 0.18rem;
  transform: translateX(0.1rem);
}

.chat-action-stack:last-child {
  transform: translateX(-1.45rem);
}

.chat-voice-button {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.chat-voice-button:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.chat-voice-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.chat-voice-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08) 34%, transparent 56%);
  opacity: 0.55;
  pointer-events: none;
}

.chat-voice-button::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.chat-voice-button-call {
  background: linear-gradient(180deg, #d9b08d 0%, #bf6d47 100%);
  color: #ffffff;
}

.chat-voice-button-call::after {
  background: radial-gradient(circle, rgba(191, 109, 71, 0.22), transparent 68%);
}

.chat-voice-button-call.is-listening {
  background: linear-gradient(180deg, #d8c5a8 0%, #8a6a52 100%);
  box-shadow: 0 0 0 3px rgba(191, 109, 71, 0.14), 0 4px 14px rgba(15, 23, 42, 0.16);
}

.chat-voice-button-call.is-listening::after {
  opacity: 1;
  transform: scale(1.18);
}

.chat-voice-button-end {
  background: linear-gradient(180deg, #f87171 0%, #b91c1c 100%);
  color: #ffffff;
}

.chat-voice-button-end::after {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.2), transparent 68%);
}

.chat-contact-button {
  background: linear-gradient(180deg, #dbeceb 0%, #0f5f70 100%);
  color: #ffffff;
}

.chat-contact-button::after {
  background: radial-gradient(circle, rgba(15, 95, 112, 0.2), transparent 68%);
}

.chat-assistant-button {
  background: linear-gradient(180deg, #60a5fa 0%, #1d4ed8 100%);
  color: #ffffff;
}

.chat-assistant-button::after {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 68%);
}

.chat-voice-button.is-disabled-mode {
  opacity: 0.65;
}

.chat-voice-core {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-shadow: none;
}

.chat-voice-svg {
  width: 12px;
  height: 12px;
  line-height: 1;
  filter: none;
}

.chat-voice-beta {
  font-size: 0.56rem;
  letter-spacing: 0.03em;
  color: #64748b;
  line-height: 1.08;
  white-space: nowrap;
  min-height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.chat-voice-label,
.chat-mode-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  justify-content: flex-start;
}

.chat-voice-label,
.chat-mode-label {
  width: 58px;
}

.chat-voice-label span,
.chat-mode-label span {
  display: block;
}

.chat-voice-label span:first-child,
.chat-mode-label span:first-child {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0;
}

.chat-voice-label span:nth-child(2) {
  font-size: 0.52rem;
  letter-spacing: 0;
}

.chat-voice-label span:nth-child(3) {
  font-size: 0.5rem;
  letter-spacing: 0.02em;
}

.chat-mode-label span:nth-child(2) {
  font-size: 0.52rem;
  letter-spacing: 0;
}

.chat-mode-label span:nth-child(3) {
  font-size: 0.5rem;
  letter-spacing: 0.02em;
}

.chat-orb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e0f2fe, #2563eb);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.18);
  flex-shrink: 0;
  position: relative;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.chat-orb::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.chat-title-main {
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-title-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1em;
  letter-spacing: 0.01em;
  transition: color 180ms ease;
}

.chat-title-sub[data-state="connecting"] { color: #475569; }

.chat-title-sub[data-state="available"],
.chat-title-sub[data-state="ready"] { color: #1f2937; }

.chat-title-sub[data-state="processing"] { color: #111827; }

.chat-title-sub[data-state="error"] { color: #991b1b; }

.chat-title-sub[data-state="handoff"] { color: #1f2937; }

.chat-title-sub[data-state="relay"] { color: #a16207; }

.chat-title-sub[data-state="checking"] { color: #166534; }

.chat-mobile-close {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.76rem;
  cursor: pointer;
  display: none;
}

.chat-messages {
  flex: 1;
  padding: 0.8rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #f9fafb;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.assistant { justify-content: flex-start; }

.message-row.user { justify-content: flex-end; }

.message-row.event { justify-content: center; }

.message-bubble {
  max-width: 72%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 16px;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.message-bubble.assistant {
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.message-bubble.user {
  background: #dbeafe;
  color: #0f172a;
  border-bottom-right-radius: 4px;
}

.message-event {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  max-width: 82%;
}

.message-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  align-self: flex-end;
}

.message-ticks {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
}

.message-tick {
  color: #9ca3af;
  opacity: 0.95;
  transition: color 180ms ease, opacity 180ms ease;
}

.message-tick.is-active { color: #86efac; }

.message-tick.is-error { color: #dc2626; }

.message-status-label { color: var(--text-muted); }

.message-meta[data-status="processing"] .message-status-label { color: #374151; }

.message-meta[data-status="responded"] .message-status-label { color: #166534; }

.message-meta[data-status="error"] .message-status-label { color: #b91c1c; }

.chat-input-row {
  flex: none;
  min-width: 0;
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 0.55rem 0.7rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  box-sizing: border-box;
  min-width: 0;
  width: 0;
  flex: 1;
  resize: none;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  min-height: 40px;
  max-height: 144px;
  line-height: 1.45;
  outline: none;
  background: #f9fafb;
}

@media (max-width: 880px) {
  .chat-input-row textarea {
    font-size: 16px;
  }
}

.chat-input-row textarea:focus {
  border-color: var(--link);
  background: #ffffff;
}

.chat-input-row button {
  flex: none;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

.chat-input-row button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.chat-orb.state-connecting {
  background: radial-gradient(circle at 30% 30%, #f0f9ff, #3b82f6);
  animation: orb-connect 1.3s ease-in-out infinite;
}

.chat-orb.state-connecting::after {
  opacity: 1;
  border-color: rgba(59, 130, 246, 0.35);
}

.chat-orb.state-idle {
  opacity: 1;
  background: radial-gradient(circle at 30% 30%, #ffffff, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.chat-orb.state-idle::after {
  opacity: 1;
  transform: scale(1);
}

.chat-orb.state-typing {
  background: radial-gradient(circle at 30% 30%, #eff6ff, #1d4ed8);
  animation: orb-processing 0.9s linear infinite;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.chat-orb.state-typing::after {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.38);
  animation: orb-ring 1.2s ease-out infinite;
}

.chat-orb.state-ready {
  background: radial-gradient(circle at 30% 30%, #ffffff, #2563eb);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  animation: orb-ready 1.8s ease-in-out infinite;
}

.chat-orb.state-ready::after {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.28);
  transform: scale(1.08);
}

.chat-orb.state-error {
  background: radial-gradient(circle at 30% 30%, #fef2f2, #b91c1c);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1);
}

.chat-orb.state-error::after {
  opacity: 1;
  border-color: rgba(185, 28, 28, 0.28);
}

.chat-orb.state-handoff {
  background: radial-gradient(circle at 30% 30%, #f0fdf4, #22c55e);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
  animation: orb-handoff 1.5s ease-in-out infinite;
}

.chat-orb.state-handoff::after {
  opacity: 1;
  border-color: rgba(34, 197, 94, 0.32);
  transform: scale(1.08);
}

.chat-orb.state-relay {
  background: radial-gradient(circle at 30% 30%, #fefce8, #eab308);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.08);
  animation: orb-relay 1.7s ease-in-out infinite;
}

.chat-orb.state-relay::after {
  opacity: 1;
  border-color: rgba(234, 179, 8, 0.24);
  transform: scale(1.03);
}

.chat-orb.state-checking {
  background: radial-gradient(circle at 30% 30%, #ecfdf5, #16a34a);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
  animation: orb-checking 1.6s ease-in-out infinite;
}

.chat-orb.state-checking::after {
  opacity: 1;
  border-color: rgba(34, 197, 94, 0.24);
  transform: scale(1.05);
}

@keyframes orb-connect {
  0%   { transform: scale(1); opacity: 0.8; }
  50%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes orb-processing {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes orb-ring {
  0%   { transform: scale(0.9); opacity: 0.75; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes orb-ready {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08); }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08); }
}

@keyframes orb-handoff {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08); }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08); }
}

@keyframes orb-relay {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.06); }
  50%  { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(234, 179, 8, 0.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.06); }
}

@keyframes orb-checking {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.06); }
  50%  { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.06); }
}

/* =====================================================================
   Unified floaty launcher + open/close states (one pill on every page).
   The chat card is hidden until the pill opens it, so every surface shows
   the same bottom-right Nancy launcher and routes into this one engine.
   ===================================================================== */

:root { --pepper-launcher-height: 52px; --pepper-launcher-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }

.pepper-launcher {
  position: fixed;
  right: 22px;
  bottom: var(--pepper-launcher-bottom);
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 44px);
  height: var(--pepper-launcher-height);
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: rgba(248, 251, 252, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 95, 112, 0.22);
  color: #1f2933;
  box-shadow: 0 16px 40px rgba(31, 41, 51, 0.18);
}

.pepper-launcher-orb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #f4fff8 0%, #48b778 40%, #155f70 100%);
  box-shadow: 0 0 0 4px rgba(43, 164, 101, 0.16);
  animation: pepper-orb-breathe 2.1s ease-in-out infinite;
}

@keyframes pepper-orb-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.86); opacity: 0.82; }
}

.pepper-launcher-name {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: #1f2933;
}

.pepper-launcher-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.pepper-launcher-btn svg {
  width: 18px;
  height: 18px;
}

.pepper-launcher-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.pepper-launcher-call {
  background: linear-gradient(180deg, #d9b08d 0%, #bf6d47 100%);
}

.pepper-launcher-chat {
  background: linear-gradient(180deg, #2f7d8a 0%, #155f70 100%);
}

.pepper-launcher-hidden {
  display: none !important;
}

.pepper-choice-popover {
  position: fixed;
  right: 22px;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  z-index: 1202;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(233, 247, 248, 0.68) 55%, rgba(255, 248, 243, 0.66));
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
  box-shadow: 0 18px 46px rgba(13, 38, 48, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  color: #1f2933;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pepper-choice-popover[hidden] { display: none; }
.pepper-choice-popover.is-open { opacity: 1; transform: translateY(0) scale(1); }

.pepper-choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 3px 9px 7px;
}

.pepper-choice-kicker {
  display: block;
  margin-bottom: 2px;
  color: #155f70;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pepper-choice-head h2 {
  margin: 0;
  color: #1f2933;
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.pepper-choice-close {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  color: #52616a;
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
  transition: background 150ms, transform 150ms;
}

.pepper-choice-close svg { width: 18px; height: 18px; }
.pepper-choice-close:hover { color: #1f2933; background: rgba(255, 255, 255, 0.76); }
.pepper-choice-close:focus-visible,
.pepper-choice-option:focus-visible { outline: 3px solid rgba(21, 95, 112, 0.42); outline-offset: 2px; }

.pepper-choice-actions {
  display: grid;
  gap: 0;
  padding: 3px;
  border: 1px solid rgba(21, 95, 112, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.pepper-choice-option {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  border: 0;
  border-radius: 16px;
  color: #1f2933;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pepper-choice-option + .pepper-choice-option { border-top: 1px solid rgba(21, 95, 112, 0.1); }
.pepper-choice-option:hover { background: rgba(255, 255, 255, 0.42); box-shadow: 0 5px 15px rgba(21, 95, 112, 0.07); }
.pepper-choice-option strong { display: block; color: inherit; font-size: 0.94rem; line-height: 1.25; }
.pepper-choice-option small { display: block; margin-top: 3px; color: #687980; font-size: 0.76rem; line-height: 1.25; }

.pepper-choice-icon { width: 40px; height: 40px; border-radius: 50%; }

.pepper-choice-icon.is-surya { color: #9e4f2d; background: #f7e8dc; }
.pepper-choice-arrow { width: 18px; height: 18px; color: #688087; }
.pepper-choice-icon { display: grid; place-items: center; color: #155f70; background: #dceff1; box-shadow: inset 0 0 0 1px rgba(21, 95, 112, 0.08); }
.pepper-choice-icon svg { display: block; width: 32px; height: 32px; }

/* Nancy is represented by an abstract N signal mark: explicitly artificial, never a human portrait. */
.pepper-choice-icon .pepper-choice-nancy-mark { overflow: visible; }
.pepper-choice-icon .pepper-choice-nancy-ring { opacity: 0.42; transform-origin: center; animation: pepper-nancy-mark-pulse 2.2s ease-in-out infinite; }
.pepper-choice-icon .pepper-choice-nancy-letter { filter: drop-shadow(0 0 2px rgba(21, 95, 112, 0.16)); }
@keyframes pepper-nancy-mark-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.36; }
  50% { transform: scale(1.05); opacity: 0.72; }
}
@media (prefers-reduced-motion: reduce) {
  .pepper-launcher-orb,
  .pepper-choice-icon .pepper-choice-nancy-ring { animation: none; }
}
.pepper-choice-recording-note { display: flex; align-items: flex-start; gap: 7px; margin: 8px 6px 2px; color: #5f747b; font-size: 0.7rem; line-height: 1.35; }
.pepper-choice-recording-note svg { flex: none; width: 15px; height: 15px; margin-top: 1px; color: #39717c; }
.pepper-choice-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(20, 35, 42, 0.1); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pepper-choice-backdrop[hidden] { display: none; }
body.pepper-choices-open { overflow: hidden; }
.pepper-choices-open .pepper-launcher { z-index: 1201; }

.pepper-choice-close:hover { transform: rotate(90deg); }
.chat-messages { min-height: 0; }
.chat-mobile-close { margin-left: auto; min-height: 44px; }

@media (max-width: 520px) {
  .pepper-choice-popover {
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 28px);
    border-radius: 26px;
  }
  .pepper-choice-option { min-height: 68px; }
}

/* Card is hidden until the launcher opens it. Using :not(.pepper-open) so the
   open state never sets display and therefore never fights the mobile-fullscreen
   grid layout via specificity. */
.pepper-embed:not(.pepper-open) .chat-card {
  display: none;
}

/* Desktop / tablet: open as a floating panel bottom-right (mobile uses the
   existing is-mobile-fullscreen lock untouched). */
@media (min-width: 881px) {
  .pepper-embed.pepper-open .chat-card {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1190;
    width: 384px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 40px);
    margin-top: 0;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.32);
  }

  .pepper-embed.pepper-open .chat-mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---- Header polish + call relocation (call now lives on the launcher pill) ---- */

/* Nancy title must stay readable regardless of the page's inherited text color. */
.chat-title-main {
  color: #1f2933;
}

/* Nice branded accent on the chat header. */
.chat-header {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.07), rgba(191, 109, 71, 0.07));
  border-bottom: 1px solid rgba(15, 95, 112, 0.18);
  box-shadow: inset 0 3px 0 0 #bf6d47;
}

/* The call button moved to the floaty pill, so hide it in the header (keep Contact Surya). */
.chat-action-cluster .chat-action-stack:first-child {
  display: none;
}

/* The content pages load site.css which has a global `button { padding: 12px 23px }`. The launcher
   buttons never declared padding, so that global leaked in and stretched the pill on those pages.
   Pin the launcher's own elements explicitly (higher specificity, scoped to the pill). */
.pepper-launcher .pepper-launcher-btn {
  padding: 0;
  width: 36px;
  height: 36px;
  flex: none;
}
.pepper-launcher .pepper-launcher-name { flex: none; }
.pepper-launcher .pepper-launcher-orb { flex: none; }

/* ============================================================================
   Starter chips, markdown-lite output, and dark theme for the chat widget.
   ============================================================================ */

/* Starter chips shown on a fresh, empty conversation. */
.pepper-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 14px 10px;
}
.pepper-chip {
  border: 1px solid var(--border, #d8e4e8);
  background: rgba(37, 99, 235, 0.06);
  color: #0f5f70;
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pepper-chip:hover { background: rgba(37, 99, 235, 0.12); }
.pepper-chip:focus-visible { outline: 2px solid #0f5f70; outline-offset: 2px; }

/* Markdown-lite rendered content inside an assistant bubble. */
.message-bubble .md p { margin: 0 0 0.5em; }
.message-bubble .md p:last-child { margin-bottom: 0; }
.message-bubble .md ul,
.message-bubble .md ol { margin: 0.3em 0 0.5em; padding-left: 1.3em; }
.message-bubble .md li { margin: 0.15em 0; }
.message-bubble .md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(15, 23, 42, 0.07);
  padding: 0.08em 0.36em;
  border-radius: 5px;
}
.message-bubble .md a { text-decoration: underline; }
/* Streaming caret while tokens arrive. */
.message-bubble.is-streaming .md::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: currentColor;
  opacity: 0.55;
  animation: pepper-caret 1s steps(1) infinite;
}
@keyframes pepper-caret { 50% { opacity: 0; } }

/* ---- Dark theme for the chat widget ---- */
[data-theme="dark"] .chat-card,
[data-theme="dark"] .chat-card.is-mobile-fullscreen { background: #14242a; border-color: #2b3f46; }
[data-theme="dark"] .chat-header { background: #182a30; border-bottom-color: #2b3f46; }
[data-theme="dark"] .chat-messages { background: #0f1c20; }
[data-theme="dark"] .message-bubble.assistant { background: #1f3138; color: #e7eff1; }
[data-theme="dark"] .message-bubble.user { background: #1d3a5c; color: #eaf2ff; }
[data-theme="dark"] .message-event { background: rgba(255, 255, 255, 0.06); color: #a3b5bb; }
[data-theme="dark"] .chat-input-row { background: #182a30; border-top-color: #2b3f46; }
[data-theme="dark"] .chat-input-row textarea { background: #12222a; color: #e7eff1; border-color: #2b3f46; }
[data-theme="dark"] .chat-input-row textarea:focus { background: #14262e; }
[data-theme="dark"] .chat-title-sub { color: #a3b5bb; }
[data-theme="dark"] .chat-title-main { color: #edf5f6; }
[data-theme="dark"] .chat-mobile-close { color: #d8e8ec; background: #20383f; border-color: #39545e; }
[data-theme="dark"] .message-meta[data-status="responded"] .message-status-label { color: #99d9b2; }
[data-theme="dark"] .message-meta[data-status="processing"] .message-status-label { color: #bbd1da; }
[data-theme="dark"] .pepper-choice-backdrop { background: rgba(2, 9, 13, 0.24); }
[data-theme="dark"] .pepper-choice-icon { color: #a0e4ee; background: rgba(24, 62, 73, 0.86); box-shadow: inset 0 0 0 1px rgba(138, 216, 228, 0.16); }
[data-theme="dark"] .pepper-choice-icon.is-surya { color: #f3bd93; background: rgba(73, 52, 44, 0.86); }
[data-theme="dark"] .pepper-launcher { background: rgba(22, 36, 42, 0.94); border-color: #2b3f46; }
[data-theme="dark"] .pepper-launcher-name { color: #e7eff1; }
[data-theme="dark"] .pepper-choice-popover { color: #e7eff1; background: linear-gradient(145deg, rgba(27, 47, 54, 0.8), rgba(18, 43, 50, 0.72) 55%, rgba(53, 39, 34, 0.7)); border-color: rgba(138, 216, 228, 0.18); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .pepper-choice-head h2 { color: #f1f7f8; }
[data-theme="dark"] .pepper-choice-kicker { color: #8ad8e4; }
[data-theme="dark"] .pepper-choice-close { color: #b9c8cc; background: rgba(31, 49, 56, 0.44); border-color: rgba(138, 216, 228, 0.16); }
[data-theme="dark"] .pepper-choice-recording-note { color: #aabfc4; }
[data-theme="dark"] .pepper-choice-recording-note svg { color: #8ad8e4; }
[data-theme="dark"] .pepper-choice-actions { background: rgba(3, 14, 18, 0.18); border-color: rgba(138, 216, 228, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .pepper-choice-option { color: #edf5f6; background: transparent; }
[data-theme="dark"] .pepper-choice-option + .pepper-choice-option { border-top-color: rgba(138, 216, 228, 0.14); }
[data-theme="dark"] .pepper-choice-option:hover { background: rgba(138, 216, 228, 0.1); }
[data-theme="dark"] .pepper-choice-option small { color: #a3b5bb; }
[data-theme="dark"] .message-bubble .md code { background: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .pepper-chip { background: rgba(92, 192, 209, 0.12); color: #8ad8e4; border-color: #2b3f46; }
[data-theme="dark"] .pepper-chip:hover { background: rgba(92, 192, 209, 0.2); }

/* Keep theme access at the profile's top-right, independently of Nancy's floating controls. */
.pepper-theme-host { position: relative; }
.pepper-theme-host.site-topbar { padding-right: 56px; }
.pepper-theme-host .pepper-sidebar-theme { position: absolute; top: 12px; right: 12px; z-index: 1; width: 44px; height: 44px; padding: 0; }
.pepper-sidebar-theme:focus-visible { outline: 3px solid #73b6bd; outline-offset: 3px; }
.pepper-launcher-theme { background: transparent; }
.pepper-launcher-theme .pl-theme-half { width: 19px; height: 19px; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, #111 0 50%, #fff 50%); box-sizing: border-box; position: relative; }
.pepper-launcher-theme .pl-theme-half::after { content: ""; position: absolute; inset: 0 50% 0 auto; border-left: 1px solid #777; }

@media (prefers-reduced-motion: reduce) {
  .pepper-choice-popover, .pepper-choice-option, .pepper-choice-close { transition: none; }
}


