/* The support assistant (components/support): the floating chat button and panel on hub pages, and the inline chat on /contact.
   Tokens come from the design system (pt.css, scoped to .pt-root), so it follows light and dark with the rest of the page. */

.pt-root.hub-chat-root { background: none !important; background-image: none !important; min-height: 0; margin: 0; }

.pt-root .hub-chat-launcher {
  position: fixed; z-index: 65; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--glass-rim)); background: var(--surface-200); color: var(--ink);
  font: 650 14px/20px var(--font-sans); box-shadow: var(--shadow-float); cursor: pointer;
}
.pt-root .hub-chat-launcher:hover { border-color: var(--accent); }
.pt-root .hub-chat-launcher:focus-visible, .pt-root .hub-chat button:focus-visible, .pt-root .hub-chat textarea:focus-visible, .pt-root .hub-chat input:focus-visible, .pt-root .hub-chat a:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.pt-root .hub-chat-launcher svg { flex: none; color: var(--accent-text); }
@media (max-width: 480px) { .pt-root .hub-chat-launcher { padding: 0 14px; } .pt-root .hub-chat-launcher .hub-chat-launcher-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
/* Lifted over the bottom bars of checkout and the calculator on phones. */
@media (max-width: 959.98px) { body:has(.co-summary) .pt-root .hub-chat-launcher { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 760px) { body:has(.calc-sticky) .pt-root .hub-chat-launcher { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
body:has(.pt-tb-tray) .pt-root .hub-chat-launcher { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }

.pt-root .hub-chat-dialog {
  position: fixed; z-index: 85; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 104px));
  display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 1px solid var(--glass-rim); background: var(--surface-200); box-shadow: var(--shadow-float); overflow: hidden;
}
@media (max-width: 560px) {
  .pt-root .hub-chat-dialog { inset: 0; width: 100%; height: 100dvh; max-height: none; border-radius: 0; border: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); box-sizing: border-box; }
}

.pt-root .hub-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; color: var(--ink); font: 400 15px/22px var(--font-sans); }
.pt-root .hub-chat-dialog .hub-chat { flex: 1; }
.pt-root .hub-chat-inline { border-radius: var(--radius-lg); border: 1px solid var(--glass-rim); background: var(--surface-200); box-shadow: var(--shadow-glass); height: min(620px, 78dvh); overflow: hidden; }
.pt-root .hub-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.pt-root .hub-chat-head h2 { margin: 0; font: 650 16px/22px var(--font-sans); flex: 1; min-width: 0; }
.pt-root .hub-chat-head p { margin: 0; color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.pt-root .hub-chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex: none; }
.pt-root .hub-chat-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--ink-muted); cursor: pointer; }
.pt-root .hub-chat-icon:hover { color: var(--ink); background: var(--surface-300); }

.pt-root .hub-chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pt-root .hub-chat-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.pt-root .hub-chat-msg.is-user { align-self: flex-end; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-bottom-right-radius: 4px; }
.pt-root .hub-chat-msg.is-assistant, .pt-root .hub-chat-msg.is-staff { align-self: flex-start; background: var(--surface-300); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.pt-root .hub-chat-msg.is-staff { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pt-root .hub-chat-msg .hub-chat-who { display: block; margin-bottom: 2px; color: var(--ink-muted); font: 600 11px/16px var(--font-sans); text-transform: uppercase; letter-spacing: .04em; }
.pt-root .hub-chat-msg a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.pt-root .hub-chat-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.pt-root .hub-chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); animation: hub-chat-blink 1.2s infinite ease-in-out; }
.pt-root .hub-chat-typing i:nth-child(2) { animation-delay: .15s; } .pt-root .hub-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hub-chat-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pt-root .hub-chat-typing i { animation: none; opacity: .6; } }

.pt-root .hub-chat-intro { color: var(--ink-muted); margin: 0; }
.pt-root .hub-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-root .hub-chat-chip { min-height: 36px; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 500 13px/18px var(--font-sans); cursor: pointer; text-align: left; }
.pt-root .hub-chat-chip:hover { border-color: var(--accent); }

.pt-root .hub-chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.pt-root .hub-chat-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; box-sizing: border-box; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-100); color: var(--ink); font: 400 16px/22px var(--font-sans); }
.pt-root .hub-chat-send { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); border: 0; background: var(--brand); color: var(--on-brand); cursor: pointer; }
.pt-root .hub-chat-send:disabled { opacity: .5; cursor: default; }
.pt-root .hub-chat-foot { padding: 0 12px 12px; display: grid; gap: 8px; color: var(--ink-muted); font-size: 12px; line-height: 17px; }
.pt-root .hub-chat-foot p { margin: 0; }
.pt-root .hub-chat-foot a { color: var(--link); }
.pt-root .hub-chat-follow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pt-root .hub-chat-follow input { flex: 1 1 180px; min-width: 0; height: 40px; box-sizing: border-box; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-100); color: var(--ink); font: 400 16px/22px var(--font-sans); }
.pt-root .hub-chat-follow button, .pt-root .hub-chat-link { height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 600 13px/18px var(--font-sans); cursor: pointer; }
.pt-root .hub-chat-link { height: auto; padding: 0; border: 0; color: var(--link); text-decoration: underline; font-weight: 500; }
.pt-root .hub-chat-error { margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--ink); }

/* The contact page (components/hub/pages/HubContact.jsx). */
.pt-root .hub-contact-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "email" "chat" "rest"; align-items: start; }
.pt-root .hub-contact-email { grid-area: email; } .pt-root .hub-contact-chat { grid-area: chat; min-width: 0; } .pt-root .hub-contact-rest { grid-area: rest; min-width: 0; }
@media (min-width: 960px) { .pt-root .hub-contact-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "email chat" "rest chat"; grid-template-rows: auto 1fr; } .pt-root .hub-contact-chat { position: sticky; top: 88px; align-self: start; } }
.pt-root .hub-contact-paths { display: grid; gap: 16px; }
.pt-root .hub-contact-path { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--glass-rim); background: var(--surface-200); min-width: 0; }
.pt-root .hub-contact-path h3 { margin: 0 0 4px; }
.pt-root .hub-contact-path ul { margin: 12px 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-muted); }
.pt-root .hub-contact-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pt-root .hub-contact-links a, .pt-root .hub-contact-email a { color: var(--link); }
.pt-root .hub-contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 16px 20px; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--glass-rim)); background: var(--surface-200); overflow-wrap: anywhere; }
.pt-root .hub-contact-email strong { font: 700 20px/26px var(--font-sans); }
.pt-root .hub-contact-times { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--ink-muted); }

/* The support inbox in /partners/admin (components/hub/pages/partners/AdminSupport.jsx). */
.pt-root .hub-sa-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pt-root .hub-sa-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pt-root .hub-sa-select { height: 32px; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-100); color: var(--ink); font: 400 14px/20px var(--font-sans); }
.pt-root .hub-sa-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .pt-root .hub-sa-grid.is-open { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); } .pt-root .hub-sa-back { display: none; } }
@media (max-width: 999.98px) { .pt-root .hub-sa-grid.is-open .hub-sa-list { display: none; } }
.pt-root .hub-sa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 760px; overflow-y: auto; min-width: 0; }
.pt-root .hub-sa-item { display: grid; gap: 4px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-200); color: var(--ink); cursor: pointer; font: inherit; min-width: 0; }
.pt-root .hub-sa-item:hover, .pt-root .hub-sa-item.is-active { border-color: var(--accent); }
.pt-root .hub-sa-item:focus-visible, .pt-root .hub-sa-textarea:focus-visible, .pt-root .hub-sa-select:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.pt-root .hub-sa-item-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.pt-root .hub-sa-item-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pt-root .hub-sa-preview { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pt-root .hub-sa-thread { display: grid; gap: 16px; min-width: 0; }
.pt-root .hub-sa-thread-head { display: grid; gap: 8px; }
.pt-root .hub-sa-flag { margin: 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--amber) 14%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); display: flex; gap: 6px; align-items: center; }
.pt-root .hub-sa-messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pt-root .hub-sa-msg { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-200); min-width: 0; }
.pt-root .hub-sa-msg.is-out { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.pt-root .hub-sa-msg.is-ai { border-style: dashed; }
.pt-root .hub-sa-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14px/21px var(--font-sans); color: var(--ink); max-height: 420px; overflow-y: auto; }
.pt-root .hub-sa-textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-100); color: var(--ink); font: 400 15px/22px var(--font-sans); resize: vertical; }
.pt-root .hub-sa-tools, .pt-root .hub-sa-atts { margin: 6px 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }
