/* Marketplace assistant: conversation, evidence, and pending edits have distinct places. */
.chatbot-panel {
    --chat-ink: #0f172a;
    --chat-muted: #526176;
    --chat-border: #dbe3ec;
    display: flex; flex-direction: column; position: fixed; right: 24px; bottom: 88px;
    width: min(560px, calc(100vw - 32px)); height: min(800px, calc(100dvh - 112px));
    z-index: 1001; overflow: hidden; border: 1px solid var(--chat-border); border-radius: 16px;
    background: #fff; box-shadow: 0 18px 55px rgba(15, 23, 42, .18); color: var(--chat-ink);
}
.chatbot-panel .hidden, .chatbot-panel.hidden { display: none; }
.chatbot-panel *, .chatbot-toggle, .chatbot-nudge { box-sizing: border-box; }
.chatbot-toggle { position: fixed; right: 24px; bottom: 24px; z-index: 1000; padding: 13px 20px; border: 0; border-radius: 999px; background: #2563eb; color: #fff; font-weight: 650; cursor: pointer; box-shadow: 0 6px 18px rgba(15,23,42,.15); }
.chatbot-toggle:hover { background: #1d4ed8; }
.chatbot-nudge { display: none; position: fixed; right: 24px; bottom: 82px; z-index: 1000; padding: 10px 35px 10px 14px; background: #fff; border: 1px solid #dbe3ec; border-radius: 10px; font-size: .85rem; box-shadow: 0 5px 16px rgba(15,23,42,.1); }
.chatbot-nudge.show { display: block; }
.chatbot-nudge-close { position: absolute; right: 7px; top: 5px; border: 0; background: transparent; cursor: pointer; color: #526176; font-size: 1.1rem; }
.chatbot-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 8px; padding: 15px 18px; border-bottom: 1px solid var(--chat-border); background: white; }
.chatbot-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chatbot-avatar { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: #eaf1ff; color: #1d4ed8; font-weight: 750; }
.chatbot-identity > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chatbot-identity strong { font-size: .95rem; line-height: 1.3; }
.chatbot-identity small { font-size: .76rem; color: var(--chat-muted); }
.chatbot-header-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.chatbot-clear, .chatbot-close { border: 0; background: transparent; color: var(--chat-muted); cursor: pointer; padding: 7px; border-radius: 5px; }
.chatbot-clear { font-size: .75rem; }
.chatbot-close { font-size: 1.5rem; line-height: 1; }
.chatbot-clear:hover, .chatbot-close:hover { background: #f1f5f9; color: #0f172a; }
.chatbot-access-note { flex-shrink: 0; padding: 0 16px 10px; color: var(--chat-muted); font-size: .71rem; line-height: 1.4; }
.chatbot-access-note a { color: #1d4ed8; }
.chatbot-post-tools { flex-shrink: 0; padding: 12px 18px; max-height: 42%; overflow-y: auto; background: #f8fafc; border-bottom: 1px solid var(--chat-border); }
.chatbot-entry-title { margin: 0 0 10px; font-size: 1.25rem; line-height: 1.35; letter-spacing: -.02em; }
.chatbot-entry-description { margin: 0 0 26px; color: var(--chat-muted); font-size: .88rem; line-height: 1.6; }
.chatbot-picking .chatbot-post-tools { flex: 1; min-height: 0; max-height: none; padding: 28px 24px; background: white; border-bottom: 0; }
.chatbot-picking .chatbot-messages, .chatbot-picking .chatbot-form, .chatbot-picking .chatbot-post-actions,
.chatbot-picking .chatbot-findings, .chatbot-picking .chatbot-proposal { display: none; }
.chatbot-picking .chatbot-access-note { padding: 12px 24px; border-top: 1px solid var(--chat-border); }
.chatbot-post-empty { color: var(--chat-muted); font-size: .82rem; line-height: 1.5; }
.chatbot-post-list { display: grid; gap: 7px; max-height: min(220px, 27dvh); overflow-y: auto; margin-top: 12px; padding: 2px; }
.chatbot-post-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--chat-border); border-radius: 7px; background: white; color: var(--chat-ink); text-align: left; font: inherit; font-size: .86rem; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
.chatbot-post-list button::after { content: ""; flex-shrink: 0; width: 16px; height: 16px; border: 1px solid #94a3b8; border-radius: 50%; }
.chatbot-post-list button[aria-pressed=true] { border-color: #2563eb; background: #f4f8ff; }
.chatbot-post-list button[aria-pressed=true]::after { border: 5px solid #2563eb; background: white; }
.chatbot-post-list button:hover { border-color: #93b8f5; }
.chatbot-platform-help { display: block; width: 100%; margin-top: 24px; padding: 12px 0; border: 0; border-top: 1px solid var(--chat-border); color: #1d4ed8; background: transparent; font: inherit; font-size: .84rem; text-align: left; cursor: pointer; }
.chatbot-return-posts { padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: white; color: #1d4ed8; font-size: .82rem; cursor: pointer; }
.chatbot-general-nav { display: none; }
.chatbot-general .chatbot-general-nav { display: block; align-self: flex-start; margin: 12px 18px 0; }
.chatbot-general .chatbot-post-tools { display: none; }
.chatbot-match-links { display: grid; gap: 8px; margin-top: 12px; }
.chatbot-match-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #f4f8ff; border: 1px solid #c5d8f8; border-radius: 7px; text-decoration: none; }
.chatbot-match-links strong { font-size: .82rem; font-weight: 600; }
.chatbot-match-links span { flex-shrink: 0; font-size: .76rem; font-weight: 650; }
.chatbot-match-links a:hover { background: #eaf1ff; border-color: #93b8f5; }
#chatbot-post-picker > label { display: block; margin-bottom: 5px; font-size: .8rem; font-weight: 650; }
.chatbot-post-tools input[type=search], .chatbot-post-tools select { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: white; color: #0f172a; font: inherit; font-size: .86rem; }
.chatbot-post-tools select { margin-top: 7px; }
.chatbot-post-consent { margin-top: 10px; font-size: .76rem; line-height: 1.5; color: var(--chat-muted); }
.chatbot-post-consent label { display: flex; gap: 8px; align-items: flex-start; }
.chatbot-post-consent input { flex: 0 0 auto; margin-top: 4px; accent-color: #2563eb; }
.chatbot-post-consent details { margin: 5px 0 8px 22px; }
.chatbot-post-consent summary { cursor: pointer; color: #1d4ed8; }
.chatbot-post-consent p { margin: 5px 0; }
.chatbot-review-button { width: 100%; border: 0; border-radius: 6px; padding: 9px 12px; background: #2563eb; color: white; font-weight: 650; cursor: pointer; }
.chatbot-context-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .83rem; }
.chatbot-context-summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatbot-context-summary button { flex-shrink: 0; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 5px; background: white; color: #1d4ed8; font-size: .76rem; cursor: pointer; }
.chatbot-findings { flex-shrink: 0; border-bottom: 1px solid var(--chat-border); color: #334155; font-size: .79rem; }
.chatbot-findings summary { padding: 10px 18px; cursor: pointer; color: #1d4ed8; font-weight: 600; }
.chatbot-findings details > div { padding: 0 18px 12px; max-height: 160px; overflow: auto; line-height: 1.5; }
.chatbot-findings ul { margin: 2px 0 8px; padding-left: 18px; }
.chatbot-findings a { display: block; margin-top: 5px; color: #1d4ed8; }
.chatbot-post-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 18px 0; flex-shrink: 0; }
.chatbot-post-actions button { padding: 5px 9px; border: 1px solid #dbe3ec; border-radius: 999px; background: #fff; color: #475569; font-size: .76rem; cursor: pointer; }
.chatbot-post-actions button:hover { border-color: #93b8f5; color: #1d4ed8; }
.chatbot-messages { display: flex; flex: 1; flex-direction: column; gap: 15px; min-height: 70px; overflow-y: auto; padding: 18px; scroll-behavior: auto; scrollbar-color: #cbd5e1 transparent; scrollbar-width: thin; }
.chatbot-message { flex-shrink: 0; font-size: .88rem; line-height: 1.6; overflow-wrap: anywhere; }
.bot-message { align-self: stretch; color: #1e293b; padding: 2px 0; }
.user-message { align-self: flex-end; max-width: 88%; padding: 9px 13px; border-radius: 12px 12px 3px 12px; background: #eaf1ff; color: #173c77; white-space: pre-wrap; }
.bot-message p, .bot-message ul, .bot-message ol, .bot-message pre, .bot-message h4, .bot-message h5, .bot-message h6 { margin: 0 0 8px; }
.bot-message > :last-child { margin-bottom: 0; }
.bot-message ul, .bot-message ol { padding-left: 20px; }
.bot-message li + li { margin-top: 4px; }
.bot-message a { color: #1d4ed8; text-underline-offset: 2px; }
.bot-message > a { display: block; margin-top: 6px; }
.bot-message h4, .bot-message h5, .bot-message h6 { font-size: .92rem; }
.bot-message code { padding: 2px 4px; background: #eef2f6; border-radius: 4px; font-size: .85em; }
.bot-message pre { overflow-x: auto; padding: 10px; background: #eef2f6; border-radius: 6px; }
.chatbot-suggestion-label { display: block; margin-bottom: 5px; color: #64748b; font-size: .72rem; font-weight: 600; }
.chatbot-error { border-left: 3px solid #dc2626; padding-left: 10px; color: #991b1b; }
.chatbot-thinking { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: .8rem; }
.chatbot-thinking-dots { display: flex; gap: 3px; }
.chatbot-thinking-dots span { width: 4px; height: 4px; border-radius: 50%; background: #64748b; animation: chatbot-pulse 1s infinite alternate; }
.chatbot-thinking-dots span:nth-child(2) { animation-delay: .2s; }
.chatbot-thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes chatbot-pulse { from { opacity: .3; } to { opacity: 1; } }
.chatbot-examples { display: grid; gap: 6px; }
.chatbot-example { border: 1px solid #dbe3ec; border-radius: 6px; padding: 9px 11px; text-align: left; background: white; color: #334155; cursor: pointer; font-size: .84rem; }
.chatbot-example:hover { border-color: #93b8f5; }
.chatbot-proposal { flex-shrink: 0; border-top: 1px solid #c5d8f8; background: #f4f8ff; }
.chatbot-preview-toggle { display: flex; width: 100%; justify-content: space-between; border: 0; padding: 10px 18px; text-align: left; background: transparent; color: #173c77; font-size: .83rem; font-weight: 700; cursor: pointer; }
.chatbot-preview-toggle::after { content: "−"; font-size: 1rem; }
.chatbot-preview-toggle[aria-expanded=false]::after { content: "+"; }
.chatbot-edit-content { padding: 0 18px 10px; max-height: min(240px, 30dvh); overflow-y: auto; font-size: .79rem; line-height: 1.5; }
.chatbot-preview-note { margin: 0 0 10px; color: #526176; }
.chatbot-wording-change + .chatbot-wording-change { margin-top: 12px; }
.chatbot-wording-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px; }
.chatbot-edit-before, .chatbot-edit-after { padding: 8px 10px; border-radius: 5px; overflow-wrap: anywhere; min-width: 0; }
.chatbot-edit-before { background: #e9eef5; color: #526176; }
.chatbot-edit-after { background: #fff; border: 1px solid #c5d8f8; color: #0f172a; }
.chatbot-wording-comparison small { display: block; color: #64748b; font-size: .7rem; }
.chatbot-wording-comparison p { margin: 4px 0 0; white-space: pre-wrap; }
.chatbot-current-dates { margin: 9px 0; color: #526176; }
.chatbot-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chatbot-date-grid label { display: grid; gap: 5px; font-weight: 600; min-width: 0; }
.chatbot-date-grid input { width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 5px; background: white; color: #0f172a; font: inherit; }
.chatbot-open-ended { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #334155; }
.chatbot-open-ended input { accent-color: #2563eb; }
.chatbot-edit-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 18px 12px; }
.chatbot-edit-actions button { padding: 8px 13px; border: 1px solid #cbd5e1; border-radius: 6px; background: white; color: #475569; cursor: pointer; font-size: .82rem; }
.chatbot-edit-actions button:last-child { background: #2563eb; color: white; border-color: #2563eb; font-weight: 650; }
.chatbot-form { display: flex; align-items: flex-end; gap: 9px; padding: 12px 16px 8px; flex-shrink: 0; background: white; }
.chatbot-form textarea { flex: 1; width: 100%; min-width: 0; resize: none; max-height: 96px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: .85rem; line-height: 1.5; background: white; color: #0f172a; }
.chatbot-form button { padding: 11px 14px; border: 0; border-radius: 7px; background: #2563eb; color: white; font-weight: 650; cursor: pointer; }
.chatbot-panel button:disabled { opacity: .5; cursor: not-allowed; }
.chatbot-panel input:disabled { background: #eef2f6; color: #64748b; }
.chatbot-panel :focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.chatbot-panel .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chatbot-confirm { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.2); }
.chatbot-confirm-card { width: 100%; max-width: 340px; padding: 22px; border-radius: 12px; background: white; box-shadow: 0 12px 32px rgba(15,23,42,.15); }
.chatbot-confirm-icon { font-size: 1.5rem; color: #2563eb; }
.chatbot-confirm-card h3 { margin: 8px 0; font-size: 1.05rem; }
.chatbot-confirm-card p { margin: 0; line-height: 1.5; color: #526176; font-size: .85rem; }
.chatbot-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.chatbot-confirm-actions button { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; }
.chatbot-confirm-cancel { background: white; color: #334155; }
.chatbot-confirm-submit { background: #2563eb; color: white; border-color: #2563eb !important; }
.chatbot-login-link { display: inline-block; margin-top: 8px; padding: 7px 11px; border-radius: 5px; background: #2563eb; color: white !important; }
.chatbot-table-wrapper { overflow-x: auto; max-width: 100%; margin: 6px 0; }
.chatbot-table-wrapper table { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: .8rem; }
.chatbot-table-wrapper th, .chatbot-table-wrapper td { padding: 7px 9px; border: 1px solid #dbe3ec; overflow-wrap: anywhere; vertical-align: top; }
.chatbot-table-wrapper th { background: #f1f5f9; }
@media (max-width: 600px) {
    .chatbot-panel { inset: 8px; width: auto; height: calc(100dvh - 16px); border-radius: 12px; }
    .chatbot-header { padding: 12px 14px; }
    .chatbot-identity strong { font-size: .88rem; }
    .chatbot-clear { font-size: .7rem; }
    .chatbot-post-tools, .chatbot-messages { padding: 12px 14px; }
    .chatbot-picking .chatbot-post-tools { padding: 24px 18px; }
    .chatbot-match-links a { align-items: flex-start; flex-direction: column; gap: 4px; }
    .chatbot-date-grid { gap: 7px; }
    .chatbot-form textarea { font-size: 16px; }
    .chatbot-edit-content { max-height: 26dvh; }
    .chatbot-wording-comparison { grid-template-columns: 1fr; }
    .chatbot-toggle { right: 16px; bottom: 16px; }
    .chatbot-nudge { right: 16px; bottom: 74px; }
}
@media (prefers-reduced-motion: reduce) { .chatbot-thinking-dots span { animation: none; } .chatbot-messages { scroll-behavior: auto; } }
