/* Partner back button — centered above input, shown when arriving via ?back= from a whitelisted partner */
.partner-bar {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
    max-width: 800px;
    margin: 0 auto;
}

.partner-bar a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
    background-color: transparent;
    border: 1.5px solid var(--color-accent);
    border-radius: 24px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.partner-bar a:hover {
    background-color: var(--color-accent);
    color: white;
    text-decoration: none;
}

.partner-bar svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Broadcast banner — admin-controlled service notice */
.broadcast-banner {
    width: 100%;
    text-align: center;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    line-height: 1.4;
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border-bottom: 1px solid var(--color-warning-border);
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: white;
    border-radius: 0 0 4px 0;
    font-size: 0.9rem;
    text-decoration: none;
}
.skip-link:focus {
    left: 0;
}

html {
    font-size: 1.05rem;
}

body {
    font-size: 1rem;
    background-color: var(--color-bg);
    color: var(--color-text);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Header — hidden in landing state, shown in chat */
.header {
    padding: 1rem 1rem 1rem;
    text-align: center;
    display: none;
}

body.chat-active .header {
    display: block;
}

.header h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-link {
    color: var(--color-navy);
    text-decoration: none;
}

.header p {
    margin: 0.2rem 0 0 0;
    font-size: 1rem;
    color: var(--color-navy);
    font-weight: 600;
}

/* Landing greeting — centered on page, hidden in chat */
.landing-greeting {
    text-align: center;
    padding: 0 1rem 1rem;
}

.landing-greeting h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.landing-greeting h2 .header-link.shimmer {
    background: linear-gradient(
        90deg,
        var(--color-navy) 0%,
        var(--color-navy) 40%,
        var(--color-shimmer) 50%,
        var(--color-navy) 60%,
        var(--color-navy) 100%
    );
    background-size: 250% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-shimmer 2.5s ease-in-out forwards;
}

@keyframes title-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .assistant-message, .user-message, .text-appear {
        animation: none;
        transform: none;
    }

    .landing-greeting h2 .header-link.shimmer {
        animation: none;
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-fill-color: unset;
        color: var(--color-navy);
    }
}

.landing-greeting .landing-subtitle {
    font-size: 1.05rem;
    color: var(--color-navy);
    font-weight: 600;
}

.landing-greeting .landing-note {
    font-size: 0.88rem;
    color: var(--color-navy);
    margin-top: 1.75rem;
}

body.chat-active .landing-greeting {
    display: none;
}

/* Hide partner bar and clear button in landing state */
body:not(.chat-active) .partner-bar {
    display: none;
}

body:not(.chat-active) .clear-btn {
    display: none;
}

/* Suggestion chips — landing only */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1rem 0;
    max-width: 800px;
    margin: 0 auto;
}

body.chat-active .suggestions {
    display: none;
}

.suggestion-chip {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.88rem;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s, border-color 0.2s;
}

.suggestion-chip:hover {
    background: var(--color-border);
    border-color: var(--color-border-light);
}

/* Disclaimer */
.disclaimer {
    text-align: center;
    padding: 0 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.6rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
    font-size: 0.88rem;
    color: var(--color-navy);
}

/* No-training note — visible only in chat state */
.chat-only {
    display: none;
}

body.chat-active .chat-only {
    display: inline;
}

/* Chat container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem;
    overflow: hidden;
}

/* Landing state: center content slightly above midpoint */
body:not(.chat-active) .chat-container {
    justify-content: center;
    padding-bottom: 10vh;
}

/* Messages — hidden in landing, visible in chat */
body:not(.chat-active) .messages {
    display: none;
}

.clear-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    background: transparent;
    color: var(--color-muted);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: center;
}

.clear-btn svg {
    width: 18px;
    height: 18px;
}

.clear-btn:hover:not(:disabled) {
    background-color: var(--color-surface-alt);
    color: var(--color-muted-dark);
}

.clear-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.messages {
    flex: 1;
    overflow-y: auto;
    overflow-anchor: none;
    padding: 0.75rem;
    min-height: 150px;

}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--color-muted);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted-dark);
}

/* Scroll-to-bottom button — mirrors theme toggle at top-right */
.scroll-bottom-btn {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 100;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--color-surface-alt);
    color: var(--color-muted-dark);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    display: none;
    transition: background-color 0.2s, color 0.2s;
}

.scroll-bottom-btn.visible {
    display: flex;
}

.scroll-bottom-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.scroll-bottom-btn svg {
    width: 18px;
    height: 18px;
}

body:not(.chat-active) .scroll-bottom-btn {
    display: none;
}

[data-theme="dark"] .scroll-bottom-btn {
    background: var(--color-surface-subtle);
    color: var(--color-text-strong);
}

[data-theme="dark"] .scroll-bottom-btn:hover {
    background: var(--color-border-light);
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 1rem;
}

.user-message {
    background-color: var(--color-accent);
    color: white;
    margin-left: auto;
    white-space: pre-wrap;
    padding: 0.6rem 1rem;
}

.assistant-message {
    background: transparent;
    color: var(--color-text-strong);
    padding: 0.5rem 0.25rem;
    line-height: 1.6;
    overflow-x: auto;
    border-radius: 0;
    max-width: 100%;
}

/* Markdown content inside assistant messages */
.assistant-message p {
    margin-bottom: 0.5rem;
}

.assistant-message p:last-child {
    margin-bottom: 0;
}

.assistant-message ul,
.assistant-message ol {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.assistant-message li {
    margin-bottom: 0.25rem;
}

.assistant-message h1, .assistant-message h2, .assistant-message h3,
.assistant-message h4, .assistant-message h5, .assistant-message h6 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--color-heading);
}

.assistant-message h1:first-child, .assistant-message h2:first-child,
.assistant-message h3:first-child {
    margin-top: 0;
}

.assistant-message code {
    background-color: var(--color-surface-alt);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.assistant-message pre {
    background-color: var(--color-surface-alt);
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.assistant-message pre code {
    background: none;
    padding: 0;
}

.assistant-message a {
    color: var(--color-accent);
    text-decoration: underline;
}

.assistant-message a:hover {
    color: var(--color-accent-hover);
}

.assistant-message table {
    border-collapse: collapse;
    margin-bottom: 0.5rem;
    font-size: 0.9em;
}

.assistant-message th,
.assistant-message td {
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.assistant-message th {
    background-color: var(--color-surface-subtle);
    font-weight: 600;
}

.assistant-message blockquote {
    border-left: 3px solid var(--color-border-light);
    margin: 0.5rem 0;
    padding: 0.3rem 0.75rem;
    color: var(--color-muted-dark);
}

.assistant-message hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.75rem 0;
}

.system-message {
    background-color: var(--color-info-light);
    border-left: 3px solid var(--color-accent);
    text-align: center;
    margin: 1rem auto;
    font-style: italic;
    color: var(--color-info-text);
}

.loading {
    color: var(--color-muted-dark);
    font-style: italic;
}

.streaming {
    /* Rendering is throttled via requestAnimationFrame in app.js */
}

@keyframes blockAppear {
    from { opacity: 0.2; }
    to { opacity: 1; }
}

.text-appear {
    animation: blockAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.assistant-message, .user-message {
    animation: messageAppear 0.2s ease-out;
}

.input-limit-warning {
    display: none;
    text-align: center;
    font-size: 0.88rem;
    color: var(--color-warning-text);
    background-color: var(--color-warning-bg);
    padding: 0.4rem 1rem;
    border-radius: 16px;
    margin-bottom: 0.4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.input-limit-warning.visible {
    display: block;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-container:focus-within {
    border-color: var(--color-focus);
    box-shadow: var(--shadow-focus);
}

#userInput {
    flex: 1;
    padding: 0.5rem 0.25rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-strong);
    resize: none;
    min-height: 36px;
    max-height: 150px;
    overflow-y: auto;
    outline: none;
    line-height: 1.4;
}

#userInput::placeholder {
    color: var(--color-muted);
}

.clear-input-btn {
    display: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
    align-items: center;
    align-self: center;
    justify-content: center;
}

.clear-input-btn.visible {
    display: flex;
}

.clear-input-btn svg {
    width: 18px;
    height: 18px;
}

.clear-input-btn:hover {
    color: var(--color-muted-dark);
}

#sendBtn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    align-self: center;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendBtn svg {
    width: 18px;
    height: 18px;
}

#sendBtn:hover:not(:disabled) {
    background-color: var(--color-accent-hover);
}

#sendBtn.stop-mode {
    background-color: var(--color-muted-dark);
}

#sendBtn.stop-mode:hover {
    background-color: var(--color-muted-darker);
}

#sendBtn:disabled {
    background-color: var(--color-border-light);
    cursor: not-allowed;
}

.retry-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.retry-btn:hover {
    background-color: var(--color-accent-hover);
}

/* Welcome Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-strong);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: var(--color-navy);
    margin-bottom: 1rem;
    text-align: center;
}

.modal-content h3 {
    color: var(--color-text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.warning-box {
    background-color: var(--color-surface-subtle);
    border-left: 3px solid var(--color-border-light);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
}

.warning-box ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.accept-btn {
    background-color: var(--color-accent);
    color: white;
}

.accept-btn:hover {
    background-color: var(--color-accent-hover);
}

.decline-btn {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
}

.decline-btn:hover {
    background-color: var(--color-border);
}

.legal-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.legal-links a {
    text-decoration: none;
    margin: 0 0.5rem;
}

.legal-links a:hover {
    text-decoration: underline;
}

/* Feedback Button on Messages */
.message-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.max-length-notice {
    font-size: 0.95rem;
    color: var(--color-navy);
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--color-info-bg);
    border-radius: 6px;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.action-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn:hover {
    background-color: var(--color-surface-alt);
    color: var(--color-accent);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.action-btn.copied {
    color: var(--color-success);
}

.message-time {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-left: auto;
    padding-left: 0.5rem;
}

/* Feedback Modal */
.feedback-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    animation: fadeIn 0.3s;
}

.feedback-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-content {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-strong);
    animation: slideIn 0.3s;
}

.feedback-content h2 {
    color: var(--color-navy);
    margin-bottom: 0.5rem;
}

.feedback-content p.subtitle {
    color: var(--color-muted-dark);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.feedback-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

.feedback-form textarea,
.feedback-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
    background-color: var(--color-surface);
    color: var(--color-text);
}

.feedback-form textarea:focus,
.feedback-form select:focus {
    outline: none;
    border-color: var(--color-focus);
}

.feedback-form textarea {
    resize: vertical;
    min-height: 80px;
}

.feedback-form textarea.readonly-display {
    background-color: var(--color-surface-subtle);
    color: var(--color-muted-dark);
    min-height: 60px;
}

.feedback-form select {
    cursor: pointer;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.feedback-submit-btn {
    flex: 2;
    padding: 0.75rem;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.feedback-submit-btn:hover {
    background-color: var(--color-accent-hover);
}

.feedback-cancel-btn {
    flex: 1;
    padding: 0.75rem;
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.feedback-cancel-btn:hover {
    background-color: var(--color-border);
}

.feedback-success {
    text-align: center;
    padding: 2rem;
}

.feedback-success h3 {
    color: var(--color-success);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 0 1rem 1rem;
}

footer p {
    font-size: 0.88rem;
    margin: 0;
    color: var(--color-navy);
}

footer a {
    color: var(--color-navy);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.footer-sep {
    margin: 0 0.5rem;
}

.footer-sep-sm {
    margin: 0 0.3rem;
}

@media (max-width: 768px) {
    html {
        font-size: 1rem;
    }

    body {
        font-size: 0.9rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-content h2 {
        font-size: 1.1rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .header {
        padding: 0.5rem 2.75rem;
    }

    .header h1 {
        font-size: 1.35rem;
    }

    .header p {
        font-size: 0.9rem !important;
        margin-top: 0.05rem !important;
    }

    .landing-greeting h2 {
        font-size: 1.75rem;
    }

    .landing-greeting .landing-subtitle {
        font-size: 0.95rem;
    }

    .landing-greeting .landing-note {
        font-size: 0.8rem;
    }

    .landing-greeting {
        padding: 0 2.75rem 0.75rem;
    }

    .suggestions {
        padding-top: 0.75rem;
    }

    .suggestion-chip {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }

    .disclaimer {
        padding: 0 0.5rem;
        margin-top: 0.75rem;
        margin-bottom: 0.4rem;
        font-size: 0.8rem;
    }


    .scroll-bottom-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 32px;
        height: 32px;
    }

    .scroll-bottom-btn svg {
        width: 16px;
        height: 16px;
    }

    #userInput {
        flex: 1;
        min-width: 0;
        font-size: 16px;
        min-height: 36px;
        padding: 0.4rem 0.25rem;
    }

    .input-container {
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
        border-radius: 20px;
    }

    #sendBtn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    #sendBtn svg {
        width: 16px;
        height: 16px;
    }

    .clear-btn {
        padding: 0.4rem;
    }

    .messages {
        min-height: 100px;
        padding: 0.5rem;
        scrollbar-width: none;
    }

    .messages::-webkit-scrollbar {
        display: none;
    }

    .chat-container {
        padding: 0.25rem;
    }

    .message {
        max-width: 90%;
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .assistant-message {
        padding: 0.4rem 0.15rem;
    }

    footer {
        padding: 0 0.5rem 0.75rem;
    }

    footer p {
        font-size: 0.8rem !important;
    }

    .warning-box, .modal-content p, .modal-content li {
        font-size: 0.85rem;
    }

    .partner-bar {
        padding-top: 0.35rem;
    }

    .partner-bar a {
        font-size: 0.82rem;
        padding: 0.45rem 1rem;
    }

    body.chat-active:not(.input-focused) .chat-only {
        display: none;
    }

    body.chat-active:not(.input-focused) footer {
        display: none;
    }
}

/* Utility classes */
.hidden {
    display: none;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-half {
    margin-bottom: 0.5rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 1rem;
}

.text-xs {
    font-size: 0.8rem;
}

.text-sm {
    font-size: 0.9rem;
}

.text-muted {
    color: var(--color-muted-dark);
}

.link-primary {
    color: var(--color-accent);
}

/* Info box in welcome modal */
.info-box {
    background-color: var(--color-surface-subtle);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Copy popover */
.copy-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    min-width: 180px;
    padding: 0.25rem 0;
}

.copy-popover-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.copy-popover-item:hover {
    background: var(--color-surface-alt);
    color: var(--color-accent);
}

/* Print header — hidden normally, shown only in @media print */
.print-header {
    display: none;
}

/* Print styles */
@media print {
    /* Hide UI chrome */
    .header,
    .landing-greeting,
    .suggestions,
    .disclaimer,
    .input-container,
    .input-limit-warning,
    .partner-bar,
    .theme-toggle,
    .modal,
    .feedback-modal,
    .message-actions,
    .retry-btn,
    .copy-popover,
    .skip-link,
    .clear-btn,
    .scroll-bottom-btn,
    #paddingSpacer,
    footer {
        display: none !important;
    }

    /* Reset layout */
    body {
        background: white !important;
        color: black !important;
        height: auto;
        overflow: visible;
    }

    .chat-container {
        max-width: 100%;
        padding: 0;
        overflow: visible;
    }

    .messages {
        overflow: visible;
        padding: 0;
        min-height: 0;
    }

    /* Print header */
    .print-header {
        display: block;
        text-align: center;
        font-size: 0.9rem;
        color: #666;
        padding: 0.5rem 0 1rem;
        border-bottom: 1px solid #ccc;
        margin-bottom: 1rem;
    }

    /* Message wrappers */
    .message-wrapper {
        margin-bottom: 0.75rem;
    }

    /* User messages */
    .user-message {
        background: none !important;
        color: black !important;
        font-weight: 700;
        padding: 0.5rem 0;
        max-width: 100%;
        margin-left: 0;
        border-radius: 0;
        animation: none;
    }

    .user-message::before {
        content: 'Kysymys: ';
        font-weight: 700;
    }

    /* Assistant messages */
    .assistant-message {
        background: none !important;
        color: black !important;
        padding: 0.5rem 0;
        border-bottom: 1px solid #e0e0e0;
        animation: none;
    }

    .assistant-message a {
        color: black !important;
        text-decoration: underline;
    }

    /* Code and tables */
    .assistant-message code {
        background-color: #f0f0f0 !important;
    }

    .assistant-message pre {
        background-color: #f0f0f0 !important;
        border: 1px solid #ddd;
    }

    .assistant-message th {
        background-color: #f0f0f0 !important;
    }

    .assistant-message th,
    .assistant-message td {
        border-color: #999 !important;
    }

    /* Notices */
    .max-length-notice {
        color: #666 !important;
        background: none !important;
        font-style: italic;
    }

    @page {
        margin: 2cm 1.5cm;
    }
}

