/* The site assistant's chat (assistant-chat.js). Its colours are its own variables: a site sets --aic-* on :root to
   match its look; the defaults follow the system's light / dark choice and a site's data-theme="dark|light". */
:root {
    --aic-bg: #ffffff; --aic-bg-2: #f2f4f7; --aic-ink: #1b2330; --aic-ink-2: #4a5568; --aic-ink-3: #6b7280;
    --aic-border: #dde2ea; --aic-border-strong: #b8c0cc; --aic-accent: #1f5fbf; --aic-accent-ink: #ffffff;
    --aic-mine: #e3ecfa; --aic-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    --aic-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --aic-bg: #161b22; --aic-bg-2: #212833; --aic-ink: #e6e9ee; --aic-ink-2: #b4bcc8; --aic-ink-3: #8b95a3;
        --aic-border: #2d3542; --aic-border-strong: #444f60; --aic-accent: #6ea8ff; --aic-accent-ink: #0b1220;
        --aic-mine: #22344f; --aic-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    }
}
:root[data-theme="dark"] {
    --aic-bg: #161b22; --aic-bg-2: #212833; --aic-ink: #e6e9ee; --aic-ink-2: #b4bcc8; --aic-ink-3: #8b95a3;
    --aic-border: #2d3542; --aic-border-strong: #444f60; --aic-accent: #6ea8ff; --aic-accent-ink: #0b1220;
    --aic-mine: #22344f; --aic-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.aic { position: fixed; right: 18px; bottom: 18px; z-index: 2147483000; font-family: var(--aic-font); }
.aic[hidden], .aic-open[hidden], .aic-panel[hidden] { display: none; }
.aic-open {
    display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--aic-font);
    padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--aic-accent); color: var(--aic-accent-ink); box-shadow: var(--aic-shadow);
}
.aic-panel {
    width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 100px));
    display: flex; flex-direction: column; background: var(--aic-bg); color: var(--aic-ink);
    border: 1px solid var(--aic-border-strong); border-radius: 14px; box-shadow: var(--aic-shadow);
}
@media (max-width: 480px) { .aic { right: 12px; bottom: 12px; } }
.aic-panel .aic-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--aic-border); }
.aic-panel .aic-head div { flex: 1; display: flex; flex-direction: column; }
.aic-panel .aic-head small { color: var(--aic-ink-3); font-size: 12px; line-height: 1.35; }
.aic-panel .aic-head button { background: none; border: 0; color: var(--aic-ink-2); cursor: pointer; font: inherit; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.aic-panel .aic-head button:hover { background: var(--aic-bg-2); color: var(--aic-ink); }
.aic-panel .aic-head .aic-close { font-size: 22px; line-height: 1; }
.aic-log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.aic-log li { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.aic-log li p { margin: 0; white-space: pre-line; }
.aic-log li a { display: inline-block; margin-top: 6px; font-weight: 600; color: var(--aic-accent); }
.aic-log .mine { align-self: flex-end; background: var(--aic-mine); }
.aic-log .theirs { align-self: flex-start; background: var(--aic-bg-2); }
.aic-log .refused { color: var(--aic-ink-2); }
.aic-more { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--aic-border); display: flex; flex-direction: column; gap: 2px; }
.aic-more small { color: var(--aic-ink-3); font-size: 12px; }
.aic-log li .aic-more a { margin-top: 0; font-weight: 500; }
.aic-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--aic-border); }
.aic-form input {
    flex: 1; min-width: 0; font: 15px var(--aic-font); padding: 9px 12px; border-radius: 8px;
    border: 1px solid var(--aic-border-strong); background: var(--aic-bg); color: var(--aic-ink);
    font-variant-ligatures: none;
}
.aic-send { font: 600 14px var(--aic-font); padding: 9px 14px; border-radius: 8px; border: 0; cursor: pointer; background: var(--aic-accent); color: var(--aic-accent-ink); }
.aic-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aic-mark { outline: 3px solid var(--aic-accent); outline-offset: 4px; border-radius: 4px; transition: outline-color .4s; }
.aic-wait { display: flex; gap: 4px; align-items: center; min-height: 34px; }
.aic-wait span { width: 6px; height: 6px; border-radius: 50%; background: var(--aic-ink-3); animation: aic-dot 1s infinite ease-in-out; }
.aic-wait span:nth-child(2) { animation-delay: .15s; }
.aic-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes aic-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aic-wait span { animation: none; opacity: .6; } }
@media print { .aic { display: none; } }
/* the documentation's examples in an answer (```sql ... ```) */
.aic-log li p + p, .aic-log li pre + p { margin-top: 6px; }
.aic-log li pre { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(127, 127, 127, .12); overflow-x: auto; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; font-variant-ligatures: none; }
