/* PH Labs Assistant, using the live Maya chat's compact layout. On wide screens the launcher stands at the lower
   right. Up to 860px (the phone layout, where the bar shows the Menu button) it sits in the bar beside Menu, so it
   never covers the page's text or controls, and the panel opens under the bar. */
.phl-assistant-launch { position: fixed; z-index: 9999; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: #191919; color: #fff; box-shadow: 0 6px 20px #0f172a40; cursor: pointer; }
.phl-assistant-launch:hover { background: #282828; }
.phl-assistant-launch:focus-visible { outline: 3px solid #9aa4b2; outline-offset: 3px; }
.phl-assistant-launch svg { display: block; flex: 0 0 auto; }
.phl-assistant-launch .phl-assistant-launch__close { display: none; }
.phl-assistant-launch[aria-expanded="true"] .phl-assistant-launch__chat { display: none; }
.phl-assistant-launch[aria-expanded="true"] .phl-assistant-launch__close { display: block; }
.phl-assistant { position: fixed; z-index: 9998; inset: auto max(24px, env(safe-area-inset-right)) calc(max(24px, env(safe-area-inset-bottom)) + 72px) auto; margin: 0; width: min(370px, calc(100vw - 40px)); height: min(540px, calc(100vh - 120px)); height: min(540px, calc(100dvh - 120px - env(safe-area-inset-bottom))); max-width: none; max-height: none; padding: 0; border: 1px solid #e3e6eb; border-radius: 14px; color: #1c2430; color-scheme: light; background: #fff; box-shadow: 0 16px 48px #0f172a38; font: 400 14px/1.45 var(--sans); overflow: hidden; }
.phl-assistant[open] { display: flex; flex-direction: column; }
.phl-assistant::backdrop { background: transparent; }
.phl-assistant :is(button, textarea, a):focus-visible { outline: 2px solid #777; outline-offset: 2px; }
.phl-assistant__header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border: 0; background: #191919; color: #fff; }
.phl-assistant__header h2 { margin: 0; color: #fff; font: 600 15px/1.45 var(--sans); letter-spacing: 0; }
.phl-assistant__subtitle { margin: 2px 0 0; color: #bdbdbd; font: 400 12px/1.45 var(--sans); }
.phl-assistant__close { flex: 0 0 36px; width: 36px; height: 36px; padding: 2px 6px; border: 0; background: none; color: #fff; font: 400 26px/1 var(--sans); cursor: pointer; }
.phl-assistant__messages { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; padding: 14px; background: #fff; scrollbar-width: thin; }
.phl-assistant__message { flex: 0 0 auto; align-self: flex-start; max-width: 85%; margin: 0; padding: 9px 12px; border: 0; border-radius: 12px 12px 12px 4px; background: #f2f4f7; color: #1c2430; overflow-wrap: anywhere; }
.phl-assistant__message-label, .phl-assistant__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.phl-assistant__message-body { white-space: pre-wrap; margin: 0; font: 400 14px/1.45 var(--sans); }
.phl-assistant__message-body a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.phl-assistant__message--user { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: #191919; color: #fff; }
.phl-assistant__message--pending { color: #6a7480; }
/* the five topics, the families of the homepage: one per row, each a full touch target */
.phl-assistant__suggestions { display: grid; flex-shrink: 0; grid-template-columns: minmax(0, 1fr); gap: 6px; max-height: min(270px, 50%); overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 10px; background: #fff; scrollbar-width: thin; }
.phl-assistant__suggestions[hidden] { display: none; }
.phl-assistant__suggestions > p { margin: 0 0 2px; color: #606974; font: 400 12px/1.4 var(--sans); }
.phl-assistant__suggestions > button { min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid #e3e6eb; border-radius: 7px; background: #f8f9fa; color: #1c2430; font: 500 13px/1.35 var(--sans); text-align: left; cursor: pointer; }
.phl-assistant__suggestions > button:hover { border-color: #8e969e; background: #f2f4f7; }
.phl-assistant__form { flex-shrink: 0; margin: 0; padding: 10px; border-top: 1px solid #e3e6eb; background: #fff; }
.phl-assistant__compose { display: flex; gap: 8px; align-items: stretch; }
.phl-assistant__compose textarea { flex: 1; width: 100%; min-width: 0; height: 42px; min-height: 42px; max-height: 90px; resize: none; padding: 9px 11px; border: 1px solid #e3e6eb; border-radius: 8px; background: #fff; color: #1c2430; font: 400 14px/1.5 var(--sans); }
.phl-assistant__compose textarea::placeholder { color: #6a7480; }
.phl-assistant__compose button { flex-shrink: 0; min-width: 62px; padding: 0 16px; border: 0; border-radius: 8px; background: #191919; color: #fff; font: 400 14px/1.45 var(--sans); cursor: pointer; }
.phl-assistant button:disabled { opacity: .45; cursor: default; }
.phl-assistant__status { margin: 8px 1px 0; color: #555f6b; font: 400 12px/1.45 var(--sans); overflow-wrap: anywhere; }
.phl-assistant__status:empty { display: none; }
.phl-assistant__footer { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0; padding: 0 12px 8px; border: 0; background: #fff; color: #606974; font: 400 11px/1.4 var(--sans); }
.phl-assistant__footer button { border: 0; padding: 4px 0; background: none; color: #4b535d; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@media (pointer: coarse) { .phl-assistant__suggestions > button { min-height: 44px; } .phl-assistant__footer button { min-height: 32px; } }
/* phone layout: the launcher joins the bar, left of the Menu button (room for its "Close" label), styled like it */
@media (max-width: 860px) {
  .phl-assistant-launch { top: 12px; right: calc(var(--gutter, 18px) + 80px); bottom: auto; width: 40px; height: 40px; border: 1px solid var(--line-2, rgba(236, 239, 241, .24)); border-radius: 2px; background: transparent; color: var(--fg, #eceff1); box-shadow: none; }
  .phl-assistant-launch:hover { background: rgba(236, 239, 241, .06); }
  .phl-assistant-launch[aria-expanded="true"] { border-color: var(--fg, #eceff1); }
  .phl-assistant-launch:focus-visible { outline: 2px solid var(--signal, #ff3b2f); outline-offset: 3px; }
  .phl-assistant-launch svg { width: 20px; height: 20px; }
  .phl-assistant { inset: calc(var(--bar, 64px) + 8px) max(16px, env(safe-area-inset-right)) auto auto; width: min(400px, calc(100vw - 32px)); height: min(540px, calc(100vh - var(--bar, 64px) - 24px)); height: min(540px, calc(100dvh - var(--bar, 64px) - 24px)); }
  .phl-assistant__compose textarea { font-size: 16px; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) { .phl-assistant, .phl-assistant * { scroll-behavior: auto; } }
