:root {
    --bg-color: #0f172a; /* Slightly warmer dark background (slate-900) */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc; /* Higher contrast white (slate-50) */
    --text-muted: #cbd5e1; /* Increased contrast for muted text (slate-300) */
    --text-color: var(--text-main); /* alias: several rules reference --text-color */
    --card-bg: rgba(255, 255, 255, 0.05); /* Increased card opacity for differentiation */
    --border-color: rgba(255, 255, 255, 0.15); /* Significantly increased border visibility (violates anti-pattern of using 0.1 or below) */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #3b82f6 0%, rgba(59, 130, 246, 0) 70%);
    top: -200px;
    right: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 50px) scale(1.1); }
}

/* The app is used on desktop monitors by a small internal team, so the shell
   defaults to desktop-shaped. 900px was the original default and every wide page
   opted out with its own inline magic number (loans 1600, pipeline 1200), which
   left the dashboard and known-offerings narrow by omission rather than by
   choice. One default, overridden only where a page genuinely wants to be
   narrower. */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 900px) {
    .container {
        padding: 1.5rem 1rem;
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--primary-color);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.12);
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
}

.search-box {
    display: flex;
    gap: 1rem;
}

input[type="text"], input[type="password"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.3); /* Darker input background for better contrast against cards */
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); /* Stronger focus ring for accessibility */
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-height: 44px;
}

button.primary-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#multi-action-bar {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px);
    border-color: var(--primary-color) !important;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

/* Focus indicators for keyboard navigation (UX-H3 from run 20260503_2042).
 * Browsers default to outline:none on .modal, button, select, input via the
 * reset above; without an explicit replacement, keyboard users have no
 * visible focus. :focus-visible avoids showing the ring on mouse clicks. */
button:focus-visible,
select:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="file"]:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 3px;
}

button.icon-btn {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.status-message.hidden {
    display: none;
}

.status-message.loading {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-message.info {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    background: transparent !important;
    text-align: center;
    padding: 2rem !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
}

.hidden {
    display: none !important;
}

.filter-controls {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
}

#search-results-table, #scanner-table, #pipeline-table, #vocab-table, #asset-scanner-table, #asset-dict-table, #fidelity-queue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#search-results-table th, #search-results-table td, #scanner-table th, #scanner-table td, #pipeline-table th, #pipeline-table td, #vocab-table th, #vocab-table td, #asset-scanner-table th, #asset-scanner-table td, #asset-dict-table th, #asset-dict-table td, #fidelity-queue-table th, #fidelity-queue-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#search-results-table th, #scanner-table th, #pipeline-table th, #vocab-table th, #asset-scanner-table th, #asset-dict-table th, #fidelity-queue-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 500;
}

#search-results-table tbody tr, #scanner-table tbody tr, #pipeline-table tbody tr, #vocab-table tbody tr, #asset-scanner-table tbody tr, #asset-dict-table tbody tr, #fidelity-queue-table tbody tr {
    transition: background 0.2s;
}

#search-results-table tbody tr:hover, #scanner-table tbody tr:hover, #pipeline-table tbody tr.main-row:hover, #vocab-table tbody tr:hover, #asset-scanner-table tbody tr:hover, #asset-dict-table tbody tr:hover, #fidelity-queue-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#search-results-table tbody tr:last-child td, #scanner-table tbody tr:last-child td, #pipeline-table tbody tr:last-child td, #vocab-table tbody tr:last-child td, #asset-scanner-table tbody tr:last-child td, #asset-dict-table tbody tr:last-child td, #fidelity-queue-table tbody tr:last-child td {
    border-bottom: none;
}

button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none !important;
    opacity: 0.7;
}

#search-btn:disabled {
    cursor: wait;
    animation: searchPulse 1.5s infinite;
}

@keyframes searchPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.drop-zone:hover, .drop-zone.dragover {
    background-color: rgba(59, 130, 246, 0.05);
    border-color: var(--primary-color) !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 0;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 95vw;
    min-height: 50vh;
    max-height: 95vh;
    height: auto;
    background: rgba(15, 23, 42, 0.95); /* Extremely reduced transparency */
    backdrop-filter: blur(24px); /* Heavy glassmorphic blur to destroy underlying text */
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: auto;
}

#viewer-modal .modal-content {
    height: 95vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.modal-header .icon-btn {
    font-size: 1.5rem;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-body.split-pane {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pane {
    overflow: auto;
}

.pdf-pane {
    border-right: none;
}

.resizer {
    width: 12px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    cursor: col-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
    z-index: 10;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.resizer:hover, .resizer.dragging {
    background: rgba(59, 130, 246, 0.4);
}

.resizer::after {
    content: "⋮";
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1;
}

#md-viewer-raw, #md-viewer-preview {
    margin: 0;
    padding: 1.5rem;
    flex: 1;
    overflow: auto;
}

#md-viewer-raw {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-color);
}

.md-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.markdown-body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-color);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-body th, .markdown-body td {
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.05);
}

/* Collapsible Offerings & Health UI */
.collapsible-wrapper {
    margin-bottom: 2rem;
}

.offering-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    min-width: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

.offering-header:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary-color);
}

.offering-header h2 {
    margin: 0 !important;
    font-size: 1.2rem;
    flex: 1 1 250px;
    min-width: 0;
}

.health-report {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.85rem;
    color: var(--text-color);
    flex: 2 1 350px;
    min-width: 0;
}

.health-indicator {
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.health-indicator.good {
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.health-indicator.bad {
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.collapsible-content {
    display: none;
    margin-top: 1rem;
    animation: fadeInDown 0.3s ease-out;
}

.collapsible-content.expanded {
    display: block;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chevron-icon {
    transition: transform 0.3s;
}

.offering-header.expanded .chevron-icon {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .offering-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
        gap: 0.75rem;
    }

    .health-report {
        justify-content: flex-start;
        width: 100%;
        flex: none;
        gap: 0.5rem;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Top Navigation & Dropdowns */
.top-nav {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 50;
}

@media (max-width: 768px) {
    .top-nav {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 2rem;
    }
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover, .dropdown:hover .dropdown-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 220px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    padding: 0.5rem 0;
    z-index: 100;
    animation: fadeInDown 0.2s ease-out;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

/* Click/keyboard-only, driven by the `.open` class from dropdowns.js
   (ux F1@1633). Hover-to-open was removed deliberately: it made the menu
   keyboard-unreachable, it popped per-row Delete/Promote menus open as
   the pointer swept across a table row, and it needed an invisible
   ::before bridge to stop the menu closing between toggle and menu.
   Mouse and keyboard now share one path. */
.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item svg {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Semantic Classes for Main Body Cards */
.loan-card {
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loan-card:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.04);
}

.loan-card-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.4;
    font-weight: 600;
}

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

.badge-blue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-pink { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.badge-purple { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

.card-indicators {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-indicator-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.card-indicator-item.ready-htm { color: #60a5fa; background: rgba(96, 165, 250, 0.1); }
.card-indicator-item.ready-md { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.card-indicator-item.ready-pdf { color: #f87171; background: rgba(248, 113, 113, 0.1); }

.card-warning {
    color: #fbbf24;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #fbbf24;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
}

.offering-actions-dropdown {
    margin-left: 0.5rem;
}

.icon-btn-small {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.icon-btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Expandable Details Row */
.details-row {
    background: rgba(0, 0, 0, 0.2);
}

.details-row.hidden {
    display: none !important;
}

.details-container {
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.details-table th, .details-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.details-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 500;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1.5s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    .blob {
        animation: none !important;
        display: none; /* Often blobs distract from reading without animation too */
    }
}

@media (prefers-reduced-transparency: reduce) {
    .glass-card, .modal-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--bg-color) !important;
        border: 2px solid var(--border-color) !important;
    }
    .background-elements {
        opacity: 0.1 !important;
    }
}

/* LEX-137: fidelity queue visibility (badge in Tools menu + header pill) */
.nav-count-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.fidelity-alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.75rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    cursor: pointer;
}
.fidelity-alert-pill.hidden { display: none; }
.nav-count-badge.hidden { display: none; }

/* F31: SSE connection health dot in the top nav */
.sse-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    align-self: center;
    background: rgba(148, 163, 184, 0.6); /* connecting: slate */
}
.sse-dot.sse-live { background: #34d399; }
.sse-dot.sse-reconnecting { background: #fbbf24; }
.sse-dot.sse-closed { background: #f87171; }

.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;
}

/* Scanner modals: discovery above management on a laptop, side by side once
   there is room. The markup always intended two columns — the `Left Side` /
   `Right Side` comments predate the 800px cap that forced them to stack —
   and stacking is what limited each pane to roughly half the viewport. */
.modal-split {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.modal-split-pane {
    display: flex;
    flex-direction: column;
    flex: none;
    min-width: 0;
}

.modal-split-divider {
    background: var(--border-color);
    flex-shrink: 0;
    height: 1px;
}

/* Stacked: the two panes share the viewport, so each takes half. */
.scanner-pane-table {
    max-height: calc(50vh - 120px);
}

@media (min-width: 1400px) {
    .modal-split {
        flex-direction: row;
        align-items: stretch;
    }

    .modal-split-pane {
        flex: 1;
    }

    .modal-split-divider {
        height: auto;
        width: 1px;
        align-self: stretch;
    }

    /* Side by side, each pane owns the full height. */
    .scanner-pane-table {
        max-height: calc(100vh - 300px);
    }
}
