/* Webcam Test — Technical Camera Diagnostics Workbench */
.wct-top-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.wct-title-block h1 {
    margin: 8px 0 4px;
    font-size: clamp(1.55rem, 2.4vw, 2.1rem);
    letter-spacing: -0.03em;
}

.wct-title-block p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.wct-quick-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wct-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.95fr);
    gap: 22px;
    align-items: start;
}

.wct-stage-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.wct-viewfinder {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #070b14;
    overflow: hidden;
}

.wct-viewfinder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    transition: transform 0.2s ease;
}

.wct-viewfinder.no-mirror video {
    transform: scaleX(1);
}

.wct-hud-corners span {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: rgba(255, 255, 255, 0.45);
    border-style: solid;
    pointer-events: none;
}
.wct-hud-corners span:nth-child(1) { top: 14px; left: 14px; border-width: 2px 0 0 2px; }
.wct-hud-corners span:nth-child(2) { top: 14px; right: 14px; border-width: 2px 2px 0 0; }
.wct-hud-corners span:nth-child(3) { bottom: 14px; left: 14px; border-width: 0 0 2px 2px; }
.wct-hud-corners span:nth-child(4) { bottom: 14px; right: 14px; border-width: 0 2px 2px 0; }

.wct-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background-image:
        linear-gradient(to right, transparent 33.2%, rgba(255,255,255,0.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,0.35) 66.6%, transparent 66.8%),
        linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,0.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,0.35) 66.6%, transparent 66.8%);
    transition: opacity 0.2s ease;
}
.wct-grid-overlay.is-on { opacity: 1; }

.wct-crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wct-crosshair.is-on { opacity: 1; }
.wct-crosshair::before, .wct-crosshair::after {
    content: "";
    position: absolute;
    background: rgba(56, 189, 248, 0.85);
}
.wct-crosshair::before { width: 28px; height: 2px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.wct-crosshair::after { width: 2px; height: 28px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.wct-live-pill {
    position: absolute;
    top: 16px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    color: #f8fafc;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wct-live-pill.is-visible { opacity: 1; }
.wct-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }

.wct-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: #cbd5e1;
    background: radial-gradient(circle at center, #13203b 0%, #070b14 75%);
}
.wct-placeholder.is-hidden { display: none; }
.wct-placeholder-ico {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    margin-bottom: 14px;
}
.wct-placeholder h2 { margin: 0 0 6px; font-size: 1.15rem; color: #f8fafc; }
.wct-placeholder p { margin: 0; font-size: 0.9rem; max-width: 360px; color: #94a3b8; }

.wct-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
}

.wct-tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wct-toolbar .btn[aria-pressed="true"] {
    background: color-mix(in srgb, var(--tool-accent) 14%, transparent);
    border-color: var(--tool-accent);
    color: var(--tool-accent);
}

.wct-snapshots {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

.wct-snap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.wct-snap-header h3 { margin: 0; font-size: 0.92rem; }

.wct-snap-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.wct-snap-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}
.wct-snap-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wct-snap-actions {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--bg-elev);
    font-size: 0.76rem;
}
.wct-snap-actions a, .wct-snap-actions button {
    border: none;
    background: none;
    color: var(--tool-accent);
    font-weight: 600;
    padding: 0;
}
.wct-snap-actions button { color: #ef4444; }

/* Telemetry Sidebar */
.wct-telemetry {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wct-panel {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.wct-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wct-panel-title {
    margin: 0 0 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
}
.wct-panel-head .wct-panel-title { margin-bottom: 0; }

.wct-luma-badge {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.wct-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.wct-spec-box {
    padding: 11px 12px;
    border-radius: 10px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}
.wct-spec-label { display: block; font-size: 0.74rem; color: var(--text-soft); margin-bottom: 2px; }
.wct-spec-val { font-family: var(--font-mono); font-size: 1rem; color: var(--text); }

.wct-meta-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.86rem;
}
.wct-meta-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 7px;
    border-bottom: 1px dashed var(--border);
}
.wct-meta-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.wct-meta-list dt { color: var(--text-muted); }
.wct-meta-list dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; max-width: 65%; }

#wct-histogram {
    width: 100%;
    height: 92px;
    border-radius: 8px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.wct-rgb-bars { display: flex; flex-direction: column; gap: 6px; }
.wct-rgb-row {
    display: grid;
    grid-template-columns: 16px 1fr 30px;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
}
.wct-bar { height: 7px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.wct-bar i { display: block; height: 100%; width: 0%; border-radius: 99px; transition: width 0.15s ease; }
#bar-r { background: #ef4444; }
#bar-g { background: #22c55e; }
#bar-b { background: #3b82f6; }
.wct-rgb-row em { font-style: normal; text-align: right; color: var(--text-muted); }

.wct-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.wct-checklist li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.88rem;
    color: var(--text-soft);
}
.wct-checklist li svg {
    padding: 3px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-soft);
}
.wct-checklist li.is-pass { color: var(--text); font-weight: 500; }
.wct-checklist li.is-pass svg { background: rgba(34, 197, 94, 0.16); color: #16a34a; }

@media (max-width: 980px) {
    .wct-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .wct-quick-controls { width: 100%; }
    .wct-quick-controls select { flex: 1 1 140px; }
}
