/* =========================================
   BinaryPH Chatbot
   ========================================= */

/* =========================================
   1. CORE CONTAINER + THEME TOKENS
   ========================================= */
.binaryph-chatbot-container {
    --bg-light-sidebar: #f9f9f9;
    --bg-dark-sidebar: #171717;
    --bg-dark-main: #212121;
    --accent-color: #3b82f6;

    --bph-accent: var(--accent-color);
    --bph-link: #2563eb; /* darker than the accent: readable on white */
    --bph-bg: #fff;
    --bph-text: #333;
    --bph-muted: rgba(0, 0, 0, 0.55);
    --bph-faint: rgba(0, 0, 0, 0.06);
    --bph-hover: rgba(0, 0, 0, 0.06);
    --bph-border: rgba(0, 0, 0, 0.12);
    --bph-sidebar: var(--bg-light-sidebar);
    --bph-user-bubble: #ececec;
    --bph-composer: #f4f4f4;
    --bph-composer-border: rgba(0, 0, 0, 0.08);
    --bph-chip: #e5e7eb;
    --bph-code-bg: #0f172a;
    --bph-code-head: #1e293b;
    --bph-code-text: #e2e8f0;
    --bph-inline-code: rgba(0, 0, 0, 0.06);
    /* The shimmer's dimmest point still meets 4.5:1 text contrast. */
    --bph-shimmer-base: rgba(0, 0, 0, 0.56);
    --bph-shimmer-hi: rgba(0, 0, 0, 0.95);
    --bph-error-bg: rgba(239, 68, 68, 0.07);
    --bph-error-border: rgba(239, 68, 68, 0.35);
    --bph-error-text: #b91c1c;
    --bph-toast-bg: #111827;
    --bph-toast-text: #fff;

    display: flex;
    flex-direction: row; /* Side-by-side layout */
    height: 600px;       /* Fallback height */
    position: relative;

    /* ISOLATION creates a new stacking context. */
    isolation: isolate;
    z-index: 1;

    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: var(--bph-bg);
    color: var(--bph-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.binaryph-chatbot-dark {
    --bph-link: #60a5fa; /* lighter than the accent: readable on dark grey */
    --bph-bg: var(--bg-dark-main);
    --bph-text: #ececec;
    --bph-muted: rgba(255, 255, 255, 0.6);
    --bph-faint: rgba(255, 255, 255, 0.07);
    --bph-hover: rgba(255, 255, 255, 0.09);
    --bph-border: rgba(255, 255, 255, 0.14);
    --bph-sidebar: var(--bg-dark-sidebar);
    --bph-user-bubble: #3a3a3a;
    --bph-composer: #2f2f2f;
    --bph-composer-border: rgba(255, 255, 255, 0.08);
    --bph-chip: #404040;
    --bph-code-bg: #0b0f19;
    --bph-code-head: #161b26;
    --bph-inline-code: rgba(255, 255, 255, 0.1);
    --bph-shimmer-base: rgba(255, 255, 255, 0.55);
    --bph-shimmer-hi: rgba(255, 255, 255, 1);
    --bph-error-bg: rgba(239, 68, 68, 0.12);
    --bph-error-border: rgba(248, 113, 113, 0.4);
    --bph-error-text: #fca5a5;
    --bph-toast-bg: #f3f4f6;
    --bph-toast-text: #111827;
    border: 1px solid #333;
}

/* FULLSCREEN */
.binaryph-chatbot-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    z-index: 2147483647 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
    isolation: auto;
}

.binaryph-chatbot-container * { box-sizing: border-box; }

/* Theme-proofing: many themes style every <button> (padding, uppercase,
   shadows, fixed sizes). Reset what they commonly touch. */
.binaryph-chatbot-container button {
    font-family: inherit;
    font-size: inherit;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
    text-shadow: none;
    box-shadow: none;
    margin: 0;
    min-width: 0;
    min-height: 0;
    -webkit-appearance: none;
    appearance: none;
}
.binaryph-chatbot-container button:focus { outline: none; }
.binaryph-chatbot-container button:focus-visible,
.binaryph-chatbot-container a:focus-visible,
.binaryph-chatbot-container textarea:focus-visible {
    outline: 2px solid var(--bph-accent);
    outline-offset: 2px;
}
.binaryph-chatbot-container svg { display: block; flex-shrink: 0; }

.bph-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =========================================
   2. SIDEBAR
   ========================================= */
.binaryph-chatbot-sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    background: var(--bph-sidebar);
    border-right: 1px solid var(--bph-border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, min-width 0.3s ease, transform 0.3s ease;
    z-index: 100;
    position: relative;
}

.binaryph-chatbot-sidebar.closed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border: none;
}

.binaryph-chatbot-sidebar-header {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title { font-weight: 600; font-size: 14px; opacity: 0.8; }

.binaryph-chatbot-container .binaryph-mobile-close-sidebar {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    line-height: 1;
    padding: 0 5px;
}

.sidebar-actions { display: flex; gap: 8px; }

.binaryph-chatbot-container .binaryph-new-chat {
    flex: 1;
    padding: 8px 12px;
    background: var(--bph-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.binaryph-chatbot-container .binaryph-new-chat:hover { opacity: 0.9; }

.binaryph-chatbot-container .binaryph-clear-all-conversations {
    background: transparent;
    border: 1px solid var(--bph-border);
    border-radius: 8px;
    color: inherit;
    min-width: 36px;
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.binaryph-chatbot-container .binaryph-clear-all-conversations:hover { color: #ef4444; border-color: #ef4444; }

.binaryph-chatbot-history {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 12px;
}
.bph-history-group + .bph-history-group { margin-top: 10px; }
.bph-history-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bph-muted);
    padding: 8px 8px 4px;
}
.binaryph-chatbot-container .binaryph-chatbot-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.binaryph-chatbot-container .binaryph-chatbot-log-list li {
    display: flex;
    align-items: center;
    border-radius: 8px;
    margin: 0 0 2px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--bph-text);
}
.binaryph-chatbot-log-list li:hover { background: var(--bph-hover); }
.binaryph-chatbot-log-list li.is-active { background: var(--bph-hover); }
.binaryph-chatbot-log-list li.is-active .conversation-title { font-weight: 600; }

.binaryph-chatbot-container .conversation-open {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    padding: 9px 4px 9px 10px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 8px;
}
.conversation-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.binaryph-chatbot-container .conversation-delete {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    padding: 6px 8px;
    margin-right: 2px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
}
.binaryph-chatbot-log-list li:hover .conversation-delete,
.binaryph-chatbot-log-list li.is-active .conversation-delete,
.binaryph-chatbot-container .conversation-delete:focus-visible { opacity: 0.65; }
.binaryph-chatbot-container .conversation-delete:hover { opacity: 1; color: #ef4444; }

/* Pin: hidden until hover like delete; always shown (accent) once pinned. */
.binaryph-chatbot-container .conversation-pin {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
}
.binaryph-chatbot-log-list li:hover .conversation-pin,
.binaryph-chatbot-log-list li.is-active .conversation-pin,
.binaryph-chatbot-container .conversation-pin:focus-visible { opacity: 0.65; }
.binaryph-chatbot-container .conversation-pin:hover { opacity: 1; color: var(--bph-accent); }
.binaryph-chatbot-container .conversation-pin.is-pinned { opacity: 1; color: var(--bph-accent); }
.binaryph-chatbot-container .conversation-pin.is-pinned svg path { fill: currentColor; }

/* Two-tap delete confirmation (confirm() dialogs don't fire in iOS webviews) */
.binaryph-chatbot-container .conversation-delete.confirm-state {
    opacity: 1;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.binaryph-chatbot-container .binaryph-clear-all-conversations.confirm-state {
    color: #ef4444;
    border-color: #ef4444;
    font-weight: 600;
}

.binaryph-chatbot-container .bph-history-empty {
    margin: 12px 8px;
    padding: 0;
    font-size: 13px;
    color: var(--bph-muted);
}

/* Inline sidebar notice (replaces alert(), also suppressed in iOS webviews) */
.binaryph-sidebar-notice {
    margin: 4px 0 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}
.binaryph-chatbot-dark .binaryph-sidebar-notice { color: #fca5a5; }

.binaryph-sidebar-backdrop { display: none; }

/* =========================================
   3. MAIN + HEADER
   ========================================= */
.binaryph-chatbot-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    overflow: hidden;
    z-index: 10;
    background-color: inherit;
}

.binaryph-chatbot-header {
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 50;
    position: relative;
}
.header-left, .header-right { display: flex; align-items: center; gap: 2px; }

.binaryph-chatbot-container .binaryph-chatbot-header button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.65;
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background-color 0.15s;
}
.binaryph-chatbot-container .binaryph-chatbot-header button:hover { opacity: 1; background: var(--bph-hover); }

/* Nothing to save or restart on the empty welcome screen. */
.binaryph-chatbot-container.is-hero-mode .binaryph-download-chat,
.binaryph-chatbot-container.is-hero-mode .binaryph-header-new-chat { display: none; }
/* The sidebar already has "+ New Chat" while it is open. */
.binaryph-chatbot-container.bph-sidebar-open:not(.bph-narrow) .binaryph-header-new-chat { display: none; }

.binaryph-fullscreen-toggle .bph-icon-collapse { display: none; }
.binaryph-chatbot-container.fullscreen .binaryph-fullscreen-toggle .bph-icon-expand { display: none; }
.binaryph-chatbot-container.fullscreen .binaryph-fullscreen-toggle .bph-icon-collapse { display: block; }

/* Light/dark switch: the moon offers dark mode, the sun offers light mode. */
.binaryph-theme-toggle .bph-icon-sun { display: none; }
.binaryph-chatbot-dark .binaryph-theme-toggle .bph-icon-sun { display: block; }
.binaryph-chatbot-dark .binaryph-theme-toggle .bph-icon-moon { display: none; }

/* Colours fade briefly when a visitor switches themes (class set by JS). */
.binaryph-chatbot-container.bph-theme-anim,
.binaryph-chatbot-container.bph-theme-anim * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* =========================================
   4. MESSAGES
   ========================================= */
.binaryph-chatbot-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    opacity: 1;
    transition: opacity 0.3s;
    background-color: inherit;
}
.binaryph-chatbot-container.is-hero-mode .binaryph-chatbot-messages {
    opacity: 0;
    pointer-events: none;
}

/* Keep the conversation a comfortable reading width on wide screens. */
.binaryph-chatbot-messages > * {
    width: 100%;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes bphFadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.binaryph-user-message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    animation: bphFadeInUp 0.35s ease-out both;
}
.user-message-text {
    background: var(--bph-user-bubble);
    padding: 10px 16px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    max-width: 85%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
}
.binaryph-chatbot-container .user-message-text a,
.binaryph-chatbot-container .bph-md a {
    color: var(--bph-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.bph-user-attachments {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 6px;
    max-width: 85%;
}
.bph-att-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--bph-border);
    display: block;
}
.bph-att-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--bph-user-bubble);
    font-size: 12px;
    max-width: 220px;
}
.bph-att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.binaryph-bot-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 4px;
    animation: bphFadeInUp 0.35s ease-out both;
}
.bot-message-text {
    max-width: 100%;
    line-height: 1.65;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* "Searched the web · Looked it up · 14s" */
.bph-steps {
    font-size: 12.5px;
    color: var(--bph-muted);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bph-steps::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bph-accent);
    opacity: 0.8;
    flex-shrink: 0;
}

/* Message actions: always visible on touch screens, on hover elsewhere
   (and always for the latest reply). */
.bph-msg-actions {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    min-height: 30px;
    opacity: 0;
    transition: opacity 0.15s;
}
.binaryph-user-message:hover .bph-msg-actions,
.binaryph-bot-message:hover .bph-msg-actions,
.binaryph-bot-message:last-child .bph-msg-actions,
.bph-msg-actions:focus-within { opacity: 1; }
.binaryph-chatbot-container .bph-action {
    background: transparent;
    border: none;
    color: var(--bph-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.binaryph-chatbot-container .bph-action:hover { background: var(--bph-hover); color: inherit; }
.binaryph-chatbot-container .bph-action.is-copied { color: #16a34a; }

/* Error reply with a retry button */
.bph-error-message .bot-message-text {
    background: var(--bph-error-bg);
    border: 1px solid var(--bph-error-border);
    color: var(--bph-error-text);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
}
.bph-error-message .bph-msg-actions { opacity: 1; margin-top: 8px; }
.binaryph-chatbot-container .bph-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--bph-border);
    color: inherit;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.binaryph-chatbot-container .bph-retry:hover { background: var(--bph-hover); }

/* =========================================
   5. FORMATTED REPLIES (Markdown)
   Specific selectors + explicit resets so theme typography (heading fonts,
   uppercase, list styles, margins) can't leak into the chat.
   ========================================= */
.binaryph-chatbot-container .bph-md { white-space: normal; font-size: 15px; }
.binaryph-chatbot-container .bph-md > :first-child { margin-top: 0; }
.binaryph-chatbot-container .bph-md > :last-child { margin-bottom: 0; }
.binaryph-chatbot-container .bph-md p {
    margin: 0 0 0.8em;
    padding: 0;
    font: inherit;
    color: inherit;
    line-height: inherit;
}
.binaryph-chatbot-container .bph-md h3,
.binaryph-chatbot-container .bph-md h4,
.binaryph-chatbot-container .bph-md h5,
.binaryph-chatbot-container .bph-md h6 {
    font-family: inherit;
    color: inherit;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: normal;
    margin: 1.1em 0 0.45em;
    padding: 0;
    border: 0;
    background: none;
}
/* "#" renders as <h3>, "##" as <h4>, "###" (the one models use most) as <h5>. */
.binaryph-chatbot-container .bph-md h3 { font-size: 1.3em; }
.binaryph-chatbot-container .bph-md h4 { font-size: 1.18em; }
.binaryph-chatbot-container .bph-md h5 { font-size: 1.08em; }
.binaryph-chatbot-container .bph-md h6 { font-size: 1em; }
.binaryph-chatbot-container .bph-md strong { font-weight: 700; color: inherit; }
.binaryph-chatbot-container .bph-md em { font-style: italic; }
.binaryph-chatbot-container .bph-md del { opacity: 0.7; }
.binaryph-chatbot-container .bph-md ul,
.binaryph-chatbot-container .bph-md ol {
    margin: 0 0 0.8em;
    padding: 0 0 0 1.5em;
    list-style-position: outside;
}
.binaryph-chatbot-container .bph-md ul { list-style-type: disc; }
.binaryph-chatbot-container .bph-md ul ul { list-style-type: circle; }
.binaryph-chatbot-container .bph-md ol { list-style-type: decimal; }
.binaryph-chatbot-container .bph-md li {
    margin: 0.3em 0;
    padding: 0 0 0 0.2em;
    list-style: inherit;
    background: none;
    color: inherit;
}
.binaryph-chatbot-container .bph-md li::before { content: none; }
.binaryph-chatbot-container .bph-md li > ul,
.binaryph-chatbot-container .bph-md li > ol { margin: 0.3em 0 0.3em; }
.binaryph-chatbot-container .bph-md li > p { margin: 0 0 0.4em; }
.binaryph-chatbot-container .bph-md code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
    background: var(--bph-inline-code);
    color: inherit;
    padding: 0.12em 0.4em;
    border-radius: 5px;
    border: 0;
    white-space: break-spaces;
}
.binaryph-chatbot-container .bph-md .bph-code {
    margin: 0.4em 0 0.9em;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bph-code-bg);
    color: var(--bph-code-text);
    max-width: 100%;
}
.binaryph-chatbot-container .bph-code-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 6px 14px;
    background: var(--bph-code-head);
    font-size: 12px;
    color: #94a3b8;
}
.binaryph-chatbot-container .bph-code-copy {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.binaryph-chatbot-container .bph-code-copy:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.binaryph-chatbot-container .bph-code-copy.is-copied { color: #4ade80; }
.binaryph-chatbot-container .bph-md pre {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}
.binaryph-chatbot-container .bph-md pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre;
}
.binaryph-chatbot-container .bph-md blockquote {
    margin: 0 0 0.8em;
    padding: 0.2em 0 0.2em 1em;
    border: 0;
    border-left: 3px solid var(--bph-accent);
    background: none;
    color: inherit;
    font-style: normal;
    font-size: inherit;
    quotes: none;
}
.binaryph-chatbot-container .bph-md blockquote::before,
.binaryph-chatbot-container .bph-md blockquote::after { content: none; }
.binaryph-chatbot-container .bph-md hr {
    border: 0;
    border-top: 1px solid var(--bph-border);
    height: 0;
    margin: 1.1em 0;
    background: none;
}
.binaryph-chatbot-container .bph-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    margin: 0.4em 0 0.9em;
    -webkit-overflow-scrolling: touch;
}
.binaryph-chatbot-container .bph-md table {
    border-collapse: collapse;
    width: auto;
    margin: 0;
    font-size: 0.93em;
    line-height: 1.45;
    border: 0;
    background: none;
}
.binaryph-chatbot-container .bph-md th,
.binaryph-chatbot-container .bph-md td {
    border: 1px solid var(--bph-border);
    padding: 7px 11px;
    text-align: left;
    vertical-align: top;
    min-width: 64px;
    overflow-wrap: normal;
    word-break: normal;
    background: none;
    color: inherit;
}
.binaryph-chatbot-container .bph-md th { background: var(--bph-faint); font-weight: 600; }
.binaryph-chatbot-container .bph-md .bph-al-center { text-align: center; }
.binaryph-chatbot-container .bph-md .bph-al-right { text-align: right; }

/* Word-by-word reveal of a new reply (the text is already laid out; only
   its opacity animates). */
.bph-revealing .bph-w { opacity: 0; transition: opacity 0.35s ease-out; }
.bph-revealing .bph-w.bph-w-in { opacity: 1; }

/* =========================================
   6. THINKING INDICATOR
   Never stops while waiting: the spark twinkles, a shimmer sweeps the text,
   the phrase rotates, and the clock counts.
   ========================================= */
.bph-thinking {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 30px;
    font-size: 14.5px;
}
.bph-spark {
    width: 22px;
    height: 22px;
    color: var(--bph-accent);
    flex: 0 0 auto;
    display: block;
}
.bph-spark svg {
    width: 22px;
    height: 22px;
    overflow: visible;
    animation: bphSparkTurn 6s linear infinite;
}
.bph-spark line {
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    transform-origin: 12px 12px;
    animation: bphRay 1.6s ease-in-out infinite;
}
.bph-spark line:nth-child(1) { animation-delay: 0s; }
.bph-spark line:nth-child(2) { animation-delay: 0.2s; }
.bph-spark line:nth-child(3) { animation-delay: 0.4s; }
.bph-spark line:nth-child(4) { animation-delay: 0.6s; }
.bph-spark line:nth-child(5) { animation-delay: 0.8s; }
.bph-spark line:nth-child(6) { animation-delay: 1s; }
.bph-spark line:nth-child(7) { animation-delay: 1.2s; }
.bph-spark line:nth-child(8) { animation-delay: 1.4s; }

@keyframes bphSparkTurn {
    to { transform: rotate(360deg); }
}
@keyframes bphRay {
    0%, 100% { transform: scale(0.5); opacity: 0.35; }
    45% { transform: scale(1.12); opacity: 1; }
}

.bph-thinking-label { display: inline-block; }
.bph-thinking-label.bph-swap { animation: bphSwap 0.35s ease-out; }
@keyframes bphSwap {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Shimmer: a highlight sweeps across the text, forever. */
.bph-shimmer {
    color: var(--bph-muted);
    font-weight: 500;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .bph-shimmer {
        background-image: linear-gradient(90deg,
            var(--bph-shimmer-base) 0%, var(--bph-shimmer-base) 35%,
            var(--bph-shimmer-hi) 50%,
            var(--bph-shimmer-base) 65%, var(--bph-shimmer-base) 100%);
        background-size: 250% 100%;
        background-repeat: no-repeat;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
        animation: bphShimmer 2.2s linear infinite;
    }
}
@keyframes bphShimmer {
    from { background-position: 100% 0; }
    to { background-position: 0% 0; }
}

.bph-thinking-time {
    font-size: 12px;
    color: var(--bph-muted);
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

/* =========================================
   7. SCROLLBARS
   ========================================= */
.binaryph-chatbot-messages::-webkit-scrollbar,
.binaryph-chatbot-history::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.binaryph-chatbot-messages::-webkit-scrollbar-track,
.binaryph-chatbot-history::-webkit-scrollbar-track {
    background: transparent;
}
.binaryph-chatbot-messages::-webkit-scrollbar-thumb,
.binaryph-chatbot-history::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.binaryph-chatbot-messages::-webkit-scrollbar-thumb:hover,
.binaryph-chatbot-history::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}
.binaryph-chatbot-dark .binaryph-chatbot-messages::-webkit-scrollbar-thumb,
.binaryph-chatbot-dark .binaryph-chatbot-history::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}
.binaryph-chatbot-dark .binaryph-chatbot-messages::-webkit-scrollbar-thumb:hover,
.binaryph-chatbot-dark .binaryph-chatbot-history::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
.binaryph-chatbot-messages::-webkit-scrollbar-corner,
.binaryph-chatbot-history::-webkit-scrollbar-corner {
    background: transparent;
}

/* =========================================
   8. JUMP TO LATEST
   ========================================= */
.binaryph-chatbot-container .binaryph-jump-latest {
    position: absolute;
    left: 50%;
    bottom: 150px;
    transform: translate(-50%, 8px);
    z-index: 45;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--bph-border);
    background: var(--bph-bg);
    color: inherit;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.binaryph-chatbot-container.bph-show-jump .binaryph-jump-latest {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* =========================================
   9. INPUT AREA
   ========================================= */
/* In-flow footer: the messages viewport ends ABOVE the input, so message
   text can never sit hidden behind it. Hero mode is the only state that
   overlays (messages are opacity:0 there); the hero<->chat slide is
   animated in JS via a FLIP transform because position changes can't
   transition in CSS. */
.binaryph-chatbot-input-wrapper {
    width: 100%;
    padding: 6px 20px 12px;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 40;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.binaryph-chatbot-container.is-hero-mode .binaryph-chatbot-input-wrapper {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-38%);
    max-width: 100%;
}

.binaryph-chatbot-input {
    width: 100%;
    max-width: 760px !important;
    background: var(--bph-composer);
    border: 1px solid var(--bph-composer-border);
    border-radius: 22px;
    padding: 12px 12px 8px 16px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    transition: box-shadow 0.2s, border-color 0.2s;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}
.binaryph-chatbot-input:focus-within {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 2px 16px rgba(59, 130, 246, 0.12);
}
.binaryph-chatbot-dark .binaryph-chatbot-input { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }

/* WPAUTOP GUARD: some themes run wpautop over shortcode output. It adds
   stray <br>s, empty <p>s (from orphan </p>), and <p> wrappers around inline
   elements. The template gives every control its own <div> so nothing gets
   wrapped; as a second line of defence a stray <p> becomes box-less
   (display: contents) — its children still render — instead of display:none,
   which once hid the message box itself. */
.binaryph-chatbot-input > br,
.binaryph-chatbot-main > br,
.binaryph-chatbot-input-wrapper > br,
.binaryph-chatbot-header > br,
.binaryph-chatbot-buttons > br,
.binaryph-chatbot-sidebar > br,
.binaryph-file-preview-container > br,
.binaryph-chatbot-container > br,
.binaryph-chatbot-input > p:empty,
.binaryph-chatbot-main > p:empty,
.binaryph-chatbot-header > p:empty,
.binaryph-chatbot-sidebar > p:empty,
.binaryph-file-preview-container > p:empty,
.binaryph-chatbot-container > p:empty {
    display: none !important;
}
.binaryph-chatbot-input > p,
.binaryph-chatbot-main > p,
.binaryph-chatbot-header > p,
.binaryph-chatbot-buttons > p,
.binaryph-chatbot-sidebar > p,
.binaryph-file-preview-container > p,
.binaryph-chatbot-container > p {
    display: contents !important;
}
.binaryph-chatbot-fields,
.binaryph-chatbot-prepaint { display: none !important; }
.binaryph-textarea-wrap { width: 100%; display: block; }
.binaryph-jump-wrap { height: 0; flex: 0 0 auto; }
.binaryph-clear-files-wrap { display: flex; flex-shrink: 0; }

/* TextArea: grows with its content (JS sets the height up to 200px). */
.binaryph-chatbot-container .binaryph-chatbot-message-input {
    width: 100%;
    background: transparent;
    border: none !important;
    resize: none;
    min-height: 26px !important;
    max-height: 200px !important;
    height: 26px;
    overflow-y: hidden;
    outline: none !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: inherit;
    font-family: inherit;
    padding: 0 !important;
    margin: 0 0 6px 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    display: block;
}
.binaryph-chatbot-container.is-hero-mode .binaryph-chatbot-message-input { min-height: 72px !important; }
.binaryph-chatbot-container .binaryph-chatbot-message-input::placeholder { color: var(--bph-muted); opacity: 1; }

.binaryph-chatbot-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.binaryph-buttons-spacer { flex: 1; }

.binaryph-chatbot-container .binaryph-chatbot-buttons button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background-color 0.15s, transform 0.1s;
}
.binaryph-chatbot-container .binaryph-chatbot-buttons button:hover { background: var(--bph-hover); opacity: 1; }

/* Send <-> Stop */
.binaryph-chatbot-container .binaryph-chatbot-buttons .binaryph-send-message {
    background: var(--bph-accent);
    color: #fff;
    opacity: 1;
}
.binaryph-chatbot-container .binaryph-chatbot-buttons .binaryph-send-message:hover { background: var(--bph-accent); filter: brightness(1.08); }
.binaryph-chatbot-container .binaryph-chatbot-buttons .binaryph-send-message:active { transform: scale(0.94); }
.binaryph-chatbot-container .binaryph-chatbot-buttons .binaryph-send-message:disabled {
    opacity: 0.35;
    cursor: default;
    filter: none;
    transform: none;
}
.binaryph-send-message .bph-icon-stop { display: none; }
.binaryph-send-message.is-stop .bph-icon-send { display: none; }
.binaryph-send-message.is-stop .bph-icon-stop { display: block; }
.binaryph-chatbot-container .binaryph-chatbot-buttons .binaryph-send-message.is-stop {
    background: var(--bph-text);
    color: var(--bph-bg);
}

/* Suggested questions (welcome screen only) */
.binaryph-suggestions {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 760px;
    margin-top: 12px;
}
.binaryph-chatbot-container.is-hero-mode .binaryph-suggestions { display: flex; }
.binaryph-chatbot-container .binaryph-suggestion {
    background: transparent;
    border: 1px solid var(--bph-border);
    color: inherit;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s, border-color 0.15s;
}
.binaryph-chatbot-container .binaryph-suggestion:hover { background: var(--bph-hover); border-color: var(--bph-accent); }

.binaryph-chatbot-container .binaryph-disclaimer {
    margin: 8px 0 0;
    padding: 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--bph-muted);
    text-align: center;
    max-width: 760px;
}

/* Short notices above the composer (file errors, copy blocked, stopped). */
.bph-toast {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translate(-50%, 6px);
    width: max-content;
    max-width: calc(100% - 32px);
    background: var(--bph-toast-bg);
    color: var(--bph-toast-text);
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 60;
    text-align: center;
}
.bph-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -4px);
}

/* =========================================
   10. ATTACHMENTS (composer)
   ========================================= */
.binaryph-file-preview-container {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    max-width: 100%;
}
.binaryph-file-preview-container.has-files { display: flex; }

.binaryph-file-list {
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.binaryph-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bph-chip);
    padding: 4px 4px 4px 4px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
    max-width: 100%;
}
.bph-chip-thumb {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.bph-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bph-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.binaryph-file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.binaryph-chatbot-container .binaryph-file-remove {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.6;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.binaryph-chatbot-container .binaryph-file-remove:hover { opacity: 1; background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.binaryph-chatbot-container .binaryph-clear-files {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}
.binaryph-chatbot-container .binaryph-clear-files:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* Drag & drop overlay */
.binaryph-drop-overlay {
    display: none;
    position: absolute;
    top: 10px; right: 10px; bottom: 10px; left: 10px; /* not `inset`: iOS < 14.1 ignores it */
    z-index: 70;
    border: 2px dashed var(--bph-accent);
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.08);
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--bph-accent);
    pointer-events: none;
}
.binaryph-chatbot-container.bph-dragging .binaryph-drop-overlay { display: flex; }

/* =========================================
   11. HERO (welcome screen)
   ========================================= */
.binaryph-hero-branding {
    position: absolute;
    top: 14%;
    left: 0;
    width: 100%;
    padding: 0 20px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateY(20px);
    z-index: 1;
}
.binaryph-hero-branding h2 { font-size: 32px; font-weight: 700; opacity: 0.9; margin: 0; line-height: 1.2; }
/* The title keeps the site's heading font (brand look) but NOT its colour:
   a dark site theme paints headings near-white, invisible on the light chat. */
.binaryph-chatbot-container .binaryph-hero-branding h2 {
    color: var(--bph-text) !important;
    -webkit-text-fill-color: currentColor !important;
    background: none !important;
    text-shadow: none !important;
}
.binaryph-chatbot-container .binaryph-hero-greeting {
    margin: 8px 0 0;
    padding: 0;
    font-size: 16px;
    color: var(--bph-muted);
}
.binaryph-chatbot-container.is-hero-mode .binaryph-hero-branding {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   12. NARROW / MOBILE LAYOUT
   (.bph-narrow = the chat sits in a narrow column on a wide screen)
   ========================================= */
@media (max-width: 768px) {
    .binaryph-chatbot-sidebar {
        position: absolute;
        height: 100%;
        left: 0; top: 0;
        transform: translateX(-100%);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
        width: 78%;
        min-width: 180px;
        max-width: 320px;
        z-index: 200;
    }
    .binaryph-chatbot-sidebar:not(.closed) { transform: translateX(0); }
    .binaryph-chatbot-sidebar.closed { transform: translateX(-100%); width: 78%; min-width: 180px; }
    .binaryph-chatbot-container .binaryph-mobile-close-sidebar { display: block; }
    .binaryph-chatbot-sidebar-header { gap: 18px; }
    .binaryph-chatbot-sidebar:not(.closed) ~ .binaryph-sidebar-backdrop {
        display: block;
        position: absolute;
        top: 0; right: 0; bottom: 0; left: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 150;
    }
    .binaryph-chatbot-messages { padding: 10px 14px 16px; }
    .binaryph-chatbot-input-wrapper { padding: 4px 10px 10px; }
    .binaryph-chatbot-container.is-hero-mode .binaryph-chatbot-input-wrapper { transform: translateY(-40%); }
    .binaryph-chatbot-container .conversation-delete,
    .binaryph-chatbot-container .conversation-pin:not(.is-pinned) { opacity: 0.55; }
    .binaryph-jump-latest { bottom: 130px; }
}
.binaryph-chatbot-container.bph-narrow .binaryph-chatbot-sidebar {
    position: absolute;
    height: 100%;
    left: 0; top: 0;
    transform: translateX(-100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    width: 78%;
    min-width: 180px;
    max-width: 320px;
    z-index: 200;
}
.binaryph-chatbot-container.bph-narrow .binaryph-chatbot-sidebar:not(.closed) { transform: translateX(0); }
.binaryph-chatbot-container.bph-narrow .binaryph-chatbot-sidebar.closed { transform: translateX(-100%); width: 78%; min-width: 180px; }
.binaryph-chatbot-container.bph-narrow .binaryph-mobile-close-sidebar { display: block; }
.binaryph-chatbot-container.bph-narrow .binaryph-chatbot-sidebar:not(.closed) ~ .binaryph-sidebar-backdrop {
    display: block;
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 150;
}
.binaryph-chatbot-container.bph-narrow .binaryph-chatbot-messages { padding: 10px 14px 16px; }
.binaryph-chatbot-container.bph-narrow .binaryph-chatbot-input-wrapper { padding: 4px 10px 10px; }

@media (max-width: 480px) {
    .binaryph-hero-branding h2 { font-size: 28px; }
    .binaryph-file-name { max-width: 120px; }
    .user-message-text { max-width: 90%; }
}

/* Short containers: tighter welcome screen. */
@media (max-height: 560px) {
    .binaryph-hero-branding { top: 8%; }
    .binaryph-chatbot-container.is-hero-mode .binaryph-chatbot-message-input { min-height: 48px !important; }
}

/* =========================================
   13. MOBILE / CROSS-PLATFORM HARDENING
   ========================================= */

/* Momentum scrolling + stop scroll chaining to the page */
.binaryph-chatbot-messages,
.binaryph-chatbot-history {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Safe-area insets so the input row clears the iPhone home indicator */
.binaryph-chatbot-container.fullscreen .binaryph-chatbot-input-wrapper {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
}
.binaryph-chatbot-container.fullscreen .binaryph-chatbot-header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(52px + env(safe-area-inset-top, 0px));
}

/* Dynamic viewport height: old WebViews take vh, modern ones take dvh.
   While the keyboard is open on iOS, the JS pins the panel to the visible
   area with an inline !important height instead. */
.binaryph-chatbot-container.fullscreen {
    height: 100vh !important;
    height: 100svh !important;
    height: 100dvh !important;
}

/* Body scroll lock while fullscreen is active */
html.binaryph-fs-lock,
body.binaryph-fs-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* Kill the 300ms tap delay and the grey tap flash */
.binaryph-chatbot-container button,
.binaryph-chatbot-container label {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

/* 44px tap targets on touch devices (pseudo-element halo, no layout shift),
   and actions that are hover-only on desktop stay visible. */
@media (hover: none) and (pointer: coarse) {
    .binaryph-chatbot-container .binaryph-clear-files,
    .binaryph-chatbot-container .conversation-delete,
    .binaryph-chatbot-container .conversation-pin,
    .binaryph-chatbot-container .binaryph-mobile-close-sidebar,
    .binaryph-chatbot-container .binaryph-file-remove,
    .binaryph-chatbot-container .bph-action {
        position: relative;
    }
    .binaryph-chatbot-container .binaryph-clear-files::after,
    .binaryph-chatbot-container .conversation-delete::after,
    .binaryph-chatbot-container .conversation-pin::after,
    .binaryph-chatbot-container .binaryph-mobile-close-sidebar::after,
    .binaryph-chatbot-container .binaryph-file-remove::after,
    .binaryph-chatbot-container .bph-action::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 44px;
        height: 44px;
        transform: translate(-50%, -50%);
    }
    .bph-msg-actions { opacity: 1; }
    .binaryph-chatbot-container .conversation-delete,
    .binaryph-chatbot-container .conversation-pin:not(.is-pinned) { opacity: 0.55; }
}

/* Visually-hidden file input: display:none inputs can't be opened
   programmatically in some iOS WKWebViews */
.binaryph-file-input.binaryph-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

/* =========================================
   14. RESTRICTED BOT NOTICE ("Who can use it")
   Shown instead of the chat to visitors without access. Inherits the page's
   text colour so it reads on light and dark sites alike.
   ========================================= */
.binaryph-chatbot-locked {
    max-width: 520px;
    margin: 20px auto;
    padding: 22px 24px;
    text-align: center;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
.binaryph-chatbot-locked p { margin: 0 0 12px; padding: 0; }
.binaryph-chatbot-locked p:last-child { margin-bottom: 0; }
.binaryph-chatbot-locked .binaryph-chatbot-locked-login {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
}
.binaryph-chatbot-locked .binaryph-chatbot-locked-login:hover { background: #2563eb; }

/* =========================================
   15. REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    .binaryph-user-message,
    .binaryph-bot-message,
    .bph-thinking-label.bph-swap { animation: none; }
    .bph-spark svg,
    .bph-spark line { animation: none; }
    .bph-spark line { transform: none; opacity: 1; }
    .bph-shimmer {
        animation: none;
        background: none;
        color: var(--bph-muted);
        -webkit-text-fill-color: currentColor;
    }
    .binaryph-chatbot-input-wrapper,
    .binaryph-hero-branding,
    .binaryph-chatbot-sidebar { transition: none; }
}
