/* ── Coming Soon chip on the Install to go Offline title ── */
#install-offline-title::after {
    content: 'Coming Soon';
    position: relative;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background-color: #bbf7d0;
    color: #14532d;
    padding: 2px 8px;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #86efac;
    line-height: 1.4;
    z-index: 5;
}
/* Right panel blur overlay */
#right-panel {
    position: relative;
}
#right-panel .blur-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}
#right-panel .blur-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    pointer-events: none;
    margin-top: 80px;
}
#right-panel .blur-overlay .coming-soon-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 16px rgba(5,150,105,0.3);
    pointer-events: none;
}
.separator {
    flex-shrink: 0;
    background: linear-gradient(to right, transparent, #000, transparent);
    height: 2px;
    width: 80%;
    margin: 0 auto;
    align-self: center;
}
@media (min-width: 768px) {
    .separator {
        width: 2px;
        height: 75vh;
        background: linear-gradient(to bottom, transparent, #000, transparent);
        margin: auto 0;
    }
}

/* ── Drop zone ── */
.drop-zone {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.drop-zone:hover {
    background-color: #e5e7eb;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}
.drop-zone:hover #drop-icon {
    color: #000;
    transition: color 0.3s;
}
.drop-zone:hover #drop-text {
    color: #000;
    transition: color 0.3s;
}
.drop-zone.dragover {
    background-color: #d1d5db;
    border-color: #000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.2);
}
.drop-zone.dragover #drop-icon {
    color: #000;
    transition: color 0.3s;
}
.drop-zone.dragover #drop-text {
    color: #000;
    transition: color 0.3s;
}
.drop-zone .preview-img {
    max-height: 140px;
    width: auto;
    border-radius: 0.75rem;
    object-fit: contain;
    border: 2px solid #d1d5db;
}

#popup-img {
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    cursor: pointer;
}
#popup-img:active {
    transform: scale(0.96);
    filter: brightness(0.92);
}
.scan-container.dragover {
    background-color: #d1d5db;
    border: 2px dashed #4b5563;
}
.scan-container.dragover #popup-img {
    filter: brightness(0.85);
    transform: scale(0.97);
}

/* ── Toast — backdrop blur comes first, then popup fades in ── */
#toast-container.toast-hidden {
    pointer-events: none;
}
#toast-container.toast-visible {
    pointer-events: auto;
}

#toast-backdrop {
    opacity: 0;
    transition: opacity 0.2s ease;
}
#toast-container.toast-visible #toast-backdrop {
    opacity: 1;
}

#toast {
    opacity: 0;
    transition: opacity 0.3s ease 0.15s;
}
#toast-container.toast-visible #toast {
    opacity: 1;
}

/* ── Scanning line animation ── */
.scan-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #f3f4f6;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scan-container img,
.scan-container video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.75rem;
}
.scan-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.scan-placeholder.hidden {
    opacity: 0;
}
.placeholder-svg {
    width: 100%;
    max-width: 160px;
    height: auto;
}
@media (max-width: 767px) {
    .scan-container {
        aspect-ratio: 3 / 4;
        min-height: 260px;
    }
}
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    top: 0;
    animation: scan-down 1.6s ease-in-out infinite;
}
.scan-line.scan-done {
    animation: none;
    opacity: 0;
}
@keyframes scan-down {
    0%   { top: 0; }
    50%  { top: calc(100% - 3px); }
    100% { top: 0; }
}

/* ── Toast title scanning dots animation ── */
@keyframes title-dot-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}
.title-dot {
    display: inline-block;
    animation: title-dot-pulse 1.4s ease-in-out infinite;
}
.title-dot:nth-child(1) { animation-delay: 0s; }
.title-dot:nth-child(2) { animation-delay: 0.2s; }
.title-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Popup panel — vertical layout (scanner on top, result below) ── */
.popup-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    overflow: hidden;
}
.popup-image-col {
    flex-shrink: 0;
    transition: all 0.4s ease;
}
.popup-image-col.has-result .scan-container {
    max-height: 45vh;
}
@media (min-width: 768px) {
    .popup-image-col.has-result .scan-container {
        max-height: 50vh;
        aspect-ratio: 16 / 9;
    }
}
@media (max-width: 767px) {
    .popup-image-col.has-result .scan-container {
        max-height: 40vh;
        aspect-ratio: 3 / 4;
    }
}
.popup-result-col {
    flex: 1;
    min-width: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease 0.15s, transform 0.35s ease 0.15s;
}
.popup-result-col.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Left-to-right green highlight sweep for result text ── */
@keyframes highlight-sweep {
    0% { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0% 0 0); }
}
.result-highlight {
    position: relative;
    border-radius: 6px;
    animation: highlight-sweep 0.8s ease-out forwards;
    background: rgba(16, 185, 129, 0.10);
}

/* ── Copy toast — slides down from top with rounded styling ── */
#copy-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-16px);
    z-index: 9999;
    background: #1f2937;
    color: white;
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
#copy-toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Flash toggle button (neumorphism) ── */
.flash-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 20;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        -3px -3px 6px rgba(255,255,255,0.6),
        3px 3px 6px rgba(0,0,0,0.15),
        inset -1px -1px 3px rgba(0,0,0,0.05),
        inset 1px 1px 3px rgba(255,255,255,0.5);
    color: #374151;
    transition: all 0.2s ease;
}
.flash-btn:hover {
    box-shadow:
        -3px -3px 8px rgba(255,255,255,0.7),
        3px 3px 8px rgba(0,0,0,0.2),
        inset -1px -1px 3px rgba(0,0,0,0.05),
        inset 1px 1px 3px rgba(255,255,255,0.5);
    transform: scale(1.05);
}
.flash-btn:active {
    box-shadow:
        inset -2px -2px 5px rgba(255,255,255,0.4),
        inset 2px 2px 5px rgba(0,0,0,0.15);
}
.flash-btn.active {
    color: #fbbf24;
    box-shadow:
        -3px -3px 6px rgba(255,255,255,0.5),
        3px 3px 6px rgba(0,0,0,0.15),
        inset -1px -1px 3px rgba(0,0,0,0.05),
        inset 1px 1px 3px rgba(255,255,255,0.5);
}

/* ── Focus tap indicator ── */
.focus-indicator {
    position: absolute;
    width: 70px;
    height: 70px;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 50%;
    pointer-events: none;
    z-index: 25;
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0;
    animation: focus-pop 0.5s ease-out forwards;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}
@keyframes focus-pop {
    0%   { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ── Privacy text ── */
.privacy-text {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.65rem;
    color: #9ca3af;
    letter-spacing: 0.02em;
    line-height: 1.3;
}