/* ==========================================
   Textile QC System - Professional Light Theme
   ========================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   Header
   ========================================== */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.header-title h1 {
    font-size: 1.25rem;
    color: #0066cc;
    font-weight: 700;
}

.header-title .subtitle {
    font-size: 0.8rem;
    color: #64748b;
}

.version-badge {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==========================================
   Code Download Button & Dropdown
   ========================================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================
   Language Toggle Switch
   ========================================== */
.language-toggle-container {
    display: flex;
    align-items: center;
}

.language-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-flag-side {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    filter: grayscale(0.3);
}

.toggle-flag-side .flag-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active flag styling - Turkish selected */
.language-toggle-wrapper.lang-tr-active .toggle-flag-tr {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}

.language-toggle-wrapper.lang-tr-active .toggle-flag-tr .flag-img {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

/* Active flag styling - English selected */
.language-toggle-wrapper.lang-en-active .toggle-flag-en {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}

.language-toggle-wrapper.lang-en-active .toggle-flag-en .flag-img {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.language-toggle-switch {
    position: relative;
    width: 70px;
    height: 36px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    order: 2;
}

.language-toggle-switch:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 20px;
}

.toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 20px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.language-toggle-switch:hover .toggle-track {
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.12);
}

.language-toggle-switch.toggle-active .toggle-track {
    background: linear-gradient(135deg, #0066cc 0%, #0088ff 100%);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 102, 204, 0.3);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 50%;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 -1px 2px rgba(255, 255, 255, 0.8);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.language-toggle-switch.toggle-active .toggle-slider {
    transform: translateX(34px);
    box-shadow:
        0 3px 10px rgba(0, 102, 204, 0.25),
        0 1px 4px rgba(0, 102, 204, 0.2),
        inset 0 -1px 2px rgba(255, 255, 255, 0.9);
}

/* Flag positioning */
.toggle-flag-tr {
    order: 1;
}

.toggle-flag-en {
    order: 3;
}

/* Hover effect on flags */
.toggle-flag-side:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.language-toggle-wrapper.lang-tr-active .toggle-flag-tr:hover,
.language-toggle-wrapper.lang-en-active .toggle-flag-en:hover {
    opacity: 1;
    filter: grayscale(0);
}

/* Hover effect on toggle */
.language-toggle-switch:hover .toggle-slider {
    transform: scale(1.05);
}

.language-toggle-switch.toggle-active:hover .toggle-slider {
    transform: translateX(34px) scale(1.05);
}

/* Active/pressed state */
.language-toggle-switch:active .toggle-slider {
    transform: scale(0.95);
}

.language-toggle-switch.toggle-active:active .toggle-slider {
    transform: translateX(34px) scale(0.95);
}

/* Google Colab Logo */
.colab-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

/* ==========================================
   Feedback Header Button
   ========================================== */
.btn-feedback-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ea580c;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.08), rgba(249, 115, 22, 0.12));
    border: 2px solid rgba(234, 88, 12, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    white-space: nowrap;
}

.btn-feedback-header:hover {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.15), rgba(249, 115, 22, 0.2));
    border-color: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

.btn-feedback-header:active {
    transform: translateY(0);
}


/* ==========================================
   Datasheet Download Button (Red)
   ========================================== */
.datasheet-download-container {
    position: relative;
    margin-left: 12px;
}

.btn-datasheet-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(239, 68, 68, 0.12));
    border: 2px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    white-space: nowrap;
}

.btn-datasheet-download:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(239, 68, 68, 0.2));
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-datasheet-download:active {
    transform: translateY(0);
}

.btn-datasheet-download .chevron {
    transition: transform 0.25s ease;
}

.btn-datasheet-download.active .chevron {
    transform: rotate(180deg);
}

.datasheet-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 320px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.datasheet-dropdown.show,
.datasheet-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================
   Language Dropdown
   ========================================== */
.lang-dropdown-container {
    position: relative;
}

.btn-lang-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(0, 136, 255, 0.04));
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0066cc;
}

.btn-lang-dropdown:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.15), rgba(0, 136, 255, 0.1));
    border-color: #0066cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.btn-lang-dropdown .lang-flag {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-lang-dropdown .chevron {
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.btn-lang-dropdown.active .chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 102, 204, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

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

.lang-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.04), rgba(0, 136, 255, 0.08));
}

.lang-dropdown-item.active {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(0, 136, 255, 0.12));
}

.lang-dropdown-item .lang-flag {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lang-dropdown-item span {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a202c;
}

.lang-dropdown-item .lang-check {
    color: #0066cc;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lang-dropdown-item.active .lang-check {
    opacity: 1;
}

/* Report Language Dropdown in Settings */
.report-lang-dropdown-container {
    position: relative;
}

.btn-report-lang-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    min-width: 160px;
}

.btn-report-lang-dropdown:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.btn-report-lang-dropdown .report-lang-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

.btn-report-lang-dropdown .chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    color: #94a3b8;
}

.report-lang-dropdown-container.open .btn-report-lang-dropdown .chevron {
    transform: rotate(180deg);
}

.report-lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.report-lang-dropdown-container.open .report-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.report-lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    transition: background 0.15s ease;
}

.report-lang-dropdown-item:first-child {
    border-radius: 10px 10px 0 0;
}

.report-lang-dropdown-item:last-child {
    border-radius: 0 0 10px 10px;
}

.report-lang-dropdown-item:hover {
    background: #f1f5f9;
}

.report-lang-dropdown-item.active {
    background: #eff6ff;
    color: #3b82f6;
}

.report-lang-dropdown-item .report-lang-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

.report-lang-dropdown-item .lang-check {
    margin-left: auto;
    color: #3b82f6;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.report-lang-dropdown-item.active .lang-check {
    opacity: 1;
}

.dropdown-header {
    padding: 14px 18px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8fafc;
}

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

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.04), rgba(0, 136, 255, 0.08));
}

.dropdown-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.dropdown-item-left svg {
    color: #0066cc;
    flex-shrink: 0;
}

.dropdown-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a202c;
}

.dropdown-item-desc {
    font-size: 0.75rem;
    color: #64748b;
}

.btn-help {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-help:hover {
    background: #0066cc;
    border-color: #0066cc;
    color: white;
    transform: scale(1.08);
}

/* ==========================================
   Help Dialog
   ========================================== */
.help-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.help-dialog {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.help-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    position: relative;
}

.help-dialog-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.help-dialog-icon svg {
    width: 20px;
    height: 20px;
}

.help-dialog-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    min-width: 0;
}

.help-dialog-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.help-dialog-close:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.help-dialog-close:active {
    transform: scale(1.05);
}

.help-dialog-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.help-dialog-body h4 {
    font-size: 0.95rem;
    color: #1a202c;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-dialog-body p {
    color: #475569;
    line-height: 1.6;
    margin: 0 0 12px;
    font-size: 0.875rem;
}

.help-dialog-body ul {
    margin: 0 0 12px;
    padding-left: 18px;
}

.help-dialog-body li {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.help-dialog-body .highlight-box {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.06), rgba(0, 136, 255, 0.1));
    border-left: 4px solid #0066cc;
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    margin-top: 12px;
}

.help-dialog-body .highlight-box p {
    margin: 0;
    color: #0066cc;
    font-weight: 500;
    font-size: 0.8rem;
}

/* GitHub Help Content Styles */
.github-help-content {
    color: #1a202c;
}

.github-help-content h4 {
    font-size: 0.95rem;
    color: #1a202c;
    margin: 0 0 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.github-description {
    color: #475569;
    line-height: 1.6;
    margin: 0 0 16px;
    font-size: 0.85rem;
}

.github-info-box {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.04), rgba(0, 136, 255, 0.08));
    border-radius: 10px;
    padding: 12px;
    margin: 14px 0;
    border: 1px solid rgba(0, 102, 204, 0.1);
}

.github-info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    color: #334155;
    font-size: 0.8rem;
    line-height: 1.5;
}

.github-info-item:last-child {
    margin-bottom: 0;
}

.github-info-item svg {
    color: #0066cc;
    margin-top: 2px;
}

.github-contact-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.github-contact-section h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.github-contact-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.github-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.4;
}

.github-contact-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.github-contact-item svg {
    color: #0066cc;
    flex-shrink: 0;
}

.github-email-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.github-email-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* GitHub dropdown item styling */
.dropdown-item-github {
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
    padding-top: 12px;
}

.dropdown-item-github:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.04), rgba(0, 136, 255, 0.08));
}

.help-dialog-footer {
    padding: 14px 20px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-header h2 {
    color: #0066cc;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.page-header p {
    color: #64748b;
}

/* ==========================================
   Image Viewer
   ========================================== */
.image-viewer-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

.image-viewer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 450px;
}

.viewer-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
}

.viewer-panel:last-child {
    border-right: none;
}

.panel-header {
    background: #f8fafc;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.ref {
    background: #0066cc;
}

.dot.sample {
    background: #00c853;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-info-name {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    max-width: 180px;
    margin: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 10px;
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.08), rgba(100, 116, 139, 0.04));
    border-radius: 6px;
}

.panel-info-name:empty {
    display: none;
}

.panel-info-right {
    display: flex;
    align-items: center;
}

.panel-info-dimensions {
    display: none;
    font-size: 0.72rem;
    color: #64748b;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    padding: 2px 8px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 4px;
    white-space: nowrap;
}

.panel-info-empty {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

.panel-content {
    flex: 1;
    display: block;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
    /* CRITICAL: No centering, no min-height - container fits image exactly */
}

/* Upload Placeholder */
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 12px;
}

.upload-placeholder:hover {
    background: rgba(0, 102, 204, 0.05);
}

.upload-placeholder:hover svg {
    color: #0066cc;
    transform: translateY(-4px);
}

.upload-placeholder svg {
    color: #94a3b8;
    transition: all 0.2s;
}

.upload-placeholder span {
    font-weight: 500;
    color: #475569;
}

.upload-placeholder small {
    color: #94a3b8;
}

/* Image Preview */
.image-preview {
    display: block;
    width: 100%;
    height: auto;
    /* CRITICAL: No object-fit, no max constraints - image displays at actual size */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Image Info Bar - Displayed below header, outside image area */
.image-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 1px solid #cbd5e1;
    font-size: 0.82rem;
}

.image-info-bar .info-name {
    color: #1e293b;
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-info-bar .info-dimensions {
    color: #475569;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    padding: 4px 10px;
    background: rgba(0, 102, 204, 0.12);
    border-radius: 6px;
    letter-spacing: 0.02em;
    font-weight: 500;
}

/* Region Selection Overlay */
.region-overlay,
.shape-overlay {
    position: absolute;
    pointer-events: none;
    border: 3px solid #00d4ff;
    /* CRITICAL: No transform - JavaScript handles centering */
    opacity: 0;
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 0 4px rgba(0, 212, 255, 0.3),
        0 0 30px rgba(0, 212, 255, 0.4),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    width: 100px;
    height: 100px;
    z-index: 10;
    cursor: grab;
    overflow: visible;
}

.region-overlay.placed,
.shape-overlay.placed {
    pointer-events: auto;
    opacity: 1;
}

.region-overlay.dragging,
.shape-overlay.dragging {
    cursor: grabbing;
    border-color: #00ff88;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 1),
        0 0 0 4px rgba(0, 255, 136, 0.5),
        0 0 40px rgba(0, 255, 136, 0.6),
        inset 0 0 30px rgba(0, 255, 136, 0.15);
}

.region-overlay:hover,
.shape-overlay.placed:hover {
    border-color: #00ff88;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 1),
        0 0 0 4px rgba(0, 255, 136, 0.4),
        0 0 35px rgba(0, 255, 136, 0.5),
        inset 0 0 25px rgba(0, 255, 136, 0.12);
}

.shape-overlay.circle,
.region-overlay.circle {
    border-radius: 50%;
}

/* Pen (Freehand) dimension notice in modal */
.pen-dimension-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 120, 212, 0.08);
    border: 1px solid rgba(0, 120, 212, 0.2);
    border-radius: 8px;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    line-height: 1.4;
}

/* Pen draw canvas (overlaid on image panels) */
.pen-draw-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 12;
    pointer-events: none;
}

/* Region Dimmer - darkens area outside selection */
/* CRITICAL: Position and size are set dynamically by JavaScript to match the actual image */
.region-dimmer {
    position: absolute;
    /* top, left, width, height set by JavaScript to match image exactly */
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.region-dimmer.active {
    opacity: 1;
}

/* Crosshair in center of selection */
.region-overlay::before,
.region-overlay::after,
.shape-overlay::before,
.shape-overlay::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.region-overlay::before,
.shape-overlay::before {
    width: 1px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.region-overlay::after,
.shape-overlay::after {
    width: 12px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================================
   Controls Section
   ========================================== */
.controls-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.shape-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.shape-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.shape-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.shape-option:hover {
    background: #e2e8f0;
}

.shape-option.active {
    background: rgba(0, 102, 204, 0.1);
    border-color: #0066cc;
}

.shape-option.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.shape-option input {
    width: 16px;
    height: 16px;
    accent-color: #0066cc;
}

.shape-option svg {
    width: 20px;
    height: 20px;
    color: #0066cc;
}

.shape-option span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Size Slider */
.size-slider-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.size-slider-container.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.size-slider-container label {
    font-weight: 500;
    color: #475569;
    font-size: 0.9rem;
}

/* Single Image Option */
.single-image-option-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.single-image-option-container .shape-option {
    width: auto;
}

/* Single Image Mode */
.image-viewer.single-image-mode {
    grid-template-columns: 1fr;
    justify-items: center;
}

.image-viewer.single-image-mode .viewer-panel:first-child {
    display: none;
}

.image-viewer.single-image-mode .viewer-panel:last-child {
    border-right: none;
    max-width: 80%;
    width: 80%;
    margin: 0 auto;
}

.viewer-panel {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.viewer-panel.hiding {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

.viewer-panel.centering {
    animation: slideToCenter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideToCenter {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(0);
        max-width: 100%;
    }
}

.panel-title .dot.single {
    background: #7c3aed;
}

.size-slider-container input[type="range"] {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.size-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

.size-value {
    font-family: monospace;
    font-weight: 600;
    color: #0066cc;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    min-width: 70px;
    text-align: center;
}

/* Region Selection Hint */
.region-hint {
    width: 100%;
    text-align: center;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 255, 136, 0.05));
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.region-hint small {
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.region-hint small::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00d4ff;
    border-radius: 50%;
    animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Main Buttons */
.main-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 200, 83, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff3d00, #ff6e40);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 61, 0, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 61, 0, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    color: #0066cc;
    border: 2px solid #0066cc;
}

.btn-outline:hover:not(:disabled) {
    background: #0066cc;
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ==========================================
   Results Section
   ========================================== */
.results-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.results-header h2 {
    color: #1a202c;
}

.decision-badge {
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.decision-badge.accept {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: white;
}

.decision-badge.conditional {
    background: linear-gradient(135deg, #ffb300, #ffc107);
    color: #1a202c;
}

.decision-badge.reject {
    background: linear-gradient(135deg, #ff3d00, #ff6e40);
    color: white;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.result-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #64748b;
}

.card-header svg {
    color: #0066cc;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: monospace;
    color: #0066cc;
    margin-bottom: 12px;
}

.card-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.bar-fill.success {
    background: linear-gradient(90deg, #00c853, #69f0ae);
}

.bar-fill.warning {
    background: linear-gradient(90deg, #ffb300, #ffe082);
}

.bar-fill.danger {
    background: linear-gradient(90deg, #ff3d00, #ff8a65);
}

.results-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ==========================================
   Detailed Results Panel
   ========================================== */
.web-results-detail { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

/* Collapsible Sections */
.wrpt-collapse { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.wrpt-collapse-hdr { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 14px; font-weight: 600; color: #1a202c; cursor: pointer; user-select: none; background: #f8fafc; transition: background 0.12s; }
.wrpt-collapse-hdr:hover { background: #edf2f7; }
.wrpt-collapse-hdr.open { border-bottom: 1px solid #e2e8f0; }
.wrpt-collapse-icon { transition: transform 0.2s ease; flex-shrink: 0; color: #94a3b8; }
.wrpt-collapse-body { padding: 14px 18px; font-size: 13px; }

/* Summary Grid */
.wrpt-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.wrpt-summary-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; transition: border-color 0.15s, box-shadow 0.15s; }
.wrpt-summary-card:hover { border-color: #0066cc; box-shadow: 0 2px 8px rgba(0,102,204,0.1); }
.wrpt-summary-icon { flex-shrink: 0; color: #0066cc; margin-top: 2px; }
.wrpt-summary-body { min-width: 0; }
.wrpt-summary-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: #94a3b8; margin-bottom: 4px; }
.wrpt-summary-val { font-size: 15px; font-weight: 700; color: #1a202c; font-family: monospace; }
.wrpt-summary-val.good { color: #00c853; }
.wrpt-summary-val.warn { color: #ffb300; }
.wrpt-summary-val.bad { color: #ff3d00; }

/* KPI Row */
.wrpt-kpi-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.wrpt-kpi { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; }
.wrpt-kpi-label { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; }
.wrpt-kpi-value { font-family: monospace; font-size: 13px; font-weight: 700; color: #1a202c; }
.wrpt-kpi-value.good { color: #00c853; }
.wrpt-kpi-value.warn { color: #ffb300; }
.wrpt-kpi-value.bad { color: #ff3d00; }

/* Info Note */
.wrpt-info-note { font-size: 11px; color: #475569; background: #f0f7ff; border-left: 3px solid #0284c7; border-radius: 0 6px 6px 0; padding: 8px 12px; margin: 8px 0 12px; line-height: 1.5; }

/* Section Title */
.wrpt-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #0066cc; margin-top: 16px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }

/* Status Badge */
.wrpt-status-badge { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.wrpt-status-badge.good { background: #e8f5e9; color: #2e7d32; }
.wrpt-status-badge.warn { background: #fff8e1; color: #f57f17; }
.wrpt-status-badge.bad { background: #ffebee; color: #c62828; }

/* Stat Rows */
.wrpt-stat-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.wrpt-stat-row:last-child { border-bottom: none; }
.wrpt-stat-label { font-size: 12px; color: #64748b; font-weight: 500; }
.wrpt-stat-value { font-family: monospace; font-size: 13px; font-weight: 600; color: #1a202c; }

/* Data Table */
.wrpt-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.wrpt-table thead th { text-align: left; padding: 8px 8px; background: #f1f5f9; color: #64748b; font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.wrpt-table tbody td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; color: #334155; font-family: monospace; font-size: 11px; white-space: nowrap; }
.wrpt-table tbody tr:hover { background: #f8fafc; }
.wrpt-table td.good { color: #2e7d32; font-weight: 600; }
.wrpt-table td.warn { color: #f57f17; font-weight: 600; }
.wrpt-table td.bad { color: #c62828; font-weight: 600; }
.wrpt-color-chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #e2e8f0; margin-right: 5px; vertical-align: middle; }

/* Pattern Cards Grid */
.wrpt-pattern-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.wrpt-pattern-card { flex: 1; min-width: 120px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; transition: border-color 0.15s; }
.wrpt-pattern-card:hover { border-color: #0066cc; }
.wrpt-pattern-name { font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrpt-pattern-val { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.wrpt-pattern-val.good { color: #00c853; }
.wrpt-pattern-val.warn { color: #ffb300; }
.wrpt-pattern-val.bad { color: #ff3d00; }
.wrpt-mini-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.wrpt-mini-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.wrpt-mini-fill.good { background: #00c853; }
.wrpt-mini-fill.warn { background: #ffb300; }
.wrpt-mini-fill.bad { background: #ff3d00; }

/* Image Gallery */
.wrpt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.wrpt-gallery-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.wrpt-gallery-item:hover { border-color: #0066cc; box-shadow: 0 4px 12px rgba(0,102,204,0.12); }
.wrpt-gallery-title { padding: 8px 12px; font-size: 12px; font-weight: 600; color: #1a202c; background: #f8fafc; border-bottom: 1px solid #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrpt-img-thumb { display: block; width: 100%; height: auto; cursor: pointer; transition: opacity 0.15s; background: #0a0a0a; }
.wrpt-img-thumb:hover { opacity: 0.88; }
.wrpt-gallery-caption { padding: 8px 12px; font-size: 11px; color: #94a3b8; line-height: 1.4; border-top: 1px solid #f1f5f9; }

/* Lightbox */
.wrpt-lightbox { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.wrpt-lb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82); cursor: pointer; }
.wrpt-lb-content { position: relative; z-index: 1; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.wrpt-lb-content img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); object-fit: contain; background: #111; }
.wrpt-lb-close { position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; backdrop-filter: blur(4px); transition: background 0.15s; }
.wrpt-lb-close:hover { background: rgba(255,255,255,0.3); }
.wrpt-lb-label { margin-top: 10px; color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 500; }

/* Decision Banner */
.wrpt-decision-banner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-radius: 8px; margin-bottom: 16px; }
.wrpt-decision-banner.good { background: linear-gradient(135deg, #059669, #10b981); }
.wrpt-decision-banner.warn { background: linear-gradient(135deg, #d97706, #f59e0b); }
.wrpt-decision-banner.bad { background: linear-gradient(135deg, #dc2626, #ef4444); }
.wrpt-decision-label { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.wrpt-decision-id { font-size: 12px; color: rgba(255,255,255,0.8); font-family: monospace; }

/* Score Gauges */
.wrpt-scores-row { display: flex; justify-content: center; gap: 32px; margin: 18px 0; flex-wrap: wrap; }
.wrpt-score-gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wrpt-gauge-ring { position: relative; width: 80px; height: 80px; }
.wrpt-gauge-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wrpt-gauge-fill { stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.wrpt-gauge-ring.good .wrpt-gauge-fill { stroke: #10b981; }
.wrpt-gauge-ring.warn .wrpt-gauge-fill { stroke: #f59e0b; }
.wrpt-gauge-ring.bad .wrpt-gauge-fill { stroke: #ef4444; }
.wrpt-gauge-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #1a202c; }
.wrpt-gauge-label { font-size: 13px; font-weight: 600; color: #1a202c; }
.wrpt-gauge-sub { font-size: 11px; color: #94a3b8; max-width: 100px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Color Comparison Swatches */
.wrpt-color-compare { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 12px 0 16px; flex-wrap: wrap; }
.wrpt-color-swatch-block { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wrpt-swatch { width: 72px; height: 72px; border-radius: 10px; border: 2px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.wrpt-swatch-label { font-size: 12px; font-weight: 600; color: #1a202c; }
.wrpt-swatch-info { font-size: 11px; color: #64748b; font-family: monospace; }
.wrpt-color-arrow { font-size: 24px; color: #94a3b8; font-weight: 300; }

/* Highlight row in tables */
.wrpt-highlight-row { background: #f0fdf4; }

/* Findings Cards */
.wrpt-findings { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.wrpt-finding-card { border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.wrpt-finding-card.good { border-left: 4px solid #10b981; }
.wrpt-finding-card.warn { border-left: 4px solid #f59e0b; }
.wrpt-finding-card.bad { border-left: 4px solid #ef4444; }
.wrpt-finding-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.wrpt-finding-card.good .wrpt-finding-header { background: #ecfdf5; color: #065f46; }
.wrpt-finding-card.warn .wrpt-finding-header { background: #fffbeb; color: #92400e; }
.wrpt-finding-card.bad .wrpt-finding-header { background: #fef2f2; color: #991b1b; }
.wrpt-finding-metric { flex: 1; }
.wrpt-finding-value { font-family: monospace; font-size: 13px; }
.wrpt-finding-eval { padding: 8px 14px; font-size: 12px; color: #334155; line-height: 1.5; background: #f8fafc; }
.wrpt-finding-rec { padding: 8px 14px; font-size: 12px; color: #64748b; line-height: 1.5; border-top: 1px solid #f1f5f9; }

/* Conclusion Block */
.wrpt-conclusion { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 18px; border-radius: 8px; border: 1px solid #e2e8f0; }
.wrpt-conclusion.good { background: #ecfdf5; border-color: #a7f3d0; }
.wrpt-conclusion.warn { background: #fffbeb; border-color: #fde68a; }
.wrpt-conclusion.bad { background: #fef2f2; border-color: #fecaca; }
.wrpt-conclusion-badge { flex-shrink: 0; padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.wrpt-conclusion.good .wrpt-conclusion-badge { background: #059669; }
.wrpt-conclusion.warn .wrpt-conclusion-badge { background: #d97706; }
.wrpt-conclusion.bad .wrpt-conclusion-badge { background: #dc2626; }
.wrpt-conclusion-text { font-size: 13px; color: #334155; line-height: 1.5; }

@media (max-width: 768px) {
    .wrpt-summary-grid { grid-template-columns: 1fr; }
    .wrpt-gallery { grid-template-columns: 1fr; }
    .wrpt-kpi-row { flex-direction: column; }
    .wrpt-scores-row { gap: 16px; }
    .wrpt-color-compare { flex-direction: column; }
    .wrpt-conclusion { flex-direction: column; text-align: center; }
}

/* ==========================================
   Loading Overlay - Compact Modal Design
   ========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 28px 32px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    min-width: 320px;
    max-width: 360px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-content h3 {
    color: #1a202c;
    margin-bottom: 8px;
}

.loading-content p {
    color: #64748b;
}

/* Progress Modal - Compact Sequential Design */
.progress-modal {
    text-align: center;
}

/* Logo at top of progress modal - smaller */
.progress-logo {
    margin-bottom: 16px;
}

.progress-logo img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

/* Percentage display - compact */
.progress-percentage-large {
    font-size: 2rem;
    font-weight: 700;
    color: #0066cc;
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

/* Progress bar container - slim */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066cc 0%, #00a3e0 100%);
    border-radius: 3px;
    transition: width 0.5s ease-out;
    width: 0%;
}

.progress-bar-fill.complete {
    background: #00c853;
}

.progress-bar-glow {
    display: none;
}

/* Status text - smaller */
.progress-status {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 16px;
    min-height: 20px;
    transition: all 0.3s;
}

.progress-status.success {
    color: #00c853;
    font-weight: 600;
}

.progress-status.error {
    color: #ef4444;
    font-weight: 600;
}

/* Steps list - compact sequential layout */
.progress-steps {
    text-align: left;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 4px;
}

.progress-steps .step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #94a3b8;
    font-size: 0.8rem;
    transition: all 0.25s ease;
    position: relative;
    margin-bottom: 4px;
    background: transparent;
}

.progress-steps .step:last-child {
    margin-bottom: 0;
}

/* Step icon wrapper - compact circles */
.step-icon-wrapper {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-icon {
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
}

.step-label {
    flex: 1;
    text-align: left;
}

/* Pending state (default) - gray circle */
.progress-steps .step .step-icon-wrapper {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #94a3b8;
}

.progress-steps .step .step-icon {
    color: #94a3b8;
}

/* Active/Running state - blue with spinner */
.progress-steps .step.active {
    color: #0066cc;
    font-weight: 500;
}

.progress-steps .step.active .step-icon-wrapper {
    background: #0066cc;
    border-color: #0066cc;
    color: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.progress-steps .step.active .step-icon {
    color: white;
    animation: spinStep 0.8s linear infinite;
}

@keyframes spinStep {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Completed state - GREEN with checkmark */
.progress-steps .step.completed {
    color: #16a34a;
}

.progress-steps .step.completed .step-icon-wrapper {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.progress-steps .step.completed .step-icon {
    color: white;
    animation: none;
    font-size: 13px;
}

/* Checkmark pop animation */
@keyframes checkPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.progress-steps .step.completed .step-icon-wrapper {
    animation: checkPop 0.3s ease-out;
}

/* Failed state - red with X */
.progress-steps .step.failed {
    color: #dc2626;
}

.progress-steps .step.failed .step-icon-wrapper {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.progress-steps .step.failed .step-icon {
    color: white;
    animation: none;
}

/* Hide old compatibility styles */
.progress-header,
.progress-percentage {
    display: none;
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.modal-header h2 {
    color: white;
    font-size: 1.25rem;
}

.modal-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Web maintenance modal (analysis disabled — desktop download CTA) */
.web-maintenance-overlay {
    z-index: 10002;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.web-maintenance-card {
    background: #ffffff;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.web-maintenance-body {
    padding: 28px 24px 32px;
    text-align: center;
}

.web-maintenance-hero {
    margin-bottom: 20px;
}

.web-maintenance-brand-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 102, 204, 0.22);
}

.web-maintenance-text {
    color: #475569;
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 24px;
    margin-left: auto;
    margin-right: auto;
    max-width: 42em;
}

.web-maintenance-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
}

.web-maintenance-download .windows-icon {
    flex-shrink: 0;
}

.web-maintenance-header .web-maintenance-logo {
    width: 44px;
    height: 44px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.tab {
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    color: #0066cc;
    background: white;
}

.tab.active {
    color: #0066cc;
    background: white;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0066cc;
    border-radius: 3px 3px 0 0;
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Settings */
.settings-group {
    margin-bottom: 28px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group h3 {
    font-size: 1rem;
    color: #1a202c;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    font-weight: 500;
    color: #475569;
}

.setting-row input[type="number"],
.setting-row input[type="text"] {
    width: 120px;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    text-align: right;
    font-family: monospace;
}

.setting-row input:focus {
    outline: none;
    border-color: #0066cc;
}

.setting-row select {
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    min-width: 160px;
}

.setting-row select:focus {
    outline: none;
    border-color: #0066cc;
}

.setting-row input[type="checkbox"] {
    width: 44px;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-row input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.setting-row input[type="checkbox"]:checked {
    background: #0066cc;
}

.setting-row input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

/* ==========================================
   Enhanced Settings Modal
   ========================================== */
.modal-wide {
    max-width: 960px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* Enhanced Tabs */
.modal-tabs .tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
}

.modal-tabs .tab svg {
    opacity: 0.7;
}

.modal-tabs .tab.active svg {
    opacity: 1;
}

/* Settings Intro */
.settings-intro {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 136, 255, 0.08));
    border: 1px solid rgba(0, 102, 204, 0.15);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.settings-intro p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* Enhanced Settings Group */
.settings-group {
    background: #fafbfc;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 0;
}

.settings-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.settings-group-header svg {
    color: #0066cc;
    flex-shrink: 0;
}

.settings-group-header h3 {
    font-size: 0.95rem;
    color: #1a202c;
    margin: 0;
    padding: 0;
    border: none;
}

.settings-group-desc {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 0 16px 32px;
}

/* Enhanced Setting Row */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-row:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.08);
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row.compact {
    padding: 10px 14px;
    margin-bottom: 6px;
}

.setting-row.compact label {
    font-size: 0.85rem;
}

.setting-row.threshold-row {
    background: linear-gradient(to right, white, #fafbfc);
}

/* Setting Label */
.setting-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label label {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}

.setting-label small {
    color: #94a3b8;
    font-size: 0.75rem;
}

.setting-label small.threshold-pass {
    color: #16a34a;
}

.setting-label small.threshold-conditional {
    color: #ea580c;
}

/* Input with Unit */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-unit input {
    width: 90px !important;
}

.input-with-unit .unit {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 40px;
}

/* Toggle Switch */
/* Toggle Switch */
.toggle-switch {
    display: inline-block;
    width: 44px;
    height: 24px;
    position: relative;
    border-radius: 20px;
    vertical-align: middle;
}

.toggle-switch input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    border-radius: 24px;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    /* Modern Blue */
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* Modal Footer Enhancement */
.modal-footer .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-footer .btn svg {
    flex-shrink: 0;
}

/* Settings Group Highlight */
.settings-group-highlight {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.06), rgba(0, 136, 255, 0.04));
    border: 2px solid rgba(0, 102, 204, 0.2);
}

/* Language Selector in Settings */
.language-selector-container {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.language-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.language-option:hover {
    border-color: #0066cc;
    background: #f8fafc;
}

.language-option.active {
    border-color: #0066cc;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(0, 136, 255, 0.04));
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.language-option .language-flag {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-option .language-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.language-option .language-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.95rem;
}

.language-option .language-desc {
    color: #64748b;
    font-size: 0.75rem;
}

.language-option .language-check {
    color: #0066cc;
    opacity: 0;
    transition: opacity 0.2s;
}

.language-option.active .language-check {
    opacity: 1;
}

/* ==========================================
   Modal Region Controls
   ========================================== */
.modal-shape-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-shape-option {
    flex: 1;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.modal-shape-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal-shape-option svg {
    width: 32px;
    height: 32px;
    color: #64748b;
    transition: all 0.2s ease;
}

.modal-shape-option span {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    transition: color 0.2s ease;
}

.modal-shape-option:hover {
    border-color: #0066cc;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.modal-shape-option:hover svg {
    color: #0066cc;
}

.modal-shape-option.active {
    border-color: #0066cc;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(0, 136, 255, 0.05));
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.modal-shape-option.active svg {
    color: #0066cc;
}

.modal-shape-option.active span {
    color: #0066cc;
    font-weight: 600;
}

/* Modal Dimension Inputs */
.modal-dimension-inputs {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.modal-dimension-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dimension-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}

.dimension-input {
    width: 100%;
    max-width: 150px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    background: white;
    color: #1a202c;
    transition: all 0.2s ease;
}

.dimension-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    background: #fafbfc;
}

.dimension-input:hover {
    border-color: #94a3b8;
}

/* Invalid state */
.dimension-input:invalid {
    border-color: #ef4444;
}

.dimension-input::placeholder {
    color: #94a3b8;
}

/* Chrome, Safari, Edge, Opera - Hide spinner */
.dimension-input::-webkit-outer-spin-button,
.dimension-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox - Hide spinner */
.dimension-input[type=number] {
    -moz-appearance: textfield;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
}

.modal-footer-right {
    display: flex;
    gap: 12px;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #64748b;
    font-size: 0.85rem;
}

.footer img {
    height: 24px;
    opacity: 0.7;
}

.footer-logo {
    height: 32px;
    width: auto;
    opacity: 0.85;
}

.footer-contact-btn {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0066cc;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.footer-contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.footer-contact-btn:hover::before {
    left: 100%;
}

.footer-contact-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 102, 204, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.footer-contact-btn:active {
    transform: translateY(0);
}

/* ==========================================
   Contact Popup
   ========================================== */
.contact-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.contact-popup {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 90%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-popup-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 136, 255, 0.1));
}

.contact-popup-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0066cc;
}

.contact-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.contact-popup-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a202c;
}

.contact-popup-body {
    padding: 32px 24px;
    text-align: center;
}

.contact-email-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 204, 0.2);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.contact-email-container svg {
    color: #0066cc;
    flex-shrink: 0;
}

.contact-email {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-email:hover {
    color: #0052a3;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .contact-popup {
        min-width: auto;
        width: 100%;
        max-width: 90%;
    }

    .contact-popup-body {
        padding: 24px 20px;
    }

    .contact-email-container {
        flex-direction: column;
        gap: 8px;
    }

    .contact-email {
        font-size: 1rem;
        word-break: break-all;
    }
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .image-viewer {
        grid-template-columns: 1fr;
    }

    .viewer-panel {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    .code-dropdown {
        right: 50%;
        transform: translateX(50%) translateY(-8px) scale(0.98);
        min-width: calc(100vw - 48px);
        max-width: 320px;
    }

    .code-dropdown.show {
        transform: translateX(50%) translateY(0) scale(1);
    }

    .btn-code-download span {
        display: none;
    }

    .btn-code-download {
        padding: 8px 12px;
    }

    .main-content {
        padding: 16px;
    }

    .shape-controls {
        flex-direction: column;
        gap: 16px;
    }

    .main-buttons {
        flex-direction: column;
    }

    .main-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .modal {
        margin: 16px;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .setting-row input,
    .setting-row select {
        width: 100%;
    }
}

/* ==========================================
   Sample Tests Side Menu
   ========================================== */
.samples-toggle-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    border: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 102, 204, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.samples-toggle-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.samples-toggle-btn:hover {
    padding-right: 16px;
    box-shadow: 6px 0 25px rgba(0, 102, 204, 0.35);
}

.samples-toggle-btn svg {
    transform: rotate(90deg);
}

/* Sidebar Panel */
.samples-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 360px;
    max-width: 90vw;
    background: white;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.samples-sidebar.open {
    transform: translateX(0);
}

.samples-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
}

.samples-sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.05rem;
}

.samples-sidebar-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.samples-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.samples-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.samples-sidebar-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.samples-sidebar-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.samples-language-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(0, 102, 204, 0.08);
    border-left: 3px solid #0066cc;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #0066cc;
    line-height: 1.5;
}

/* ==========================================
   Feedback Sidebar (Orange/Gold Theme)
   ========================================== */


.feedback-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: white;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-sidebar.active {
    transform: translateX(0);
}

.feedback-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
}

.feedback-sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.05rem;
}

.feedback-sidebar-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.feedback-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.feedback-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1099;
}

.feedback-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Feedback Form Styles */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.feedback-note {
    padding: 12px 16px;
    background: rgba(249, 115, 22, 0.08);
    border-left: 3px solid #f97316;
    border-radius: 8px;
    margin-bottom: 8px;
}

.feedback-note p {
    margin: 0;
    font-size: 0.85rem;
    color: #ea580c;
    line-height: 1.5;
}

.feedback-anonymous-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}



.feedback-fields-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-fields-group.hidden {
    display: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.char-count {
    font-weight: 400;
    color: #64748b;
    font-size: 0.8rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
    max-width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-textarea.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
}

.feedback-attachment-note {
    padding: 14px 16px;
    background: rgba(249, 115, 22, 0.05);
    border-left: 3px solid #f97316;
    border-radius: 8px;
    margin-bottom: 8px;
}

.feedback-attachment-note p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

.feedback-attachment-note a.feedback-email-link {
    color: #f97316;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.feedback-attachment-note a.feedback-email-link:hover {
    color: #ea580c;
    text-decoration: underline;
}

.feedback-form-content {
    display: block;
}

.feedback-form-content.hidden {
    display: none;
}

.feedback-success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.4s ease-out;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: #22c55e;
}

.success-icon svg {
    width: 48px;
    height: 48px;
}

.feedback-success-message h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.feedback-success-message p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 32px 0;
    max-width: 500px;
}

.btn-feedback-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-feedback-new:hover {
    background: linear-gradient(135deg, #ea580c, #f97316);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.btn-feedback-new:active {
    transform: translateY(0);
}

.file-upload-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-input {
    display: none;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.file-upload-label:hover {
    background: #f1f5f9;
    border-color: #f97316;
    color: #f97316;
}

.file-name {
    font-size: 0.85rem;
    color: #64748b;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
}

.btn-feedback-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    margin-top: 8px;
}

.btn-feedback-submit:hover {
    background: linear-gradient(135deg, #ea580c, #f97316);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.btn-feedback-submit:active {
    transform: translateY(0);
}

.btn-feedback-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .feedback-toggle-btn {
        top: 70px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}



/* Sample Card */
.sample-card {
    background: #f8fafc;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
}

.sample-card:hover {
    border-color: rgba(0, 102, 204, 0.3);
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.04), rgba(0, 136, 255, 0.08));
    transform: translateX(4px);
}

.sample-card:last-child {
    margin-bottom: 0;
}

.sample-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sample-card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.sample-card-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #00c853;
    background: rgba(0, 200, 83, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.sample-card-images {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.sample-card-image-wrapper {
    flex: 1;
    position: relative;
}

.sample-card-image-label {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 1;
}

.sample-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.sample-card:hover .sample-card-image {
    border-color: #0066cc;
}

.sample-card-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sample-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.35);
}

.sample-card-btn svg {
    width: 18px;
    height: 18px;
}

/* Overlay */
.samples-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.samples-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Loading state */
.samples-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #64748b;
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Sample Test Mode Indicator */
.sample-test-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.1), rgba(0, 230, 118, 0.15));
    border: 2px solid #00c853;
    border-radius: 10px;
    margin-bottom: 16px;
}

.sample-test-indicator.show {
    display: flex;
}

.sample-test-indicator svg {
    color: #00c853;
    flex-shrink: 0;
}

.sample-test-indicator span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00c853;
}

/* ==========================================
   Development Modal
   ========================================== */
.development-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.development-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.development-modal-header {
    text-align: center;
    padding: 40px 40px 30px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 136, 255, 0.1));
    border-radius: 20px 20px 0 0;
    border-bottom: 2px solid rgba(0, 102, 204, 0.1);
}

.development-logo-container {
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.development-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 102, 204, 0.2));
}

.development-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0066cc;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    text-shadow: 0 2px 4px rgba(0, 102, 204, 0.1);
}

.development-message {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.development-modal-body {
    padding: 30px 40px;
}

.development-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.development-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
    margin: 0;
}

.development-logos-section {
    margin-top: 10px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.development-logos-note {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 16px 0;
    font-style: italic;
}

.development-logos-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-logo-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0066cc;
    background: #ffffff;
    border: 2px solid rgba(0, 102, 204, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    text-align: left;
}

.btn-logo-download:hover {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(0, 136, 255, 0.12));
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.btn-logo-download:active {
    transform: translateY(0);
}

.btn-logo-download svg {
    flex-shrink: 0;
}

.development-code-section {
    margin-top: 20px;
    padding: 20px;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
}

.development-code-section h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.development-code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 16px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.development-copy-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.development-copy-instruction {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin: 0;
    text-align: center;
    font-style: italic;
}

.btn-copy-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-copy-code:hover {
    background: linear-gradient(135deg, #0052a3, #0066cc);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.btn-copy-code:active {
    transform: translateY(0);
}

.development-modal-footer {
    padding: 30px 40px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.development-modal-footer .btn {
    min-width: 180px;
}

@media (max-width: 768px) {
    .development-modal {
        max-width: 100%;
        margin: 10px;
        max-height: 95vh;
    }

    .development-modal-header {
        padding: 30px 20px 20px;
    }

    .development-logo {
        width: 80px;
        height: 80px;
    }

    .development-title {
        font-size: 1.5rem;
    }

    .development-modal-body {
        padding: 20px;
    }

    .development-modal-footer {
        padding: 20px;
        flex-direction: column;
    }

    .development-modal-footer .btn {
        width: 100%;
    }
}

/* Responsive for sidebar */
@media (max-width: 480px) {
    .samples-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .samples-toggle-btn {
        padding: 10px 8px;
    }

    .samples-toggle-btn span {
        font-size: 0.65rem;
    }
}

/* ==========================================
   Sampling Mode Selector
   ========================================== */
.sampling-mode-selector {
    display: flex;
    gap: 16px;
}

.sampling-mode-selector .radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
}

.sampling-mode-selector .radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #0066cc;
}

/* ==========================================
   Region Shape Selector
   ========================================== */
.region-shape-selector {
    display: flex;
    gap: 10px;
}

.radio-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.radio-option-card:hover {
    border-color: #0066cc;
    background: rgba(0, 102, 204, 0.05);
}

.radio-option-card.active {
    border-color: #0066cc;
    background: rgba(0, 102, 204, 0.1);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.radio-option-card input[type="radio"] {
    display: none;
}

.radio-option-card svg {
    color: #64748b;
    transition: color 0.2s ease;
}

.radio-option-card.active svg {
    color: #0066cc;
}

.radio-option-card span {
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
}

.radio-option-card.active span {
    color: #0066cc;
    font-weight: 600;
}

.region-dimension-settings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================
   Shape Preview Container
   ========================================== */
.shape-preview-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 12px;
}

.shape-preview-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.shape-preview {
    transition: all 0.3s ease;
    background: rgba(0, 102, 204, 0.3);
    border: 2px solid #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.shape-preview.circle {
    border-radius: 50%;
}

.shape-preview.square {
    border-radius: 4px;
}

.shape-preview.rectangle {
    border-radius: 4px;
}

.shape-preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-shape-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

.preview-dimensions {
    font-size: 0.85rem;
    color: #64748b;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    background: rgba(0, 102, 204, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.shape-preview-container.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.shape-preview-container.disabled .shape-preview-box {
    border-color: #94a3b8;
}

.shape-preview-container.disabled .shape-preview {
    background: rgba(148, 163, 184, 0.3);
    border-color: #94a3b8;
}

/* Hide shape preview for non-circle shapes */
.shape-preview-container.hidden {
    display: none;
}

/* Hint Icon with Tooltip */
.hint-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    margin-left: 6px;
    transition: color 0.2s ease;
}

.hint-icon:hover,
.hint-icon:focus {
    color: #0066cc;
    outline: none;
}

.hint-icon svg {
    display: block;
}

.hint-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #334155;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    min-width: 220px;
    text-align: left;
}

.hint-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.hint-bullet {
    width: 6px;
    height: 6px;
    background-color: #f97316;
    /* Orange accent */
    border-radius: 50%;
    flex-shrink: 0;
}

.hint-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #334155;
}

.hint-icon:hover .hint-tooltip,
.hint-icon:focus .hint-tooltip,
.hint-icon.active .hint-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
}

/* Checkbox Option Card for Advanced Settings */
.setting-row-checkbox {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.checkbox-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-option-card:hover {
    border-color: #0066cc;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
}

.checkbox-option-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
    cursor: pointer;
}

.checkbox-option-card svg {
    color: #64748b;
    flex-shrink: 0;
}

.checkbox-option-card:hover svg {
    color: #0066cc;
}

.checkbox-label-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-label-content span {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.checkbox-label-content small {
    color: #64748b;
    font-size: 0.78rem;
}

.checkbox-option-card:has(input:checked) {
    border-color: #0066cc;
    background: linear-gradient(135deg, #e6f0ff 0%, #dbeafe 100%);
}

.checkbox-option-card:has(input:checked) svg {
    color: #0066cc;
}

.manual-points-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
}

.btn-select-points {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select-points:hover {
    background: linear-gradient(135deg, #0055aa, #0077ee);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-select-points:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-select-points svg {
    flex-shrink: 0;
}

.manual-points-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #64748b;
}

.manual-points-status.has-points {
    background: #dcfce7;
    color: #166534;
}

.btn-clear-points {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-points:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

/* ==========================================
   Point Selector Modal
   ========================================== */
.point-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
}

.point-selector-content {
    background: white;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.point-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
}

.point-selector-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.point-selector-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.point-selector-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.point-selector-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

.point-selector-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.point-selector-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.point-selector-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}

.point-selector-counter #pointCountCurrent {
    font-weight: 700;
    color: #0066cc;
    font-size: 1.1rem;
}

.point-selector-counter #pointCountTotal {
    color: #64748b;
}

.point-selector-progress {
    flex: 1;
    max-width: 200px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.point-selector-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #00c853);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.point-selector-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 24px;
    flex: 1;
    overflow: auto;
}

.point-selector-image-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.point-selector-image-panel h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
}

.point-selector-image-container {
    position: relative;
    background: #1a1a2e;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
    /* CRITICAL: No forced aspect ratio - container adapts to image */
    min-height: 200px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.point-selector-image-container img {
    /* CRITICAL: Image displays at natural size, scaled down only if too large */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    /* No object-fit - image keeps exact dimensions */
}

.point-selector-image-container canvas {
    position: absolute;
    /* Canvas will be positioned dynamically via JS to match image */
    pointer-events: none;
}

.point-selector-roi-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.point-selector-roi-overlay.has-roi {
    background: rgba(0, 0, 0, 0.4);
}

.point-selector-roi-overlay .roi-clear-zone {
    position: absolute;
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
}

.point-selector-roi-overlay .roi-clear-zone.circle {
    border-radius: 50%;
}

.point-selector-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.85rem;
}

.point-selector-hint.warning {
    background: #fef3c7;
    color: #92400e;
}

.point-selector-hint.success {
    background: #dcfce7;
    color: #166534;
}

.point-selector-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.point-selector-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.point-selector-actions .btn-secondary:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.point-selector-actions .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.point-selector-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.point-selector-actions .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.point-selector-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Point markers on canvas */
.point-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Responsive point selector */
@media (max-width: 768px) {
    .point-selector-images {
        grid-template-columns: 1fr;
    }

    .point-selector-content {
        max-height: 95vh;
    }

    .point-selector-header-left {
        gap: 10px;
    }

    .point-selector-logo {
        width: 36px;
        height: 36px;
    }

    .point-selector-header h2 {
        font-size: 1rem;
    }
}

/* ==========================================
   Advanced Settings Modal - Premium Redesign
   ========================================== */
.modal-overlay {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.6);
}

.modal {
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    height: 85vh;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.modal-header h2 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.modal-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

/* Tabs */
.modal-tabs {
    padding: 0 28px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

.tab {
    padding: 16px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: #0066cc;
}

.tab.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

 .modal-tabs .tab.tab-disabled {
     opacity: 0.45;
     pointer-events: none;
     cursor: not-allowed;
 }

/* Body */
.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.settings-group {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.settings-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #0f172a;
}

.settings-group-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.settings-group-desc {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Form Elements */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding-right: 20px;
}

.setting-label label {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}

.setting-label small {
    color: #94a3b8;
    font-size: 0.8rem;
}

.form-control {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #1e293b;
    width: 120px;
    transition: all 0.2s;
    text-align: right;
}

.form-control:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}



/* ==========================================
   Modern Checkbox
   ========================================== */
.modern-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.modern-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 24px;
    width: 24px;
    background-color: white;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modern-checkbox:hover .checkmark {
    border-color: #0066cc;
    background-color: #f8fafc;
}

.modern-checkbox input:checked~.checkmark {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    border-color: #0066cc;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    transform: scale(1.05);
}

.check-icon {
    width: 16px;
    height: 16px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-checkbox input:checked~.checkmark .check-icon {
    opacity: 1;
    transform: scale(1);
}

.modern-checkbox input:focus~.checkmark {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

/* Footer */
.modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 16px 28px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0055aa, #0077ee);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* File Size Display */
.file-size-display {
    font-size: 0.75rem;
    text-align: center;
    color: #6c757d;
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* Split Button Styles */
.split-btn-group {
    display: inline-flex;
    position: relative;
    vertical-align: middle;
}

.split-btn-group .main-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 1px;
}

.split-btn-group .dropdown-toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 260px;
    margin-top: 6px;
    overflow: hidden;
    padding: 4px 0;
}

.download-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}


.dropdown-item:hover {
    background: #f8fafc;
    color: #475569;
}

/* Button Content Layout */
.btn-content-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.btn-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-size-label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}

/* Dropdown Content Layout */
.dropdown-item-content {
    display: flex;
    align-items: center;
}

.dropdown-size-label {
    margin-left: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.dropdown-item:hover .dropdown-size-label {
    background: #e2e8f0;
    color: #64748b;
}

/* Video Logo Styling */
.progress-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.progress-logo-video {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: #fff;
}

/* Sampling Unit Redesign */
.sampling-section {
    border: 1px solid #e0e7ff;
    /* Light indigo tint */
    background: #fdfeff;
    margin-top: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.sampling-mode-selector {
    display: flex;
    gap: 20px;
}

.modern-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #334155;
}

.manual-points-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.manual-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.btn-select-points {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 6px;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-select-points:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

/* Orange Button for "Complete Randomly" */
.btn-complete-randomly {
    background: #f97316;
    /* Orange-500 */
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(249, 115, 22, 0.2);
}

.btn-complete-randomly:hover {
    background: #ea580c;
    /* Orange-600 */
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
}

/* Progress Bar Styling */
.sampling-progress-container {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #334155;
}

.progress-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
}

.progress-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.manual {
    background: #22c55e;
}

.dot.random {
    background: #f97316;
}

/* Progress bar segments */
#progressGreen,
#progressGreenSingle {
    height: 100%;
    background: #22c55e;
    transition: width 0.3s ease;
}

#progressYellow,
#progressYellowSingle {
    height: 100%;
    background: #f97316;
    transition: width 0.3s ease;
}

/* Point Selector Back Button */
.point-selector-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 12px;
}

.point-selector-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}
/* ==========================================
   Custom Modal (Alerts & Confirms)
   ========================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.custom-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.custom-modal-header {
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-modal-icon.warning {
    background: #fff7ed;
    color: #ea580c;
}

.custom-modal-icon.error {
    background: #fef2f2;
    color: #dc2626;
}

.custom-modal-icon.success {
    background: #f0fdf4;
    color: #16a34a;
}

.custom-modal-icon.info {
    background: #eff6ff;
    color: #0066cc;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    flex-grow: 1;
}

.custom-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.custom-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.custom-modal-body {
    padding: 24px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.custom-modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.custom-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.custom-modal-btn.secondary {
    background: white;
    border-color: #cbd5e1;
    color: #475569;
}

.custom-modal-btn.secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.custom-modal-btn.primary {
    background: #0066cc;
    color: white;
}

.custom-modal-btn.primary:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.custom-modal-btn.danger {
    background: #dc2626;
    color: white;
}

.custom-modal-btn.danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* ==========================================
   Custom Shape Dropdown & Controls
   ========================================== */

.shape-selector-container {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Custom Select Container */

.custom-select-container {
    position: relative;
    width: 200px;
    user-select: none;
    font-family: inherit;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #1e293b;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.custom-select-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.custom-select-container.open .custom-select-trigger {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Trigger content (Icon + Text) */

.selected-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-value svg {
    width: 20px;
    height: 20px;
    color: #0066cc;
}

.selected-value span {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

/* Arrow rotation */

.dropdown-arrow {
    width: 16px;
    height: 16px;
    color: #64748b;
    transition: transform 0.3s ease;
}

.custom-select-container.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Options List */

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-container.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Option Item */

.custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.custom-option:last-child {
    border-bottom: none;
}

/* ==========================================
   Ready-to-Test Dropdown
   ========================================== */
.rtt-container {
    position: relative;
}

.btn-rtt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    color: #0369a1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-rtt:hover {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.btn-rtt:active {
    transform: translateY(0);
}

.btn-rtt .chevron {
    color: #0284c7;
    transition: transform 0.2s;
}

.btn-rtt svg {
    color: #0284c7;
}

.rtt-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    padding: 6px 0;
}

.rtt-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rtt-header {
    padding: 10px 16px 2px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.rtt-caption {
    padding: 0 16px 10px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 2px;
}

.rtt-section {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.rtt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    border-radius: 0;
}

.rtt-item:hover {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
}

.rtt-thumbs {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.rtt-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 5px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rtt-item:hover .rtt-thumb {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ==========================================
   Datasheet Dropdown
   ========================================== */
.datasheet-download-container {
    position: relative;
}

.btn-datasheet-download {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1a202c;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-datasheet-download:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.btn-datasheet-download svg {
    color: #0066cc;
}

.btn-datasheet-download .chevron {
    color: #64748b;
    transition: transform 0.2s;
}

.datasheet-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

.datasheet-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.datasheet-dropdown .dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.datasheet-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

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

.datasheet-dropdown .dropdown-item:hover {
    background: #f8fafc;
}

.datasheet-dropdown .dropdown-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.datasheet-dropdown .dropdown-item-left svg {
    color: #0066cc;
    flex-shrink: 0;
}

.datasheet-dropdown .dropdown-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.datasheet-dropdown .dropdown-item-title {
    font-weight: 500;
    color: #1a202c;
    font-size: 0.9rem;
}

.datasheet-dropdown .dropdown-item-desc {
    font-size: 0.75rem;
    color: #64748b;
}

.datasheet-dropdown .btn-help {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 102, 204, 0.1);
    border: none;
    color: #0066cc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.datasheet-dropdown .btn-help:hover {
    background: rgba(0, 102, 204, 0.2);
    transform: scale(1.1);
}

/* ==========================================
   Datasheet Modal
   ========================================== */
.modal-medium {
    max-width: 700px;
    max-height: 400px;
}

.modal-intro {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 24px;
    line-height: 1.7;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h4 {
    font-size: 1.1rem;
    color: #0066cc;
    margin-bottom: 12px;
    font-weight: 600;
}

.modal-section p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 8px;
}

.modal-section strong {
    color: #1a202c;
    font-weight: 600;
}

.modal-section-highlight {
    background: #f0f9ff;
    border-left: 4px solid #0066cc;
    padding: 16px;
    border-radius: 8px;
    margin-top: 24px;
}

.modal-section-highlight p {
    margin-bottom: 0;
    color: #1a202c;
    font-weight: 500;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

.modal-description {
    font-size: 1rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 16px;
}

.modal-available {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 24px;
    text-align: center;
}

.modal-download-buttons {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.modal-download-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 1rem;
}

/* ==========================================
   Windows Desktop Download Button (Header)
   ========================================== */
.btn-desktop-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #0066cc 0%, #0088ff 50%, #00aaff 100%);
    border: 2px solid rgba(0, 102, 204, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
    letter-spacing: 0.3px;
}

.btn-desktop-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-desktop-download:hover::before {
    left: 100%;
}

.btn-desktop-download:hover {
    background: linear-gradient(135deg, #0055b3 0%, #0077ee 50%, #0099ee 100%);
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-desktop-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-desktop-download .windows-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-desktop-download .download-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
    animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

.btn-desktop-download .btn-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.btn-desktop-download .btn-main-text {
    font-size: 0.8125rem;
    font-weight: 700;
}

.btn-desktop-download .btn-sub-text {
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ==========================================
   Download Fallback Dialog
   ========================================== */
.dl-fallback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dlFadeIn 0.25s ease;
}

@keyframes dlFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.dl-fallback-dialog {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 40px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 102, 204, 0.08);
    animation: dlSlideUp 0.3s ease;
}

@keyframes dlSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dl-fallback-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.dl-fallback-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.dl-fallback-icon {
    color: #0066cc;
    margin-bottom: 12px;
    animation: dlBounce 2s ease-in-out infinite;
}

@keyframes dlBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

.dl-fallback-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.4;
}

.dl-fallback-timer-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
}

.dl-fallback-ring {
    width: 80px;
    height: 80px;
}

.dl-ring-bg {
    stroke: #e2e8f0;
}

.dl-ring-fg {
    stroke: #0066cc;
    transition: stroke-dashoffset 1s linear;
}

.dl-fallback-seconds {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #0066cc;
    font-variant-numeric: tabular-nums;
}

.dl-fallback-hint {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.dl-fallback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #0066cc 0%, #0088ee 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.dl-fallback-btn:hover {
    background: linear-gradient(135deg, #0055b3 0%, #0077dd 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.dl-fallback-btn:active {
    transform: translateY(0);
}

.dl-fallback-version {
    margin-top: 16px;
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

/* ==========================================
   RTT Loading Indicator
   ========================================== */
.rtt-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.rtt-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rtt-loader-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 28px 40px;
    text-align: center;
    min-width: 340px;
    max-width: 420px;
}

.rtt-loader-track {
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.rtt-loader-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 3px;
    animation: rttSlide 1.2s ease-in-out infinite;
}

@keyframes rttSlide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(175%); }
    100% { transform: translateX(-100%); }
}

.rtt-loader-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.5;
}
