/* ============================================
   FastDQ Web - Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary: #E63946;
    --primary-dark: #D32F2F;
    --secondary: #F1FAEE;
    --accent: #A8DADC;
    --accent-dark: #457B9D;
    --dark: #1D3557;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;

    --priority-high: #E63946;
    --priority-medium: #CC7722;
    --priority-low: #4682B4;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;

    --transition: 150ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    color-scheme: light;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark);
    background-color: var(--secondary);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
}

p {
    margin: 0 0 1em 0;
}

ul, ol {
    margin: 0;
    padding-left: 1.5em;
}

/* App Layout */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-section {
    flex-shrink: 0;
    z-index: 1;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.title-section {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none; /* Allow clicks to pass through to elements behind if overlap */
}

.title-section h1,
.title-section .tagline {
    pointer-events: auto; /* But text itself is still selectable */
}

.title-section h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.tagline {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.header-actions {
    flex-shrink: 0;
    z-index: 1;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: var(--white);
    color: var(--primary);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-100);
}

.btn-header {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--white);
    background: transparent;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-header:hover {
    background: var(--white);
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex-grow: 1;
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Panels */
.panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-panel {
    flex: 0 0 400px;
    min-width: 350px;
}

.results-panel {
    flex: 1;
    min-width: 400px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.panel-header h2 {
    font-size: 1rem;
    color: var(--dark);
}

/* ============================================
   Drop Zone
   ============================================ */
.drop-zone {
    padding: 2rem;
    margin: 1rem;
    border: 2px dashed var(--accent-dark);
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    background: var(--accent);
    border-color: var(--accent-dark);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    margin: 0.25rem 0;
    color: var(--gray-600);
}

.drop-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Hide drop zone when files exist */
.drop-zone.hidden {
    display: none;
}

/* ============================================
   File List
   ============================================ */
.file-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.file-card {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--white);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-card:hover {
    background: var(--secondary);
    border-color: var(--accent-dark);
}

/* Currently viewing file (shown in results panel) */
.file-card.viewing {
    background: var(--accent);
    border-color: var(--accent-dark);
    border-width: 2px;
}

/* Batch selected for operations (Ctrl+click) */
.file-card.batch-selected {
    border-left: 4px solid var(--accent-dark);
    background: rgba(69, 123, 157, 0.1);
}

.file-card.batch-selected:hover {
    background: rgba(69, 123, 157, 0.15);
}

/* Both viewing and batch-selected */
.file-card.viewing.batch-selected {
    background: var(--accent);
    border-color: var(--accent-dark);
    border-width: 2px;
    border-left: 4px solid var(--dark);
}

.file-card.disabled {
    opacity: 0.7;
    cursor: pointer;
}

.file-card.disabled.viewing {
    opacity: 1;
}

.file-card.disabled .file-card-issues {
    pointer-events: none;
}

/* Files that need re-adding (cached results or orphan pending) */
.file-card.needs-readd {
    background: var(--gray-100);
    border-style: dashed;
    border-color: var(--gray-400);
    opacity: 0.7;
}

.file-card.needs-readd:hover {
    background: var(--gray-200);
    opacity: 0.85;
}

.file-card.needs-readd .file-card-name {
    color: var(--gray-600);
}

.readd-icon {
    font-size: 0.85rem;
    vertical-align: middle;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.file-card-readd-hint {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 0.25rem;
    font-style: italic;
}

.file-card-content {
    flex-grow: 1;
    min-width: 0;
}

.file-card-name {
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.file-card-issues {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.issue-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
}

.issue-badge.high {
    background: var(--priority-high);
}

.issue-badge.medium {
    background: var(--priority-medium);
}

.issue-badge.low {
    background: var(--priority-low);
}

/* File Actions */
.file-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Selection Indicator */
.selection-indicator {
    padding: 0.5rem 1rem;
    background: rgba(69, 123, 157, 0.12);
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-dark);
    text-align: center;
}

.selection-indicator.hidden {
    display: none;
}

/* Selection Hint */
.selection-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.7rem;
    color: var(--gray-500);
}

.selection-hint .hint-icon {
    font-size: 0.85rem;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.sort-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.btn-sort {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}

.btn-sort:hover {
    background: var(--gray-100);
}

.btn-sort.active {
    background: var(--accent-dark);
    color: var(--white);
    border-color: var(--accent-dark);
}

/* ============================================
   Results Panel
   ============================================ */
.results-empty {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    padding: 2rem;
    text-align: center;
}

.results-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.results-content.hidden {
    display: none;
}

/* Metrics Row */
.metrics-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-box {
    flex: 1;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    color: var(--white);
}

.metric-box.records {
    background: var(--dark);
}

.metric-box.issues {
    background: var(--priority-medium);
}

.metric-box.high {
    background: var(--priority-high);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Summary Text */
.summary-text {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent-dark);
}

.summary-text p {
    margin-bottom: 0.75rem;
}

.summary-text p:last-child {
    margin-bottom: 0;
}

/* Priority Issues */
.priority-issues {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.priority-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
}

.priority-indicator.high {
    background: rgba(230, 57, 70, 0.1);
    color: var(--priority-high);
}

.priority-indicator.medium {
    background: rgba(204, 119, 34, 0.1);
    color: var(--priority-medium);
}

.priority-indicator.low {
    background: rgba(70, 130, 180, 0.1);
    color: var(--priority-low);
}

.priority-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.priority-dot.high {
    background: var(--priority-high);
}

.priority-dot.medium {
    background: var(--priority-medium);
}

.priority-dot.low {
    background: var(--priority-low);
}

/* Assessment Details */
.assessment-details,
.next-steps-details {
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.assessment-details summary,
.next-steps-details summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.assessment-details[open] summary,
.next-steps-details[open] summary {
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius) var(--radius) 0 0;
}

.assessment-content,
.next-steps-content {
    padding: 1rem;
}

/* Assessment Items */
.assessment-section {
    margin-bottom: 1.5rem;
}

.assessment-section:last-child {
    margin-bottom: 0;
}

.assessment-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid;
}

.assessment-section-title.high {
    color: var(--priority-high);
    border-color: var(--priority-high);
}

.assessment-section-title.medium {
    color: var(--priority-medium);
    border-color: var(--priority-medium);
}

.assessment-section-title.low {
    color: var(--priority-low);
    border-color: var(--priority-low);
}

.assessment-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border-left: 3px solid;
}

.assessment-item.high {
    background: rgba(230, 57, 70, 0.05);
    border-color: var(--priority-high);
}

.assessment-item.medium {
    background: rgba(204, 119, 34, 0.05);
    border-color: var(--priority-medium);
}

.assessment-item.low {
    background: rgba(70, 130, 180, 0.05);
    border-color: var(--priority-low);
}

/* Next Steps */
.next-steps-content h4 {
    font-size: 0.875rem;
    margin: 1rem 0 0.5rem 0;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.next-steps-content h4:first-child {
    margin-top: 0;
}

.next-steps-content ul {
    margin-bottom: 1rem;
}

.next-steps-content li {
    margin-bottom: 0.375rem;
}

/* ============================================
   Footer
   ============================================ */
/* ============================================
   Action Toolbar (fixed below header)
   ============================================ */
.action-toolbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-content {
    max-width: 1400px;
    margin: 0 auto;
}

.progress-section {
    margin-bottom: 0.75rem;
}

.progress-section.hidden {
    display: none;
}

.progress-bar-container {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 300ms ease;
}

.progress-bar.indeterminate {
    width: 30%;
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

.progress-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
    margin: 0;
}

.status-text {
    text-align: center;
    color: var(--gray-600);
    font-style: italic;
    margin: 0 0 0.75rem 0;
    min-height: 1.25rem;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.spacer {
    flex-grow: 1;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--dark);
    border: 1px solid var(--accent);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent);
}

.btn-analyse {
    background: var(--accent-dark);
    color: var(--white);
}

.btn-analyse:hover:not(:disabled) {
    background: #3D6E8C;
}

.btn-accent {
    background: var(--accent);
    color: var(--dark);
}

.btn-accent:hover:not(:disabled) {
    background: #96C9CC;
}

.btn-warning {
    background: var(--priority-medium);
    color: var(--white);
}

.btn-warning:hover:not(:disabled) {
    background: #B36B1E;
}

.btn-danger {
    background: var(--primary);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: var(--primary-dark);
}

.hidden {
    display: none !important;
}

/* ============================================
   Privacy Badge
   ============================================ */
.privacy-badge {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--dark);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 0.75rem;
    opacity: 0.9;
    z-index: 100;
}

.privacy-badge.hidden {
    display: none;
}

.privacy-icon {
    font-size: 1rem;
}

.privacy-dismiss {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0 0 0.5rem;
    margin-left: 0.25rem;
    opacity: 0.7;
    transition: var(--transition);
}

.privacy-dismiss:hover {
    opacity: 1;
}

/* ============================================
   Mobile Banner
   ============================================ */
.mobile-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--priority-medium);
    color: var(--white);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-align: center;
    z-index: 200;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mobile-banner.hidden {
    display: none !important;
}

.mobile-dismiss {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: var(--transition);
}

.mobile-dismiss:hover {
    opacity: 1;
}

@media (max-width: 1000px) {
    .header-content {
        flex-wrap: wrap;
    }

    .title-section {
        position: static;
        transform: none;
        width: 100%;
        order: 3;
        pointer-events: auto;
    }
}

@media (max-width: 900px) {
    .mobile-banner:not(.hidden) {
        display: flex;
    }
    
    body {
        padding-top: 2.5rem;
    }

    body.banner-dismissed {
        padding-top: 0;
    }   
}

/* ============================================
   Modals
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-small {
    max-width: 400px;
}

.modal-large {
    max-width: 900px;
}

/* Sticky header modal variant */
.modal-with-sticky-header {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.modal-with-sticky-header .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
    flex-shrink: 0;
}

.modal-with-sticky-header .modal-header h2 {
    margin: 0;
    padding: 0;
}

.modal-with-sticky-header .modal-header .modal-close {
    position: static;
}

.modal-with-sticky-header .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* ============================================
   Methodology Modal Specific Styles
   ============================================ */
.priority-grid {
    margin: 1rem 0;
    overflow-x: auto;
}

.methodology-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.methodology-table th,
.methodology-table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.methodology-table th {
    background: var(--gray-100);
    font-weight: 600;
}

.methodology-table .row-header {
    background: var(--gray-100);
    font-weight: 600;
    text-align: left;
}

.methodology-table .priority-high {
    background: rgba(230, 57, 70, 0.15);
    color: var(--priority-high);
    font-weight: 600;
}

.methodology-table .priority-medium {
    background: rgba(204, 119, 34, 0.15);
    color: var(--priority-medium);
    font-weight: 600;
}

.methodology-table .priority-low {
    background: rgba(70, 130, 180, 0.15);
    color: var(--priority-low);
    font-weight: 600;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.filter-controls label {
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-controls select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--white);
}

.analysis-catalogue {
    overflow-x: auto;
    margin-top: 1rem;
}

.catalogue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.catalogue-table th,
.catalogue-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--gray-200);
    vertical-align: top;
}

.catalogue-table th {
    background: var(--gray-100);
    font-weight: 600;
    white-space: nowrap;
}

.catalogue-table tr.hidden-row {
    display: none;
}

.tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-completeness {
    background: #E8F5E9;
    color: #2E7D32;
}

.tag-uniqueness {
    background: #E3F2FD;
    color: #1565C0;
}

.tag-validity {
    background: #FFF3E0;
    color: #EF6C00;
}

.tag-accuracy {
    background: #FCE4EC;
    color: #C2185B;
}

.tag-consistency {
    background: #F3E5F5;
    color: #7B1FA2;
}

.tag-core {
    background: var(--dark);
    color: var(--white);
}

.tag-plausible {
    background: var(--accent-dark);
    color: var(--white);
}

.tag-potential {
    background: var(--gray-500);
    color: var(--white);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary-dark);
}

.modal-content h2 {
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-content h3 {
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem 0;
}

.modal-body {
    color: var(--gray-700);
}

.modal-body p {
    margin-bottom: 0.75rem;
}

.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.confirm-file-list {
    max-height: 150px;
    overflow-y: auto;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.confirm-file-list div {
    padding: 0.25rem 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .file-panel {
        flex: none;
        min-width: auto;
    }

    .results-panel {
        min-width: auto;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .title-section {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        pointer-events: auto;
    }

    .metrics-row {
        flex-wrap: wrap;
    }

    .metric-box {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .priority-issues {
        flex-wrap: wrap;
    }

    .footer-actions,
    .toolbar-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .toolbar-actions .spacer {
        display: none;
    }

    .privacy-badge {
        position: static;
        margin: 1rem auto 0;
        width: fit-content;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .action-toolbar,
    .file-panel,
    .privacy-badge,
    .modal {
        display: none !important;
    }

    .main-content {
        display: block;
    }

    .results-panel {
        border: none;
    }

    .assessment-details,
    .next-steps-details {
        break-inside: avoid;
    }

    .assessment-details[open],
    .next-steps-details[open] {
        display: block;
    }
}

/* ============================================
   Custom Scrollbar Styling (Matching Python)
   ============================================ */

/* 
   Strategy: Use a mid-tone blue that darkens gracefully.
   Python uses #A8DADC (light) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ #457B9D (dark).
   We use #7FBFC4 as base - between the two - so browser 
   auto-darkening stays in pleasant blue range.
*/

/* Webkit browsers (Chrome, Safari, Edge) - has full control */
body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.file-list::-webkit-scrollbar,
.results-content::-webkit-scrollbar,
.analysis-catalogue::-webkit-scrollbar,
.confirm-file-list::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.file-list::-webkit-scrollbar-track,
.results-content::-webkit-scrollbar-track,
.analysis-catalogue::-webkit-scrollbar-track,
.confirm-file-list::-webkit-scrollbar-track {
    background: var(--secondary);
    border-radius: 6px;
}

body::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb,
.results-content::-webkit-scrollbar-thumb,
.analysis-catalogue::-webkit-scrollbar-thumb,
.confirm-file-list::-webkit-scrollbar-thumb {
    background: #7FBFC4;
    border-radius: 6px;
    min-height: 30px;
}

body::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.file-list::-webkit-scrollbar-thumb:hover,
.results-content::-webkit-scrollbar-thumb:hover,
.analysis-catalogue::-webkit-scrollbar-thumb:hover,
.confirm-file-list::-webkit-scrollbar-thumb:hover {
    background: #5A9EA3;
}

body::-webkit-scrollbar-thumb:active,
.modal-content::-webkit-scrollbar-thumb:active,
.file-list::-webkit-scrollbar-thumb:active,
.results-content::-webkit-scrollbar-thumb:active,
.analysis-catalogue::-webkit-scrollbar-thumb:active,
.confirm-file-list::-webkit-scrollbar-thumb:active {
    background: var(--accent-dark);
}

/* Firefox - only apply scrollbar-color where webkit isn't supported */
@supports not selector(::-webkit-scrollbar) {
    html {
        scrollbar-width: auto;
        scrollbar-color: #5A9EA3 var(--secondary);
    }
    
    .modal-content,
    .file-list,
    .results-content,
    .analysis-catalogue,
    .confirm-file-list {
        scrollbar-width: auto;
        scrollbar-color: #5A9EA3 var(--secondary);
    }
}

/* ============================================
   Calculation Cell Styling
   ============================================ */
.calc-cell {
    font-size: 0.75rem;
}

.calc-cell code {
    background: var(--gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    color: var(--dark);
    white-space: nowrap;
}