/* A bounded workspace: only the camera library and detail panels scroll. */
body:has(.camera-workspace) { overflow: hidden; }
.premium-shell:has(.camera-workspace) { height: 100dvh; min-height: 0; display: flex; flex-direction: column; background-color: #101416; background-image: linear-gradient(#a4c9c905 1px, transparent 1px), linear-gradient(90deg, #a4c9c905 1px, transparent 1px); background-size: 32px 32px; }
.premium-shell:has(.camera-workspace) > main { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 12px 18px 6px; display: flex; flex-direction: column; overflow: hidden; }
.premium-shell:has(.camera-workspace) .premium-topbar { background: #141a1d; border: 0; box-shadow: 0 1px 0 #9be1d314; }
.premium-shell:has(.camera-workspace) .premium-topbar::before,
.premium-shell:has(.camera-workspace) .premium-topbar::after { display: none; }
.premium-shell:has(.camera-workspace) .dashboard-header-tools { flex-shrink: 0; min-height: 54px; margin: 0 0 4px; padding: 4px 0; background: transparent; border: 0; box-shadow: none; }
.premium-shell:has(.camera-workspace) .dashboard-compact-actions { gap: 12px; }
.premium-shell:has(.camera-workspace) .compact-icon-button { min-width: 40px; width: 40px; height: 40px; border: 0; border-radius: 6px; background: #ffffff06; box-shadow: none; }
.premium-shell:has(.camera-workspace) .compact-icon-button:hover:not(:disabled) { background: #ffffff12; }
.premium-shell:has(.camera-workspace) .service-label { font: 600 12px/1.4 "Segoe UI", Arial, sans-serif; letter-spacing: 0; color: #b6c5ca; }
main:has(.camera-workspace) > .camera-wall { flex: 1; min-height: 0; margin: 0; display: flex; }
main:has(.camera-workspace) .compact-admin-panel { position: fixed; z-index: 1150; top: 65px; left: 16px; right: 16px; max-height: calc(100dvh - 90px); overflow: auto; }
.camera-wall.camera-wall-fullscreen:has(.camera-workspace) { display: flex !important; padding: 8px !important; background: #101214; }
.premium-shell:has(.workspace-secondary) > .topbar,
main:has(.workspace-secondary) > .dashboard-header-tools { display: none; }
.camera-workspace { --wall-border: #ffffff14; --wall-muted: #a2b1b7; --wall-surface: #1a2226; color: #edf4f5; font: 14px/1.4 "Segoe UI", Arial, sans-serif; letter-spacing: 0; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.camera-workspace *, .camera-workspace *::before, .camera-workspace *::after { box-sizing: border-box; letter-spacing: 0; }
.camera-workspace button, .camera-workspace select, .camera-workspace input { font: inherit; color: inherit; border: 1px solid var(--wall-border); border-radius: 4px; background: #24292e; min-height: 36px; box-shadow: none; text-transform: none; }
.camera-workspace button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; cursor: pointer; }
.camera-workspace select { padding: 5px 26px 5px 8px; max-width: 100%; }
.camera-workspace input { padding: 7px 10px; min-width: 0; }
.camera-workspace button:hover:not(:disabled) { background: #3a4249; border-color: #87949f; }
.camera-workspace button:disabled { opacity: .4; cursor: default; }
.camera-workspace :focus-visible { outline: 2px solid #66c8ee; outline-offset: 2px; }
.camera-workspace .wall-tool { width: 40px; height: 40px; min-width: 40px; flex: 0 0 40px; padding: 10px; background: transparent; border-color: transparent; display: inline-flex; align-items: center; justify-content: center; color: #b9c8cf; text-decoration: none; border-radius: 6px; }
.camera-workspace a.wall-tool:hover { background: #3a4249; }
.camera-workspace .wall-tool.active { background: #244754; border-color: #4eabc9; }
.wall-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor; mask: var(--wall-icon) center / contain no-repeat; -webkit-mask: var(--wall-icon) center / contain no-repeat; }
.workspace-toolbar { display: flex; align-items: center; gap: 12px; flex: 0 0 60px; padding: 0 0 12px; }
.workspace-group-select { width: 230px; min-width: 110px; }
.workspace-count { color: var(--wall-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.workspace-toolbar-space { flex: 1; }
.workspace-notice { display: flex; align-items: center; justify-content: space-between; background: #473b20; padding: 4px 10px; margin-bottom: 8px; flex-shrink: 0; }
.workspace-body { display: flex; gap: 10px; flex: 1; min-height: 0; position: relative; }
.workspace-wall { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.workspace-grid { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-columns: repeat(var(--wall-columns), minmax(0, 1fr)); grid-template-rows: repeat(var(--wall-rows), minmax(0, 1fr)); gap: 12px; overflow: hidden; }
.camera-workspace .workspace-tile { container-type: inline-size; display: flex; flex-direction: column; position: relative; min-height: 0; min-width: 0; height: auto; width: auto; margin: 0; padding: 0; border: 0; border-radius: 7px; background: #090d0f; overflow: hidden; box-shadow: none; transform: none; }
.camera-workspace .workspace-tile:hover { transform: none; }
.workspace-tile-header { display: flex; align-items: center; flex-shrink: 0; min-height: 48px; gap: 7px; padding: 5px 8px; background: var(--wall-surface); z-index: 2; }
.workspace-tile-header strong { font: 600 14px/1.25 "Segoe UI", Arial, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.camera-workspace .workspace-tile-header .wall-tool { width: 34px; height: 36px; min-width: 34px; flex-basis: 34px; padding: 7px; }
.camera-workspace .workspace-tile-header .workspace-grip { width: 24px; min-width: 24px; flex-basis: 24px; padding: 3px; color: #7f949c; }
.workspace-tile-header .wall-tool:last-child { margin-left: 4px; color: #9babad; }
.workspace-tile-header .camera-tile-state { flex-shrink: 0; width: 8px; height: 8px; }
.workspace-grip { cursor: grab !important; user-select: none; }
.workspace-grip:active { cursor: grabbing !important; }
.workspace-dragging .workspace-video iframe { pointer-events: none; }
.workspace-dragging .workspace-video::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.workspace-grip { cursor: grab !important; touch-action: none; }
.workspace-grip svg { pointer-events: none; }
.workspace-dragging .workspace-grip { cursor: grabbing !important; }
.workspace-dragging .workspace-tile { outline: 1px dashed #759c9d; outline-offset: -2px; }
.workspace-dragging .workspace-drag-source { opacity: .6; }
.workspace-dragging .workspace-drop-target { outline: 2px solid #83e4cf; outline-offset: -2px; }
.workspace-drop-target .workspace-tile-header { background: #244b45; }
.camera-workspace .workspace-video { flex: 1; min-height: 0; height: auto; aspect-ratio: auto; position: relative; overflow: hidden; }
.workspace-video iframe { position: absolute; inset: 0; height: 100%; width: 100%; border: 0; }
.workspace-video .offline { position: absolute; inset: 0; display: grid; place-content: center; background: #111719; font: 500 13px/1.4 "Segoe UI", Arial, sans-serif; }
.workspace-video .offline span { letter-spacing: 0; border: 0; background: transparent; color: #8eaaaf; box-shadow: none; }
.workspace-reconnecting { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border: 1px solid #ad8741; border-radius: 4px; color: #ffe0a0; background: #322918; font-size: 13px; }
.workspace-tile-footer { min-height: 44px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 5px 10px; background: #161e21; flex-shrink: 0; }
.camera-workspace .workspace-tile-footer select { min-height: 32px; height: 32px; min-width: 90px; width: 103px; font-size: 13px; padding-block: 2px; background: #ffffff06; border-color: transparent; }
.workspace-rate { font-size: 12px; font-variant-numeric: tabular-nums; color: #c5cdd4; white-space: nowrap; }
.workspace-position { color: #a8e1c4; font: 12px/1.3 Consolas, monospace; overflow-wrap: anywhere; margin-left: auto; }
.workspace-tile-settings { position: absolute; top: 50px; right: 8px; z-index: 5; width: min(260px, calc(100% - 16px)); max-height: calc(100% - 56px); overflow: auto; padding: 14px; border: 1px solid #ffffff20; border-radius: 6px; background: #252f33; box-shadow: 0 8px 24px #0008; }
.workspace-tile-settings label { display: grid; gap: 5px; margin-bottom: 10px; }
.workspace-tile-settings label:last-child { margin: 0; }
.workspace-pagebar { display: flex; align-items: center; gap: 8px; flex: 0 0 42px; color: var(--wall-muted); font-size: 13px; }
.workspace-library { width: 310px; flex: 0 0 310px; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 0; border-right: 1px solid var(--wall-border); background: #171f22; }
.workspace-library-head { display: flex; align-items: center; justify-content: space-between; }
.workspace-library h2 { margin: 0; font: 600 17px/1.3 "Segoe UI", Arial, sans-serif; }
.workspace-library-list { flex: 1; min-height: 70px; overflow-y: auto; }
.workspace-library-item { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid #353c42; cursor: pointer; }
.camera-workspace input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; accent-color: #48b4d3; }
.workspace-library-item > span:last-child { flex: 1; min-width: 0; }
.workspace-library-item strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.workspace-library-item small { display: block; color: var(--wall-muted); font: 12px/1.5 "Segoe UI", Arial, sans-serif; overflow-wrap: anywhere; }
.workspace-library-footer { border-top: 1px solid var(--wall-border); padding-top: 10px; display: grid; gap: 12px; }
.workspace-check { display: flex; align-items: center; gap: 8px; }
.workspace-library-actions { display: flex; gap: 8px; }
.workspace-library-actions > button:not(.wall-tool) { flex: 1; font-size: 13px; }
.workspace-field { display: grid; gap: 5px; color: #c5cdd4; font-size: 13px; }
.workspace-muted { color: var(--wall-muted); }
.workspace-empty { grid-area: 1 / 1 / -1 / -1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
.workspace-empty .wall-icon { width: 36px; height: 36px; flex-basis: 36px; color: #8fbdc8; }
.workspace-empty h2 { font: 500 18px/1.4 "Segoe UI", Arial, sans-serif; margin: 0; }
@media (max-width: 1000px) {
    .workspace-library { position: absolute; inset: 0 auto 0 0; width: min(350px, 100%); z-index: 10; box-shadow: 10px 0 30px #0006; }
}
@media (max-width: 700px) {
    .premium-shell:has(.camera-workspace) .premium-topbar { display: flex !important; align-items: center !important; flex: 0 0 54px; min-height: 54px; padding: 6px 10px !important; gap: 8px; flex-wrap: nowrap; }
    .premium-shell:has(.camera-workspace) .brand-lockup { flex: 1; min-width: 0; gap: 5px; }
    .premium-shell:has(.camera-workspace) .brand { font-size: 16px !important; letter-spacing: 0; }
    .premium-shell:has(.camera-workspace) .brand-mark { display: none; }
    .premium-shell:has(.camera-workspace) .topbar-user { flex: 0 0 auto; gap: 2px; flex-wrap: nowrap; }
    .premium-shell:has(.camera-workspace) .topbar-icon-link { width: 30px; height: 34px; min-width: 30px; }
    .premium-shell:has(.camera-workspace) .user-identity { display: none; }
    .premium-shell:has(.camera-workspace) > main { padding: 5px; }
    .workspace-toolbar { gap: 3px; }
    .workspace-count { display: none; }
    .workspace-group-select { flex: 1; width: 120px; }
    .workspace-toolbar-space { min-width: 0; }
    .workspace-toolbar > .workspace-toolbar-space { display: none; }
    .workspace-tile-header { gap: 3px; }
    .workspace-tile-header .workspace-grip { display: none; }
    .premium-shell:has(.camera-workspace) .dashboard-compact-actions { gap: 6px; }
    .premium-shell:has(.camera-workspace) .service-label { font-size: 10px; }
    .workspace-pagebar > span:first-child { display: none; }
}
@container (max-width: 340px) {
    .workspace-tile-header { gap: 3px; padding-inline: 4px; }
    .camera-workspace .workspace-tile-header .wall-tool { width: 28px; min-width: 28px; flex-basis: 28px; padding: 4px; }
    .workspace-tile-header strong { font-size: 13px; }
    .workspace-tile-footer { gap: 6px; padding-inline: 6px; }
    .workspace-rate { font-size: 11px; }
}
