/* Partner Hub AI assistant — ported from Client Hub (US9).
 * Brand palette only. No blue anywhere. */

/* ────────────────────────────── Floating action button ────────────────────────────── */

.ai-assistant-fab-wrapper {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
}

.ai-assistant-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--an-shadow-card);
    background: linear-gradient(135deg, var(--an-red-deep) 0%, var(--an-red) 100%);
    color: white;
    transition: transform var(--an-duration-fast) var(--an-ease), box-shadow var(--an-duration-fast) var(--an-ease);
}

.ai-assistant-fab:hover {
    transform: translateY(-2px);
    box-shadow: var(--an-shadow-red);
}

/* ────────────────────────────── Brand mark (AN logo + sparkles) ────────────────────────────── */

.ai-brand-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    line-height: 0;
}

.ai-brand-logo {
    display: block; /* white asset (an-icon-white.png) — no invert filter needed */
}

.ai-brand-logo-red {
    filter: none;
}

.ai-brand-sparkle {
    position: absolute;
    pointer-events: none;
    color: var(--an-on-red-heading);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

.ai-brand-sparkle-tr {
    top: -6px;
    right: -6px;
}

.ai-brand-sparkle-bl {
    bottom: -4px;
    left: -4px;
    opacity: 0.75;
}

/* Size variants */
.ai-brand-mark-fab { width: 28px; height: 28px; }
.ai-brand-mark-fab .ai-brand-logo { width: 28px; height: auto; }
.ai-brand-mark-fab .ai-brand-sparkle-tr { width: 14px; height: 14px; top: -7px; right: -6px; }
.ai-brand-mark-fab .ai-brand-sparkle-bl { width: 10px; height: 10px; bottom: -5px; left: -4px; }

.ai-brand-mark-header { width: 22px; height: 22px; }
.ai-brand-mark-header .ai-brand-logo { width: 22px; height: auto; }
.ai-brand-mark-header .ai-brand-sparkle-tr { width: 12px; height: 12px; top: -5px; right: -5px; }
.ai-brand-mark-header .ai-brand-sparkle-bl { width: 9px; height: 9px; bottom: -4px; left: -4px; }

.ai-brand-mark-welcome { width: 44px; height: 44px; color: var(--an-red-text); }
.ai-brand-mark-welcome .ai-brand-logo { width: 44px; height: auto; }
.ai-brand-mark-welcome .ai-brand-sparkle { color: var(--an-red-text); }
.ai-brand-mark-welcome .ai-brand-sparkle-tr { width: 20px; height: 20px; top: -10px; right: -10px; }
.ai-brand-mark-welcome .ai-brand-sparkle-bl { width: 14px; height: 14px; bottom: -6px; left: -6px; }

@media (max-width: 480px) {
    .ai-assistant-fab-wrapper {
        right: 16px;
        bottom: 16px;
    }

    /* 48px is still a comfortable thumb target and covers a third less of whatever it lands
       on — at 390px that was the score and the "worked" check of the first board card. */
    .ai-assistant-fab {
        width: 48px;
        height: 48px;
    }
}

/* The FAB is z-index 1200 and the responsive drawer's scrim is below it, so with the nav open
   the assistant button floated over the dimmed page, tappable. Nothing else is; it hides. */
body:has(.mud-drawer-overlay--open) .ai-assistant-fab-wrapper {
    display: none;
}

/* ────────────────────────────── Popover window ────────────────────────────── */

.ai-assistant-popover {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 420px;
    height: min(640px, calc(100vh - 140px));
    background: white;
    border-radius: 16px;
    box-shadow: var(--an-shadow-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1200;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity var(--an-duration-fast) var(--an-ease), transform var(--an-duration-fast) var(--an-ease);
}

.ai-assistant-popover.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 600px) {
    /* Let top/right/bottom/left define the box so Safari's dynamic UI (URL bar,
     * bottom toolbar) doesn't push the header/footer off-screen the way 100vh does.
     * Start just under the MudAppBar (64px) — we bleed up by 2px so the AppBar's
     * elevation shadow doesn't leave a visible sliver of page content between the
     * bar and the chat's red header. z-index stays at 1200 (below AppBar ~1300)
     * so the AppBar + banner remain fully interactive above the chat. */
    .ai-assistant-popover.open {
        right: 0;
        bottom: 0;
        left: 0;
        top: 62px;
        width: auto;
        height: auto;
        max-height: none;
        border-radius: 0;
        transform: none;
    }

    /* Lock the page behind the open popover so swipes inside the chat don't
     * scroll the portal content through. :has() is supported on iOS 15.4+,
     * which covers the iPhone 15 Pro baseline. */
    html:has(.ai-assistant-popover.open),
    body:has(.ai-assistant-popover.open) {
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: none;
    }

    /* The chat body itself still needs to scroll; re-enable touch there and
     * contain overscroll so reaching the top/bottom doesn't chain anywhere. */
    .ai-assistant-popover.open .ai-assistant-body {
        touch-action: pan-y;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Respect the iPhone notch / status bar at the top of the header. */
    .ai-assistant-header {
        padding: calc(10px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 10px calc(12px + env(safe-area-inset-left));
        gap: 4px;
    }

    .ai-assistant-header-title {
        font-size: 0.95rem;
        gap: 8px;
    }

    .ai-assistant-header-actions {
        gap: 0;
    }

    /* Fullscreen toggle is meaningless when the popover already fills the screen. */
    .ai-header-action-fullscreen {
        display: none !important;
    }

    /* Respect the iPhone home indicator at the bottom of the footer. */
    .ai-assistant-footer {
        padding: 10px calc(12px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    }

    /* 16px minimum prevents iOS Safari from auto-zooming the page when the field
     * receives focus, which is what made the input look tiny and unusable. Scoped under
     * the popover because the base `.ai-input` rule sits LATER in this file at the same
     * specificity and was silently winning — the field computed to 14.72px and the zoom
     * this comment says is fixed was still happening. */
    .ai-assistant-popover .ai-input {
        font-size: 16px;
    }

    /* 30px was under the 32px floor for a phone tap target; the shell's right padding grows
       with it so the text still clears the button. */
    .ai-assistant-popover .ai-send-button {
        width: 36px;
        height: 36px;
        right: 6px;
        bottom: 6px;
    }

    .ai-assistant-popover .ai-input-shell {
        padding-right: 50px;
    }
}

/* Full-screen mode (toggled via header icon). Mirrors the cloudandaisummit-site pattern —
 * the popover covers the ENTIRE viewport, including above the portal's MudAppBar
 * (which sits around z-index 1300). We use a very high z-index so the chat truly
 * takes over the screen. Instant transition = snappy feel. */
.ai-assistant-popover.is-fullscreen.open {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    transform: none !important;
    transition: none;
    z-index: 10000 !important; /* above MudAppBar (~1300), MudDrawer, etc. */
}

/* In fullscreen the footer + chat column get a comfortable reading width so bubbles
 * don't stretch edge-to-edge on a wide monitor. The body itself still scrolls full-width. */
.ai-assistant-popover.is-fullscreen .ai-assistant-body > *,
.ai-assistant-popover.is-fullscreen .ai-assistant-footer > * {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* ────────────────────────────── Header ────────────────────────────── */

.ai-assistant-header {
    background: var(--an-header-gradient);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ai-assistant-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "DM Sans", "DM Sans", system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    flex: 1;
    min-width: 0;
}

.ai-assistant-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ────────────────────────────── Body ────────────────────────────── */

.ai-assistant-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    background: var(--an-paper);
    font-family: var(--an-font-sans);
}

.ai-assistant-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 12px 16px 12px;
    gap: 10px;
}

.ai-assistant-welcome-title {
    font-family: "DM Sans", serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--an-gray-1);
}

.ai-assistant-welcome-sub {
    color: var(--an-gray-4);
    font-size: 0.88rem;
    line-height: 1.4;
    max-width: 320px;
}

.ai-row {
    display: flex;
    margin-bottom: 14px;
}

.ai-row-user { justify-content: flex-end; }
.ai-row-assistant { justify-content: flex-start; }

/* For assistant rows, the wrap should align copy to the bubble's RIGHT edge,
 * not the row's right (which is far away). Achieved by making the wrap shrink-to-fit
 * and keeping align-items: flex-end. */
.ai-row-assistant .ai-bubble-wrap { align-items: flex-end; }
.ai-row-user .ai-bubble-wrap { align-items: flex-end; }

.ai-bubble-user {
    position: relative;
    background: var(--an-red);
    color: white;
    padding: 10px 14px;
    border-radius: var(--an-radius-lg) var(--an-radius-lg) 2px var(--an-radius-lg);
    font-size: 0.9rem;
    line-height: 1.45;
    /* min-width:0 lets the bubble shrink below its natural content width in the
     * flex wrap. overflow-wrap: anywhere makes long URLs / unbroken strings wrap. */
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.ai-bubble-assistant {
    position: relative;
    background: white;
    padding: 10px 14px;
    border-radius: var(--an-radius-lg) var(--an-radius-lg) var(--an-radius-lg) 2px;
    border: 1px solid var(--an-border);
    font-size: 0.9rem;
    line-height: 1.45;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Applied while the assistant message is only showing tool-progress chips and has
 * no text yet — the chip itself reads as an action, not a message, so the bubble
 * chrome (white background, border, padding) is distracting. */
.ai-bubble-assistant.ai-bubble-chipless {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
}

/* Horizontal wrap: bubble + copy button side-by-side. Copy anchors to the bubble's
 * bottom edge via align-items: flex-end on the wrap. The wrap is capped at ~92% of
 * the row so the whole bundle (bubble + gap + copy) stays inside the chat body,
 * and min-width:0 lets flex children (the bubble) shrink below their content. */
.ai-bubble-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
    max-width: 92%;
    min-width: 0;
}

/* Timestamp sits INSIDE the bubble in the bottom-right corner. Reserve a line of
 * space at the bottom so it doesn't overlap content. */
.ai-bubble-has-timestamp {
    padding-bottom: 22px;
}

.ai-bubble-inner-timestamp {
    position: absolute;
    right: 10px;
    bottom: 6px;
    font-size: 0.68rem;
    font-family: var(--an-font-sans);
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
}

.ai-bubble-inner-timestamp-on-red {
    color: rgba(255,255,255,.85);
}

.ai-bubble-inner-timestamp-on-light {
    color: var(--an-gray-4);
}

/* Copy button to the right of the bubble, anchored to the bubble's bottom via flex. */
.ai-bubble-copy-outside {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--an-border);
    background: white;
    color: var(--an-gray-5);
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--an-shadow-card);
    transition: color var(--an-duration-fast) var(--an-ease), background var(--an-duration-fast) var(--an-ease), border-color var(--an-duration-fast) var(--an-ease), box-shadow var(--an-duration-fast) var(--an-ease);
}

.ai-bubble-copy-outside .mud-icon-root {
    font-size: 15px !important;
    color: inherit !important;
}

.ai-bubble-copy-outside:hover,
.ai-bubble-copy-outside:focus-visible {
    color: var(--an-red-text);
    border-color: var(--an-red);
    background: color-mix(in srgb, var(--an-red) 6%, transparent);
}

.ai-assistant-error {
    margin-top: 8px;
}

/* Typing indicator: three pulsing dots. */
.ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--an-gray-7);
    animation: ai-typing-bounce 1.2s infinite ease-in-out both;
}

.ai-typing span:nth-child(1) { animation-delay: -0.24s; }
.ai-typing span:nth-child(2) { animation-delay: -0.12s; }

@keyframes ai-typing-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

/* ────────────────────────────── Footer / input ────────────────────────────── */

.ai-assistant-footer {
    border-top: 1px solid var(--an-border);
    padding: 12px;
    background: white;
    flex-shrink: 0;
}

.ai-input-shell {
    position: relative;
    background: white;
    border: 1px solid var(--an-border);
    border-radius: var(--an-radius-lg);
    padding: 10px 44px 10px 14px;
    transition: border-color var(--an-duration-fast) var(--an-ease), box-shadow var(--an-duration-fast) var(--an-ease);
}

.ai-input-shell:focus-within {
    border-color: var(--an-red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--an-red) 12%, transparent);
}

.ai-input {
    width: 100%;
    min-height: 20px;
    max-height: 120px;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: var(--an-font-sans);
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--an-gray-1);
}

.ai-input::placeholder {
    color: var(--an-gray-4);
}

.ai-input:disabled {
    color: var(--an-gray-4);
    cursor: not-allowed;
}

.ai-send-button {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--an-red);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--an-duration-fast) var(--an-ease), transform var(--an-duration-fast) var(--an-ease), opacity var(--an-duration-fast) var(--an-ease);
}

.ai-send-button:hover:not(:disabled) {
    background: var(--an-red-deep);
    transform: translateY(-1px);
}

.ai-send-button:disabled {
    background: var(--an-border);
    color: var(--an-gray-7);
    cursor: not-allowed;
}

.ai-send-button .mud-icon-root {
    color: inherit !important;
    font-size: 18px !important;
}

/* Cancel variant: shown while streaming. Dark background + subtle pulsing ring
 * so it reads as "action in progress, click to stop". */
.ai-cancel-button {
    background: var(--an-gray-1);
    color: white;
    animation: ai-cancel-pulse 1.6s ease-in-out infinite;
}

.ai-cancel-button:hover:not(:disabled) {
    background: var(--an-red-deep);
    transform: translateY(-1px);
}

@keyframes ai-cancel-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--an-red) 45%, transparent); }
    50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--an-red) 0%, transparent); }
}

.ai-assistant-disclaimer {
    margin-top: 8px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--an-gray-4);
    font-family: var(--an-font-sans);
}

/* ────────────────────────────── Markdown inside assistant bubbles ────────────────────────────── */

/* The markdown container must be able to shrink below its natural content width so
 * children (long paragraphs, tables, pre blocks) stay inside the bubble. */
.ai-markdown {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* System-notice row (e.g. "Condensed the earlier N messages…") — centered, subtle. */
.ai-system-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 10px 0;
    padding: 6px 12px;
    font-size: 0.78rem;
    color: var(--an-gray-4);
    font-family: var(--an-font-sans);
    font-style: italic;
}

.ai-system-notice-icon {
    font-size: 14px !important;
    color: var(--an-red-text) !important;
    opacity: 0.7;
}

/* Tool-call chips shown above the assistant's markdown while/after a tool runs.
 * Small rounded pills, subtle grey border; running state uses a tiny AN Red spinner. */
.ai-tool-chip-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.ai-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--an-radius-xs);
    border: 1px solid var(--an-border);
    background: var(--an-paper);
    color: var(--an-gray-4);
    font-size: 0.78rem;
    line-height: 1.2;
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden;
}

.ai-tool-chip.running {
    color: var(--an-red-deep);
    background: rgba(167, 37, 44, 0.05);
    border-color: rgba(167, 37, 44, 0.25);
}

.ai-tool-chip.done {
    color: var(--an-gray-1);
    background: var(--an-paper);
    border-color: var(--an-border);
}

.ai-tool-chip.error {
    color: var(--an-red-deep);
    background: rgba(167, 37, 44, 0.08);
    border-color: rgba(167, 37, 44, 0.4);
}

.ai-tool-chip-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.ai-tool-chip-icon {
    font-size: 14px !important;
    color: inherit !important;
}

.ai-tool-chip.done .ai-tool-chip-icon { color: var(--an-ink) !important; } /* subtle check green */

.ai-tool-chip-spinner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(167, 37, 44, 0.25);
    border-top-color: var(--an-red-text);
    animation: ai-tool-chip-spin 0.9s linear infinite;
    flex-shrink: 0;
}

@keyframes ai-tool-chip-spin {
    to { transform: rotate(360deg); }
}

.ai-markdown > *:first-child { margin-top: 0; }
.ai-markdown > *:last-child { margin-bottom: 0; }

.ai-markdown h1,
.ai-markdown h2,
.ai-markdown h3,
.ai-markdown h4 {
    margin: 0.5em 0 0.25em 0;
    color: var(--an-red-text);
    font-weight: 600;
    font-family: "DM Sans", serif;
}

.ai-markdown h1 { font-size: 1.15rem; }
.ai-markdown h2 { font-size: 1.05rem; }
.ai-markdown h3 { font-size: 0.95rem; }
.ai-markdown h4 { font-size: 0.90rem; }

.ai-markdown p {
    margin: 0.35em 0;
    line-height: 1.45;
    color: var(--an-gray-1);
}

.ai-markdown ul,
.ai-markdown ol {
    margin: 0.35em 0;
    padding-left: 1.5em;
}

.ai-markdown li { margin: 0.15em 0; }

.ai-markdown code {
    background: var(--an-paper);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    color: var(--an-red-deep);
}

.ai-markdown pre {
    background: var(--an-paper);
    padding: 8px 10px;
    border-radius: var(--an-radius-sm);
    overflow-x: auto;
    max-width: 100%;
    font-size: 0.82em;
    border: 1px solid var(--an-border);
    /* Preserve long code lines with scroll, not wrap. */
    white-space: pre;
}

.ai-markdown pre code {
    background: transparent;
    padding: 0;
    color: var(--an-gray-1);
    overflow-wrap: normal;
    word-break: normal;
}

/* Tables horizontally scroll inside the bubble when wider than the viewport.
 * max-width: 100% + display: block + overflow-x: auto is the combination that lets
 * wide tables live inside a constrained flex child. */
.ai-markdown table {
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.85em;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* Keep the horizontal scrollbar visible so a clipped grid reads as scrollable —
 * macOS overlay scrollbars otherwise hide until the user happens to swipe. */
.ai-markdown table::-webkit-scrollbar {
    height: 8px;
}

.ai-markdown table::-webkit-scrollbar-thumb {
    background: var(--an-gray-7);
    border-radius: 4px;
}

.ai-markdown table::-webkit-scrollbar-track {
    background: transparent;
}

.ai-markdown th,
.ai-markdown td {
    border: 1px solid var(--an-border);
    padding: 4px 8px;
    text-align: left;
    white-space: nowrap;
}

/* Images never exceed the bubble width. */
.ai-markdown img {
    max-width: 100%;
    height: auto;
}

.ai-markdown th {
    background: var(--an-border);
    color: var(--an-gray-1);
    font-weight: 600;
}

.ai-markdown a {
    color: var(--an-red-text);
    text-decoration: underline;
}

.ai-markdown blockquote {
    border-left: 3px solid var(--an-red);
    margin: 0.35em 0;
    padding: 0.25em 0.75em;
    color: var(--an-gray-3);
    background: var(--an-paper);
}

/* DemoHub brand/accessibility corrections; PartnerHub panel/composer geometry retained. */
.ai-assistant-fab-wrapper,.ai-assistant-popover { --an-header-gradient:radial-gradient(120% 135% at 94% 22%, var(--an-red-deep) 0%, var(--an-ink) 46%, var(--an-dark) 100%); --an-radius-lg:16px; --an-radius-sm:8px; --an-radius-xs:4px; --an-shadow-card:0 10px 30px -22px rgba(0,0,0,.25); --an-shadow-red:0 12px 32px rgba(167,37,44,.35); }
.ai-assistant-popover button { min-width:44px; min-height:44px; }
.ai-assistant-popover button:focus-visible,.ai-assistant-fab:focus-visible { outline:2px solid var(--an-red); outline-offset:3px; }
.ai-assistant-header button:focus-visible { outline-color:var(--an-red-light); }
.ai-assistant-popover .ai-input { font-size:16px; }
.ai-assistant-welcome-sub,.ai-bubble-user,.ai-bubble-assistant,.ai-assistant-disclaimer,.ai-tool-chip,.ai-assistant-error { font-size:15px; }
.ai-history-actions { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.ai-history-actions a { min-height:44px; display:inline-flex; align-items:center; }
.ai-assistant-header { padding:8px; }
.ai-assistant-header-title { font-size:15px; gap:6px; }
.ai-assistant-header-title > span:last-child { min-width:0; }
.ai-assistant-popover { max-height:calc(100dvh - 88px); }
.ai-markdown a[aria-disabled='true'] { pointer-events:none; color:inherit; text-decoration:none; }
@media(max-width:600px) { .ai-assistant-popover.open { max-height:calc(100dvh - 62px); } }
@media(prefers-reduced-motion:reduce) { .ai-assistant-popover,.ai-assistant-fab { transition:none; } .ai-typing span,.ai-tool-chip-spinner { animation:none; } }

.ai-bubble-inner-timestamp { position:static; display:block; font-size:15px; margin-top:8px; text-align:right; white-space:normal; }
