/* ─── HANGOUT FLOATING WIDGET STYLES ────────────────────────────────────────── */
#hangout-root {
    position: fixed;
    right: 29.5px;
    bottom: 88px;
    z-index: 9998;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    touch-action: none;
}

#hangout-root.hangout-hidden-view,
#hangout-restore-chevron.hangout-hidden-view,
#pwa-edge-ocr-handle.hangout-hidden-view,
#pwa-edge-insp-handle.hangout-hidden-view {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#hangout-root.is-dragging .hangout-bubble {
    animation: none !important;
    transition: transform 0.1s ease !important;
}

#hangout-root.is-fusing-close {
    transform: scale(0.76) !important;
    opacity: 0.82;
    transition: transform 0.14s ease, opacity 0.14s ease;
}

.hangout-bubble-wrapper {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Floating bubble itself — 80% of the 56px Relaunch Dashboard icon (45px x 45px) in all modes */
.hangout-bubble {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #0f172a;
    border: 2.2px solid #8b5cf6;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45), 0 0 10px rgba(99, 102, 241, 0.35);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: hangoutFloat 4s ease-in-out infinite;
    user-select: none;
    overflow: visible;
    touch-action: none;
}

.hangout-bubble:hover {
    transform: scale(1.08) translateY(-2px);
    border-color: #a78bfa;
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.65), 0 0 20px rgba(167, 139, 250, 0.5);
}

.hangout-bubble.active {
    border-color: #38bdf8;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
    animation: none;
}

@keyframes hangoutFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Thumbnail inside bubble */
.hangout-thumb-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.hangout-icon-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    pointer-events: none;
}

/* Badge at top right of bubble (scaled proportionally for 45px bubble) */
.hangout-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff !important;
    font-size: 9.5px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.8px solid #0f172a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Tooltip / Label for bubble (Only shown on hover when NOT clicked) */
.hangout-label-tooltip {
    position: absolute;
    right: 76px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(15, 23, 42, 0.95);
    color: #f1f5f9;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    backdrop-filter: blur(10px);
    z-index: 5;
}

/* Only display tooltip on hover if the bubble is NOT currently active */
.hangout-bubble-wrapper:not(.is-active):hover .hangout-label-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Once clicked/active, strictly suppress the flag so it never hides/blocks satellite buttons */
.hangout-bubble-wrapper.is-active .hangout-label-tooltip,
.hangout-bubble-wrapper:has(.hangout-bubble.active) .hangout-label-tooltip,
.hangout-bubble-wrapper:has(.hangout-satellites.visible) .hangout-label-tooltip,
.hangout-bubble.active ~ .hangout-label-tooltip,
.hangout-satellites.visible ~ .hangout-label-tooltip,
.hangout-bubble-wrapper:hover .hangout-bubble.active ~ .hangout-label-tooltip,
.hangout-bubble-wrapper:hover .hangout-satellites.visible ~ .hangout-label-tooltip {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Satellites Container (Structured Card Layout) */
.hangout-satellites {
    position: absolute;
    right: 76px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85) translateX(15px);
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: right center;
    width: max-content;
    max-width: 360px;
}

.hangout-satellites.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateX(0);
}

/* 1. Long, Well-Arranged VIEW DOCUMENT Button */
.hangout-satellite-btn-long {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #7c3aed 100%);
    border: 1.5px solid rgba(147, 197, 253, 0.6);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5), 0 0 16px rgba(124, 58, 237, 0.35);
    cursor: pointer;
    color: #ffffff;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.hangout-satellite-btn-long:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.7), 0 0 22px rgba(147, 197, 253, 0.6);
    border-color: #ffffff;
}

.hangout-sat-long-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hangout-sat-long-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.hangout-sat-long-texts {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.hangout-sat-long-title {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #ffffff;
}

.hangout-sat-long-desc {
    font-size: 10px;
    color: #cbd5e1;
    font-weight: 500;
}

.hangout-sat-long-arrow {
    font-size: 15px;
    color: #93c5fd;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.hangout-satellite-btn-long:hover .hangout-sat-long-arrow {
    transform: translateX(3px);
}

/* 2. Row of Satellite Quick Action Buttons */
.hangout-satellites-row {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Individual Satellite Button */
.hangout-satellite-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 20px;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}

.hangout-satellite-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
}

.hangout-sat-dochub {
    background: linear-gradient(135deg, #0284c7, #06b6d4);
}
.hangout-sat-dochub:hover {
    border-color: #38bdf8;
}

.hangout-sat-sqms {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.hangout-sat-sqms:hover {
    border-color: #a78bfa;
}

.hangout-sat-print {
    background: linear-gradient(135deg, #0891b2, #0284c7);
}
.hangout-sat-print:hover {
    border-color: #67e8f9;
}

.hangout-sat-share {
    background: linear-gradient(135deg, #059669, #10b981);
}
.hangout-sat-share:hover {
    border-color: #34d399;
}

.hangout-sat-delete {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}
.hangout-sat-delete:hover {
    border-color: #f87171;
}

/* ─── ENLARGED DOCUMENT VIEWER MODAL ────────────────────────────────────── */
.hangout-viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    z-index: 10000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: hangoutFadeIn 0.2s ease;
    box-sizing: border-box;
}

@keyframes hangoutFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.hangout-viewer-dialog {
    width: 96vw;
    max-width: 1120px;
    height: 94vh;
    background: #0f172a;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Compact 2-Row Header for Maximum PDF Viewport Space */
.hangout-viewer-header {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 6px;
    flex-shrink: 0;
}

.hangout-viewer-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.hangout-viewer-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.hangout-viewer-badge {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #ffffff !important;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hangout-viewer-title {
    color: #f8fafc !important;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.hangout-viewer-veh-tag {
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.7);
    color: #38bdf8 !important;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hangout-viewer-toolbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 5px;
    width: 100%;
}

/* Toolbar Buttons */
.hangout-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    transition: all 0.18s ease;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hangout-tool-btn span {
    color: #ffffff !important;
}

.hangout-tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.hangout-tool-print {
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    border-color: #38bdf8;
}

.hangout-tool-dochub {
    background: linear-gradient(135deg, #059669, #10b981);
}
.hangout-tool-sqms {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}
.hangout-tool-download {
    background: linear-gradient(135deg, #334155, #475569);
}
.hangout-tool-share {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.hangout-tool-close {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.75);
    color: #f87171 !important;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.hangout-tool-close:hover {
    background: #ef4444;
    color: #ffffff !important;
}

/* Modal Body Viewport — Maximized for In-App PDF Viewing */
.hangout-viewer-body {
    flex: 1 1 auto;
    min-height: 0;
    background: #090d16;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.hangout-pdf-pages-container {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px;
    box-sizing: border-box;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.hangout-pdf-page-wrap {
    position: relative;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    flex-shrink: 0;
}

.hangout-pdf-page-canvas {
    display: block;
    background: #ffffff;
    pointer-events: none;
}

.hangout-pdf-text-layer.textLayer {
    position: absolute;
    text-align: initial;
    inset: 0;
    overflow: hidden;
    opacity: 1;
    line-height: 1;
    -webkit-text-size-adjust: none;
    -moz-text-size-adjust: none;
    text-size-adjust: none;
    forced-color-adjust: none;
    transform-origin: 0 0;
    z-index: 3;
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
}

.hangout-pdf-text-layer.textLayer span,
.hangout-pdf-text-layer.textLayer br,
body.light-mode .hangout-pdf-text-layer.textLayer span {
    color: transparent !important;
    position: absolute;
    white-space: pre;
    cursor: text !important;
    transform-origin: 0% 0%;
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: all !important;
}

.hangout-pdf-text-layer.textLayer ::selection,
body.light-mode .hangout-pdf-text-layer.textLayer ::selection {
    background: rgba(2, 132, 199, 0.32) !important;
    color: transparent !important;
}

.hangout-pdf-status {
    color: #38bdf8 !important;
    font-size: 12.5px;
    font-weight: 700;
    padding: 24px 16px;
    text-align: center;
}

.hangout-viewer-iframe {
    width: 100%;
    height: 100%;
    flex: 1;
    border: none;
    background: #ffffff;
}

.hangout-viewer-img-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    overflow: auto;
}

.hangout-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Compact Footer / Extracted Metadata Strip */
.hangout-viewer-footer {
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.hangout-meta-grid {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 1px;
}

.hangout-meta-grid::-webkit-scrollbar {
    display: none;
}

.hangout-meta-chip {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    color: #e2e8f0 !important;
    flex-shrink: 0;
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text;
}

.hangout-meta-chip strong {
    color: #38bdf8 !important;
    font-weight: 700;
}

.hangout-meta-remark {
    font-size: 10px;
    color: #94a3b8 !important;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text;
}

/* Modal for Limit Exceeded */
.hangout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 25000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hangout-modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 24px;
    max-width: 440px;
    width: 100%;
    color: #f8fafc;
    box-shadow: 0 20px 45px rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
    #hangout-root {
        right: 21.5px;
        bottom: 142px; /* Centered directly above the 56px Relaunch Dashboard FAB (which sits at bottom: 80px, right: 16px) */
        gap: 7px;
    }
    .hangout-bubble {
        width: 45px;
        height: 45px;
    }
    .hangout-satellites {
        right: 56px;
        max-width: 290px;
    }
    .hangout-viewer-backdrop {
        padding: 4px;
    }
    .hangout-viewer-dialog {
        width: 98vw;
        height: 96vh;
        border-radius: 14px;
    }
    .hangout-tool-btn {
        font-size: 10.5px;
        padding: 6px 4px;
        gap: 3px;
    }
}

/* Desktop: adhesively stacked directly above the Relaunch Dashboard button (which sits at bottom: 24px, right: 24px, 56x56px) */
@media (min-width: 769px) {
    #hangout-root,
    body.react-body #hangout-root {
        right: 29.5px;
        bottom: 88px;
        gap: 8px;
    }
    .hangout-bubble {
        width: 45px;
        height: 45px;
    }
    .hangout-satellites {
        right: 58px;
    }
    .hangout-viewer-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
    }
    .hangout-viewer-top-row {
        width: auto;
        flex: 1;
    }
    .hangout-viewer-toolbar {
        display: flex;
        width: auto;
        gap: 8px;
    }
    .hangout-tool-btn {
        padding: 7px 12px;
        font-size: 11.5px;
    }
}

/* ─── MOBILE DRAG-TO-CLOSE TARGET ZONE (FUSE TO HIDE HANGOUT BUBBLE) ─────────── */
#hangout-drag-close-zone {
    position: fixed;
    left: 50%;
    bottom: 92px;
    transform: translate(-50%, 24px) scale(0.8);
    z-index: 9997;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Inter', system-ui, sans-serif;
}

#hangout-drag-close-zone.visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

#hangout-drag-close-zone .hangout-close-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.92);
    border: 2px dashed rgba(248, 113, 113, 0.85);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 16px rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f87171 !important;
    font-size: 20px;
    font-weight: 900;
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#hangout-drag-close-zone .hangout-close-hint {
    font-size: 10.5px;
    font-weight: 800;
    color: #fecaca !important;
    background: rgba(15, 23, 42, 0.88);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    white-space: nowrap;
}

#hangout-drag-close-zone.is-fusing .hangout-close-circle {
    transform: scale(1.26);
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 2.5px solid #ffffff;
    color: #ffffff !important;
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.95), 0 0 50px rgba(239, 68, 68, 0.6);
}

/* ─── RIGHT-EDGE BREATHING CHEVRON TO RESTORE CLOSED HANGOUT BUBBLE ──────────── */
#hangout-restore-chevron {
    position: fixed;
    right: 0;
    bottom: 146px;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 5px 8px 8px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(88, 28, 135, 0.92));
    border: 1.5px solid #a855f7;
    border-right: none;
    border-radius: 14px 0 0 14px;
    box-shadow: -4px 4px 16px rgba(139, 92, 246, 0.55), 0 0 12px rgba(168, 85, 247, 0.4);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    animation: hangoutRestoreBreathe 1.6s ease-in-out infinite;
}

#hangout-restore-chevron .restore-chev-icon {
    color: #f3e8ff !important;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
    animation: hangoutChevNudgeLeft 1.2s ease-in-out infinite;
}

#hangout-restore-chevron .restore-balloon-dot {
    font-size: 11px;
    line-height: 1;
}

@keyframes hangoutRestoreBreathe {
    0%, 100% {
        box-shadow: -3px 3px 12px rgba(139, 92, 246, 0.45), 0 0 0 0 rgba(168, 85, 247, 0.65);
    }
    50% {
        box-shadow: -6px 4px 20px rgba(168, 85, 247, 0.85), 0 0 0 5px rgba(168, 85, 247, 0);
    }
}

@keyframes hangoutChevNudgeLeft {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-3px);
    }
}

/* ─── MOBILE PWA EDGE-SWIPE HANDLES (LEFT->RIGHT: OCR, RIGHT->LEFT: INSPECTION) ─ */
.pwa-edge-swipe-handle {
    position: fixed;
    top: 60%;
    transform: translateY(-50%);
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    user-select: none;
    touch-action: none;
    transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, padding 0.2s ease, gap 0.2s ease;
    font-family: 'Inter', system-ui, sans-serif;
}

#pwa-edge-ocr-handle {
    left: 0;
    border-radius: 0 11px 11px 0;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.88), rgba(15, 23, 42, 0.9));
    border: 1.5px solid rgba(16, 185, 129, 0.72);
    border-left: none;
    padding-left: 3px;
    padding-right: 5px;
    animation: pwaEdgeOcrBreathe 2s ease-in-out infinite;
}

#pwa-edge-insp-handle {
    right: 0;
    border-radius: 11px 0 0 11px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 51, 68, 0.88));
    border: 1.5px solid rgba(6, 182, 212, 0.72);
    border-right: none;
    padding-left: 5px;
    padding-right: 3px;
    animation: pwaEdgeInspBreathe 2s ease-in-out infinite;
}

/* Idle: Chevron only (icon + label collapsed cleanly so calculator behind is unobstructed) */
.pwa-edge-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0;
    max-width: 0;
    height: 15px;
    opacity: 0;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.2s ease, max-width 0.2s ease, opacity 0.18s ease, margin 0.2s ease;
}

.pwa-edge-pull-label {
    font-size: 11px;
    font-weight: 800;
    color: #ffffff !important;
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.2s ease, opacity 0.18s ease, margin 0.2s ease;
}

/* Expanded (1st tap) or Pulling (swipe): reveal full icon + short name ("Scanner" / "Inspection") */
.pwa-edge-swipe-handle.is-expanded,
.pwa-edge-swipe-handle.is-pulling {
    gap: 5px;
    padding: 8px 9px !important;
}

.pwa-edge-swipe-handle.is-expanded .pwa-edge-tool-icon,
.pwa-edge-swipe-handle.is-pulling .pwa-edge-tool-icon {
    width: 15px;
    max-width: 16px;
    opacity: 1;
    animation: pwaEdgeIconPulse 1.8s ease-in-out infinite;
}

.pwa-edge-swipe-handle.is-expanded .pwa-edge-pull-label,
.pwa-edge-swipe-handle.is-pulling .pwa-edge-pull-label {
    max-width: 110px;
    opacity: 1;
}

.pwa-edge-chevron-right {
    color: #34d399 !important;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
    animation: pwaChevRightNudge 1.3s ease-in-out infinite;
}

.pwa-edge-chevron-left {
    color: #22d3ee !important;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
    animation: pwaChevLeftNudge 1.3s ease-in-out infinite;
}

.pwa-edge-swipe-handle.is-ready-trigger {
    box-shadow: 0 0 22px rgba(52, 211, 153, 0.9) !important;
    border-color: #ffffff !important;
}

@keyframes pwaEdgeOcrBreathe {
    0%, 100% {
        box-shadow: 2px 0 12px rgba(16, 185, 129, 0.35), 0 0 0 0 rgba(16, 185, 129, 0.55);
    }
    50% {
        box-shadow: 4px 0 18px rgba(16, 185, 129, 0.75), 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

@keyframes pwaEdgeInspBreathe {
    0%, 100% {
        box-shadow: -2px 0 12px rgba(6, 182, 212, 0.35), 0 0 0 0 rgba(6, 182, 212, 0.55);
    }
    50% {
        box-shadow: -4px 0 18px rgba(6, 182, 212, 0.75), 0 0 0 4px rgba(6, 182, 212, 0);
    }
}

@keyframes pwaEdgeIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.14); }
}

@keyframes pwaChevRightNudge {
    0%, 100% { transform: translateX(0); opacity: 0.75; }
    50% { transform: translateX(3px); opacity: 1; }
}

@keyframes pwaChevLeftNudge {
    0%, 100% { transform: translateX(0); opacity: 0.75; }
    50% { transform: translateX(-3px); opacity: 1; }
}
