.sp-ai { --sp-ai-ink: #202838; --sp-ai-muted: #606978; --sp-ai-line: #e1e4e9; --sp-ai-accent: #202838; --sp-ai-soft: #f8f7f4; --sp-ai-gold: #9b7a35; position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1080; color: var(--sp-ai-ink); font: 14px/1.45 Roboto, Arial, sans-serif; text-align: left; }
.sp-ai *, .sp-ai *::before, .sp-ai *::after { box-sizing: border-box; }
.sp-ai [hidden] { display: none !important; }
.sp-ai button, .sp-ai input, .sp-ai select, .sp-ai textarea { font: inherit; letter-spacing: normal; }
.sp-ai button { cursor: pointer; }
.sp-ai button:disabled { cursor: wait; opacity: .6; }
.sp-ai button:focus-visible, .sp-ai a:focus-visible, .sp-ai input:focus-visible, .sp-ai select:focus-visible, .sp-ai textarea:focus-visible { outline: 3px solid #b3914f; outline-offset: 3px; }
.sp-ai-launcher { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 0; border: 0; border-radius: 14px; background: transparent; }
.sp-ai__launcher-label { display: flex; align-items: center; min-height: 35px; padding: 0 11px; border: 1px solid #ddd9ce; border-radius: 14px 14px 3px 14px; background: #fffdf8; color: #80745c; font: 500 13px/1.2 Roboto, Arial, sans-serif; }
.sp-ai__astro { position: relative; flex: none; width: 44px; height: 44px; }
.sp-ai__astro svg { display: block; width: 100%; height: 100%; }
.sp-ai__astro-badge { position: absolute; right: -1px; bottom: 0; padding: 1px 3px; border: 1px solid #d7c4a0; border-radius: 5px; background: #fff8eb; color: #66583d; font: 600 11px/1.05 Arial, sans-serif; }
.sp-ai-launcher:hover .sp-ai__launcher-label, .sp-ai-launcher:focus-visible .sp-ai__launcher-label { background: #f7f1e4; border-color: #b5a581; color: #66583d; }
.sp-ai-send:hover, .sp-ai-button:not(.sp-ai-button--secondary):hover { background: #344056; }
.sp-ai-panel { position: absolute; right: 0; bottom: 0; display: flex; flex-direction: column; width: 400px; max-width: calc(100vw - 32px); height: min(690px, calc(100vh - 44px)); height: min(690px, calc(100dvh - 44px)); background: #fff; border: 1px solid var(--sp-ai-line); border-radius: 18px; box-shadow: 0 10px 44px #20384a38; overflow: hidden; }
.sp-ai-header { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; padding: 12px 14px; background: #f7f4ef; border-bottom: 1px solid var(--sp-ai-line); }
.sp-ai-header .sp-ai__astro { width: 38px; height: 38px; margin: 0; }
.sp-ai-header-copy { flex: 1; min-width: 0; }
.sp-ai-header h2 { font-size: 17px; line-height: 1.35; font-weight: 700; margin: 0 0 3px; color: var(--sp-ai-ink); }
.sp-ai-header p { font-size: 12px; color: var(--sp-ai-muted); margin: 0; }
.sp-ai-icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; background: #fff; color: var(--sp-ai-ink); border: 1px solid var(--sp-ai-line); border-radius: 50%; font-size: 28px !important; line-height: 1; }
.sp-ai-icon-button:hover { background: #f3f7f8; }
.sp-ai-header .sp-ai-icon-button { border: 0; border-radius: 9px; background: transparent; color: #526071; }
.sp-ai-header .sp-ai-icon-button:hover { background: #eae6df; }
.sp-ai-toolbar { display: flex; flex: 0 0 auto; justify-content: space-between; flex-wrap: wrap; gap: 4px 7px; padding: 6px 10px; border-bottom: 1px solid var(--sp-ai-line); }
.sp-ai-link-button { min-height: 38px; border: 0; border-radius: 6px; padding: 7px 4px; background: transparent; color: #526074; text-decoration: underline; text-underline-offset: 3px; font-size: 12px !important; }
.sp-ai-link-button:hover { background: #f3f1ec; color: var(--sp-ai-ink); }
.sp-ai-status { flex: 0 0 auto; margin: 8px 12px 0; padding: 10px 11px; background: #f1f7fa; border: 1px solid #c9e1e9; border-radius: 8px; overflow-wrap: anywhere; font-size: 13px; }
.sp-ai-status--error, .sp-ai-status.is-error { background: #fff2f0; border-color: #efc7c0; color: #863b31; }
.sp-ai-status button { margin: 6px 5px 0 0; }
.sp-ai-body { flex: 1 1 auto; min-height: 0; padding: 14px 13px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.sp-ai-notice { color: var(--sp-ai-muted); font-size: 12px; margin: 0 0 13px; overflow-wrap: anywhere; }
.sp-ai-history { display: grid; gap: 11px; }
.sp-ai-history-more { display: block; margin: 0 auto 12px; padding: 8px 12px; border: 1px solid var(--sp-ai-line); border-radius: 20px; background: #fff; color: var(--sp-ai-accent); }
.sp-ai-message { padding: 10px 12px; border: 1px solid var(--sp-ai-line); border-radius: 11px; background: #f7f9fa; overflow-wrap: anywhere; white-space: pre-wrap; min-width: 0; }
.sp-ai-message p { margin: 0 0 8px; }
.sp-ai-message p:last-child { margin-bottom: 0; }
.sp-ai-answer-text { line-height: 1.6; white-space: pre-wrap; }
.sp-ai-answer-text strong { font-weight: 700; color: var(--sp-ai-ink); }
.sp-ai-price-quote { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--sp-ai-line); white-space: normal; min-width: 0; }
.sp-ai-price-heading { color: var(--sp-ai-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sp-ai-price-product + .sp-ai-price-product { margin-top: 12px; }
.sp-ai-price-title { display: block; margin-bottom: 5px; color: var(--sp-ai-ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
a.sp-ai-price-title { text-decoration: underline; text-underline-offset: 3px; }
.sp-ai-price-table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; line-height: 1.4; }
.sp-ai-price-table th, .sp-ai-price-table td { padding: 6px 5px; border-bottom: 1px solid var(--sp-ai-line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sp-ai-price-table th { background: #f3f1ec; color: var(--sp-ai-muted); font-size: 11px; font-weight: 500; }
.sp-ai-price-table th:first-child { width: 42%; }
.sp-ai-price-table th:nth-child(2) { width: 25%; }
.sp-ai-price-table th:last-child { width: 33%; }
.sp-ai-price-table td:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-ai-price-note { margin-top: 7px !important; color: var(--sp-ai-muted); font-size: 11px; line-height: 1.45; }
.sp-ai-message--user { margin-left: 30px; background: #eef2f8; border-color: #d8e0ec; }
.sp-ai-message--assistant { margin-right: 12px; }
.sp-ai-message--latest { background: #fffcf6; border-color: #c9b589; box-shadow: inset 3px 0 0 #b3914f; }
.sp-ai-latest-label { display: block; margin: 0 0 7px; color: #78602e; font-size: 11px; font-weight: 600; }
.sp-ai-message--failed { border-color: #efc7c0; }
.sp-ai-message small, .sp-ai-message-time { display: block; font-size: 11px; color: var(--sp-ai-muted); margin-top: 6px; }
.sp-ai-waiting { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; gap: 12px; margin: 12px 12px 0 0; padding: 12px 14px; border: 1px solid #e1d7bf; border-radius: 11px; background: #faf7f0; box-shadow: 0 -4px 12px #20283808; }
.sp-ai-waiting-copy { min-width: 0; }
.sp-ai-waiting-copy p { margin: 0; font-size: 13px; font-weight: 500; }
.sp-ai-waiting-copy .sp-ai-waiting-time { margin-top: 3px; color: var(--sp-ai-muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.sp-ai-waiting-dots { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; min-height: 20px; }
.sp-ai-waiting-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9b7a35; animation: sp-ai-waiting-dot 1.2s ease-in-out infinite; }
.sp-ai-waiting-dots i:nth-child(2) { animation-delay: .15s; }
.sp-ai-waiting-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sp-ai-waiting-dot { 0%, 60%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.sp-ai-topics { margin: 0 0 16px; padding: 13px; border: 1px solid #e8e0d1; border-radius: 12px; background: var(--sp-ai-soft); }
.sp-ai-topics h3 { font-size: 14px; font-weight: 600; margin: 0; color: var(--sp-ai-ink); }
.sp-ai-welcome { margin: 9px 0 0; font-size: 13px; color: var(--sp-ai-muted); white-space: pre-line; }
.sp-ai-dialogue-navigation { display: flex; flex-basis: 100%; gap: 14px; margin-top: 3px; padding-top: 5px; border-top: 1px solid var(--sp-ai-line); }
.sp-ai-dialogue-navigation .sp-ai-link-button { min-height: 32px; padding: 5px 3px; border: 0; background: transparent; color: var(--sp-ai-muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.sp-ai-dialogue-navigation .sp-ai-link-button:hover { background: #f3f1ec; color: var(--sp-ai-ink); }
.sp-ai-mode-hint { flex: 0 0 auto; margin: 0; padding: 7px 13px; background: #f8f5ee; color: #6b5630; font-size: 12px; }
.sp-ai-refinement { border-color: #bbc5d3; font-size: 13px; }
.sp-ai-composer--disabled .sp-ai-send:disabled { cursor: not-allowed; }
.sp-ai-field-error { color: #863b31 !important; }
.sp-ai-field input[aria-invalid="true"] { border-color: #b95c4c; background: #fff8f6; }
.sp-ai-caption-confirm { padding: 13px; border: 1px solid #d2bd8f; border-radius: 10px; background: #fffcf6; }
.sp-ai-caption-confirm p { margin: 0 0 8px; }
.sp-ai-caption-preview { color: #6b5630; }
.sp-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 11px 0 0; white-space: normal; }
.sp-ai-actions button { padding: 9px 12px; min-height: 42px; border: 1px solid #ded5c3; border-radius: 10px; background: #fff; color: #6b5630; text-align: left; font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.sp-ai-actions button:hover { background: #f5efe2; border-color: #b99a60; }
.sp-ai-actions button.sp-ai-action--primary { background: var(--sp-ai-accent); border-color: var(--sp-ai-accent); color: #fff; font-weight: 600; }
.sp-ai-actions button.sp-ai-action--primary:hover { background: #344056; border-color: #344056; }
.sp-ai-actions > .sp-ai-field { width: 100%; margin-top: 3px; }
.sp-ai-actions select { width: 100%; min-height: 42px; min-width: 0; border: 1px solid #d4d9e1; border-radius: 8px; padding: 8px; background: #fff; color: var(--sp-ai-ink); }
.sp-ai-answer-links .sp-ai-button { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.sp-ai-context-actions { padding-top: 10px; border-top: 1px solid var(--sp-ai-line); }
.sp-ai-composer { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr) 44px; align-items: end; gap: 5px 6px; margin: 0; padding: 12px 16px; background: #fff; border-top: 1px solid var(--sp-ai-line); }
.sp-ai-input-label { grid-column: 1 / -1; margin: 0; font-size: 13px; font-weight: 600; }
.sp-ai-composer textarea { width: 100%; min-width: 0; min-height: 44px; max-height: 112px; field-sizing: content; resize: vertical; padding: 10px; border: 1px solid #ccd2d7; border-radius: 9px; font: 400 16px/22px Roboto, Arial, sans-serif; color: var(--sp-ai-ink); background: #fff; }
.sp-ai-composer textarea:disabled { background: #f3f4f6; color: var(--sp-ai-muted); cursor: not-allowed; }
.sp-ai-disclaimer { grid-column: 1 / -1; margin: 3px 0 0; color: var(--sp-ai-muted); font-size: 12px; line-height: 1.4; text-align: center;}
.sp-ai-send, .sp-ai-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--sp-ai-accent); padding: 10px 12px; border-radius: 9px; background: var(--sp-ai-accent); color: #fff; text-decoration: none; white-space: normal; text-align: center; }
.sp-ai-composer .sp-ai-send { width: 44px; height: 44px; padding: 0; background: #29364a; border: 0; }
.sp-ai-composer .sp-ai-send:not(:disabled):hover { background: #344056; }
.sp-ai-composer textarea:placeholder-shown + .sp-ai-send:not(:hover):not(:focus-visible) { background: #667283; }
.sp-ai-button--secondary { background: #fff; color: var(--sp-ai-accent); border-color: #cbd2de; }
.sp-ai-button--secondary:hover { background: #f0f3f8; }
.sp-ai-button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sp-ai-card-list { display: grid; gap: 9px; margin-top: 10px; }
.sp-ai-card { border: 1px solid var(--sp-ai-line); border-radius: 10px; background: #fff; padding: 11px; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.sp-ai-card h3, .sp-ai-card-title { display: block; margin: 0 0 7px; font-size: 15px; font-weight: 700; color: var(--sp-ai-ink); }
.sp-ai-card p { margin-bottom: 7px; }
.sp-ai-card select { max-width: 100%; width: 100%; margin: 4px 0; padding: 8px; border: 1px solid #c4d5d9; border-radius: 6px; background: #fff; }
.sp-ai-card img { display: block; width: 100%; height: auto; max-height: 230px; object-fit: contain; background: #f7f9fa; border-radius: 6px; }
.sp-ai-card .sp-ai-button { width: 100%; margin-top: 8px; }
.sp-ai-card a:not(.sp-ai-button) { display: inline-block; color: #6b5630; text-decoration: underline; text-underline-offset: 3px; }
.sp-ai-form-slot { margin-top: 14px; }
.sp-ai-form { display: grid; gap: 12px; margin: 0; padding: 13px 11px; background: #f6f9fa; border: 1px solid var(--sp-ai-line); border-radius: 12px; white-space: normal; }
.sp-ai-form h3 { font-size: 16px; margin: 0; }
.sp-ai-form p { margin: 0; }
.sp-ai-design-preview { display: grid; gap: 8px; min-width: 0; max-width: 100%; margin: 10px 0 12px; padding: 9px; border: 1px solid var(--sp-ai-line); border-radius: 9px; background: #fff; }
.sp-ai-design-preview-image { display: block; width: 100%; max-width: 100%; height: 180px; object-fit: contain; background: var(--sp-ai-soft); border-radius: 5px; }
.sp-ai-design-preview-title { min-width: 0; color: var(--sp-ai-ink); font-size: 13px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.sp-ai-field { display: grid; gap: 5px; min-width: 0; font-size: 13px; font-weight: 500; }
.sp-ai-field input, .sp-ai-field select, .sp-ai-field textarea, .sp-ai-form input:not([type=checkbox]):not([type=radio]), .sp-ai-form select, .sp-ai-form textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 42px; border: 1px solid #bdcfd4; border-radius: 7px; padding: 9px 10px; color: var(--sp-ai-ink); background: #fff; }
.sp-ai-form textarea { min-height: 76px; resize: vertical; }
.sp-ai-form label:has(input[type=checkbox]), .sp-ai-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 400; }
.sp-ai-form input[type=checkbox] { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--sp-ai-accent); }
.sp-ai-field small, .sp-ai-hint { font-size: 12px; font-weight: 400; color: var(--sp-ai-muted); }
.sp-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.sp-ai-grid .sp-ai-field--full { grid-column: 1 / -1; }
.sp-ai-form details { border-top: 1px solid var(--sp-ai-line); padding-top: 9px; }
.sp-ai-form summary { cursor: pointer; color: #6b5630; font-weight: 600; padding: 3px 0; }
.sp-ai-form details[open] > summary { margin-bottom: 10px; }
.sp-ai-review { display: grid; gap: 5px; min-width: 0; padding: 11px; border: 1px solid #bfddd4; background: #eff8f4; border-radius: 10px; overflow-wrap: anywhere; }
.sp-ai-review h3 { margin: 0 0 2px; font-size: 16px; line-height: 1.35; }
.sp-ai-review p { margin: 0; line-height: 1.45; }
.sp-ai-review > section { display: grid; gap: 3px; min-width: 0; }
.sp-ai-review > .sp-ai-button-row { gap: 8px; margin-top: 5px; }
.sp-ai-review-details { width: 100%; margin-top: 5px; }
.sp-ai-review-media { padding: 7px 9px; border-left: 3px solid #b6cec5; background: #f8fcfa; border-radius: 4px; }
.sp-ai-review > .sp-ai-review-actions { position: sticky; bottom: 0; z-index: 1; padding: 8px 0 2px; border-top: 1px solid #c8ded5; background: #eff8f4; }
.sp-ai-review dl { margin: 0; }
.sp-ai-review dt { font-size: 12px; color: var(--sp-ai-muted); font-weight: 500; margin-top: 6px; }
.sp-ai-review dd { margin: 1px 0 4px; }
.sp-ai-receipt { margin-top: 0; padding: 17px 15px; border: 1px solid #d9decf; border-radius: 13px; background: #f8faf5; overflow-wrap: anywhere; white-space: normal; }
.sp-ai-receipt-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 11px; }
.sp-ai-receipt-icon { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #e5ebdb; color: #425632; font-size: 18px; font-weight: 600; }
.sp-ai-receipt-header h3 { margin: 2px 0 0; color: var(--sp-ai-ink); font-size: 16px; line-height: 1.4; font-weight: 600; }
.sp-ai-receipt-id { display: inline-block; margin: 0 0 10px; padding: 3px 8px; border: 1px solid #dbe1d3; border-radius: 6px; background: #fff; color: #526045; font-size: 12px; }
.sp-ai-receipt-description { margin: 0; color: #525f50; font-size: 13px; line-height: 1.55; }
.sp-ai-receipt-details { display: grid; gap: 7px; margin: 13px 0 0; padding-top: 12px; border-top: 1px solid #dfe5d7; }
.sp-ai-receipt-details > div { display: grid; grid-template-columns: minmax(72px, .8fr) minmax(0, 1.2fr); gap: 10px; }
.sp-ai-receipt-details dt { margin: 0; color: var(--sp-ai-muted); font-size: 12px; font-weight: 400; }
.sp-ai-receipt-details dd { margin: 0; color: var(--sp-ai-ink); font-size: 13px; overflow-wrap: anywhere; }
.sp-ai-receipt-actions { display: grid; grid-template-columns: 1fr; gap: 11px; margin-top: 17px; padding-top: 14px; border-top: 1px solid #dfe5d7; }
.sp-ai-receipt-actions .sp-ai-button { width: 100%; min-height: 44px; margin: 0; font-weight: 500; }
.sp-ai-error { color: #9a3c32; font-size: 12px; }
.sp-ai-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; margin-top: 10px; min-width: 0; }
.sp-ai-media--single { grid-template-columns: minmax(0, 1fr); }
.sp-ai-media button { display: block; width: 100%; min-width: 0; padding: 0; border: 1px solid var(--sp-ai-line); border-radius: 9px; overflow: hidden; background: #fff; text-align: left; }
.sp-ai-media .sp-ai-media-button--portrait { grid-column: 1 / -1; }
.sp-ai-media button:hover { border-color: var(--sp-ai-gold); }
.sp-ai-media button:disabled { cursor: default; }
.sp-ai-media-visual { display: flex; align-items: center; justify-content: center; width: 100%; overflow: hidden; background: #f5f7f8; }
.sp-ai-media-visual .sp-ai-hint { padding: 12px; text-align: center; }
.sp-ai-media img { width: 100%; height: auto; display: block; object-fit: contain; }
.sp-ai-media figcaption, .sp-ai-media-caption { display: block; margin: 0; padding: 8px; color: var(--sp-ai-muted); font-size: 12px; white-space: normal; }
.sp-ai-media-title { display: block; color: var(--sp-ai-ink); font-weight: 500; overflow-wrap: anywhere; }
.sp-ai-media-description { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.sp-ai-media-dialog { border: 1px solid #c8d8dc; border-radius: 16px; padding: 22px; color: var(--sp-ai-ink); background: #fff; width: min(720px, calc(100vw - 28px)); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); overflow: auto; box-shadow: 0 16px 60px #20384a50; }
.sp-ai-media-dialog::backdrop { background: #102936aa; }
.sp-ai-media-close { position: absolute; right: 10px; top: 10px; }
.sp-ai-media-content { padding-top: 38px; }
.sp-ai-media-content img, .sp-ai-media-content video { display: block; width: 100%; height: auto; object-fit: contain; background: #f7f9fa; border-radius: 8px; }
.sp-ai-media-content video { max-height: 70vh; max-height: 70dvh; }
.sp-ai-media-content figcaption { margin-top: 10px; color: var(--sp-ai-muted); }
.sp-ai-reset-overlay { position: absolute; inset: 0; z-index: 2; display: grid; align-items: center; padding: 18px; overflow-y: auto; background: #eef1f5ed; }
.sp-ai-reset-card { min-width: 0; padding: 22px 18px; border: 1px solid #e0d8c8; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px #20283818; }
.sp-ai-reset-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; color: var(--sp-ai-ink); }
.sp-ai-reset-card p { margin: 0; line-height: 1.5; color: var(--sp-ai-muted); }
.sp-ai-reset-buttons { display: grid; gap: 12px; margin-top: 22px; }
.sp-ai-reset-buttons .sp-ai-button { width: 100%; min-height: 46px; font-weight: 500; }
.sp-ai-reset-buttons .sp-ai-button--secondary { order: 1; }
.sp-ai-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sp-ai-caption-list { flex: 0 0 100%; margin: 0; padding-left: 23px; display: grid; gap: 12px; }
.sp-ai-caption-list li { padding: 10px 12px; border: 1px solid var(--sp-ai-line, #dce3eb); border-radius: 10px; background: #fff; }
.sp-ai-caption-list p { margin: 0 0 9px; line-height: 1.55; overflow-wrap: anywhere; }
.sp-ai-caption-list .sp-ai-button { min-height: 38px; }
.sp-ai-quiz .sp-ai-quiz-progress { margin: 0 0 6px; font-size: 12px; color: var(--sp-ai-muted); }
.sp-ai-quiz progress { display: block; width: 100%; height: 6px; margin: 0 0 16px; border: 0; accent-color: #ac8849; }
.sp-ai-quiz h3 { margin-bottom: 10px; }
.sp-ai-quiz-buttons { margin-top: 20px; }
.sp-ai-quiz-shortcut { width: 100%; margin-top: 12px; }
.sp-ai-quiz-navigation { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #e4e8ed; }
.sp-ai-anchor-space { pointer-events: none; }
.sp-ai--open .sp-ai-launcher { display: none; }
.sp-ai--checkout-input:not(.sp-ai--open) .sp-ai-launcher { display: none; }
body.site-mobile-nav-open .sp-ai:not(.sp-ai--open), body.rvp-lightbox-open .sp-ai:not(.sp-ai--open) { visibility: hidden; }
@media (min-width: 992px) {
    /* The desktop chat is non-modal: an open catalogue menu takes precedence. */
    body:has(.site-nav-dropdown.is-open) .sp-ai { z-index: 79; }
}
@media (max-width: 991.98px) {
    .sp-ai { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    /* The surface covers the page; only the controls follow the keyboard and safe area. */
    .sp-ai--open { inset: 0; background: var(--sp-ai-soft); }
    .sp-ai-launcher { min-height: 46px; gap: 1px; }
    .sp-ai__launcher-label { min-height: 30px; padding: 0 9px; border-radius: 12px 12px 3px 12px; font-size: 12px; }
    .sp-ai__astro { width: 36px; height: 36px; margin-inline: 2px; }
    .sp-ai:not(.sp-ai--open) { bottom: max(calc(12px + env(safe-area-inset-bottom, 0px)), calc(var(--sp-ai-launcher-offset, 0px) + 12px)); }
    .sp-ai-panel { position: fixed; right: calc(8px + env(safe-area-inset-right, 0px)); left: calc(8px + env(safe-area-inset-left, 0px)); top: calc(var(--sp-ai-vtop, 0px) + 8px + env(safe-area-inset-top, 0px)); bottom: auto; width: auto; max-width: none; height: calc(var(--sp-ai-vh, 100dvh) - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); max-height: none; border-radius: 14px; box-shadow: none; }
    .sp-ai-header { padding: 12px 10px 10px 14px; }
    .sp-ai-header h2 { font-size: 16px; }
    .sp-ai-body { padding: 12px 10px; }
    .sp-ai-composer { padding: 8px 9px calc(9px + env(safe-area-inset-bottom, 0px)); }
    .sp-ai-composer textarea, .sp-ai-form input, .sp-ai-form select, .sp-ai-form textarea { font-size: 16px; }
    .sp-ai-message--user { margin-left: 18px; }
    .sp-ai-message--assistant { margin-right: 5px; }
    .sp-ai-media-dialog { width: calc(100vw - 20px); padding: 15px; }
    .sp-ai--keyboard-compact .sp-ai-panel {
        top: calc(var(--sp-ai-vtop, 0px) + env(safe-area-inset-top, 0px));
        height: calc(var(--sp-ai-vh, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
    .sp-ai--keyboard-compact .sp-ai-header { padding: 2px 8px 2px 12px; }
    .sp-ai--keyboard-compact .sp-ai-header h2 { margin: 0; }
    .sp-ai--keyboard-compact .sp-ai-header p,
    .sp-ai--keyboard-compact .sp-ai-toolbar,
    .sp-ai--keyboard-compact .sp-ai-mode-hint { display: none; }
    .sp-ai--keyboard-compact .sp-ai-body { padding-block: 6px; }
    .sp-ai--keyboard-compact .sp-ai-status { max-height: 30%; overflow-y: auto; margin: 3px 8px 0; padding: 4px 8px; }
    .sp-ai--keyboard-compact .sp-ai-composer { padding: 4px 8px; gap: 3px 8px; }
    .sp-ai--keyboard-compact .sp-ai-composer textarea {
        height: 44px;
        padding-block: 8px;
        resize: none;
    }
    .sp-ai--keyboard-compact .sp-ai-waiting { margin-top: 6px; padding: 4px 8px; }
    .sp-ai--keyboard-compact .sp-ai-quiz { row-gap: 8px; }
    .sp-ai--keyboard-compact .sp-ai-quiz-buttons { margin-top: 0; }
    .sp-ai--keyboard-compact .sp-ai-review > .sp-ai-review-actions { position: static; }
}
@media (max-width: 380px) {
    .sp-ai-grid { grid-template-columns: 1fr; }
    .sp-ai-grid .sp-ai-field--full { grid-column: auto; }
    .sp-ai-toolbar { gap: 0 6px; }
    .sp-ai-link-button { font-size: 11px !important; }
}
@media (prefers-reduced-motion: reduce) { .sp-ai *, .sp-ai *::before, .sp-ai *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
