.ox8bs-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; font-size: 15px; line-height: 1.4;
    cursor: pointer; border: 1px solid #3d7cda; background: #3d7cda; color: #fff;
    border-radius: 4px; text-decoration: none;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.ox8bs-trigger:hover { background: #2a63b8; border-color: #2a63b8; color: #fff; text-decoration: none; }

.ox8bs-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 2147483640 !important;
    isolation: isolate;
    background: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center;
    padding: 6px;
    margin: 0 !important; border: none !important;
    float: none !important; transform: none !important;
}

.ox8bs-popup {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    z-index: 1;
    margin: 0 !important; padding: 0 !important; float: none !important;
}
.ox8bs-popup, .ox8bs-popup * { box-sizing: border-box !important; }
@media (max-width: 540px) {
    .ox8bs-popup { max-width: 100%; border-radius: 6px; }
}

.ox8bs-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    background: #f8f8f8; border-bottom: 1px solid #e5e5e5;
}
.ox8bs-popup-title { font-size: 15px; font-weight: 600; color: #333; }

.ox8bs-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 14px; font-size: 14px; font-weight: 500;
    border: 1px solid #ccc; background: #fff; color: #333;
    border-radius: 6px; cursor: pointer; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; user-select: none;
    touch-action: manipulation; position: relative; z-index: 10;
}
.ox8bs-btn:hover { background: #f5f5f5; }
.ox8bs-btn-close { font-size: 13px; padding: 5px 10px; }
.ox8bs-btn-find { background: #3d7cda; color: #fff; border-color: #3d7cda; flex-shrink: 0; }
.ox8bs-btn-find:hover { background: #2a63b8; }
.ox8bs-btn-restart { background: #5cb85c; color: #fff; border-color: #5cb85c; }
.ox8bs-btn-restart:hover { background: #449d44; }
.ox8bs-btn-torch { background: #f0ad4e; color: #fff; border-color: #f0ad4e; }
.ox8bs-btn-torch:hover { background: #ec971f; }
.ox8bs-btn-torch.active { background: #fff; color: #f0ad4e; border-color: #f0ad4e; }

.ox8bs-viewport {
    background: #000;
    overflow: hidden;
}
.ox8bs-viewport video {
    width: 100%;
    max-height: 50vh;
    max-height: 50dvh;
    display: block;
    background: #000;
}

.ox8bs-camera-hint {
    padding: 4px 12px; background: #111; color: rgba(255,255,255,0.5);
    font-size: 11px; text-align: center;
}

.ox8bs-status {
    padding: 7px 12px; background: #fafafa; border-bottom: 1px solid #eee;
    min-height: 32px; display: flex; align-items: center;
    transition: background-color 0.4s ease;
}
.ox8bs-status-text { font-size: 13px; color: #555; line-height: 1.3; transition: color 0.3s; }
.ox8bs-status--warning { background-color: #fef3f2; }
.ox8bs-status--warning .ox8bs-status-text { color: #c9302c; font-weight: 500; }
.ox8bs-status--success { background-color: #f0f9f0; }
.ox8bs-status--success .ox8bs-status-text { color: #3c763d; }
.ox8bs-status--searching { background-color: #f0f6fc; }
.ox8bs-status--searching .ox8bs-status-text { color: #31708f; }

.ox8bs-controls { display: flex; gap: 8px; padding: 7px 12px; }

.ox8bs-manual { display: flex; gap: 8px; padding: 0 12px 8px; }
.ox8bs-manual-input {
    flex: 1; min-width: 0; padding: 9px 12px;
    font-size: 16px; border: 1px solid #ccc; border-radius: 6px;
    outline: none; -webkit-appearance: none;
}
.ox8bs-manual-input:focus { border-color: #3d7cda; box-shadow: 0 0 0 2px rgba(61,124,218,0.2); }
.ox8bs-manual-input::placeholder { color: #999 !important; opacity: 1 !important; font-style: normal !important; }

.ox8bs-results { padding: 0 12px 8px; max-height: 160px; overflow-y: auto; }
.ox8bs-results-title { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; }
.ox8bs-results-list { list-style: none; margin: 0; padding: 0; }
.ox8bs-results-list li { margin-bottom: 3px; }
.ox8bs-results-list a {
    display: block; padding: 7px 10px; background: #f5f5f5;
    border: 1px solid #e5e5e5; border-radius: 4px;
    color: #3d7cda; font-size: 13px; text-decoration: none;
}
.ox8bs-results-list a:hover { background: #eef4fc; border-color: #3d7cda; }

.ox8bs-loading {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    z-index: 5; pointer-events: none;
}
.ox8bs-loading span { font-size: 14px; color: #555; }
.ox8bs-spinner {
    width: 32px; height: 32px;
    border: 3px solid #e5e5e5; border-top-color: #3d7cda;
    border-radius: 50%; animation: ox8bs-spin .8s linear infinite;
}
@keyframes ox8bs-spin { to { transform: rotate(360deg); } }

.ox8bs-demo-banner {
    padding: 6px 12px; background: #fff3cd; border-bottom: 1px solid #ffc107;
    font-size: 12px; color: #856404; text-align: center; line-height: 1.4;
}
