/* Operator.Construct call surface. Colours come from ConstructBranding via inline --construct-* vars on .construct-call. */
.construct-call {
    --construct-primary: #1f6f54;
    --construct-accent: #2f9e79;
    --construct-surface: #10151b;
    --construct-on-surface: #f3f5f7;

    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--construct-surface);
    color: var(--construct-on-surface);
    font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    overflow: hidden;
}

.construct-call__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, .35);
    flex: 0 0 auto;
    z-index: 3;
}

.construct-call__logo { height: 28px; width: auto; }
.construct-call__title { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.construct-call__subtitle { font-size: 12px; opacity: .7; margin-left: 4px; }

.construct-call__status {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}
.construct-call__status--live { background: rgba(47, 158, 121, .25); color: #c8f3e2; }
.construct-call__status--reconnecting { background: rgba(214, 158, 46, .25); color: #f4dea0; }
.construct-call__status--ended { background: rgba(200, 80, 80, .25); color: #f3c8c8; }

/* Video stage */
.construct-call__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #06090c;
}

.construct-call__remote {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.construct-call__remote video { width: 100%; height: 100%; object-fit: cover; }

.construct-call__waiting {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 24px;
}
.construct-call__waiting-dot {
    width: 54px; height: 54px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .15);
    border-top-color: var(--construct-accent);
    animation: construct-spin 1s linear infinite;
}
@keyframes construct-spin { to { transform: rotate(360deg); } }

.construct-call__local {
    position: absolute;
    right: 16px;
    bottom: 92px;
    width: 200px;
    max-width: 38vw;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .12);
    z-index: 2;
}
.construct-call__local video { width: 100%; height: 100%; object-fit: cover; }
.construct-call__local--off { display: none; }

/* Multi-participant tiles (room PTZ camera support). Each remote stream gets a tile inside .construct-call__remote;
   construct-call.js applyLayout() positions it as main (full stage) / pip (corner) / hidden by role + spotlight.
   A room camera tile carries an inline background-image (the stock holding image) shown until its live PTZ renders. */
.construct-tile { position: absolute; overflow: hidden; background-color: #000; }
.construct-tile video { width: 100%; height: 100%; object-fit: cover; }
.construct-tile--hidden { display: none; }
.construct-tile--main { inset: 0; z-index: 1; }
.construct-tile--pip {
    top: 16px;
    right: 16px;
    width: 200px;
    max-width: 38vw;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    z-index: 3;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .12);
}

/* Controls */
.construct-call__controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px;
    background: rgba(0, 0, 0, .4);
    z-index: 3;
    flex-wrap: wrap;
}

.construct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: var(--construct-on-surface);
    font-size: 14px;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
}
.construct-btn:hover { background: rgba(255, 255, 255, .2); }
.construct-btn:active { transform: scale(.96); }
.construct-btn:disabled { opacity: .45; cursor: not-allowed; }
.construct-btn--active { background: var(--construct-accent); color: #06241b; }
.construct-btn--danger { background: #c0392b; color: #fff; }
.construct-btn--danger:hover { background: #d9483a; }

.construct-call__camera select {
    height: 48px;
    border-radius: 999px;
    border: none;
    padding: 0 14px;
    background: rgba(255, 255, 255, .12);
    color: var(--construct-on-surface);
    font-size: 13px;
    max-width: 220px;
}

.construct-call__error {
    position: absolute;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%);
    background: rgba(192, 57, 43, .92);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 90vw;
    z-index: 4;
}

@media (max-width: 640px) {
    .construct-call__local { width: 120px; bottom: 84px; right: 10px; }
    .construct-call__controls { gap: 8px; padding: 10px; }
    .construct-btn { height: 44px; min-width: 44px; padding: 0 12px; font-size: 13px; }
    .construct-call__camera select { height: 44px; max-width: 150px; }
}
