        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

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

        .roi-input {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border-color);
            color: var(--accent-primary);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            width: 100%;
            min-width: 0;
            padding: 5px 6px;
            border-radius: 6px;
            outline: none;
            text-align: center;
        }

        .roi-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.7rem;
            margin-top: 8px;
        }

        .roi-table th {
            text-align: left;
            color: var(--text-dim);
            padding: 8px;
            border-bottom: 1px solid var(--border-color);
            font-weight: 500;
        }

        .roi-table td {
            padding: 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            color: var(--text-main);
        }

        .roi-table th:nth-child(3),
        .roi-table td:nth-child(3) {
            text-align: center;
        }

        .roi-row {
            cursor: pointer;
            transition: background 0.2s;
        }

        .roi-row:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .roi-row.active {
            background: rgba(0, 242, 255, 0.1);
            border-left: 2px solid var(--accent-primary);
        }

        .btn-delete-roi {
            color: #ff4444;
            background: rgba(255, 68, 68, 0.08);
            border: 1px solid rgba(255, 68, 68, 0.2);
            border-radius: 6px;
            padding: 3px 7px;
            opacity: 0.75;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .btn-delete-roi:hover {
            opacity: 1;
        }

        .btn-focus-roi {
            color: var(--accent-primary);
            background: rgba(0, 242, 255, 0.08);
            border: 1px solid rgba(0, 242, 255, 0.22);
            border-radius: 6px;
            padding: 3px 7px;
            cursor: pointer;
            font-size: 11px;
            opacity: 0.85;
            transition: opacity 0.2s, background 0.2s;
        }

        .btn-focus-roi:hover {
            opacity: 1;
            background: rgba(0, 242, 255, 0.14);
        }

        .roi-actions {
            display: inline-flex;
            justify-content: center;
            gap: 6px;
            width: 100%;
        }

        .image-strip {
            position: absolute;
            left: 24px;
            right: 380px;
            bottom: 24px;
            min-height: 92px;
            display: none;
            align-items: center;
            gap: 12px;
            padding: 10px;
            border: 1px solid var(--border-color);
            border-radius: 14px;
            background: var(--panel-bg);
            backdrop-filter: var(--glass-blur);
            z-index: 120;
            overflow-x: auto;
        }

        body.has-multi-images .image-strip {
            display: flex;
        }

        .image-thumb {
            width: 132px;
            min-width: 132px;
            height: 72px;
            position: relative;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            overflow: hidden;
            background: #000;
            cursor: pointer;
            opacity: 0.72;
        }

        .image-thumb.active {
            opacity: 1;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 1px rgba(0, 242, 255, 0.35), var(--shadow-glow);
        }

        .image-thumb.low-confidence {
            border-color: rgba(255, 170, 0, 0.6);
        }

        .image-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .thumb-label,
        .thumb-ref,
        .thumb-confidence,
        .thumb-align-metrics {
            position: absolute;
            left: 6px;
            right: 6px;
            font-size: 0.58rem;
            color: #fff;
            text-shadow: 0 1px 4px #000;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .thumb-label {
            bottom: 6px;
        }

        .thumb-align-metrics {
            bottom: 22px;
            display: inline-flex;
            gap: 5px;
            align-items: center;
            width: fit-content;
            max-width: calc(100% - 12px);
            padding: 2px 5px;
            border-radius: 5px;
            background: rgba(5, 7, 10, 0.72);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #d8fbff;
            font-family: 'JetBrains Mono', monospace;
            text-shadow: none;
        }

        .thumb-align-metrics.strong {
            border-color: rgba(0, 255, 136, 0.35);
            color: #b9ffd9;
        }

        .thumb-align-metrics.medium {
            border-color: rgba(255, 170, 0, 0.42);
            color: #ffe0a3;
        }

        .thumb-align-metrics.weak {
            border-color: rgba(255, 68, 68, 0.42);
            color: #ffb9b9;
        }

        .thumb-align-metrics.unaligned {
            border-color: rgba(148, 163, 184, 0.34);
            color: #d8e1ea;
        }

        .thumb-ref {
            top: 6px;
            right: auto;
            padding: 2px 5px;
            border-radius: 5px;
            background: rgba(0, 242, 255, 0.85);
            color: #05070a;
            font-weight: 800;
            text-shadow: none;
        }

        .thumb-confidence {
            top: 6px;
            left: auto;
            width: auto;
            padding: 2px 5px;
            border-radius: 5px;
            background: rgba(255, 170, 0, 0.82);
            color: #05070a;
            font-weight: 800;
            text-shadow: none;
        }

        .thumb-actions {
            position: absolute;
            right: 6px;
            bottom: 6px;
            display: flex;
            gap: 4px;
        }

        .thumb-action {
            border: 1px solid rgba(255, 255, 255, 0.18);
            background: rgba(5, 7, 10, 0.75);
            color: var(--text-main);
            border-radius: 5px;
            padding: 2px 5px;
            font-size: 0.55rem;
            font-weight: 700;
            cursor: pointer;
        }

        .roi-status-badge {
            display: inline-flex;
            align-items: center;
            margin-left: 5px;
            padding: 2px 5px;
            border-radius: 999px;
            font-size: 0.55rem;
            font-weight: 800;
            color: #05070a;
            background: var(--accent-primary);
        }

        .roi-status-badge.warn {
            background: #ffaa00;
        }

        .roi-fd-stack {
            display: grid;
            gap: 2px;
            font-family: 'JetBrains Mono', monospace;
            color: var(--accent-primary);
            line-height: 1.2;
        }

        .roi-fd-line {
            display: flex;
            justify-content: space-between;
            gap: 8px;
        }
    
        /* Release responsive hardening */
        .tool-btn,
        .btn-upload,
        .guide-link,
        .producer-badge,
        .language-control { white-space: nowrap; }

        .side-stack-content,
        .panel-content,
        .auto-panel,
        .filter-panel { scrollbar-width: thin; scrollbar-color: rgba(0, 242, 255, 0.35) rgba(255,255,255,0.05); }

        @media (max-width: 1180px) {
            .side-stack { right: 16px; width: min(320px, calc(100vw - 32px)); }
            .image-strip { left: 16px; right: 352px; }
            #status-bar { right: 16px; }
            .notification-center { right: 16px; }
        }

        @media (max-width: 980px) {
            header { min-height: 64px; height: auto; padding: 10px 12px; flex-wrap: wrap; row-gap: 8px; }
            .logo-container { min-width: 0; }
            .toolbar { order: 3; width: 100%; overflow-x: auto; gap: 6px; padding: 5px; scrollbar-width: none; }
            .toolbar::-webkit-scrollbar { display: none; }
            .tool-btn { flex: 0 0 auto; padding: 8px 10px; font-size: 0.8rem; }
            .tool-btn.compact { padding: 7px 9px; font-size: 0.76rem; }
            .btn-upload { padding: 8px 12px; }
            .header-actions { margin-left: auto; }
            #canvas-container { min-height: calc(100dvh - 122px); }
            .side-stack { right: 12px; bottom: 84px; width: min(330px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 156px)); max-height: calc(100dvh - 156px); }
            .image-strip { left: 12px; right: 356px; bottom: 12px; min-height: 82px; padding: 8px; }
            .image-thumb { width: 112px; min-width: 112px; height: 62px; }
            .alignment-preview-panel { left: 12px; bottom: 104px; width: min(540px, calc(100vw - 24px)); }
            .alignment-preview-canvas-wrap { height: min(320px, 42dvh); }
            #status-bar { right: 12px; bottom: 12px; width: min(320px, calc(100vw - 24px)); }
            .notification-center { right: 12px; top: 76px; }
        }

        @media (max-width: 760px) {
            body { height: 100dvh; min-height: 100dvh; }
            header { align-items: center; }
            .logo-icon { width: 30px; height: 30px; }
            .logo-text { font-size: 0.95rem; }
            .header-actions { gap: 6px; }
            .language-control { min-width: 112px; height: 32px; }
            .producer-badge { display: none; }
            .empty-upload-card { width: calc(100vw - 28px); padding: 22px 18px; }
            .empty-upload-title { text-align: center; }
            .empty-upload-subtitle { font-size: 0.74rem; }
            .side-stack { left: 12px; right: 12px; bottom: 86px; width: auto; height: min(48dvh, 460px); max-height: calc(100dvh - 202px); border-radius: 18px; z-index: 900; }
            body.has-multi-images .side-stack { bottom: 112px; max-height: calc(100dvh - 238px); }
            .side-stack.collapsed { height: 46px; max-height: 46px; }
            .side-stack-header { min-height: 46px; padding: 11px 14px; }
            .side-stack-content { padding: 10px; gap: 10px; }
            .floating-panel { border-radius: 14px; }
            .panel-content { padding: 14px; }
            .metrics-grid,
            .advanced-metrics-grid,
            .quality-grid,
            .histogram-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .calibration-row { grid-template-columns: 1fr; }
            .preview-container,
            .pipeline-preview-grid { grid-template-columns: 1fr 1fr; }
            .image-strip { left: 12px; right: 12px; bottom: 10px; min-height: 72px; gap: 8px; z-index: 860; }
            .image-thumb { width: 96px; min-width: 96px; height: 54px; }
            #status-bar { left: 12px; right: 12px; top: auto; bottom: 10px; width: auto; max-width: none; z-index: 1280; }
            body.has-multi-images #status-bar { bottom: 86px; }
            .notification-center { left: 12px; right: 12px; top: 78px; width: auto; }
            .filter-panel { position: fixed; left: 12px; right: 12px; bottom: 86px; transform: none; width: auto; max-height: 48dvh; overflow: auto; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; }
            .filter-panel.visible { bottom: 102px; }
            .auto-panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 86px; width: auto; max-height: 58dvh; overflow: auto; border-radius: 16px; }
            .auto-panel.visible { top: auto; bottom: 102px; }
            .alignment-preview-panel { position: fixed; left: 12px; right: 12px; bottom: 86px; width: auto; max-height: 68dvh; overflow: auto; border-radius: 16px; }
            .alignment-preview-canvas-wrap { height: min(300px, 40dvh); }
            .alignment-preview-meta,
            .overlay-controls { grid-template-columns: 1fr; }
        }

        @media (max-width: 520px) {
            .logo-text { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
            .tool-btn { padding: 7px 9px; font-size: 0.76rem; gap: 6px; }
            .btn-upload { padding: 8px 10px; font-size: 0.78rem; }
            .language-control { min-width: 104px; padding-left: 9px; }
            .fd-value { font-size: 2.05rem; }
            .metrics-grid,
            .advanced-metrics-grid,
            .quality-grid { grid-template-columns: 1fr; }
            .pipeline-preview-grid { grid-template-columns: 1fr; }
            .app-toast { grid-template-columns: 9px minmax(0, 1fr) auto; padding: 11px 10px 11px 12px; }
        }


        @media (max-width: 430px) {
            header { padding: 8px 10px; row-gap: 7px; }
            .logo-container { gap: 9px; }
            .logo-icon { width: 28px; height: 28px; border-radius: 8px; }
            .logo-mark-img { width: 21px; height: 21px; border-radius: 6px; }
            .logo-text { max-width: calc(100vw - 78px); font-size: 0.9rem; }
            .header-actions { width: 100%; justify-content: flex-start; order: 2; }
            .language-control { height: 31px; min-width: 102px; font-size: 0.68rem; }
            .toolbar { order: 3; scroll-snap-type: x proximity; }
            .tool-btn { min-height: 38px; scroll-snap-align: start; }
            #canvas-container { min-height: calc(100dvh - 140px); }
            .empty-upload-card { width: calc(100vw - 22px); padding: 19px 14px; border-radius: 20px; }
            .empty-upload-mark { width: 54px; height: 54px; }
            .empty-upload-subtitle { max-width: 30rem; line-height: 1.45; }
            .side-stack { left: 10px; right: 10px; bottom: calc(86px + env(safe-area-inset-bottom)); height: min(52dvh, 430px); max-height: calc(100dvh - 218px); }
            body.has-multi-images .side-stack { bottom: calc(106px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 238px); }
            .image-strip { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); min-height: 68px; }
            .image-thumb { width: 88px; min-width: 88px; height: 50px; }
            #status-bar { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); }
            body.has-multi-images #status-bar { bottom: calc(82px + env(safe-area-inset-bottom)); }
            .notification-center { left: 10px; right: 10px; top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); max-height: 36dvh; overflow: auto; }
            body.has-multi-images .notification-center { bottom: calc(160px + env(safe-area-inset-bottom)); }
            .filter-panel, .auto-panel, .alignment-preview-panel { left: 10px; right: 10px; bottom: calc(92px + env(safe-area-inset-bottom)); max-height: 62dvh; }
            .filter-panel.visible, .auto-panel.visible { bottom: calc(108px + env(safe-area-inset-bottom)); }
            .alignment-preview-panel.visible { bottom: calc(96px + env(safe-area-inset-bottom)); }
            .auto-option { padding: 9px; }
            .preset-grid { grid-template-columns: 1fr; }
            .alignment-preview-canvas-wrap { height: min(260px, 38dvh); }
        }


        /* Final overlay and panel layer assurance */
        .side-stack, .filter-panel, .auto-panel, .alignment-preview-panel, .floating-panel { border-color: rgba(0, 242, 255, 0.12); box-shadow: 0 18px 48px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.018); }
        .filter-panel, .auto-panel, .alignment-preview-panel { z-index: 2150; }
        .notification-center { z-index: 2450; }
        .logo-icon { position: relative; overflow: hidden; background: rgba(255,255,255,0.96); }
