﻿body {
    background: #f4f6f8;
    color: #1f2937;
}

:root {
    /* ── Pastel colour palette (24 colours) ── */
    --kvp-color-0: #fca5a5; /* rose        */
    --kvp-color-1: #fdba74; /* orange      */
    --kvp-color-2: #fcd34d; /* amber       */
    --kvp-color-3: #fde047; /* yellow      */
    --kvp-color-4: #bef264; /* lime        */
    --kvp-color-5: #86efac; /* green       */
    --kvp-color-6: #6ee7b7; /* emerald     */
    --kvp-color-7: #5eead4; /* teal        */
    --kvp-color-8: #67e8f9; /* cyan        */
    --kvp-color-9: #7dd3fc; /* sky         */
    --kvp-color-10: #93c5fd; /* blue        */
    --kvp-color-11: #a5b4fc; /* indigo      */
    --kvp-color-12: #c4b5fd; /* violet      */
    --kvp-color-13: #d8b4fe; /* purple      */
    --kvp-color-14: #f0abfc; /* fuchsia     */
    --kvp-color-15: #f9a8d4; /* pink        */
    --kvp-color-16: #fecdd3; /* light rose  */
    --kvp-color-17: #fed7aa; /* light orange*/
    --kvp-color-18: #d9f99d; /* light lime  */
    --kvp-color-19: #99f6e4; /* mint        */
    --kvp-color-20: #bae6fd; /* light sky   */
    --kvp-color-21: #c7d2fe; /* light indigo*/
    --kvp-color-22: #f5d0fe; /* light fuchsia*/
    --kvp-color-23: #fbcfe8; /* light pink  */
    --preview-divider-width: 12px;
}

.analyzer-page {
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
}

.analyzer-layout {
    --analyzer-sidebar-width: calc((100% - var(--preview-divider-width)) / 2);
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
}

.analyzer-sidebar-column {
    flex: 0 0 var(--analyzer-sidebar-width);
    width: var(--analyzer-sidebar-width);
    max-width: none;
    min-width: 0;
    overflow: auto;
    min-height: 0;
    height: 100%;
}

.analyzer-logo {
    height: 45px;
    width: auto;
}

.ui-panel {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 0.9rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.section-heading h2 {
    color: #0f172a;
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 150px;
    padding: 1.25rem;
    border: 2px dashed #ffa500;
    border-radius: 1rem;
    background: linear-gradient(180deg, #fffcf5 0%, #ffeddb 100%);
    text-align: center;
    color: #0d6efd;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .upload-dropzone:hover,
    .upload-dropzone:focus-visible,
    .upload-dropzone.is-dragover {
        border-color: #0d6efd;
        background: #e9f3ff;
        transform: translateY(-1px);
        box-shadow: var(--focus-ring);
        outline: none;
    }

.upload-dropzone-icon {
    font-size: 2rem;
    line-height: 1;
}

.upload-dropzone-title {
    font-weight: 600;
    color: #0f172a;
}

.upload-dropzone-subtitle {
    font-size: 0.9rem;
    color: #52607a;
}

.upload-dropzone-compact {
    flex-direction: row;
    justify-content: flex-start;
    min-height: unset;
    padding: 0.6rem 1rem;
    gap: 0.75rem;
    text-align: left;
}

    .upload-dropzone-compact .upload-dropzone-icon {
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    .upload-dropzone-compact .upload-dropzone-body {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
    }

.selected-files-summary {
    margin-top: 0.4rem;
}

.selected-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.selected-file-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.selected-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 0.35rem;
    background: #e8f0ff;
    color: #0d6efd;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.selected-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-file-details {
    font-size: 0.75rem;
    color: #64748b;
}

.token-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.85rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .token-editor:focus-within {
        border-color: #0d6efd;
        box-shadow: var(--focus-ring);
    }

.token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.token-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #e8f0ff;
    color: #0b5ed7;
    font-size: 0.9rem;
    font-weight: 500;
}

.token-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 18rem;
}

.token-chip-remove {
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

    .token-chip-remove:hover,
    .token-chip-remove:focus-visible {
        background: rgba(11, 94, 215, 0.12);
        outline: none;
    }

.token-input {
    flex: 1 1 12rem;
    border: none;
    min-width: 12rem;
    padding: 0.25rem 0;
    outline: none;
    background: transparent;
}

.token-empty {
    color: #94a3b8;
    font-size: 0.9rem;
}

#fieldTemplatesDropdown {
    position: relative;
    width: 100%;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.85rem;
    box-shadow: var(--panel-shadow);
    max-height: 24rem;
    overflow: auto;
    z-index: 2000;
    display: none;
    font-size: 0.9rem;
}

#fieldTemplatesSearch {
    position: sticky;
    top: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem;
    z-index: 1;
}

    #fieldTemplatesSearch input {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid #cbd5e1;
        border-radius: 0.65rem;
    }

#fieldTemplatesDropdown .tpl-item {
    position: relative;
    padding: 0.85rem 3rem 0.85rem 0.85rem;
    cursor: pointer;
    line-height: 1.3;
    border-bottom: 1px solid #f1f5f9;
    outline: none;
}

    #fieldTemplatesDropdown .tpl-item:last-child {
        border-bottom: none;
    }

    #fieldTemplatesDropdown .tpl-item:hover,
    #fieldTemplatesDropdown .tpl-item:focus-visible {
        background: #edf4ff;
    }

    #fieldTemplatesDropdown .tpl-item.is-active {
        background: #e8f0ff;
    }

#fieldTemplatesDropdown .tpl-vendor {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

#fieldTemplatesDropdown .tpl-meta,
#fieldTemplatesDropdown .tpl-fields {
    color: #475569;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#fieldTemplatesDropdown .tpl-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #dc3545;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

    #fieldTemplatesDropdown .tpl-delete:hover {
        color: #a71d2a;
    }

#previewToolbar,
#documentNavigator,
#downloadBtn,
#loading-overlay,
#loginModal,
#loginError,
#analyzeProgressStatus,
#uploadError {
    display: none;
}

.results-panel .nav-link {
    font-weight: 600;
}

    .results-panel .nav-link:focus-visible {
        box-shadow: var(--focus-ring);
    }

.document-preview-column {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

    .preview-header .h6 {
        color: #1e293b;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

        .preview-header .h6 .bi {
            color: #0d6efd;
            opacity: 0.85;
        }

    .preview-header .text-muted {
        font-size: 0.78rem;
        color: #64748b !important;
    }

.preview-toolbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.625rem 1rem;
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid #dde6f0;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s;
}

.preview-toolbar-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    justify-content: space-between;
}

.preview-zoom-label {
    min-width: 4rem;
}

.multi-page-preview {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
    align-items: flex-start;
}

.preview-page-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.preview-page-wrapper {
    position: relative;
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 0.9rem;
    box-shadow: var(--panel-shadow);
    overflow: hidden;
    transform-origin: top left;
}

    .preview-page-wrapper img,
    .preview-page-wrapper canvas {
        display: block;
        max-width: 100%;
        height: auto;
    }

.preview-resize-divider {
    flex: 0 0 var(--preview-divider-width);
    width: var(--preview-divider-width);
    min-width: var(--preview-divider-width);
    cursor: col-resize;
    background: linear-gradient(180deg, #eef2f6 0%, #dde5ee 100%);
    border-left: 1px solid #d7dee8;
    border-right: 1px solid #d7dee8;
    position: relative;
    user-select: none;
    touch-action: none;
}

    .preview-resize-divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 4px;
        height: 64px;
        border-radius: 999px;
        background: #93a4b8;
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85);
    }

    .preview-resize-divider:hover,
    .preview-resize-divider.is-resizing,
    .preview-resize-divider:focus-visible {
        background: linear-gradient(180deg, #dcecff 0%, #cfe2ff 100%);
        outline: none;
    }

body.is-column-resizing {
    cursor: col-resize;
    user-select: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 220px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    color: #475569;
    box-sizing: border-box;
}

.empty-state-icon {
    font-size: 2rem;
    color: #0d6efd;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.empty-state-description {
    max-width: 32rem;
}

.empty-state-list {
    margin: 0.25rem 0 0;
    padding-left: 1.25rem;
    text-align: left;
}

.kvp {
    border-radius: 0.8rem;
    margin-bottom: 0.5rem;
    padding: 0.65rem 0.85rem 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-left-width: 4px;
    transition: box-shadow 0.15s ease, filter 0.15s ease;
}

    .kvp:hover {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
        filter: brightness(0.97);
    }

    .kvp:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    }

.kvp-label {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #374151;
}

.kvp-value {
    font-size: 0.92rem;
    color: #111827;
    margin-top: 0.2rem;
    word-break: break-word;
    line-height: 1.45;
}

.kvp-confidence {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    color: #6b7280;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    float: right;
    margin-left: 0.5rem;
}

/* ── Pastel field colour classes (24 colours) ── */
.kvp-color-0, .table-color-0 {
    border-color: #fca5a5;
    background: #fff1f2;
}

.kvp-color-1, .table-color-1 {
    border-color: #fdba74;
    background: #fff7ed;
}

.kvp-color-2, .table-color-2 {
    border-color: #fcd34d;
    background: #fffbeb;
}

.kvp-color-3, .table-color-3 {
    border-color: #fde047;
    background: #fefce8;
}

.kvp-color-4, .table-color-4 {
    border-color: #bef264;
    background: #f7fee7;
}

.kvp-color-5, .table-color-5 {
    border-color: #86efac;
    background: #f0fdf4;
}

.kvp-color-6, .table-color-6 {
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.kvp-color-7, .table-color-7 {
    border-color: #5eead4;
    background: #f0fdfa;
}

.kvp-color-8, .table-color-8 {
    border-color: #67e8f9;
    background: #ecfeff;
}

.kvp-color-9, .table-color-9 {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.kvp-color-10, .table-color-10 {
    border-color: #93c5fd;
    background: #eff6ff;
}

.kvp-color-11, .table-color-11 {
    border-color: #a5b4fc;
    background: #eef2ff;
}

.kvp-color-12, .table-color-12 {
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.kvp-color-13, .table-color-13 {
    border-color: #d8b4fe;
    background: #faf5ff;
}

.kvp-color-14, .table-color-14 {
    border-color: #f0abfc;
    background: #fdf4ff;
}

.kvp-color-15, .table-color-15 {
    border-color: #f9a8d4;
    background: #fdf2f8;
}

.kvp-color-16, .table-color-16 {
    border-color: #fecdd3;
    background: #fff8f8;
}

.kvp-color-17, .table-color-17 {
    border-color: #fed7aa;
    background: #fff9f3;
}

.kvp-color-18, .table-color-18 {
    border-color: #d9f99d;
    background: #f9fff0;
}

.kvp-color-19, .table-color-19 {
    border-color: #99f6e4;
    background: #f0fffe;
}

.kvp-color-20, .table-color-20 {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.kvp-color-21, .table-color-21 {
    border-color: #c7d2fe;
    background: #f1f2ff;
}

.kvp-color-22, .table-color-22 {
    border-color: #f5d0fe;
    background: #fef6ff;
}

.kvp-color-23, .table-color-23 {
    border-color: #fbcfe8;
    background: #fef6fa;
}

.kvp-box, .table-box {
    position: absolute;
    border: 2px solid;
    border-radius: 3px;
    pointer-events: none;
    z-index: 20;
    box-sizing: border-box;
    opacity: 0.7;
}

    .kvp-box.is-focused {
        opacity: 0.66;
        stroke-width: 2;
        outline: 2px dotted #ffa500;
        outline-offset: 2px;
    }

.label-box {
    position: absolute;
    border: 2px dashed #0078d4;
    pointer-events: none;
    z-index: 10;
}

.page-number-overlay {
    position: absolute;
    top: 0;
    left: 0;
    background: #aaa;
    color: #fff;
    padding: 0.35rem 0.55rem;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 50;
    pointer-events: none;
    border-bottom-right-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ── Document info chips ── */
.doc-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.doc-info-item {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    min-width: 10rem;
    flex: 1 1 auto;
}

.doc-info-item--full {
    flex-basis: 100%;
}

.doc-info-icon {
    font-size: 0.85rem;
    color: #0d6efd;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.doc-info-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    line-height: 1;
    margin-bottom: 0.1rem;
    white-space: nowrap;
}

.doc-info-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #0f172a;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

/* ── Combined grid ── */
th.sticky-header.sticky-top {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    color: #212529;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    z-index: 20;
    overflow: visible; /* must be visible so the resize handle isn't clipped */
    user-select: none;
}

.combined-grid-wrapper {
    max-height: 32rem;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.combined-grid-table {
    margin-bottom: 0;
}

    .combined-grid-table tbody tr {
        transition: background-color 0.12s ease;
    }

        .combined-grid-table tbody tr > td:first-child {
            text-align: center;
            color: #6b7280;
            font-size: 0.8rem;
            font-variant-numeric: tabular-nums;
            width: 3rem;
        }

.combined-grid-table tbody td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.combined-grid-table tbody td.is-expanded {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.cell-content {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.cell-content.is-expanded {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    cursor: pointer;
}

.grid-filename-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}

    .grid-filename-link:hover {
        text-decoration: underline;
    }

.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 30;
    background: #eee;
    transition: background 0.15s ease;
}

    .col-resize-handle:hover,
    .col-resize-handle.is-resizing {
        background: #0d6efd44;
    }

.analyze-progress-button {
    position: relative;
    overflow: hidden;
    min-height: 2.85rem;
}

.analyze-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.35) 100%);
    transition: width 0.2s ease;
}

.analyze-progress-text {
    position: relative;
    z-index: 1;
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.loading-card {
    width: min(32rem, 100%);
    padding: 1.25rem;
    border-radius: 1rem;
    background: #fff;
}

.loading-progress {
    width: 100%;
    height: 0.65rem;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0d6efd 0%, #6f42c1 100%);
    border-radius: inherit;
    transition: width 0.2s ease;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar-inner {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #0078d4 0%, #6f42c1 50%, #17a2b8 100%);
    border-radius: 2px;
    position: absolute;
    left: -40%;
    animation: progress-indeterminate 3s linear infinite;
}

@keyframes progress-indeterminate {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.28);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-modal-dialog {
    min-width: min(26rem, 100%);
    margin: auto;
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible,
.dropdown-item:focus-visible {
    box-shadow: var(--focus-ring);
}

@media (max-width: 991.98px) {
    .analyzer-layout {
        min-height: auto;
    }

    .analyzer-sidebar-column,
    .document-preview-column {
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    .analyzer-page {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .analyzer-layout {
        flex-wrap: wrap;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .analyzer-sidebar-column,
    .document-preview-column {
        flex: 1 1 100%;
        width: 100%;
        height: auto;
    }

    .preview-resize-divider {
        display: none;
    }

    .token-chip-label {
        max-width: 12rem;
    }

    .preview-toolbar-content {
        justify-content: flex-start;
    }
}

.token-chip[draggable="true"] {
    cursor: grab;
}

.token-chip.is-dragging {
    opacity: 0.6;
    cursor: grabbing;
}

.token-editor.is-drop-target {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background: rgba(13, 110, 253, 0.04);
}

.token-chip.is-drop-before,
.token-chip.is-drop-after {
    position: relative;
}

    .token-chip.is-drop-before::before,
    .token-chip.is-drop-after::after {
        content: '';
        position: absolute;
        top: 0.25rem;
        bottom: 0.25rem;
        width: 3px;
        border-radius: 999px;
        background: #0d6efd;
    }

    .token-chip.is-drop-before::before {
        left: -0.4rem;
    }

    .token-chip.is-drop-after::after {
        right: -0.4rem;
    }

/* ── Workflow step indicator ── */
.workflow-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.workflow-step-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.workflow-step-label {
    font-size: 1.2rem;
    color: #94a3b8;
    font-weight: 600;
    transition: color 0.2s;
    white-space: nowrap;
}

.workflow-step.is-active .workflow-step-dot {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

.workflow-step.is-active .workflow-step-label {
    color: #0d6efd;
}

.workflow-step.is-complete .workflow-step-dot {
    border-color: #198754;
    background: #198754;
    color: #fff;
}

.workflow-step.is-complete .workflow-step-label {
    color: #198754;
}

.workflow-step-connector {
    flex: 1 1 auto;
    height: 2px;
    background: #e2e8f0;
    margin-bottom: 1.8rem;
    min-width: 2rem;
}

/* ── Workflow steps footer (below preview) ── */
.workflow-steps-footer {
    opacity: 0.5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 1rem 1rem;
    width: 100%;
}

    .workflow-steps-footer .workflow-step {
        flex: 0 0 auto;
        min-width: 4.5rem;
        max-width: 9rem;
        width: 20%;
        position: relative;
    }

    .workflow-steps-footer .workflow-step-dot {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.15rem;
        border-width: 2px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
        transition: border-color 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s;
    }

    .workflow-steps-footer .workflow-step-label {
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        transition: color 0.25s;
    }

.workflow-step-desc {
    display: none;
}

.workflow-steps-footer .workflow-step-desc {
    display: block;
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
    text-align: center;
    white-space: normal;
    line-height: 1.3;
    transition: color 0.25s;
}

.workflow-steps-footer .workflow-step.is-active .workflow-step-desc {
    color: #3b82f6;
}

.workflow-steps-footer .workflow-step.is-complete .workflow-step-desc {
    color: #22c55e;
}

.workflow-steps-footer .workflow-step-connector {
    flex: 1 1 auto;
    min-width: 1rem;
    max-width: 5rem;
    align-self: flex-start;
    margin-top: 1.375rem;
    height: 2px;
    background: linear-gradient(to right, #cbd5e1, #e2e8f0);
    border-radius: 999px;
    transition: background 0.3s;
}

.workflow-steps-footer .workflow-step.is-active .workflow-step-dot {
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15), 0 4px 12px rgba(13, 110, 253, 0.25);
    transform: scale(1.08);
}

.workflow-steps-footer .workflow-step.is-active .workflow-step-label {
    font-weight: 800;
}

.workflow-steps-footer .workflow-step.is-complete .workflow-step-dot {
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12), 0 2px 8px rgba(25, 135, 84, 0.18);
}

.workflow-steps-footer .workflow-step-connector.is-complete {
    background: linear-gradient(to right, #198754, #20c997);
}

/* ── Workflow step animations ── */
.workflow-images {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workflow-anim {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.75s ease-in-out;
    pointer-events: none;
    padding: 2.5rem;
}

    .workflow-anim.is-active {
        opacity: 0.5;
    }

.wf-anim-caption {
    font-size: 1.56rem;
    color: #94a3b8;
    font-weight: 500;
    text-align: center;
    margin-top: 1.2rem;
    letter-spacing: 0.01em;
}

/* Step 1: Upload */
.wf-anim-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.wf-anim-cloud {
    font-size: 8rem;
    color: #3b82f6;
    line-height: 1;
    animation: wf-cloud-float 2.8s ease-in-out infinite;
    filter: drop-shadow(0 8px 28px rgba(59, 130, 246, 0.35));
}

.wf-anim-dropzone {
    width: 18rem;
    height: 9rem;
    border: 2.5px dashed #93c5fd;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(219, 234, 254, 0.35);
    animation: wf-zone-pulse 2.8s ease-in-out infinite;
    overflow: hidden;
}

.wf-anim-file {
    font-size: 3.6rem;
    color: #60a5fa;
    animation: wf-file-rise 2.8s ease-in-out infinite;
    display: block;
    line-height: 1;
}

@keyframes wf-cloud-float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-14px);
    }
}

@keyframes wf-file-rise {
    0% {
        transform: translateY(60px);
        opacity: 0;
    }

    18% {
        transform: translateY(0);
        opacity: 1;
    }

    68% {
        transform: translateY(0);
        opacity: 1;
    }

    95% {
        transform: translateY(-68px);
        opacity: 0;
    }

    100% {
        transform: translateY(60px);
        opacity: 0;
    }
}

@keyframes wf-zone-pulse {
    0%, 100% {
        border-color: #93c5fd;
    }

    50% {
        border-color: #3b82f6;
        box-shadow: inset 0 0 0 3px rgba(59, 130, 246, 0.07);
    }
}

/* Step 2: Fields */
.wf-anim-fields {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    max-width: 28rem;
}

.wf-anim-fields-input {
    width: 100%;
    height: 4.5rem;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.wf-anim-cursor {
    color: #3b82f6;
    font-weight: 300;
    font-size: 2.2rem;
    animation: wf-blink 1s step-end infinite;
}

.wf-anim-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.wf-anim-chip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.4rem 1.5rem;
    font-size: 1.44rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(-16px) scale(0.88);
    animation: wf-chip-in 3.2s ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

@keyframes wf-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes wf-chip-in {
    0% {
        opacity: 0;
        transform: translateX(-16px) scale(0.88);
    }

    18% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    72% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    90% {
        opacity: 0;
        transform: translateX(0) scale(0.92);
    }

    100% {
        opacity: 0;
        transform: translateX(-16px) scale(0.88);
    }
}

/* Step 3: Extract */
.wf-anim-doc {
    width: 14rem;
    height: 18rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 8px 36px rgba(15, 23, 42, 0.09);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.6rem;
    gap: 0.8rem;
}

.wf-anim-doc-lines span {
    display: block;
    height: 0.9rem;
    background: #e2e8f0;
    border-radius: 999px;
    margin-bottom: 0.8rem;
}

    .wf-anim-doc-lines span:nth-child(1) {
        width: 85%;
    }

    .wf-anim-doc-lines span:nth-child(2) {
        width: 70%;
    }

    .wf-anim-doc-lines span:nth-child(3) {
        width: 90%;
    }

    .wf-anim-doc-lines span:nth-child(4) {
        width: 55%;
    }

.wf-anim-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, transparent, #3b82f6, transparent);
    box-shadow: 0 0 20px 8px rgba(59, 130, 246, 0.45);
    animation: wf-scan 2s ease-in-out infinite;
    top: 0;
}

.wf-anim-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wf-sparkle {
    position: absolute;
    color: #f59e0b;
    opacity: 0;
    animation: wf-sparkle-pop 2s ease-in-out infinite;
}

.wf-sparkle-1 {
    font-size: 2.5rem;
    top: 8%;
    left: 78%;
    animation-delay: 0s;
}

.wf-sparkle-2 {
    font-size: 2.1rem;
    top: 50%;
    left: 82%;
    animation-delay: 0.65s;
}

.wf-sparkle-3 {
    font-size: 1.8rem;
    top: 82%;
    left: 74%;
    animation-delay: 1.3s;
}

@keyframes wf-scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    6% {
        opacity: 1;
    }

    94% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

@keyframes wf-sparkle-pop {
    0% {
        opacity: 0;
        transform: scale(0.4) rotate(-15deg);
    }

    35%, 60% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.6) rotate(12deg);
    }
}

/* Step 4: Review */
.wf-anim-review {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    max-width: 30rem;
}

.wf-anim-table {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07);
}

.wf-anim-table-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1.3rem;
    font-size: 1.44rem;
    border-bottom: 1px solid #f1f5f9;
    opacity: 0;
    transform: translateX(-12px);
    animation: wf-row-in 3.2s ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

    .wf-anim-table-row:last-child {
        border-bottom: none;
    }

.wf-anim-table-head {
    background: #f8fafc;
    font-weight: 700;
    color: #475569;
    font-size: 1.36rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.wf-anim-table-row span:last-child {
    color: #0d6efd;
    font-weight: 600;
}

.wf-anim-table-head span:last-child {
    color: #475569;
    font-weight: 700;
}

.wf-anim-check {
    font-size: 4.8rem;
    color: #22c55e;
    opacity: 0;
    animation: wf-check-bounce 3.2s ease-in-out infinite;
    animation-delay: 0.9s;
    filter: drop-shadow(0 8px 24px rgba(34, 197, 94, 0.35));
}

@keyframes wf-row-in {
    0% {
        opacity: 0;
        transform: translateX(-12px);
    }

    22% {
        opacity: 1;
        transform: translateX(0);
    }

    78% {
        opacity: 1;
        transform: translateX(0);
    }

    98% {
        opacity: 0;
        transform: translateX(-12px);
    }

    100% {
        opacity: 0;
    }
}

@keyframes wf-check-bounce {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    32% {
        opacity: 1;
        transform: scale(1.2);
    }

    44% {
        transform: scale(1);
    }

    78% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.85);
    }
}

/* Step 3 idle CTA (before extraction starts) */
.wf-anim-extract-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.wf-anim-extract {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    transition: opacity 0.4s ease;
}
/* While extracting: hide idle CTA, show scanner */
#workflowImages.is-extracting .wf-anim-extract-idle {
    display: none;
}

#workflowImages.is-extracting .wf-anim-extract {
    display: flex;
}

.wf-anim-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #FFA500 0%, #ff8c00 100%);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 1.1rem 2.5rem;
    border-radius: 0.6rem;
    box-shadow: 0 8px 28px rgba(255, 165, 0, 0.4);
    animation: wf-cta-pulse 2.2s ease-in-out infinite;
    letter-spacing: 0.01em;
    pointer-events: none;
}

    .wf-anim-cta-btn .bi {
        font-size: 2.1rem;
        animation: wf-cta-star-spin 2.2s ease-in-out infinite;
    }

@keyframes wf-cta-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 28px rgba(255, 165, 0, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 44px rgba(255, 165, 0, 0.6);
    }
}

@keyframes wf-cta-star-spin {
    0%, 40% {
        transform: rotate(0deg) scale(1);
    }

    70% {
        transform: rotate(20deg) scale(1.2);
    }

    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* ── Template applied toast ── */
.template-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    background: #1e293b;
    color: #fff;
    padding: 0.65rem 1.1rem;
    border-radius: 0.75rem;
    font-size: 0.88rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

    .template-toast.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ── Password strength meter ── */
.password-strength-track {
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.25s ease, background 0.25s ease;
    background: #e2e8f0;
}

    .password-strength-fill.strength-1 {
        background: #ef4444;
    }

    .password-strength-fill.strength-2 {
        background: #f97316;
    }

    .password-strength-fill.strength-3 {
        background: #eab308;
    }

    .password-strength-fill.strength-4 {
        background: #22c55e;
    }

    .password-strength-fill.strength-5 {
        background: #16a34a;
    }

.password-strength-label {
    font-size: 0.75rem;
    font-weight: 600;
}

    .password-strength-label.strength-1 {
        color: #ef4444;
    }

    .password-strength-label.strength-2 {
        color: #f97316;
    }

    .password-strength-label.strength-3 {
        color: #eab308;
    }

    .password-strength-label.strength-4 {
        color: #22c55e;
    }

    .password-strength-label.strength-5 {
        color: #16a34a;
    }

/* ── File status badge (post-analysis) ── */
.selected-file-item.status-success .selected-file-icon {
    background: #dcfce7;
    color: #16a34a;
}

.selected-file-item.status-error .selected-file-icon {
    background: #fee2e2;
    color: #dc2626;
}


/* ── Bootstrap overrides ── */
.btn-primary {
    --bs-btn-bg: #FFA500;
    --bs-btn-border-color: #ffb835;
    --bs-btn-hover-bg: #3191CF;
    --bs-btn-hover-border-color: #55a0d0;
    --bs-btn-active-color: #ffffff;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-color: #ffffff;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 152, 0, 0.4);
        border-color: rgba(255, 152, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.8), 0 0 30px rgba(255, 152, 0, 0.2);
        border-color: rgba(255, 152, 0, 1);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 152, 0, 0.4);
        border-color: rgba(255, 152, 0, 0.5);
    }
}

.glow-active {
    animation: glow-pulse 3s infinite ease-in-out;
    transition: all 0.3s ease;
}

#glAccountCodingInfoIcon {
    font-size: 0.85rem;
    cursor: pointer;
    vertical-align: text-bottom;
}

.gl-coding-hint {
    color: #6c757d;
    font-size: 0.8rem;
}

kbd {
    background-color: darkgrey;
}

/* == Chart of Accounts modal ============================================= */
.coa-modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.coa-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}
.coa-modal-dialog {
    display: flex;
    flex-direction: column;
    width: min(660px, 95vw);
    max-height: 88vh;
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 0.9rem;
    box-shadow: 0 8px 32px rgba(15, 23, 42, .18);
    overflow: hidden;
}

/* Header */
.coa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1.125rem .875rem 1.25rem;
    border-bottom: 1px solid #e8eef5;
    background: #f8fafc;
    border-radius: 0.9rem 0.9rem 0 0;
    flex-shrink: 0;
}
.coa-modal-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9375rem;
    font-weight: 600;
    color: #0f172a;
}
.coa-modal-title i {
    color: #0d6efd;
    font-size: 1rem;
}

/* Subtitle */
.coa-modal-subtitle {
    padding: .5rem 1.25rem .625rem;
    font-size: .8125rem;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e8eef5;
    line-height: 1.5;
}

/* Toolbar */
.coa-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border-bottom: 1px solid #e8eef5;
    background: #fff;
    flex-shrink: 0;
}

/* Paste panel */
.coa-paste-panel {
    padding: .875rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e8eef5;
    font-size: .875rem;
    color: #475569;
    flex-shrink: 0;
}
.coa-paste-area {
    font-family: var(--bs-font-monospace);
    font-size: .8125rem;
    background: #fff;
}

/* Scrollable table body */
.coa-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
}
.coa-table-wrapper {
    overflow: visible;
}
.coa-table {
    margin-bottom: 0;
}
.coa-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #475569;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .5rem 1rem;
    border-bottom: 1px solid #e8eef5;
}
.coa-table tbody tr:hover {
    background: #f8fafc;
}
.coa-table tbody td {
    padding: .375rem .75rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}
.coa-table .form-control {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    padding: .25rem .5rem;
    font-size: .875rem;
}
.coa-table .form-control:focus {
    border-color: #86b7fe;
    background: #fff;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}
.coa-table .coa-remove-btn {
    opacity: 0;
    transition: opacity .15s;
    color: #ef4444;
    font-size: .875rem;
}
.coa-table tbody tr:hover .coa-remove-btn {
    opacity: 1;
}

/* Footer */
.coa-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid #e8eef5;
    background: #f8fafc;
    border-radius: 0 0 0.9rem 0.9rem;
    flex-shrink: 0;
}
.coa-item-count {
    font-size: .8125rem;
    color: #94a3b8;
}
.coa-validation-message {
    font-size: .8125rem;
    color: #dc3545;
}

/* ── Collapsible sections ── */
.section-heading.d-flex {
    cursor: pointer;
    user-select: none;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
    margin: -0.25rem -0.25rem 0 !important;
    padding: 0.25rem 0.25rem 0.75rem;
}

.section-heading.d-flex:hover {
    background: #f8fafc;
}

.section-toggle-btn {
    background: none;
    border: none;
    padding: 0.15rem 0.3rem;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 0.375rem;
    transition: color 0.15s ease, background 0.15s ease;
}

    .section-toggle-btn:hover,
    .section-toggle-btn:focus-visible {
        color: #0d6efd;
        background: #e9f3ff;
        outline: none;
    }

.section-toggle-icon {
    display: inline-block;
    transition: transform 0.25s ease;
}

.section-toggle-btn[aria-expanded="false"] .section-toggle-icon {
    transform: rotate(-180deg);
}

.section-collapsible-body {
    transition: max-height 0.3s ease, opacity 0.25s ease;
    max-height: 2000px;
    opacity: 1;
}

    .section-collapsible-body.is-collapsed {
        overflow: hidden;
        max-height: 0 !important;
        opacity: 0;
    }

/* ─── Sign-Up modal: two-column promo layout ─────────────────────────────── */
/* When the Create Account panel is visible, widen the dialog and show the
   animated demo GIF alongside the form. Uses :has() so no JS is needed —
   the width follows the panel's [hidden] state automatically. */
.login-modal-dialog:has(#authPanelRegister:not([hidden])) {
    min-width: min(81rem, 95vw);
    max-width: min(81rem, 95vw);
}

    /* Give the Create Account panel a bit more breathing room around the split. */
    .login-modal-dialog:has(#authPanelRegister:not([hidden])) .modal-body {
        padding: 1.5rem 1.75rem 1.75rem;
    }

.register-split {
    margin: 0;
    align-items: stretch;
}

.register-promo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(160deg, rgba(13, 110, 253, 0.08), rgba(13, 110, 253, 0.02) 60%, rgba(15, 23, 42, 0.04));
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0.875rem;
}

.register-promo-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0d6efd;
    margin-bottom: 0.125rem;
}

.register-promo-frame {
    /* Bigger preview window — fills the available column width and grows
       vertically with the form so both sides align cleanly. */
    flex: 1 1 auto;
    min-height: 22rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #0f172a;
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .register-promo-frame img {
        width: 100%;
        height: 100%;
        /* `contain` ensures the full GIF is visible regardless of its native
           aspect ratio — no cropping of the animation. */
        object-fit: contain;
        display: block;
    }

.register-promo-caption {
    margin: 0;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
}

.register-promo-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #1f2937;
}

    .register-promo-features li {
        display: flex;
        align-items: center;
        gap: 0.625rem;
    }

    .register-promo-features .bi-check-circle-fill {
        color: #198754;
        font-size: 1.05rem;
        flex-shrink: 0;
    }

.register-form-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 2.5rem;
}

    /* Slightly larger inputs/buttons so the form visually balances the bigger preview. */
    .register-form-col .form-label {
        font-weight: 500;
    }

    .register-form-col .form-control {
        padding: 0.5rem 0.75rem;
    }

    .register-form-col .btn-primary {
        padding: 0.6rem 1rem;
        font-weight: 500;
    }

@media (max-width: 991.98px) {
    .login-modal-dialog:has(#authPanelRegister:not([hidden])) {
        min-width: min(56rem, 95vw);
        max-width: min(56rem, 95vw);
    }

    .register-promo-frame {
        min-height: 18rem;
    }
}

@media (max-width: 767.98px) {
    .login-modal-dialog:has(#authPanelRegister:not([hidden])) {
        min-width: min(26rem, 100%);
        max-width: 100%;
    }

        .login-modal-dialog:has(#authPanelRegister:not([hidden])) .modal-body {
            padding: 1rem 1rem 1.25rem;
        }

    .register-promo {
        padding: 1rem;
        gap: 0.75rem;
    }

    .register-promo-frame {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .register-form-col {
        padding-left: 0;
    }
}
