/* Shared dialog chrome with a non-blocking corner panel on every page. */
.assistant-dialog.assistant-docked.modal-window {
    inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
    z-index: 40;
    width: min(420px, calc(100vw - 32px));
    height: min(560px, calc(100dvh - 100px));
    max-height: calc(100dvh - 100px);
    margin: 0;
}

.assistant-launcher {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 9px 14px;
    border: 1px solid #67e8f9;
    border-radius: 28px;
    background: #0f172a;
    color: #f8fafc;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.assistant-launcher:focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 3px;
}

.assistant-dialog {
    max-width: none;
    min-height: 0;
}

.assistant-dialog:not([open]) {
    display: none;
}

.assistant-dialog-header {
    align-items: center;
}

.assistant-dialog .assistant-dialog-header .assistant-close {
    width: 44px;
    height: 44px;
}

.assistant-kicker {
    margin: 0 0 2px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.assistant-messages {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
}

.assistant-message {
    flex-shrink: 0;
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 10px;
    color: #1e293b;
    font-size: 0.94rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.assistant-message-bot {
    align-self: flex-start;
    background: #e0f2fe;
}

.assistant-message-user {
    align-self: flex-end;
    background: #0e7490;
    color: #f0fdfa;
}

.assistant-message-status {
    color: #64748b;
    font-style: italic;
}

.assistant-page-link {
    display: inline-block;
    margin-top: 8px;
    color: #0369a1;
    font-weight: 700;
}

.assistant-quote-card {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(14, 116, 144, 0.25);
    color: #0f172a;
    font-weight: 700;
}

.assistant-screening-results {
    padding-left: 18px;
    margin: 10px 0 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.assistant-screening-results li { margin: 0 0 10px; }
.assistant-screening-results a { color: #0369a1; font-weight: 700; }

.assistant-analysis-preview {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 11px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
    color: #0f172a;
}

.assistant-analysis-preview-name,
.assistant-analysis-preview-sector {
    color: #475569;
    font-size: 0.8rem;
}

.assistant-analysis-preview-facts {
    font-weight: 700;
}

.assistant-analysis-preview-details {
    color: #334155;
    font-size: 0.8rem;
}

.assistant-analysis-preview-summary {
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.35;
}

.assistant-analysis-preview-regime {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    background: #cffafe;
    color: #155e75;
    font-size: 0.8rem;
    font-weight: 700;
}

.assistant-prompts {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    padding: 0 18px 10px;
    overflow-x: auto;
}

.assistant-prompts button {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid #bae6fd;
    border-radius: 14px;
    background: #fff;
    color: #075985;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.assistant-form {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    margin: 0;
    padding: 12px 18px 18px;
    border-top: 1px solid #cbd5e1;
    background: #fff;
}

.assistant-form input {
    min-width: 0;
    flex: 1;
    width: 0;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid #94a3b8;
    border-radius: 7px;
    font: inherit;
    font-size: 16px;
}

.assistant-form button {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 7px;
    background: #0e7490;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.assistant-form button:disabled,
.assistant-prompts button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    .assistant-messages {
        padding: 14px;
    }

    .assistant-prompts {
        padding-inline: 12px;
    }

    .assistant-form {
        padding: 12px;
    }
}
