.webcam-capture {
    font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--webcam-border, #e2e8f0);
    background: var(--webcam-surface, #f8fafc);
    color: var(--webcam-text, #0f172a);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    max-width: 560px;
    color-scheme: light dark;
    --webcam-text: #0f172a;
    --webcam-muted: #64748b;
    --webcam-border: #e2e8f0;
    --webcam-surface: #f8fafc;
    --webcam-panel: #ffffff;
    --webcam-accent: #0ea5e9;
    --webcam-accent-strong: #0284c7;
    --webcam-danger: #ef4444;
    --webcam-ready: #10b981;
}

.dark .webcam-capture,
.dark-theme .webcam-capture,
[data-theme="dark"] .webcam-capture {
    --webcam-text: #f8fafc;
    --webcam-muted: #94a3b8;
    --webcam-border: #334155;
    --webcam-surface: #0f172a;
    --webcam-panel: #111827;
    --webcam-accent: #38bdf8;
    --webcam-accent-strong: #0ea5e9;
    --webcam-danger: #f87171;
    --webcam-ready: #34d399;
}

.webcam-capture__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.webcam-capture__title {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.webcam-capture__status {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--webcam-muted, #64748b);
}

.webcam-capture__status[data-tone="ready"] {
    color: var(--webcam-ready, #10b981);
}

.webcam-capture__status[data-tone="active"] {
    color: var(--webcam-accent, #0ea5e9);
}

.webcam-capture__status[data-tone="error"] {
    color: var(--webcam-danger, #ef4444);
}

.webcam-capture__video {
    background: var(--webcam-panel, #ffffff);
    border-radius: 14px;
    border: 1px solid var(--webcam-border, #e2e8f0);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
}

.webcam-capture__video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webcam-capture__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.webcam-capture__button {
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: var(--webcam-accent, #0ea5e9);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

.webcam-capture__button:hover {
    background: var(--webcam-accent-strong, #0284c7);
    transform: translateY(-1px);
}

.webcam-capture__button:active {
    transform: translateY(0);
}

.webcam-capture__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--webcam-muted, #64748b);
}

.webcam-capture__toggle input {
    appearance: none;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.3);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.webcam-capture__toggle input::after {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.webcam-capture__toggle input:checked {
    background: var(--webcam-accent, #0ea5e9);
}

.webcam-capture__toggle input:checked::after {
    transform: translateX(18px);
}

.webcam-capture__toggle span {
    font-weight: 500;
}

@media (max-width: 560px) {
    .webcam-capture {
        padding: 14px;
    }

    .webcam-capture__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .webcam-capture__button {
        width: 100%;
        justify-content: center;
    }
}
