/* agent-pro.css — the "pro" look of the public Business Agent chat
   (views/agent-pro.hbs, docs/AGENT_CHAT_WIDGET.md).

   One card, three colours, everything round: a white surface, one grey for the
   agent, one fill for the visitor and the controls. Nothing inside the card has
   a border, a gradient or a shadow of its own.

   COLOUR: every literal lives in a custom property at the top of this file.
   The rules below only ever read a token, so an owner's saved appearance
   (routes/agent-public.js → proStyleVars, inlined on <html>) re-skins the whole
   widget without touching a rule. */

html[data-ag-ui="pro"] {
    --agp-page: #eeeef2;
    --agp-card: #ffffff;
    --agp-ink: #111114;
    --agp-muted: #6e6e7a;
    --agp-line: #ececf1;
    --agp-bot: #f2f2f5;
    --agp-accent: #0e0e11;
    --agp-on-accent: #ffffff;
    --agp-user: #2f54eb;
    --agp-on-user: #ffffff;
    --agp-idle: #8b8b96;
    --agp-on-idle: #ffffff;
    --agp-sheet: #f3f3f6;
    --agp-sheet-line: #dedee4;
    --agp-inset: #ffffff;
    --agp-danger: #c0392b;
    --agp-ok: #1f9d55;
    --agp-veil: rgba(0, 0, 0, 0.55);
    --agp-on-veil: #ffffff;
    --agp-shadow: 0 24px 60px rgba(17, 17, 20, 0.16);
    --agp-sheet-shadow: 0 12px 32px rgba(17, 17, 20, 0.18);
    --agp-wave-agent: var(--agp-ink);
    --agp-wave-user: var(--agp-user);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    html[data-ag-ui="pro"]:not([data-ag-theme]) {
        --agp-page: #050506;
        --agp-card: #0f0f12;
        --agp-ink: #f3f3f6;
        --agp-muted: #9b9ba8;
        --agp-line: #232329;
        --agp-bot: #1c1c22;
        --agp-accent: #000000;
        --agp-idle: #55555f;
        --agp-sheet: #1b1b21;
        --agp-sheet-line: #2c2c34;
        --agp-inset: #26262d;
        --agp-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
        --agp-sheet-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        color-scheme: dark;
    }
}
html[data-ag-ui="pro"][data-ag-theme="dark"],
html[data-ag-ui="pro"][data-ag-theme="mono-dark"] {
    --agp-page: #050506;
    --agp-card: #0f0f12;
    --agp-ink: #f3f3f6;
    --agp-muted: #9b9ba8;
    --agp-line: #232329;
    --agp-bot: #1c1c22;
    --agp-accent: #000000;
    --agp-idle: #55555f;
    --agp-sheet: #1b1b21;
    --agp-sheet-line: #2c2c34;
    --agp-inset: #26262d;
    --agp-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    --agp-sheet-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}
/* The two black-and-white presets: the fill IS the ink. */
html[data-ag-ui="pro"][data-ag-theme="mono"] {
    --agp-user: #18181b;
    --agp-on-user: #ffffff;
    --agp-accent: #18181b;
}
html[data-ag-ui="pro"][data-ag-theme="mono-dark"] {
    --agp-user: #fafafa;
    --agp-on-user: #0a0a0a;
    --agp-accent: #000000;
}

/* The full-screen call's send-off card is built by agent-voice.js with the
   classic look's token names (it is shared with the workspace). Here they are
   this look's colours under those names. Declared on <body>, not <html>: the
   owner's saved colours are inlined on <html> under the same names, and these
   must win over them so the card matches the chat it belongs to. */
html[data-ag-ui="pro"] body {
    --ag-bg: var(--agp-card);
    --ag-panel: var(--agp-bot);
    --ag-border: var(--agp-line);
    --ag-text: var(--agp-ink);
    --ag-muted: var(--agp-muted);
    --ag-bot: var(--agp-inset);
    --ag-accent: var(--agp-user);
    --ag-on-accent: var(--agp-on-user);
}

/* ── Page ─────────────────────────────────────────────────────────────── */
html[data-ag-ui="pro"], html[data-ag-ui="pro"] body { height: 100%; margin: 0; }
html[data-ag-ui="pro"] *, html[data-ag-ui="pro"] *::before, html[data-ag-ui="pro"] *::after { box-sizing: border-box; }
html[data-ag-ui="pro"] body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--agp-page);
    color: var(--agp-ink);
    display: flex; align-items: center; justify-content: center;
    -webkit-font-smoothing: antialiased;
}
/* Embedded: the loader (or the host pane) owns the backdrop and the corners. */
html[data-ag-ui="pro"] body.ag-embed { background: transparent; }
html[data-ag-ui="pro"] [hidden] { display: none !important; }

.agp-shell {
    position: relative;
    width: 100%; max-width: 420px; height: 100%; max-height: 700px;
    display: flex; flex-direction: column;
    background: var(--agp-card);
    border-radius: 22px; overflow: hidden;
    box-shadow: var(--agp-shadow);
}
body.ag-embed .agp-shell { max-width: none; max-height: none; border-radius: 0; box-shadow: none; }

/* ── Header ───────────────────────────────────────────────────────────── */
.agp-header {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 12px;
    min-height: 62px; padding: 11px 14px 11px 16px;
    background: var(--agp-accent); color: var(--agp-on-accent);
}
.agp-header.ag-hide { display: none; }
.agp-avatar {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
    background: var(--agp-idle);
}
.agp-header-id { flex: 1 1 auto; min-width: 0; }
.agp-title { font-weight: 650; font-size: 15.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agp-subtitle { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; opacity: .78; }
.agp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--agp-ok); flex: 0 0 auto; }
.agp-header-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.agp-hbtn {
    width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
    background: transparent; color: inherit; font-size: 15px; opacity: .82;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .15s ease, transform .15s ease;
}
.agp-hbtn:hover { opacity: 1; }
.agp-hbtn:active { transform: scale(.92); }
.agp-hbtn:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; opacity: 1; }

/* ── Thread ───────────────────────────────────────────────────────────── */
.agp-thread {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px 16px 14px;
    scrollbar-width: thin;
}
/* Anchored to the bottom: the first message sits just above the composer.
   A margin, not justify-content:flex-end — that one makes the overflow above
   the fold unreachable by scroll. */
.agp-thread > :first-child { margin-top: auto; }

.agp-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.agp-row-user { justify-content: flex-end; }
.agp-row-error { justify-content: center; }
.agp-row.agp-enter { animation: agp-in .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes agp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.agp-ava {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
    background: var(--agp-accent); color: var(--agp-on-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 650; text-transform: uppercase; overflow: hidden;
}
.agp-ava-user { background: var(--agp-bot); color: var(--agp-muted); font-size: 14px; }
/* Consecutive bubbles from the same side share one avatar: the last one. */
.agp-row.agp-grouped .agp-ava { visibility: hidden; }

.agp-thread .ag-msg {
    max-width: 78%; min-width: 0;
    padding: 10px 15px; border-radius: 20px;
    font-size: 14.5px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.agp-thread .ag-msg.ag-user { background: var(--agp-user); color: var(--agp-on-user); }
.agp-thread .ag-msg.ag-bot { background: var(--agp-bot); color: var(--agp-ink); white-space: normal; }
.agp-thread .ag-msg.ag-error {
    max-width: 92%; background: transparent; color: var(--agp-danger);
    font-size: 13px; text-align: center; padding: 4px 10px;
}
.agp-thread .ag-msg p { margin: 0 0 6px; }
.agp-thread .ag-msg p:last-child { margin: 0; }
.agp-thread .ag-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.agp-thread .ag-msg.ag-bot ul, .agp-thread .ag-msg.ag-bot ol { margin: 4px 0 8px; padding-left: 20px; }
.agp-thread .ag-msg.ag-bot li { margin: 2px 0; }
.agp-thread .ag-msg.ag-bot h1, .agp-thread .ag-msg.ag-bot h2,
.agp-thread .ag-msg.ag-bot h3, .agp-thread .ag-msg.ag-bot h4 { margin: 8px 0 4px; font-size: 15px; line-height: 1.3; }
.agp-thread .ag-msg.ag-bot strong { font-weight: 650; }
.agp-thread .ag-msg.ag-bot code { background: var(--agp-inset); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.agp-thread .ag-msg.ag-bot pre { background: var(--agp-inset); padding: 10px 12px; border-radius: 10px; overflow-x: auto; margin: 6px 0; }
.agp-thread .ag-msg.ag-bot pre code { background: none; padding: 0; }
.agp-thread .ag-msg.ag-bot blockquote { margin: 6px 0; padding: 2px 12px; border-left: 3px solid var(--agp-user); opacity: .85; }
.agp-thread .ag-msg.ag-bot table { border-collapse: collapse; margin: 6px 0; display: block; overflow-x: auto; max-width: 100%; }
.agp-thread .ag-msg.ag-bot th, .agp-thread .ag-msg.ag-bot td { border: 1px solid var(--agp-sheet-line); padding: 5px 9px; text-align: left; font-size: 13px; }
.agp-thread .ag-msg.ag-bot img { max-width: 100%; height: auto; border-radius: 8px; }
/* A message that is only an attachment has no text: the bubble is the frame. */
.agp-thread .ag-msg.agp-bare { padding: 6px; }
.agp-thread .ag-msg.agp-empty-wait { min-width: 64px; min-height: 40px; }

/* Visitor photos: framed by the bubble's own fill. */
.agp-thread .ag-msg-images { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.agp-thread .ag-msg.agp-bare .ag-msg-images { margin-top: 0; }
.agp-thread .ag-msg-images a { display: block; }
.agp-thread .ag-msg-images img { width: 132px; height: 132px; object-fit: cover; border-radius: 14px; display: block; }
.agp-thread .ag-msg-images.agp-many img { width: 84px; height: 84px; border-radius: 12px; }

/* Visitor documents. */
.agp-files { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.agp-bare .agp-files { margin-top: 0; }
.agp-file {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 8px 12px 8px 8px; border-radius: 14px; text-decoration: none;
    background: var(--agp-inset); color: var(--agp-ink);
}
/* Beats `.ag-msg a { color: inherit }`: on the visitor's fill that would paint the name white on the white chip. */
.agp-thread .ag-msg .agp-file { text-decoration: none; color: var(--agp-ink); }
.agp-file-ico {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    background: var(--agp-bot); color: var(--agp-muted);
}
.agp-file-meta { min-width: 0; display: flex; flex-direction: column; }
.agp-file-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agp-file-size { font-size: 11.5px; color: var(--agp-muted); }

/* Typing dots. */
.agp-thread .ag-typing { display: flex; align-items: flex-end; gap: 8px; padding: 0; }
.agp-dots { display: flex; gap: 5px; padding: 15px 16px; border-radius: 20px; background: var(--agp-bot); }
.agp-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--agp-muted); animation: agp-bounce 1.1s infinite both; }
.agp-dots span:nth-child(2) { animation-delay: .15s; }
.agp-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes agp-bounce { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ── Instant answers: the owner's FAQ chips, above the composer ─────────── */
.agp-quick {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.agp-quick::-webkit-scrollbar { display: none; }
.agp-quick-chip {
    flex: 0 0 auto; max-width: 240px; padding: 8px 14px; border: 0; border-radius: 999px;
    background: var(--agp-bot); color: var(--agp-ink); font: inherit; font-size: 13.5px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--agp-line);
    transition: transform .15s ease, background .15s ease;
    animation: agp-in .3s cubic-bezier(.2, .8, .2, 1) both;
}
.agp-quick-chip:hover, .agp-quick-chip:focus-visible { background: var(--agp-line); outline: none; transform: translateY(-1px); }
.agp-quick-chip:active { transform: scale(.96); }

/* ── Cards inside an agent bubble ─────────────────────────────────────── */
.agp-card-in { animation: agp-in .34s cubic-bezier(.2, .8, .2, 1) both; }
.agp-options {
    margin-top: 10px; padding: 6px; border-radius: 16px;
    background: var(--agp-inset); display: flex; flex-direction: column; gap: 2px;
}
.agp-options-title { padding: 6px 10px 2px; font-size: 12px; font-weight: 600; color: var(--agp-muted); }
.agp-option {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 7px 10px; border: 0; border-radius: 11px; background: transparent;
    font: inherit; font-size: 13.5px; color: var(--agp-ink); text-align: left; cursor: pointer;
    transition: background .15s ease;
}
.agp-option:hover, .agp-option:focus-visible { background: var(--agp-bot); outline: none; }
.agp-option[disabled] { cursor: default; }
.agp-option[disabled]:hover { background: transparent; }
.agp-swatch { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--agp-sheet-line); }
.agp-option-text { min-width: 0; display: flex; flex-direction: column; }
.agp-option-note { font-size: 12px; color: var(--agp-muted); }
.agp-option.agp-row-in { animation: agp-in .3s cubic-bezier(.2, .8, .2, 1) both; }
/* A page of the host site the agent opened (open_page): tap to open it again. */
.agp-nav {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
    padding: 6px 12px; border: 0; border-radius: 999px; background: var(--agp-user); color: var(--agp-on-user);
    font: inherit; font-size: 13px; cursor: pointer;
}
.agp-thread .ag-msg a.agp-nav { color: var(--agp-on-user); text-decoration: none; }
.agp-nav:hover, .agp-nav:focus-visible { opacity: .88; outline: none; }

.agp-thread .ag-media { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.agp-thread .ag-media-img { display: block; max-width: 100%; height: auto; border-radius: 14px; cursor: zoom-in; }
.agp-thread .ag-media-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; }
.agp-thread .ag-media-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.agp-thread .ag-media-video { display: block; width: 100%; max-height: 60vh; border-radius: 14px; background: var(--agp-accent); }
.agp-thread .ag-media-open { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--agp-user); text-decoration: none; }

.agp-thread .ag-payments, .agp-thread .ag-addons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.agp-thread .ag-pay-card, .agp-thread .ag-addon-card { border-radius: 16px; padding: 14px; background: var(--agp-inset); }
.agp-thread .ag-pay-title, .agp-thread .ag-addon-title { font-weight: 650; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.agp-thread .ag-addon-title i { color: var(--agp-user); }
.agp-thread .ag-pay-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.agp-thread .ag-pay-amount { font-size: 20px; font-weight: 750; }
.agp-thread .ag-pay-agency, .agp-thread .ag-addon-teaser, .agp-thread .ag-addon-note { font-size: 12.5px; color: var(--agp-muted); }
.agp-thread .ag-addon-teaser { line-height: 1.5; margin-bottom: 10px; }
.agp-thread .ag-addon-note { margin-top: 8px; }
.agp-thread .ag-addon-note:empty { display: none; }
.agp-thread .ag-addon-count { margin-left: auto; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--agp-bot); color: var(--agp-muted); }
.agp-thread .ag-addon-count::after { content: ' items'; }
.agp-thread .ag-pay-btn, .agp-thread .ag-addon-btn {
    display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none;
    font: inherit; font-weight: 650; font-size: 14px; padding: 10px 18px; border-radius: 999px;
    background: var(--agp-user); color: var(--agp-on-user);
}
.agp-thread .ag-addon-btn:disabled { opacity: .6; cursor: default; }
.agp-thread .ag-cite {
    display: inline-flex; align-items: center; gap: 3px; vertical-align: baseline;
    margin: 0 2px; padding: 1px 8px; border-radius: 999px; cursor: pointer; border: 0;
    background: var(--agp-inset); color: var(--agp-user);
    font: inherit; font-size: 11px; font-weight: 600; line-height: 1.6;
}

/* ── Email gate ───────────────────────────────────────────────────────── */
.agp-shell .ag-email-gate { flex: 0 0 auto; padding: 12px 16px 2px; border-top: 1px solid var(--agp-line); }
.agp-gate-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; border-radius: 999px; background: var(--agp-bot); }
.agp-shell .ag-email-input { flex: 1 1 auto; min-width: 0; border: 0; padding: 8px 0; background: transparent; color: var(--agp-ink); font: inherit; font-size: 14.5px; }
.agp-shell .ag-email-input:focus { outline: none; }
.agp-shell .ag-email-input::placeholder { color: var(--agp-muted); }
.agp-shell .ag-email-submit { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; background: var(--agp-user); color: var(--agp-on-user); }
.agp-shell .ag-email-submit:disabled { opacity: .5; cursor: default; }
.agp-shell .ag-email-help { margin: 7px 4px 0; color: var(--agp-muted); font-size: 12px; }
.agp-shell .ag-email-error { min-height: 15px; margin: 3px 4px 0; color: var(--agp-danger); font-size: 12px; }

/* ── Voice row ────────────────────────────────────────────────────────── */
.agp-voice {
    flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
    height: 56px; padding: 0 16px; border-top: 1px solid var(--agp-line);
    animation: agp-fold .26s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes agp-fold { from { height: 0; opacity: 0; } to { height: 56px; opacity: 1; } }
.agp-ghost {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 1.5px solid var(--agp-muted); background: transparent; color: var(--agp-muted);
    display: flex; align-items: center; justify-content: center; font-size: 13px;
    transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.agp-ghost:hover { color: var(--agp-ink); border-color: var(--agp-ink); }
.agp-ghost:active { transform: scale(.92); }
.agp-ghost:focus-visible { outline: 2px solid var(--agp-user); outline-offset: 2px; }
.agp-ghost[aria-pressed="true"] { color: var(--agp-danger); border-color: var(--agp-danger); }
.agp-wave { flex: 1 1 auto; min-width: 0; height: 30px; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--agp-muted); }
.agp-wave i { flex: 0 0 auto; width: 3px; height: 3px; border-radius: 3px; background: currentColor; transition: height .09s linear; }
.agp-wave[data-who="user"] { color: var(--agp-wave-user); }
.agp-wave[data-who="agent"] { color: var(--agp-wave-agent); }
.agp-wave[data-who="wait"] i { animation: agp-wait 1.2s ease-in-out infinite; }
.agp-wave[data-who="wait"] i:nth-child(3n+2) { animation-delay: .15s; }
.agp-wave[data-who="wait"] i:nth-child(3n) { animation-delay: .3s; }
@keyframes agp-wait { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.agp-voice-note { flex: 0 0 auto; font-size: 11.5px; color: var(--agp-muted); font-variant-numeric: tabular-nums; }
.agp-voice-note.agp-low { color: var(--agp-danger); }
.agp-voice-note:empty { display: none; }

/* ── Pending attachments ──────────────────────────────────────────────── */
.agp-shell .ag-previews { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; border-top: 1px solid var(--agp-line); }
.agp-shell .ag-thumb { position: relative; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; }
.agp-shell .ag-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agp-shell .ag-thumb-x {
    position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border: 0; border-radius: 50%;
    background: var(--agp-veil); color: var(--agp-on-veil); font-size: 12px; line-height: 18px; padding: 0; cursor: pointer;
}
.agp-chip {
    position: relative; display: flex; align-items: center; gap: 8px; max-width: 100%;
    height: 56px; padding: 0 30px 0 8px; border-radius: 12px; background: var(--agp-bot);
}
.agp-chip .agp-file-ico { background: var(--agp-inset); }
.agp-chip .agp-file-name { max-width: 150px; }
.agp-chip.agp-busy { opacity: .6; }

/* ── Composer ─────────────────────────────────────────────────────────── */
.agp-composer {
    flex: 0 0 auto; position: relative;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px 14px; border-top: 1px solid var(--agp-line);
}
.agp-previews-on + .agp-composer { border-top: 0; }
.agp-round {
    flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
    background: var(--agp-idle); color: var(--agp-on-idle); font-size: 17px;
    display: flex; align-items: center; justify-content: center;
    transition: background .18s ease, opacity .18s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.agp-round:active { transform: scale(.92); }
.agp-round:focus-visible { outline: 2px solid var(--agp-user); outline-offset: 2px; }
.agp-round.agp-on { background: var(--agp-user); color: var(--agp-on-user); }
.agp-round.agp-soft { background: var(--agp-user); color: var(--agp-on-user); opacity: .45; }
.agp-round:disabled { cursor: default; }
.agp-round:disabled:active { transform: none; }
.agp-action i { display: none; }
.agp-action[data-mode="send"] .agp-i-send { display: block; }
.agp-action[data-mode="voice"] .agp-i-voice { display: block; }

.agp-shell .ag-input {
    flex: 1 1 auto; min-width: 0; resize: none; border: 0; outline: none;
    padding: 8px 4px; max-height: 120px;
    font: inherit; font-size: 14.5px; line-height: 1.4;
    background: transparent; color: var(--agp-ink);
}
.agp-shell .ag-input::placeholder { color: var(--agp-muted); }
.agp-shell .ag-input:disabled { opacity: .5; }

/* The "+" menu. Every row IS its file input (transparent, on top), so a tap is
   a direct activation of the input: several Android browsers ignore a scripted
   .click() on a hidden one. */
.agp-plus-wrap { flex: 0 0 auto; position: relative; }
.agp-menu {
    position: absolute; left: 0; bottom: 46px; z-index: 5; width: 232px;
    border-radius: 16px; overflow: hidden;
    background: var(--agp-sheet); color: var(--agp-ink);
    box-shadow: var(--agp-sheet-shadow);
    transform-origin: bottom left; animation: agp-pop .2s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes agp-pop { from { opacity: 0; transform: scale(.9) translateY(6px); } to { opacity: 1; transform: none; } }
.agp-menu-row {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; font-size: 14.5px; cursor: pointer;
    border-top: 1px solid var(--agp-sheet-line);
}
.agp-menu-row:first-child { border-top: 0; }
.agp-menu-row i { font-size: 16px; color: var(--agp-muted); }
.agp-menu-row:hover, .agp-menu-row:focus-within, .agp-menu-row.agp-picked { background: var(--agp-user); color: var(--agp-on-user); }
.agp-menu-row:hover i, .agp-menu-row:focus-within i, .agp-menu-row.agp-picked i { color: inherit; }
.agp-menu-input {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
    opacity: 0; font-size: 0; border: 0; padding: 0; margin: 0; cursor: pointer; z-index: 2;
}
/* A camera row only where there is a camera to open. */
.agp-touch-only { display: none; }
@media (pointer: coarse) { .agp-touch-only { display: flex; } }
html[data-agp-touch="1"] .agp-touch-only { display: flex; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.agp-foot { flex: 0 0 auto; padding: 0 16px 9px; text-align: center; font-size: 10.5px; color: var(--agp-muted); }
.agp-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.agp-foot:empty { display: none; }

/* ── Full-screen call (the ?call=1 card + modal; ids shared with agent-voice.js) ── */
.agp-shell ~ .av-modal, .agp-shell ~ .ag-autocall {
    position: fixed; inset: 0; z-index: 2147483001; display: none;
    align-items: center; justify-content: center; padding: 20px; background: var(--agp-card);
}
.agp-shell ~ .av-modal.av-open, .agp-shell ~ .ag-autocall:not([hidden]) { display: flex; }
.agp-shell ~ .av-modal .av-card, .agp-shell ~ .ag-autocall .ag-autocall-card {
    position: relative; width: 320px; max-width: 100%; border-radius: 22px; padding: 28px 24px 22px;
    background: var(--agp-bot); color: var(--agp-ink); text-align: center;
}
.agp-shell ~ .av-modal .av-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--agp-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.agp-shell ~ .av-modal .av-avatar, .agp-shell ~ .ag-autocall .ag-autocall-avatar {
    width: 76px; height: 76px; border-radius: 50%; object-fit: cover; margin: 4px auto 12px; display: block;
    background: var(--agp-idle); border: 2px solid transparent;
}
.agp-shell ~ .av-modal.av-speaking .av-avatar { border-color: var(--agp-user); }
.agp-shell ~ .av-modal .av-name, .agp-shell ~ .ag-autocall .ag-autocall-title { font-weight: 650; font-size: 17px; margin: 0 0 4px; }
.agp-shell ~ .av-modal .av-status, .agp-shell ~ .av-modal .av-remaining,
.agp-shell ~ .ag-autocall .ag-autocall-body { color: var(--agp-muted); font-size: 13px; line-height: 1.5; }
.agp-shell ~ .ag-autocall .ag-autocall-body { margin: 0 0 16px; }
.agp-shell ~ .av-modal .av-timer { font-size: 26px; font-weight: 700; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.agp-shell ~ .av-modal .av-remaining.av-low, .agp-shell ~ .av-modal .av-error { color: var(--agp-danger); }
.agp-shell ~ .av-modal .av-mic {
    margin: 14px auto 4px; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    background: var(--agp-inset); color: var(--agp-muted); transition: all .15s;
}
.agp-shell ~ .av-modal .av-mic.av-active { background: var(--agp-user); color: var(--agp-on-user); }
.agp-shell ~ .av-modal .av-error { font-size: 12px; margin-top: 8px; min-height: 14px; opacity: 0; transition: opacity .2s; }
.agp-shell ~ .av-modal .av-error.av-visible { opacity: 1; }
.agp-shell ~ .av-modal .av-upgrade, .agp-shell ~ .ag-autocall .ag-autocall-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
    margin: 4px 0 12px; padding: 12px 22px; border-radius: 999px; text-decoration: none;
    font: inherit; font-weight: 650; font-size: 15px; background: var(--agp-user); color: var(--agp-on-user);
}
.agp-shell ~ .av-modal .av-upgrade[hidden] { display: none; }
.agp-shell ~ .av-modal .av-end {
    margin-top: 16px; width: 100%; border: 0; border-radius: 999px; cursor: pointer; padding: 12px;
    font: inherit; font-size: 14px; font-weight: 650; background: var(--agp-danger); color: var(--agp-on-user);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.agp-shell ~ .ag-autocall .ag-autocall-link { display: block; margin: 4px auto 0; border: 0; background: transparent; cursor: pointer; color: var(--agp-muted); font: inherit; font-size: 13px; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .agp-row.agp-enter, .agp-card-in, .agp-option.agp-row-in, .agp-menu, .agp-voice, .agp-quick-chip { animation: none; }
    .agp-dots span, .agp-wave[data-who="wait"] i { animation: none; }
    .agp-wave i { transition: none; }
}
