
  .tiny-chat {
    position: fixed;
    right: 1.25rem;
    bottom: 7rem;
    z-index: 1001;
    font-family: inherit;
  }

  .tiny-chat-bubble {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
    background: var(--color-palm, #145c3c);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  }

  .tiny-chat-bubble-icon {
    font-size: 1.2rem;
  }

  .tiny-chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: min(380px, calc(100vw - 2.5rem));
    height: min(calc(100vh - 11rem), 620px);
    min-height: 380px;
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
    overflow: hidden;
  }

  .tiny-chat-panel:not([hidden]) {
    display: flex;
  }

  .tiny-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--color-palm, #145c3c);
    color: #fff;
  }

  .tiny-chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .tiny-chat-avatar {
    font-size: 1.4rem;
    display: inline-block;
    transition: transform 0.15s ease;
  }

  .tiny-chat-avatar-speaking {
    animation: tiny-chat-pulse 0.6s ease-in-out infinite;
  }

  @keyframes tiny-chat-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
  }

  .tiny-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .tiny-chat-speak-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
    opacity: 0.6;
  }

  .tiny-chat-speak-toggle-on {
    opacity: 1;
    background: rgba(255, 255, 255, 0.18);
  }

  .tiny-chat-subtitle {
    display: block;
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: 400;
  }

  .tiny-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
  }

  .tiny-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 160px;
  }

  .tiny-msg {
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 90%;
  }

  .tiny-msg-tiny {
    background: #f1f6f3;
    color: #16321f;
    align-self: flex-start;
  }

  .tiny-msg-thinking {
    font-style: italic;
    opacity: 0.75;
  }

  .tiny-msg-user {
    background: var(--color-sand-gold, #c99a3a);
    color: #1a1406;
    align-self: flex-end;
  }

  .tiny-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e7e2d8;
  }

  .tiny-chat-form input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #cfc9bb;
    font-size: 0.9rem;
  }

  .tiny-chat-mic {
    background: #f1f6f3;
    border: 1px solid #cfc9bb;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    flex-shrink: 0;
  }

  .tiny-chat-mic-listening {
    background: #c0392b;
    border-color: #c0392b;
    animation: tiny-chat-pulse 0.8s ease-in-out infinite;
    font-size: 0;
    min-width: 2.2rem;
    min-height: 2.1rem;
    position: relative;
  }
  .tiny-chat-mic-listening::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.85rem;
    height: 0.85rem;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 2px;
  }

  .tiny-chat-mic-requesting {
    opacity: 0.6;
    animation: tiny-chat-pulse 0.4s ease-in-out infinite;
  }

  .tiny-chat-disclaimer {
    font-size: 0.72rem;
    color: #6b6457;
    padding: 0 0.85rem 0.75rem;
    margin: 0;
  }

  @media (max-width: 480px) {
    /* The header now has its own docked "Ask Tiny" entry point (packages/ui/
       components/Header.astro), inside the sticky header itself — so it can never
       overlap body text or the header's own nav links at any scroll position, unlike
       a separately floating fixed element. Hide this widget's own floating bubble on
       mobile entirely; the panel below still opens via the shared
       tiny-chat:open-request event the header button fires. */
    .tiny-chat-bubble {
      display: none;
    }

    .tiny-chat {
      position: fixed;
      top: 3.6rem;
      right: 0.75rem;
      bottom: auto;
      left: auto;
    }

    /* The panel now opens DOWNWARD from a top-anchored bubble instead of upward from
       a bottom-anchored one. */
    .tiny-chat-panel {
      top: calc(100% + 0.5rem);
      bottom: auto;
      height: min(calc(100vh - 6rem), 620px);
    }
  }

  /* ---- Inline mode (home pages): chat lives inside the hero card; no separate dialog box ---- */
  .tiny-chat.tiny-inline .tiny-chat-bubble { display: none; }
  .tiny-panel-inline {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto;
    box-shadow: none !important;
    border: 1px solid #e7e2d8;
    border-radius: 14px;
    text-align: left;
    color: #1a1406;
    overflow: hidden;
  }
  .tiny-panel-inline .tiny-chat-header { display: none; }
  .tiny-panel-inline .tiny-stage { height: auto; padding: 14px 0 6px; }
  .tiny-panel-inline .tiny-stage-figure { width: min(230px, 70vw); height: min(230px, 70vw); border-radius: 14px; }
  .tiny-panel-inline .tiny-chat-messages { min-height: 0; max-height: 340px; overflow-y: auto; }
