/*
 * Claire — AI assistant panel styles. Vendored verbatim from the Squarespace
 * footer injection (Rung 3 D5b). No external refs; the glyph is inline SVG.
 */
  /* === Shared glyph ============================================ */
  .claire-glyph {
    display: inline-flex; align-items: center; gap: 2px;
    color: #4d8990;
  }
  .claire-glyph svg { display: block; }

  /* === Dropdown Panel =========================================== */
  #claire-panel {
    position: fixed; bottom: 0; left: 50%;
    width: 100%; max-width: 1480px;
    height: 88vh; height: 88dvh;
    border-top: 1px solid #4d8990;
    border-left: 1px solid #4d8990;
    border-right: 1px solid #4d8990;
    background: rgba(15, 20, 25, 0.78);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    color: #E8ECEE;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    transform: translate(-50%, 100%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1.2, 0.36, 1), max-width 0.3s ease, opacity 0.3s ease;
    z-index: 2147483647;
    display: flex; flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
    border-radius: 16px 16px 0 0;
  }
  #claire-panel.open { transform: translate(-50%, 0); opacity: 1; }
  #claire-panel.expanded {
    max-width: 100vw;
    height: 100vh; height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }
  #claire-panel.expanded .claire-panel-header,
  #claire-panel.expanded .claire-messages,
  #claire-panel.expanded .claire-input-wrap {
    max-width: 960px;
  }


  .claire-panel-header {
    padding: 28px 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0; position: relative;
  }

.claire-lockup {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
  }
  .claire-lockup .claire-glyph svg { width: 28px; height: 28px; }
  .claire-lockup .claire-wordmark {
    font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
    color: #4d8990;
  }
  .claire-lockup .claire-ai-tag {
    font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
    line-height: 1; color: #4d8990; border: 1.5px solid #4d8990;
    padding: 4px 7px; border-radius: 5px;
    align-self: center; position: relative; top: -2px;
  }
  .claire-tagline {
    font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.7);
    margin: 0;
  }
  .claire-tagline em { font-style: italic; color: #4d8990; }
  .claire-section-cap {
    font-size: 10px; font-weight: 600; letter-spacing: 0.15em;
    text-transform: uppercase; color: #4d8990;
    margin: 18px 0 8px;
  }
  .claire-compliance {
    font-size: 12px; line-height: 1.5; color: rgba(255,255,255,0.55);
    margin: 0;
  }
  .claire-compliance strong { color: rgba(255,255,255,0.75); font-weight: 600; }


  /* Control strip at top of panel */
  .claire-control-strip {
    background: #4d8990;
    height: 44px; min-height: 44px; max-height: 44px;
    display: flex; align-items: center; justify-content: flex-end;
    gap: 4px;
    padding: 0 10px;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
    border-bottom: 2px solid #E6B84A;
    box-sizing: border-box;
  }
  #claire-panel.expanded .claire-control-strip { border-radius: 0; }
  .claire-control-strip button {
    background: none; border: none; color: #FFFFFF;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; margin: 0; flex: none;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .claire-control-strip button:hover { background: rgba(255,255,255,0.18); }
  .claire-control-strip button svg { display: block; width: 16px; height: 16px; }

  #claire-panel.expanded .claire-panel-expand svg { transform: rotate(180deg); }

  /* === Messages ================================================= */
  .claire-messages {
    flex: 1 1 0; min-height: 0; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px;
    display: flex; flex-direction: column; gap: 16px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
  }
  .claire-messages::-webkit-scrollbar { width: 6px; }
  .claire-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

  .claire-msg-row { display: flex; gap: 10px; max-width: 100%; }
  .claire-msg-row.user { justify-content: flex-end; }
  .claire-msg-row.assistant .claire-avatar {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(77,137,144,0.15); display: flex; align-items: center; justify-content: center;
    color: #4d8990; margin-top: 2px;
  }
  .claire-msg-row.assistant .claire-avatar svg { width: 16px; height: 16px; }

  .claire-msg {
    max-width: 88%;
    padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.55;
    word-wrap: break-word; overflow-wrap: break-word;
  }
  .claire-msg.user {
    background: #4d8990; color: #FFFFFF;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
  }
  .claire-msg.assistant {
    background: rgba(255,255,255,0.04); color: #E8ECEE;
    border: 1px solid rgba(255,255,255,0.06);
    border-bottom-left-radius: 4px;
  }
  .claire-msg.assistant p { margin: 0 0 10px 0; }
  .claire-msg.assistant p:last-child { margin-bottom: 0; }
  .claire-msg.assistant strong { font-weight: 600; color: #FFFFFF; }
  .claire-msg.assistant em { font-style: italic; }
  .claire-msg.assistant a {
    color: #6AAAB2; text-decoration: underline;
    text-underline-offset: 2px; word-break: break-word;
  }
  .claire-msg.assistant a:hover { color: #8BC4CB; }
  .claire-msg.assistant ul, .claire-msg.assistant ol {
    margin: 0 0 10px 0; padding-left: 20px;
  }
  .claire-msg.assistant li { margin-bottom: 4px; }
  .claire-msg.assistant hr {
    border: none; border-top: 1px solid rgba(255,255,255,0.1);
    margin: 14px 0;
  }
  .claire-msg.assistant .claire-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; max-width: 100%; }
  .claire-msg.assistant .claire-table {
    width: 100%; border-collapse: collapse; margin: 10px 0;
    font-size: 13px;
  }
  .claire-msg.assistant .claire-table th,
  .claire-msg.assistant .claire-table td {
    padding: 6px 8px; text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    vertical-align: top;
  }
  .claire-msg.assistant .claire-table th {
    color: #4d8990; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom-color: rgba(77,137,144,0.3);
  }
  .claire-msg.assistant .claire-table tr:last-child td { border-bottom: none; }
  .claire-msg.assistant.streaming::after { content: none; }
  @keyframes claire-glyph-pulse {
    0%, 100% { opacity: 0.55; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.08); }
  }
  .claire-msg-row.assistant .claire-avatar.thinking {
    animation: claire-glyph-pulse 1.2s ease-in-out infinite;
    color: #4d8990;
  }

  



  /* Always center content at 760px in bottom drawer */
  .claire-panel-header,
  .claire-messages,
  .claire-input-wrap {
    max-width: 760px; margin-left: auto; margin-right: auto; width: 100%;
  }
  .claire-panel-header { padding-top: 28px; }








  /* System messages (rate-limit warnings) */
  .claire-system-msg {
    text-align: center; font-size: 12px; line-height: 1.5;
    color: rgba(255,255,255,0.55); font-style: italic;
    padding: 8px 16px; margin: 4px 0;
  }
  .claire-system-msg a { color: #6AAAB2; text-decoration: underline; }

  /* === Suggested prompts ======================================== */
  .claire-suggestions {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 8px;
  }
  .claire-suggestion {
    text-align: left; background: rgba(77,137,144,0.08);
    border: 1px solid rgba(77,137,144,0.3); color: #E8ECEE;
    padding: 10px 14px; border-radius: 10px;
    font-size: 13px; font-family: inherit; cursor: pointer;
    transition: all 0.15s;
  }
  .claire-suggestion:hover {
    background: rgba(77,137,144,0.18); border-color: #4d8990;
  }

  /* === Input ==================================================== */
  .claire-input-wrap {
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
  }

  .claire-input-disclaimer {
    font-size: 11px; color: rgba(255,255,255,0.45);
    margin: 0 0 10px; line-height: 1.4;
  }
  .claire-input {
    display: flex; gap: 8px; align-items: flex-end;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px; padding: 6px 6px 6px 14px;
    transition: border-color 0.15s;
  }
  .claire-input:focus-within { border-color: rgba(77,137,144,0.5); }
  .claire-input textarea {
    flex: 1; resize: none; padding: 8px 0; background: transparent;
    border: none; color: #FFFFFF; font-size: 16px; font-family: inherit;
    line-height: 1.4; max-height: 100px; outline: none;
  }
  .claire-input textarea::placeholder { color: rgba(255,255,255,0.4); }
  .claire-send {
    background: #4d8990; color: white; border: none;
    width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer; font-size: 16px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
  }
  .claire-send:hover:not(:disabled) { background: #5BA0A8; }
  .claire-send:disabled { background: rgba(255,255,255,0.15); cursor: not-allowed; }

  /* === Backdrop ================================================= */
  #claire-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
    z-index: 2147483646;
  }
  #claire-backdrop.open { opacity: 1; pointer-events: auto; }
  @media (max-width: 900px) {
    #claire-backdrop { display: none; }
  }

  /* === Responsive =============================================== */
  /* Floating pill (all screen sizes) */
  #claire-mobile-launcher {
    display: inline-flex;
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
    transition: bottom 0.25s ease;
    align-items: center; gap: 8px;
    background: rgba(15, 20, 25, 0.94);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px;
    color: #FFFFFF;
    padding: 12px 18px 12px 14px;
    max-width: calc(100vw - 28px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.3);
    cursor: pointer;
    /* Roboto (site font) rather than inherit — the panel container sets a system
       stack, which left the "Ask Claire" pill off-brand vs the rest of the site. */
    font-family: 'Roboto', sans-serif; font-size: 15px; font-weight: 600;
    line-height: 1; white-space: nowrap;
    z-index: 99997;
    pointer-events: auto !important;
  }
  #claire-mobile-launcher .claire-glyph {
    color: #4d8990;
    display: inline-flex; align-items: center;
  }
  #claire-mobile-launcher .claire-glyph svg { width: 22px; height: 22px; }
  
  /* Hide pill when mobile menu is open */
  body.header-menu--open #claire-mobile-launcher,
  body[class*="menu-open"] #claire-mobile-launcher { display: none !important; }

  #claire-mobile-launcher .claire-ai-tag {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; letter-spacing: 0.04em; line-height: 1;
    padding: 4px 6px; border: 1.3px solid currentColor; border-radius: 5px;
    color: inherit;
  }
  @media (max-width: 900px) {
    #claire-panel {
      max-width: 100vw;
      height: 100vh; height: 100dvh;
      border-radius: 0;
      border-left: none;
      border-right: none;
      box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    }
    .claire-control-strip button.claire-panel-expand { display: none !important; }
    .claire-control-strip { border-radius: 0; }
  }
  @media (max-width: 600px) {
    .claire-panel-header { padding: 22px 20px 16px; }
    .claire-lockup .claire-wordmark { font-size: 24px; }
    .claire-lockup .claire-glyph svg { width: 36px; height: 36px; }
    .claire-messages { padding: 16px; }
    .claire-input-wrap { padding: 12px 16px 16px; }
  }
