/* BinkTest Custom Styles */

:root {
    --fidonet-blue: #0066cc;
    --fidonet-green: #009900;
    --fidonet-red: #cc0000;
    --fidonet-orange: #ff6600;
    --text-color: #000000;
    --text-color-muted: #6c757d;
    --message-bg: #ffffff;
    --message-quote-bg: #f8f9fa;
    --message-quote-border: #dee2e6;
    --border-color: #dee2e6;
}

/* Prevent horizontal overflow on mobile.
   overflow-x must NOT be set on html — doing so turns overflow-y into
   "auto" on the root element in Chromium, which makes html (not the
   window) the scroll container and allows the admin dropdown to push
   the page scroll height past the viewport, creating a spurious
   vertical scrollbar. */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}


.navbar-brand {
    font-weight: bold;
}

.navbar-brand i {
    margin-right: 8px;
}

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* Theme-aware popovers */
.popover {
    --bs-popover-bg: var(--message-bg);
    --bs-popover-body-color: var(--text-color);
    --bs-popover-border-color: var(--border-color);
    --bs-popover-arrow-border: var(--border-color);
    --bs-popover-header-bg: var(--message-bg);
    --bs-popover-header-color: var(--text-color);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--fidonet-blue);
    font-weight: 600;
}

/* Loading blur — applied via setSettingsLoading() in app.js */
.settings-loading {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.2s ease;
}

.settings-loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1080;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Recent updates items */
.update-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.update-item:hover {

}

.message-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    transition: background-color 0.2s;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 4px;
}

.message-from {
    font-weight: 600;
    color: var(--fidonet-blue);
}

.message-date {
    font-size: 0.875em;
    color: #6c757d;
}

.message-subject {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.message-origin {
    font-size: 0.8em;
    color: #6c757d;
    font-style: italic;
}

.fidonet-address {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Table-based message list styles */
.message-table {
    border: none;
}

.message-table thead th {
    background-color: var(--fidonet-blue);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 12px 8px;
    vertical-align: middle;
}

.message-table tbody td {
    border-top: 1px solid #eee;
    padding: 12px 8px;
    vertical-align: top;
}

.message-row {
    transition: background-color 0.2s ease;
}

.message-row:hover {
    background-color: #f8f9fa;
}

/* Override Bootstrap table-hover to preserve text colors */
.table-hover > tbody > tr:hover > * {
    color: inherit !important;
}

/* File preview link — inherits table text color so it's readable in every theme */
a.file-preview-link {
    color: inherit;
    text-decoration: none;
}
a.file-preview-link:hover {
    text-decoration: underline;
}

.table-hover > tbody > tr:hover {
    background-color: #f8f9fa !important;
}

.message-table .message-from {
    font-weight: 600;
    color: var(--fidonet-blue);
}

.message-table .message-address {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.message-table .message-subject {
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.message-table .message-date {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
}

.message-table .echoarea-tag {
    background-color: var(--fidonet-orange);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .message-table thead th {
        font-size: 0.75rem;
        padding: 8px 4px;
    }
    
    .message-table tbody td {
        padding: 8px 4px;
        font-size: 0.875rem;
    }
    
    .message-table .message-subject {
        font-size: 0.875rem;
    }
}

.echoarea-tag {
    background-color: var(--fidonet-green);
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

.netmail-indicator {
    background-color: var(--fidonet-red);
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
}

.compose-form {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compose-form .form-label {
    font-weight: 600;
    color: #495057;
}

.compose-form textarea {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.btn-fidonet {
    background-color: var(--fidonet-blue);
    border-color: var(--fidonet-blue);
    color: white;
}

.btn-fidonet:hover {
    background-color: #0056b3;
    border-color: #004085;
    color: white;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: var(--fidonet-green);
}

.status-offline {
    background-color: #6c757d;
}

.status-error {
    background-color: var(--fidonet-red);
}

.node-list .card-body {
    padding: 0;
}

.node-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.node-item:hover {
    background-color: var(--message-bg);
}

.node-item:last-child {
    border-bottom: none;
}

.node-address {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--fidonet-blue);
}

.node-system {
    font-weight: 500;
    margin-bottom: 2px;
}

.node-item.bg-primary .node-address,
.node-item.bg-primary .node-system {
    color: #fff;
}

.node-item.bg-primary .badge {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
}

.node-sysop {
    color: #6c757d;
    font-size: 0.9em;
}

.footer {
    margin-top: auto;
    padding: 20px 0;
    background-color: #e9ecef;
    border-top: 1px solid #dee2e6;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6c757d;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Kludge lines styling */
.kludge-lines {
    font-family: 'Courier New', monospace;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--kludge-bg);
}

.kludge-lines pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--kludge-text);
    background-color: var(--kludge-bg);
    line-height: 1.2;
}

.message-headers {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.message-headers h6 {
    color: #495057;
    font-weight: 600;
}

#toggleHeaders {
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

#toggleHeaders:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Animation for kludge line toggle */
#kludgeContainer {
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Kludge line color coding legend (for reference in comments)
 * MSGID: #28a745 (Green) - Message ID
 * REPLY: #17a2b8 (Info/Blue) - Reply ID
 * INTL: #ffc107 (Warning/Yellow) - International routing
 * TOPT/FMPT: #fd7e14 (Orange) - To/From points
 * PID: #e83e8c (Pink) - Product ID
 * SEEN-BY: #6f42c1 (Purple) - Seen by nodes
 * PATH: #20c997 (Teal) - Message path
 * Origin: #6c757d (Gray, Italic) - Origin line
 * Tearline: #adb5bd (Light gray) - Tearline
 * Generic: #dc3545 (Red) - Other kludge lines
 * Text: #f8f9fa (Light) - Regular text
 */

/* Echo area management styles */
.echoarea-color-selector {
    border-radius: 4px;
    transition: border-left 0.2s ease;
}

.color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .message-date {
        margin-top: 4px;
    }

    .compose-form {
        padding: 15px;
    }

    .message-headers {
        padding: 10px;
    }

    .kludge-lines pre {
        font-size: 0.8rem;
    }

    #toggleHeaders {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Mobile filter controls - used on netmail/echomail pages */
@media (max-width: 575.98px) {
    .filter-controls {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .filter-controls .btn-group {
        flex-shrink: 0;
    }

    .filter-controls .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Mobile-friendly message formatting */
.message-formatted {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-paragraph {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.message-line {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: inline;
}

.message-link {
    color: var(--bs-link-color, #0d6efd);
    text-decoration: underline;
    word-break: break-all;
}

.message-link:hover {
    color: var(--bs-link-hover-color, #0a58ca);
    text-decoration: underline;
}

.message-quote {
    border-left: 3px solid var(--message-quote-border);
    padding-left: 1rem;
    margin: 0;
    background-color: var(--message-quote-bg);
    border-radius: 0 0.25rem 0.25rem 0;
}

.quote-line {
    margin-bottom: 0.25rem;
    color: var(--text-color-muted);
    font-style: italic;
}

/* Multi-level quote coloring */
.quote-level-1 {
    color: #2e7d32;  /* Green */
    font-style: normal;
}

.quote-level-2 {
    color: #1565c0;  /* Blue */
    font-style: normal;
}

.quote-level-3 {
    color: #7b1fa2;  /* Purple */
    font-style: normal;
}

.quote-level-4 {
    color: #c62828;  /* Red - deepest quotes */
    font-style: normal;
}

.message-signature {
    color: var(--text-color-muted);
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.message-signature-separator {
    color: var(--text-color-muted);
    margin: 1rem 0 0.5rem 0;
    font-family: monospace;
}

.message-preformatted {
    background-color: var(--message-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    color: var(--text-color);
}

/* Markdown heading borders in message bodies */
.message-text h1 {
    border-bottom: 3px double var(--border-color);
    padding-bottom: 0.3em;
    margin-bottom: 0.75em;
}

.message-text h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
    margin-bottom: 0.75em;
}

/* Legacy message text styles - enhanced for mobile */
.message-text pre {
    background-color: var(--message-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .message-formatted {
        font-size: 16px;
        line-height: 1.2;
    }
    
    .message-paragraph {
        margin-bottom: 1rem;
    }
    
    .message-quote {
        padding-left: 0.75rem;
    }
    
    .message-preformatted {
        font-size: 14px;
        padding: 0.75rem;
        border-radius: 0.25rem;
    }
    
    .message-text pre {
        font-size: 14px;
        padding: 0.75rem;
        border-radius: 0.25rem;
    }
    
    .quote-line {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .message-formatted {
        font-size: 16px;
        line-height: 1.2;
    }
    
    .message-preformatted {
        font-size: 13px;
        padding: 0.5rem;
    }
    
    .message-text pre {
        font-size: 13px;
        padding: 0.5rem;
    }
    
    .message-quote {
        padding-left: 0.5rem;
        border-left-width: 2px;
    }
}



/* ===========================================
   ANSI Escape Code Styles
   For rendering BBS/terminal colored text
   =========================================== */

/* ANSI Text Attributes */
.ansi-bold { font-weight: bold; }
.ansi-dim { opacity: 0.7; }
.ansi-italic { font-style: italic; }
.ansi-underline { text-decoration: underline; }
.ansi-blink { animation: ansi-blink 1s step-end infinite; }
.ansi-reverse { filter: invert(1); }
.ansi-hidden { visibility: hidden; }
.ansi-strike { text-decoration: line-through; }

@keyframes ansi-blink {
    50% { opacity: 0; }
}

/* ANSI Standard Foreground Colors (30-37) */
.ansi-black { color: #000000; }
.ansi-red { color: #cc0000; }
.ansi-green { color: #00cc00; }
.ansi-yellow { color: #cccc00; }
.ansi-blue { color: #0000cc; }
.ansi-magenta { color: #cc00cc; }
.ansi-cyan { color: #00cccc; }
.ansi-white { color: #cccccc; }

/* ANSI Bright Foreground Colors (90-97) */
.ansi-bright-black { color: #666666; }
.ansi-bright-red { color: #ff0000; }
.ansi-bright-green { color: #00ff00; }
.ansi-bright-yellow { color: #ffff00; }
.ansi-bright-blue { color: #0000ff; }
.ansi-bright-magenta { color: #ff00ff; }
.ansi-bright-cyan { color: #00ffff; }
.ansi-bright-white { color: #ffffff; }

/* ANSI Standard Background Colors (40-47) */
.ansi-bg-black { background-color: #000000; }
.ansi-bg-red { background-color: #cc0000; }
.ansi-bg-green { background-color: #00cc00; }
.ansi-bg-yellow { background-color: #cccc00; }
.ansi-bg-blue { background-color: #0000cc; }
.ansi-bg-magenta { background-color: #cc00cc; }
.ansi-bg-cyan { background-color: #00cccc; }
.ansi-bg-white { background-color: #cccccc; }

/* ANSI Bright Background Colors (100-107) */
.ansi-bg-bright-black { background-color: #666666; }
.ansi-bg-bright-red { background-color: #ff0000; }
.ansi-bg-bright-green { background-color: #00ff00; }
.ansi-bg-bright-yellow { background-color: #ffff00; }
.ansi-bg-bright-blue { background-color: #0000ff; }
.ansi-bg-bright-magenta { background-color: #ff00ff; }
.ansi-bg-bright-cyan { background-color: #00ffff; }
.ansi-bg-bright-white { background-color: #ffffff; }

/* Container for ANSI-formatted content - use monospace for proper art display */
.ansi-content {
    font-family: 'Courier New', Consolas, monospace;
    white-space: pre;
    line-height: 1.2;
}

/* Expanded message modal on desktop */
@media (min-width: 992px) {
    .modal-dialog.modal-message-reader {
        --bs-modal-width: 1200px;
    }
}

/* Fullscreen modal: strip Bootstrap's scrollbar-compensation padding so the
   dialog truly fills the viewport with no gap on any edge. */
.modal:has(.modal-dialog.modal-fullscreen) {
    padding: 0 !important;
}

/* Echolist page - Light theme overrides */
#echolist-page .forums-table {
    background: #ffffff;
    border-color: #dee2e6;
}

#echolist-page .forum-item {
    border-bottom-color: #e9ecef;
}

#echolist-page .forum-item:hover {
    background-color: #f8f9fa;
}

#echolist-page .forum-title {
    color: #2c3e50;
}

#echolist-page .forum-title-link {
    color: #0066cc;
}

#echolist-page .forum-title-link:hover {
    color: #004999;
}

#echolist-page .forum-desc {
    color: #6c757d;
}

#echolist-page .forum-mod {
    color: #868e96;
}

#echolist-page .stat-number {
    color: #0066cc;
}

#echolist-page .stat-label {
    color: #6c757d;
}

#echolist-page .lastpost-subject {
    color: #2c3e50;
}

#echolist-page .lastpost-by {
    color: #6c757d;
}

#echolist-page .lastpost-time {
    color: #868e96;
}

#echolist-page .stat-box h5 {
    color: #0066cc;
}

#echolist-page .stat-box small {
    color: #6c757d;
}

#echolist-page .empty-state,
#echolist-page .loading {
    color: #6c757d;
}

@media (max-width: 575.98px) {
    #echolist-page .forum-stats-cell {
        border-top-color: #e9ecef;
    }
}

/* ============================================================
   Message Reader: scrollable body mode
   When .message-reader-scrollable is active the modal uses
   Bootstrap's modal-dialog-scrollable so the .modal-body
   scrolls.  The .message-header-full sticks to the top of
   that scroll container so From/To/Subject/Date stay visible.
   Background colour is set here for the default theme; theme
   stylesheets override it via their own .message-header-full rules.
   ============================================================ */
/* Remove modal-body top padding so there is no gap above the sticky header */
.message-reader-scrollable .modal-body {
    padding-top: 0;
}
.message-header-full {
    padding: 0.75rem 1rem;
}

.message-reader-scrollable .message-header-full {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #fff;
    /* Extend to the left/right edges of modal-body (which has 1rem side padding) */
    margin: 0 -1rem 1rem;
    padding: 1rem 1rem 0.75rem;
}

/* Markdown Editor
   ============================================================ */
.md-editor-wrapper {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar: single horizontal row of btn-groups, scrolls if needed */
.md-editor-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 5px 8px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    min-height: 38px;
}

.md-editor-toolbar .btn-group {
    flex-shrink: 0;
}

.md-editor-toolbar .btn {
    padding: 2px 8px;
    font-size: 0.8rem;
}

/* Editor and preview stacked — JS controls which is visible */
.md-editor-body {
    display: block;
}

.md-editor-textarea {
    display: block !important;
    width: 100% !important;
    /* height set by JS to match original textarea */
    border: none;
    border-radius: 0;
    resize: none !important;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    padding: 10px;
    outline: none;
    background-color: #fff;
    color: #212529;
    overflow-y: auto;
}

.md-editor-textarea:focus {
    outline: none;
    box-shadow: none;
}

.md-preview-pane {
    display: none;
    width: 100%;
    /* height set by JS to match original textarea */
    padding: 10px 16px;
    overflow-y: auto;
    font-size: 0.9rem;
    word-wrap: break-word;
    background-color: #fff;
    color: #212529;
}

.md-preview-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Markdown image picker grid */
.md-image-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.md-image-picker-thumb {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    width: 100%;
    transition: border-color 0.15s;
}

.md-image-picker-thumb:hover {
    border-color: #86b7fe;
}

.md-image-picker-thumb.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px #0d6efd40;
}

/* Markdown inline image placeholder (click-to-load) */
.md-image-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px dashed #adb5bd;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.85em;
    color: #6c757d;
    vertical-align: middle;
}

.md-image-placeholder .md-image-load {
    color: inherit;
    text-decoration: none;
}

.md-image-placeholder .md-image-load:hover {
    color: #495057;
    text-decoration: underline;
}

.md-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 2px 0;
}

/* Media player embeds */
.bink-media-embed {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.bink-media-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
}

.bink-media-video {
    display: block;
    width: 100%;
    max-width: 640px;
    border-radius: 4px;
}

.bink-media-audio {
    display: block;
    width: 100%;
    max-width: 480px;
}

.bink-media-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* StyleCodes (MARKUP: StyleCodes 1.0) */
.sc-body {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.sc-inverse {
    filter: invert(1);
}


/* Disabled dropdown items — grayed out but readable across all themes */
.dropdown-item-locked {
    color: #888 !important;
    pointer-events: auto;
    cursor: not-allowed;
}

/* Today's Callers table in the dashboard system-info box */
.callers-table th {
    font-weight: 600;
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0.2rem;
    white-space: nowrap;
}
.callers-table td,
.callers-table th {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

/* AI Assistant response — rendered markdown */
.ai-response-text > *:last-child { margin-bottom: 0; }
.ai-response-text p { margin-bottom: 0.5rem; }
.ai-response-text ul, .ai-response-text ol { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.ai-response-text pre { background: rgba(0,0,0,0.05); padding: 0.5rem; border-radius: 4px; overflow-x: auto; }
.ai-response-text code { font-size: 0.85em; }
.ai-response-text h1, .ai-response-text h2, .ai-response-text h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }

/* Keep share dialog inputs readable in all themes, including readonly URL fields. */
.share-message-modal .form-control,
.share-message-modal .form-select {
    background-color: var(--message-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.share-message-modal .form-control:focus,
.share-message-modal .form-select:focus {
    background-color: var(--message-bg);
    color: var(--text-color);
}

.share-message-modal .form-control::placeholder {
    color: var(--text-color-muted);
    opacity: 1;
}

.share-message-modal .form-control[readonly] {
    background-color: var(--message-bg);
    color: var(--text-color);
    border-color: var(--border-color);
    opacity: 1;
}

.share-message-modal .text-muted {
    color: var(--text-color-muted) !important;
}

.share-message-modal .alert-secondary {
    background-color: var(--bg-secondary, var(--message-bg, #f8f9fa));
    color: var(--text-color);
    border-color: var(--border-color);
}

.share-message-modal .copy-other-share-btn {
    background-color: transparent;
    color: var(--text-color);
    border-color: var(--border-color);
}

.share-message-modal .copy-other-share-btn:hover,
.share-message-modal .copy-other-share-btn:focus {
    background-color: var(--message-quote-bg, rgba(0, 0, 0, 0.05));
    color: var(--text-color);
    border-color: var(--fidonet-blue, var(--border-color));
}
