﻿:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --text: #1c1f24;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-100: #e2e8ff;
    --success-100: #ecfdf5;
    --danger-100: #fef2f2;
    --radius: 14px;
    --shadow-sm: 0 2px 10px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
    --focus: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1217;
        --surface: #151922;
        --text: #e5e7eb;
        --muted: #9aa3b2;
        --border: #252a34;
        --primary: #60a5fa;
        --primary-600: #3b82f6;
        --primary-100: rgba(96,165,250,0.12);
        --success-100: rgba(16,185,129,0.12);
        --danger-100: rgba(239,68,68,0.12);
        --shadow-sm: 0 2px 10px rgba(0,0,0,0.4);
        --shadow-md: 0 10px 30px rgba(0,0,0,0.5);
    }
}

html, body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.content {
    padding-top: 1rem;
}

h1, h2, h3, h4 {
    margin: 0 0 .75rem;
}

    h1:focus {
        outline: none;
    }

a, .btn-link {
    color: var(--primary);
    text-decoration: none;
}

    a:hover, .btn-link:hover {
        color: var(--primary-600);
    }

.card {
    border: none;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    border: none;
    background: linear-gradient(180deg, var(--surface), rgba(0,0,0,0.02));
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

    .card-header h3 {
        font-size: 1.15rem;
        font-weight: 650;
        letter-spacing: .2px;
        margin: 0;
    }

.card-body {
    padding: 1.25rem;
}

.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .form-control:focus,
    .form-select:focus,
    .btn:focus,
    .btn:active:focus,
    .form-check-input:focus,
    .btn-link.nav-link:focus {
        border-color: var(--primary);
        box-shadow: var(--focus);
        outline: none;
    }

.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: .2px;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

    .btn-primary:hover {
        background-color: var(--primary-600);
        border-color: var(--primary-600);
    }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

    .btn-secondary:hover {
        background: rgba(0,0,0,0.03);
        border-color: var(--primary);
    }

.alert {
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

    .alert strong {
        font-weight: 700;
    }

.alert-success {
    background: var(--success-100);
    color: var(--text);
    border-color: transparent;
}

.alert-danger {
    background: var(--danger-100);
    color: var(--text);
    border-color: transparent;
}

.alert-info {
    background: var(--primary-100);
    color: var(--text);
    border-color: transparent;
}

.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.table {
    color: var(--text);
}

.upload-area {
    border: 1.5px dashed var(--border);
    border-radius: calc(var(--radius) - 4px);
    padding: 1.25rem;
    background: var(--surface);
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

    .upload-area:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow-sm);
        background: var(--primary-100);
    }

    .upload-area .form-control {
        background: var(--surface);
    }

    .upload-area .file-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 16px;
        opacity: 0.6;
    }

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar main";
    min-height: 100vh;
    background: var(--bg);
}

.app-topbar {
    grid-area: topbar;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 .75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.topbar-burger {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text);
    padding: .25rem .5rem;
    border-radius: 8px;
}

    .topbar-burger:hover {
        background: rgba(0,0,0,.05);
    }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .2px;
}

    .brand i {
        font-size: 1.1rem;
        color: var(--primary);
    }

.brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 0px;
    margin-right: 8px;
}

.topbar-right {
    margin-left: auto;
}

.badge.subtle {
    padding: .25rem .5rem;
    border-radius: 999px;
    background: var(--primary-100);
    color: var(--text);
    font-size: .8rem;
    border: 1px solid var(--border);
}

.app-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 56px;
    align-self: start;
    height: calc(100vh - 56px);
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: .75rem;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-section-title {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    padding: .5rem .75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .75rem;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

    .nav-link i {
        font-size: 1rem;
        width: 1.25rem;
        text-align: center;
    }

    .nav-link:hover {
        background: var(--primary-100);
    }

    .nav-link.active {
        background: var(--primary-100);
        color: var(--primary);
        border: 1px solid var(--primary-100);
        box-shadow: inset 0 0 0 1px rgba(37,99,235,0.08);
    }

.app-main {
    grid-area: main;
    padding: 1rem;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.processing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--primary-100);
    border-radius: 10px;
    margin: 16px 0;
}

.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: .15rem;
}

.chart-container {
    position: relative;
    height: 380px;
    padding: 20px;
}

.error-check-summary {
    margin-top: 1rem;
}

.error-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.error-summary-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--surface);
    transition: all 0.2s ease;
}

    .error-summary-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .error-summary-card.has-error {
        border-color: #ef4444;
        background: rgba(239, 68, 68, 0.05);
    }

    .error-summary-card.no-error {
        border-color: #10b981;
        background: rgba(16, 185, 129, 0.05);
    }

.error-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
}

.error-summary-card.has-error .error-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.error-summary-card.no-error .error-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.error-content {
    flex: 1;
    min-width: 0;
}

.error-title {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.error-count {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.error-summary-card.has-error .error-count {
    color: #ef4444;
}

.error-summary-card.no-error .error-count {
    color: #10b981;
}

.error-subtitle {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.error-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.2s ease;
}

    .error-check-item i {
        font-size: 1.5rem;
    }

    .error-check-item.has-error {
        border-color: #ef4444;
        background: rgba(239, 68, 68, 0.05);
    }

        .error-check-item.has-error i {
            color: #ef4444;
        }

    .error-check-item.no-error {
        border-color: #10b981;
        background: rgba(16, 185, 129, 0.05);
    }

        .error-check-item.no-error i {
            color: #10b981;
        }

.text-editor-input {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

    .text-editor-input:focus {
        background: var(--surface) !important;
        color: var(--text) !important;
        border-color: var(--primary);
        box-shadow: var(--focus);
    }

    .text-editor-input::placeholder {
        color: var(--muted);
        opacity: 0.6;
    }

.text-editor-table {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

    .text-editor-table .table {
        margin-bottom: 0;
        color: var(--text);
    }

    .text-editor-table thead {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        color: #ffffff;
        border-bottom: 2px solid var(--primary);
    }

        .text-editor-table thead th {
            border: none;
            padding: 1rem;
            font-weight: 600;
            font-size: 0.95rem;
            color: #ffffff;
        }

    .text-editor-table tbody tr {
        border-bottom: 1px solid var(--border);
    }

    .text-editor-table tbody td {
        padding: 0.875rem 1rem;
        color: var(--text);
        vertical-align: middle;
    }

    .text-editor-table tbody tr:hover {
        background: var(--primary-100);
    }

    .text-editor-table .table-striped tbody tr:nth-of-type(odd) {
        background-color: rgba(0, 0, 0, 0.02);
    }

    .text-editor-table .table th:nth-child(1),
    .text-editor-table .table td:nth-child(1) {
        width: 80px;
        min-width: 80px;
    }

    .text-editor-table .table th:nth-child(2),
    .text-editor-table .table td:nth-child(2) {
        width: 220px;
        min-width: 220px;
    }

    .text-editor-table .table th:nth-child(3),
    .text-editor-table .table td:nth-child(3) {
        width: 180px;
        min-width: 180px;
    }

    .text-editor-table .table th:nth-child(4),
    .text-editor-table .table td:nth-child(4) {
        width: auto;
        min-width: 250px;
    }

    .text-editor-table .table {
        table-layout: auto;
        min-width: 100%;
    }

    .text-editor-table .table-responsive {
        overflow-x: auto;
    }

.site-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.btn-format {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

    .btn-format:hover:not(:disabled) {
        background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
        transform: translateY(-2px);
        color: #ffffff;
    }

    .btn-format:active:not(:disabled) {
        transform: translateY(0px);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    .btn-format:disabled {
        background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
        color: rgba(255, 255, 255, 0.4);
        box-shadow: none;
        cursor: not-allowed;
        opacity: 0.6;
        transform: none;
    }

.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

    .btn-export:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
        transform: translateY(-2px);
        color: #ffffff;
    }

    .btn-export:active {
        transform: translateY(0px);
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }

@media (prefers-color-scheme: dark) {
    .btn-format {
        box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
    }

        .btn-format:hover:not(:disabled) {
            box-shadow: 0 6px 16px rgba(96, 165, 250, 0.35);
        }

        .btn-format:disabled {
            background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
            color: rgba(255, 255, 255, 0.3);
            opacity: 0.5;
        }

    .btn-export {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    }

        .btn-export:hover {
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
        }
}

.diagnostic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.15s ease-out;
}

.diagnostic-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 95vw;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease-out;
}

.diagnostic-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface), rgba(0, 0, 0, 0.02));
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 650;
    margin: 0;
    color: var(--text);
}

.track-index-badge {
    background: var(--primary-100);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diagnostic-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.diagnostic-table-container {
    height: 600px;
    overflow: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

.diagnostic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--surface);
}

    .diagnostic-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .diagnostic-table th {
        background: var(--text);
        color: var(--surface);
        padding: 0.75rem 0.5rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-bottom: 2px solid var(--border);
    }

    .diagnostic-table td {
        padding: 0.625rem 0.5rem;
        border-bottom: 1px solid var(--border);
        color: var(--text);
        vertical-align: middle;
    }

    .diagnostic-table tbody tr {
        transition: background-color 0.15s ease;
    }

        .diagnostic-table tbody tr:hover {
            background: rgba(37, 99, 235, 0.04);
        }

        .diagnostic-table tbody tr:nth-child(even) {
            background: rgba(0, 0, 0, 0.02);
        }

            .diagnostic-table tbody tr:nth-child(even):hover {
                background: rgba(37, 99, 235, 0.06);
            }

.target-row {
    background: rgba(245, 158, 11, 0.15) !important;
    border-left: 4px solid #f59e0b;
}

    .target-row:hover {
        background: rgba(245, 158, 11, 0.25) !important;
    }

.target-row-backward {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-left: 4px solid #ef4444;
}

    .target-row-backward:hover {
        background-color: rgba(239, 68, 68, 0.25) !important;
    }

.target-row-save-delay {
    background-color: rgba(37, 99, 235, 0.15) !important;
    border-left: 4px solid #2563eb;
}

    .target-row-save-delay:hover {
        background-color: rgba(37, 99, 235, 0.25) !important;
    }

.track-index-cell {
    font-weight: 600;
    color: var(--primary);
}

.gps-lock-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

    .gps-lock-badge.valid {
        background: rgba(16, 185, 129, 0.15);
        color: #059669;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .gps-lock-badge.invalid {
        background: rgba(239, 68, 68, 0.15);
        color: #dc2626;
        border: 1px solid rgba(239, 68, 68, 0.3);
    }

.hero-section {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--surface) 100%);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    max-width: 800px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .feature-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md), 0 10px 30px rgba(37, 99, 235, 0.1);
    }

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-100);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

    .feature-icon i {
        font-size: 1.75rem;
        color: var(--primary);
    }

.feature-title {
    font-size: 1.5rem;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

    .feature-list li {
        padding: 0.5rem 0;
        padding-left: 1.75rem;
        position: relative;
        color: var(--text);
    }

        .feature-list li::before {
            content: "✓";
            position: absolute;
            left: 0;
            color: var(--primary);
            font-weight: bold;
        }

.getting-started-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.step-content p {
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

.key-feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

    .key-feature i {
        font-size: 1.5rem;
        margin-top: 0.25rem;
    }

    .key-feature h5 {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: var(--text);
    }

    .key-feature p {
        color: var(--muted);
        margin: 0;
        font-size: 0.9rem;
    }

.error-ui {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.error-card {
    background: var(--danger-100);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: .9rem 1rem;
    width: min(800px, 92vw);
}

.blazor-error-boundary {
    background: #b32121;
    color: #fff;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10b981;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #ef4444;
    font-size: .9rem;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
    width: 1.05rem;
    height: 1.05rem;
}

.layout-file-upload-card {
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-color-scheme: dark) {
    .topbar-burger:hover {
        background: rgba(255,255,255,.06);
    }

    .nav-link:hover {
        background: rgba(96,165,250,.12);
    }

    .nav-link.active {
        border-color: rgba(96,165,250,.22);
        box-shadow: inset 0 0 0 1px rgba(96,165,250,.18);
    }

    .diagnostic-modal {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    }

    .diagnostic-table th {
        background: #1f2937;
        color: #f9fafb;
    }

    .diagnostic-table tbody tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.02);
    }

        .diagnostic-table tbody tr:nth-child(even):hover {
            background: rgba(96, 165, 250, 0.08);
        }

    .target-row {
        background: rgba(255, 193, 7, 0.1) !important;
    }

        .target-row:hover {
            background: rgba(255, 193, 7, 0.15) !important;
        }

    .text-editor-table thead {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-bottom: 2px solid #3b82f6;
    }

    .text-editor-table .table-striped tbody tr:nth-of-type(odd) {
        background-color: rgba(255, 255, 255, 0.02);
    }

    .text-editor-table tbody tr:hover {
        background: rgba(37, 99, 235, 0.15);
    }

    .btn-format {
        box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
    }

        .btn-format:hover:not(:disabled) {
            box-shadow: 0 6px 16px rgba(96, 165, 250, 0.35);
        }

    .btn-export {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    }

        .btn-export:hover {
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
        }
}

@media (min-width: 1200px) {
    .container {
        max-width: 900px;
    }

    .page-container {
        max-width: 1400px;
    }
}

@media (max-width: 1400px) {
    .error-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 56px auto 1fr;
        grid-template-areas:
            "topbar"
            "sidebar"
            "main";
    }

    .topbar-burger {
        display: inline-block;
    }

    .app-sidebar {
        height: auto;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        transition: max-height .2s ease, padding .2s ease;
    }

        .app-sidebar.open {
            max-height: 60vh;
            padding: .75rem;
        }

    .error-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .step {
        flex-direction: column;
    }

    .diagnostic-modal {
        width: 98vw;
        max-height: 95vh;
    }

    .diagnostic-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .modal-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .diagnostic-table-container {
        height: 500px;
    }

    .diagnostic-table th,
    .diagnostic-table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.8rem;
    }

    .brand-logo {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .brand span {
        font-size: 0.9rem;
    }

    .error-summary-grid {
        grid-template-columns: 1fr;
    }
}