.ai-assistant-panel { width: min(440px, calc(100vw - 28px)); height: min(720px, calc(100dvh - 150px)); max-height: calc(100dvh - 150px); grid-template-rows: auto auto auto minmax(100px, 1fr) auto auto auto auto; }
.ai-assistant-panel [hidden] { display: none !important; }
.ai-support-account, .ai-support-toolbar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.ai-support-account span { flex: 1; font-size: 11px; color: var(--muted); }
.ai-support-account button, .ai-support-toolbar button, .ai-support-outcomes button, #aiSupportReview { min-height: 32px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--brand-navy); cursor: pointer; font-size: 11px; }
#aiSupportConnect { background: var(--brand-navy); color: white; }
.ai-support-toolbar select { flex: 1; min-width: 0; max-width: 100%; min-height: 34px; font-size: 11px; }
.ai-assistant-panel .ai-conversation { min-height: 100px; overscroll-behavior: contain; }
.ai-assistant-panel .ai-message { font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-assistant-panel .ai-message a, .ai-support-solution a { display: block; margin-top: 8px; font-size: 11px; text-decoration: underline; }
.ai-support-solution { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--brand-turquoise-pale); overflow: auto; max-height: 220px; color: var(--brand-navy); }
.ai-support-solution > strong { font-size: 13px; }
.ai-support-solution p { margin: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.ai-support-outcomes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-support-outcomes button:first-child { color: white; background: var(--brand-turquoise-dark); }
.ai-support-feedback { padding: 5px 14px; font-size: 11px; color: var(--muted); }
#aiSupportError { color: #ac302e; margin: 4px 0; }
#aiSupportError:empty { display: none; }
.ai-assistant-panel .ai-command-form { margin: 0; }
.ai-assistant-panel .ai-command-form input { font-size: 12px; }
.ai-assistant-panel button:disabled { opacity: .55; cursor: default; }
.ai-support-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; padding: 0 14px 12px; }
.ai-support-footer .ai-voice-status { padding: 0; margin: 0; font-size: 10px; }
.ai-support-footer a { font-size: 10px; }
.ai-profile-form { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink, var(--brand-navy)); min-width: 0; align-content: start; }
.ai-profile-form > strong { font-size: 14px; line-height: 1.4; }
.ai-profile-form .ai-profile-note { margin: 0 0 4px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.ai-profile-form label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.5; font-weight: 600; }
.ai-profile-form input[type="tel"] { width: 100%; min-width: 0; box-sizing: border-box; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; background: var(--paper); color: inherit; }
.ai-profile-form input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0; accent-color: var(--brand-turquoise-dark); }
.ai-profile-form > button { justify-self: end; min-height: 34px; padding: 7px 14px; border: 1px solid var(--brand-turquoise-dark); border-radius: 8px; color: white; background: var(--brand-turquoise-dark); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ai-profile-form details { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.ai-profile-form summary { cursor: pointer; font-weight: 600; }
.ai-profile-form pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; max-height: 200px; overflow: auto; }
.ai-assistant-panel.is-setup .ai-support-toolbar, .ai-assistant-panel.is-setup .ai-command-form, .ai-assistant-panel.is-setup .ai-support-footer { display: none; }
.ai-assistant-panel.is-setup { grid-template-rows: auto auto minmax(100px, 1fr) auto; }
.ai-assistant-panel.is-setup .ai-conversation { align-content: start; }
/* Rest at the lower edge; keep clearance while a form dialog is open. */
.ai-assistant-launcher { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
body:has(dialog[open]):not(:has(.sp-dialog[open])) .ai-assistant-launcher { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
.ai-assistant-launcher > :is(img, span) { pointer-events: none; }
.ai-assistant-launcher:not(.is-connected) .ai-online-dot { background: #91a2aa; box-shadow: none; animation: none; }
@media (max-width: 600px) {
  .ai-assistant-launcher { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  body:has(dialog[open]):not(:has(.sp-dialog[open])) .ai-assistant-launcher { bottom: calc(144px + env(safe-area-inset-bottom, 0px)); }
  .ai-assistant-panel { bottom: 110px; right: 10px; height: calc(100dvh - 126px); max-height: calc(100dvh - 126px); width: calc(100vw - 20px); }
  .ai-assistant-panel > header { padding: 11px 14px; }
  .ai-support-solution { max-height: 190px; }
}
.ai-media-watch { display: inline-flex; align-items: center; min-height: 36px; margin: 8px 6px 0 0; padding: 8px 14px; border: 1px solid var(--brand-turquoise-dark); border-radius: 9px; background: var(--brand-turquoise-dark); color: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ai-media-player { position: fixed; inset: 82px 18px auto auto; margin: 0; padding: 0; width: min(440px, calc(100vw - 24px)); z-index: 1500; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); color: var(--ink, var(--brand-navy)); box-shadow: 0 12px 40px #10234040; font-family: var(--ui-font, sans-serif); }
.ai-media-player::backdrop { background: transparent; pointer-events: none; }
.ai-media-player > header { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: linear-gradient(110deg, #1c3156, #397c80); color: #fff; }
.ai-media-player > header strong { flex: 1; font-size: 12px; }
.ai-media-player > header button { min-height: 28px; border: 1px solid #ffffff55; border-radius: 7px; padding: 4px 8px; background: #ffffff15; color: #fff; font: inherit; font-size: 11px; cursor: pointer; }
.ai-media-player-body { max-height: calc(100dvh - 150px); overflow: auto; }
.ai-media-player-body[hidden] { display: none; }
.ai-media-player :is(video, img) { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #101820; }
.ai-media-player p { padding: 9px 12px; margin: 0; font-size: 11px; line-height: 1.5; }
.ai-media-player button:focus-visible, .ai-media-watch:focus-visible { outline: 2px solid #7960ee; outline-offset: 2px; }
@media (max-width: 600px) { .ai-media-player { right: 12px; top: 64px; } }
