/* PhishAIris Assistant ("Iris"): violet glass panel and launcher,
   matching the shared deep-purple design system. */

/* ── Launcher ── */
.chat-launcher {
    position: fixed; right: 22px; bottom: 22px; z-index: 999;
    display: flex; align-items: center; gap: 10px;
}
.chat-toggle {
    position: relative;
    width: 60px; height: 60px; border-radius: 50%;
    display: grid; place-items: center;
    border: 0; cursor: pointer;
    color: var(--on-accent);
    background: radial-gradient(circle at 30% 25%, #f5eaff, #c084fc 55%, #9333ea);
    box-shadow: 0 0 0 1px rgba(var(--violet-rgb),0.7), 0 14px 30px -10px rgba(var(--violet-rgb),0.65), inset 0 -6px 14px rgba(16,3,31,0.25);
    transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
}
.chat-toggle:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(var(--violet-rgb),0.95), 0 18px 36px -10px rgba(var(--violet-rgb),0.85), inset 0 -6px 14px rgba(16,3,31,0.25); }
.chat-toggle:active { transform: scale(0.95); }
.chat-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.chat-toggle .iris-icon { width: 30px; height: 30px; }
.chat-toggle .close-icon { display: none; width: 24px; height: 24px; }
.chat-toggle.open .iris-icon { display: none; }
.chat-toggle.open .close-icon { display: block; }
/* A neon ring spinning round the button, and a halo pulsing out. */
.chat-toggle::before {
    content: ''; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(from 0deg, transparent 0 20%, #f900e4 35%, #c084fc 50%, transparent 65% 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
    filter: drop-shadow(0 0 6px rgba(249,0,228,0.8));
}
.chat-toggle::after {
    content: ''; position: absolute; inset: -6px; border-radius: 50%;
    border: 1px solid rgba(var(--pink-rgb),0.6); pointer-events: none; opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .chat-toggle::before { animation: chat-spin 2.8s linear infinite; }
    .chat-toggle:not(.open)::after { animation: chat-halo 3.2s ease-out infinite; }
    .chat-toggle:not(.open) .iris-dot { animation: iris-typing 5s ease-in-out infinite; }
    .chat-toggle:not(.open) .iris-dot:nth-child(2) { animation-delay: 0.15s; }
    .chat-toggle:not(.open) .iris-dot:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes chat-halo { 0% { opacity: 0.8; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.35); } }
/* A short "typing" ripple, then a long rest. */
@keyframes iris-typing { 0%, 16%, 100% { transform: translateY(0); } 6% { transform: translateY(-1.6px); } }
.iris-dot { transform-box: fill-box; transform-origin: center; }
.chat-unread {
    position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%;
    background: #f87171; box-shadow: 0 0 0 2px #0d0714, 0 0 10px rgba(248,113,113,0.8);
}
.chat-unread[hidden] { display: none; }
/* "Ask me!" speech bubble, always shown beside the button while the chat
   is closed. It pops in on page load and hops every few seconds; on the
   first page of a tab chat.js also types a few prompts into it first. */
.chat-hint {
    position: relative;
    display: inline-flex; align-items: center;
    max-width: calc(100vw - 110px);
    padding: 9px 15px; border-radius: 999px;
    border: 1.5px solid transparent;
    font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap;
    background:
        linear-gradient(rgba(26,13,42,0.97), rgba(26,13,42,0.97)) padding-box,
        linear-gradient(135deg, #c084fc, #f900e4) border-box;
    box-shadow: 0 0 18px rgba(249,0,228,0.35), 0 10px 24px -12px rgba(0,0,0,0.8);
    cursor: pointer;
    transform-origin: center bottom;
}
.chat-hint:hover { box-shadow: 0 0 26px rgba(249,0,228,0.6), 0 10px 24px -12px rgba(0,0,0,0.8); }
@media (prefers-reduced-motion: no-preference) {
    /* Hops only once any typing has finished; the pop-in keeps running
       across the switch because animations are matched by name. */
    .chat-hint.typing { animation: chat-hint-pop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 600ms both; }
    .chat-hint:not(.typing) {
        animation:
            chat-hint-pop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 600ms both,
            chat-hint-jump 3.2s ease-in-out 1.5s infinite;
    }
}
@keyframes chat-hint-pop {
    from { opacity: 0; transform: translateX(14px) scale(0.6); }
    to { opacity: 1; transform: none; }
}
/* Crouch, hop up, land with a squash, small rebound, then rest. */
@keyframes chat-hint-jump {
    0%, 34%, 100% { transform: translateY(0) scale(1); }
    6% { transform: translateY(0) scale(1.06, 0.9); }
    14% { transform: translateY(-14px) scale(0.96, 1.05); }
    22% { transform: translateY(0) scale(1.05, 0.93); }
    28% { transform: translateY(-4px) scale(1); }
}
/* The bubble's tail, pointing at the button. */
.chat-hint::after {
    content: ''; position: absolute; right: -6px; top: 50%;
    width: 9px; height: 9px;
    background: rgba(26,13,42,0.97);
    border-top: 1.5px solid #f900e4; border-right: 1.5px solid #f900e4;
    transform: translateY(-50%) rotate(45deg);
}
.chat-hint-caret { display: none; width: 2px; height: 1.05em; margin-left: 2px; background: #f900e4; }
.chat-hint.typing .chat-hint-caret { display: inline-block; animation: chat-caret 0.9s steps(1) infinite; }
.chat-launcher.is-open .chat-hint { display: none; }
/* A little wiggle of the button as the bubble appears. */
@media (prefers-reduced-motion: no-preference) {
    .chat-toggle.nudge { animation: chat-nudge 900ms ease-in-out; }
}
@keyframes chat-nudge {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(-14deg) scale(1.08); }
    30% { transform: rotate(11deg) scale(1.08); }
    45% { transform: rotate(-7deg); }
    60% { transform: rotate(4deg); }
    75% { transform: rotate(-2deg); }
}

/* ── Panel ── */
.chat-panel {
    position: fixed; right: 22px; bottom: 96px; z-index: 998;
    width: min(440px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 120px));
    display: none; flex-direction: column; overflow: hidden;
    border: 1px solid transparent; border-radius: 18px;
    background:
        radial-gradient(90% 40% at 0% 0%, rgba(var(--violet-rgb),0.16), transparent 60%) padding-box,
        radial-gradient(70% 40% at 100% 100%, rgba(var(--pink-rgb),0.08), transparent 60%) padding-box,
        linear-gradient(180deg, #211232, #130a1e) padding-box,
        linear-gradient(155deg, rgba(var(--violet-rgb),0.8), rgba(92,43,138,0.55) 30%, rgba(59,28,90,0.55) 70%, rgba(var(--pink-rgb),0.6)) border-box;
    box-shadow: 0 30px 70px -24px rgba(0,0,0,0.95), 0 0 50px -24px rgba(var(--violet-rgb),0.5);
    font-family: var(--font-ui); color: var(--ink);
    transform-origin: bottom right;
}
.chat-panel.open { display: flex; }
.chat-panel.wide { width: min(720px, calc(100vw - 32px)); height: min(820px, calc(100vh - 120px)); }
@media (prefers-reduced-motion: no-preference) {
    .chat-panel.open { animation: chat-in 260ms var(--ease-out); }
}
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }

.chat-header {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 14px 14px 16px;
    border-bottom: 1px solid rgba(var(--violet-rgb),0.2);
    background: linear-gradient(90deg, rgba(var(--violet-rgb),0.18), rgba(var(--pink-rgb),0.06) 55%, transparent);
}
.chat-header::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, #f900e4, #c084fc, transparent);
    background-size: 50% 100%; background-repeat: no-repeat;
    box-shadow: 0 0 10px rgba(249,0,228,0.6);
}
@media (prefers-reduced-motion: no-preference) { .chat-header::after { animation: chat-shimmer 4s ease-in-out infinite; } }
@keyframes chat-shimmer { 0% { background-position: -60% 0; } 100% { background-position: 160% 0; } }
.chat-avatar {
    position: relative; flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    color: var(--on-accent);
    background: radial-gradient(circle at 30% 25%, #f5eaff, #c084fc 55%, #9333ea);
    box-shadow: 0 0 16px -2px rgba(var(--violet-rgb),0.8);
}
.chat-avatar .iris-icon { width: 24px; height: 24px; }
.chat-avatar::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 25%, #f900e4 45%, #c084fc 60%, transparent 75% 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
}
@media (prefers-reduced-motion: no-preference) { .chat-avatar::after { animation: chat-spin 12s linear infinite; } }
@keyframes chat-spin { to { transform: rotate(360deg); } }
.chat-title { min-width: 0; }
.chat-title strong { display: block; font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 16px; letter-spacing: 0.02em; color: var(--accent); text-shadow: 0 0 14px rgba(249,0,228,0.4); }
.chat-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.chat-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.chat-status.ai i { background: var(--genuine); box-shadow: 0 0 8px var(--genuine); }
@media (prefers-reduced-motion: no-preference) { .chat-status.ai i { animation: chat-blink 1.8s ease-in-out infinite; } }
@keyframes chat-blink { 50% { opacity: 0.35; } }
.chat-status.offline i { background: var(--unverified); box-shadow: 0 0 8px var(--unverified); }
.chat-actions { margin-left: auto; display: flex; gap: 4px; }
.chat-icon-btn {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.chat-icon-btn:hover { background: rgba(var(--violet-rgb),0.14); color: var(--ink); }
.chat-icon-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.chat-icon-btn svg { width: 17px; height: 17px; }

/* ── Messages ── */
.chat-messages {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
    padding: 16px 14px 8px;
    display: flex; flex-direction: column; gap: 14px;
    scrollbar-width: thin; scrollbar-color: rgba(var(--violet-rgb),0.4) transparent;
    background: radial-gradient(circle, rgba(var(--violet-rgb),0.1) 1px, transparent 1.4px) 0 0 / 20px 20px;
}
.chat-row { display: flex; gap: 10px; align-items: flex-end; max-width: 100%; }
.chat-row.user { justify-content: flex-end; }
.chat-row .mini-avatar {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; color: var(--on-accent);
    background: radial-gradient(circle at 30% 25%, #f5eaff, #c084fc 55%, #9333ea);
    box-shadow: 0 0 12px -2px rgba(var(--violet-rgb),0.8);
}
.chat-row .mini-avatar .iris-icon { width: 17px; height: 17px; }
.chat-bubble-wrap { display: grid; gap: 4px; min-width: 0; max-width: 86%; }
.chat-row.user .chat-bubble-wrap { justify-items: end; }
.chat-msg {
    padding: 10px 13px; border-radius: 14px;
    font-size: 15px; line-height: 1.55; overflow-wrap: anywhere;
}
.chat-row.bot .chat-msg {
    border-bottom-left-radius: 4px;
    background: linear-gradient(135deg, rgba(var(--violet-rgb),0.1), rgba(19,10,30,0.92) 45%);
    box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb),0.22), inset 2px 0 0 rgba(249,0,228,0.75), 0 10px 22px -16px rgba(0,0,0,0.9);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chat-row.user .chat-msg {
    border-bottom-right-radius: 4px;
    color: var(--on-accent); font-weight: 600;
    background: linear-gradient(135deg, #e9d5ff, #c084fc 55%, #e879f9);
    box-shadow: 0 0 18px -4px rgba(var(--pink-rgb),0.55), 0 8px 18px -10px rgba(var(--violet-rgb),0.8);
}
.chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11px; color: var(--ink-3); padding: 0 4px; }
.chat-copy {
    border: 0; background: none; padding: 2px 4px; border-radius: 5px;
    color: var(--ink-3); font: inherit; cursor: pointer;
}
.chat-copy:hover { color: var(--accent-2-text); background: rgba(var(--violet-rgb),0.1); }
.chat-copy:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
/* Who answered: instant (curated), local AI (with time) or offline rules. */
.chat-source {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 7px; border-radius: 999px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em;
    color: var(--ink-2); background: rgba(var(--violet-rgb),0.12);
}
.chat-source::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chat-source.instant { color: #6ee7b7; background: rgba(52,211,153,0.1); }
.chat-source.ai { color: #e9d5ff; }
.chat-source.offline { color: #fcd34d; background: rgba(251,191,36,0.1); }

.chat-msg p { margin: 0 0 8px; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg ol, .chat-msg ul { margin: 4px 0 8px; padding-left: 20px; }
.chat-msg li { margin-bottom: 4px; }
.chat-msg strong { font-weight: 700; color: var(--accent-2); }
.chat-row.user .chat-msg strong { color: inherit; }
.chat-msg .chat-heading { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 15px; color: var(--accent); margin: 2px 0 6px; }
.chat-msg .chat-table-wrap { overflow-x: auto; margin: 4px 0 8px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb),0.22); }
.chat-msg table { border-collapse: collapse; width: 100%; font-size: 13px; }
.chat-msg th, .chat-msg td { padding: 6px 8px; text-align: left; border-bottom: 1px solid rgba(var(--violet-rgb),0.16); word-break: break-word; }
.chat-msg th { background: rgba(var(--violet-rgb),0.1); font-weight: 700; }
.chat-msg tr:last-child td { border-bottom: 0; }
.chat-msg code { font-family: var(--font-mono); font-size: 13px; padding: 1px 5px; border-radius: 4px; background: rgba(var(--violet-rgb),0.14); }
/* Blinking caret while a reply streams in. */
.chat-msg.streaming > :last-child::after, .chat-msg.streaming:empty::after {
    content: ''; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px;
    background: var(--accent-2); animation: chat-caret 900ms steps(2) infinite;
}
@keyframes chat-caret { 50% { opacity: 0; } }

/* Thinking indicator (the local model can take a while). */
.chat-thinking { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; }
.chat-thinking .cubes { display: inline-flex; align-items: flex-end; gap: 5px; height: 18px; }
.chat-thinking .cubes i {
    width: 7px; height: 7px; border-radius: 1.5px;
    background: #f0abfc; border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 0 8px rgba(249,0,228,0.9);
    animation: chat-hop 1.1s ease-in-out infinite;
}
.chat-thinking .cubes i:nth-child(2) { animation-delay: 0.15s; background: #c084fc; }
.chat-thinking .cubes i:nth-child(3) { animation-delay: 0.3s; background: #e879f9; }
@keyframes chat-hop { 0%, 60%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-9px) rotate(90deg); } }
.chat-thinking time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

/* Scan card: a link pasted into the chat is inspected right here. */
.chat-scan {
    --s-rgb: var(--violet-rgb);
    display: grid; gap: 8px;
    padding: 12px 14px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--s-rgb),0.14), rgba(19,10,30,0.9) 60%);
    box-shadow: inset 0 0 0 1px rgba(var(--s-rgb),0.45), inset 3px 0 0 rgba(var(--s-rgb),0.9), 0 0 26px -10px rgba(var(--s-rgb),0.9);
}
.chat-scan.safe { --s-rgb: 52,211,153; }
.chat-scan.uncertain { --s-rgb: 251,191,36; }
.chat-scan.phishing { --s-rgb: 248,113,113; }
.chat-scan-top { display: flex; align-items: center; gap: 10px; }
.chat-scan-badge {
    flex: none; padding: 3px 9px; border-radius: 999px;
    font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: rgb(var(--s-rgb)); background: rgba(19,10,30,0.85); box-shadow: inset 0 0 0 1px rgba(var(--s-rgb),0.6);
}
.chat-scan-conf { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.chat-scan-url { font-family: var(--font-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.chat-scan-meter { position: relative; height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(52,211,153,0.6), rgba(251,191,36,0.45) 62%, rgba(248,113,113,0.65)); }
.chat-scan-meter span { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #f5f0ff; border: 2px solid rgb(var(--s-rgb)); box-shadow: 0 0 8px rgba(var(--s-rgb),0.9); }
.chat-scan ul { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.chat-scan li { position: relative; padding-left: 14px; }
.chat-scan li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--s-rgb)); }
.chat-scan a { justify-self: start; font-size: 13px; font-weight: 700; color: var(--accent-2); }

/* ── Welcome: avatar orb, greeting and starter cards ── */
.chat-hello { display: grid; justify-items: center; gap: 10px; padding: 14px 4px 6px; text-align: center; }
.hello-orb {
    position: relative; width: 66px; height: 66px; border-radius: 50%;
    display: grid; place-items: center; color: var(--on-accent);
    background: radial-gradient(circle at 30% 25%, #f5eaff, #c084fc 55%, #9333ea);
    box-shadow: 0 0 34px -4px rgba(var(--violet-rgb),0.9), 0 0 60px -20px rgba(249,0,228,0.8);
}
.hello-orb .iris-icon { width: 36px; height: 36px; }
.hello-orb::before, .hello-orb::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hello-orb::before {
    inset: -7px;
    background: conic-gradient(from 0deg, transparent 0 20%, #f900e4 40%, #c084fc 55%, transparent 70% 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
.hello-orb::after { inset: -14px; border: 1px dashed rgba(var(--pink-rgb),0.35); }
@media (prefers-reduced-motion: no-preference) {
    .hello-orb::before { animation: chat-spin 3s linear infinite; }
    .hello-orb::after { animation: chat-spin 16s linear infinite reverse; }
}
.chat-hello h3 { margin-top: 8px; font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 20px; color: var(--ink); }
.chat-hello h3 span { color: var(--accent); text-shadow: 0 0 16px rgba(249,0,228,0.5); }
.chat-hello p { max-width: 32ch; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.hello-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 6px; }
.hello-tile {
    display: grid; justify-items: start; gap: 4px; padding: 11px 10px; border-radius: 12px; cursor: pointer; text-align: left;
    border: 0; font: inherit; color: var(--ink);
    background: linear-gradient(160deg, rgba(var(--violet-rgb),0.16), rgba(19,10,30,0.9) 70%);
    box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb),0.28);
    transition: transform 180ms var(--ease-out), box-shadow 180ms ease;
}
.hello-tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(var(--pink-rgb),0.7), 0 0 20px -6px rgba(249,0,228,0.6); }
.hello-tile:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.hello-tile svg { width: 18px; height: 18px; color: var(--accent-2-text); filter: drop-shadow(0 0 6px rgba(249,0,228,0.6)); }
.hello-tile b { font-size: 13px; font-weight: 800; }
.hello-tile span { font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }
@media (max-width: 400px) { .hello-tiles { grid-template-columns: minmax(0, 1fr); } }

/* ── Suggestions + input ── */
.chat-suggest { display: flex; gap: 6px; padding: 4px 14px 10px; overflow-x: auto; scrollbar-width: none; }
.chat-suggest::-webkit-scrollbar { display: none; }
.chat-chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 999px; cursor: pointer;
    font: 600 13px var(--font-ui); color: var(--accent-2);
    background: rgba(var(--violet-rgb),0.1); border: 0; box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb),0.34);
    transition: background-color 160ms ease, box-shadow 160ms ease;
}
.chat-chip:hover { background: rgba(var(--violet-rgb),0.2); box-shadow: inset 0 0 0 1px rgba(var(--pink-rgb),0.75), 0 0 14px -4px rgba(var(--pink-rgb),0.7); }
.chat-chip.scan { color: #6ee7b7; background: rgba(52,211,153,0.08); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.35); }
.chat-chip.ai { color: #f5d0fe; background: rgba(249,0,228,0.1); box-shadow: inset 0 0 0 1px rgba(249,0,228,0.45); }
.chat-chip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.chat-chip svg { width: 13px; height: 13px; }

.chat-compose {
    display: flex; align-items: flex-end; gap: 8px;
    margin: 0 12px 12px; padding: 6px 6px 6px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, #1a0d2a, #12081d) padding-box,
                linear-gradient(135deg, rgba(var(--violet-rgb),0.55), rgba(92,43,138,0.9) 45%, rgba(var(--pink-rgb),0.45)) border-box;
    border: 1px solid transparent;
    transition: box-shadow 200ms ease;
}
.chat-compose:focus-within { box-shadow: 0 0 0 3px rgba(var(--violet-rgb),0.2), 0 0 22px -4px rgba(249,0,228,0.45), 0 10px 24px -12px rgba(var(--violet-rgb),0.55); }
.chat-input {
    flex: 1; min-width: 0; max-height: 140px; min-height: 40px;
    padding: 9px 0; border: 0; outline: none; resize: none;
    background: transparent; color: var(--ink); caret-color: var(--accent-2);
    font: 15px/1.45 var(--font-ui);
    /* The compose box is the field; drop the shared field look from site.css. */
    box-shadow: none; border-radius: 0;
}
.chat-input::placeholder { color: var(--ink-3); }
.chat-send-btn {
    flex: none; width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; border: 0; cursor: pointer;
    background: var(--accent-fill); color: var(--on-accent);
    box-shadow: 0 0 14px rgba(var(--violet-rgb),0.45);
    transition: transform 160ms var(--ease-out), filter 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}
.chat-send-btn:hover { filter: brightness(1.1); box-shadow: 0 0 22px rgba(var(--pink-rgb),0.65); }
.chat-send-btn:disabled { box-shadow: none; }
.chat-send-btn:active { transform: scale(0.94); }
.chat-send-btn:disabled { opacity: 0.4; cursor: default; }
.chat-send-btn svg { width: 18px; height: 18px; }
.chat-send-btn .stop { display: none; }
.chat-send-btn.stopping { background: rgba(248,113,113,0.18); color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(248,113,113,0.5); }
.chat-send-btn.stopping .send { display: none; }
.chat-send-btn.stopping .stop { display: block; }
.chat-foot { display: flex; justify-content: space-between; gap: 8px; padding: 0 16px 10px; margin-top: -6px; font-size: 11px; color: var(--ink-3); }
.chat-count.near { color: var(--unverified); }

@media (max-width: 560px) {
    .chat-panel, .chat-panel.wide { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
    .chat-launcher { right: 14px; bottom: 14px; }
    .chat-launcher.is-open { display: none; }
    .chat-hint { padding: 7px 12px; font-size: 13px; }
    .chat-expand { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .chat-thinking .cubes i { animation: none; }
    .chat-msg.streaming > :last-child::after { animation: none; }
}
@media print { .chat-launcher, .chat-panel { display: none !important; } }
