.camera-card{background:#fff;border:1px solid #e8edf5;border-radius:19px;padding:22px;margin-top:22px;overflow:hidden}
.camera-card-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.camera-live-surface{background:#142035;border-radius:14px;overflow:hidden;aspect-ratio:16/9;display:grid;place-items:center}.camera-live-surface video{display:block;width:100%;height:100%;max-height:65vh;object-fit:contain;background:#142035}.camera-live-status{font-size:12px;color:#55718d;line-height:1.7;min-height:40px;margin:17px 0}.camera-live-status.is-error{color:#9b6a17}.camera-live-actions{display:flex;gap:10px;margin-bottom:17px}.camera-live-actions [hidden]{display:none}.camera-live-surface video[hidden]{display:none}
.camera-live-actions{flex-wrap:wrap}.camera-live-actions .btn{min-height:44px;padding:11px 15px}.camera-live-diagnostics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0;padding:15px 0;border-top:1px solid #e9eef5;border-bottom:1px solid #e9eef5}.camera-live-diagnostics div{min-width:0}.camera-live-diagnostics dt{font-size:9px;letter-spacing:.3px;color:#7a8ca4;margin-bottom:5px}.camera-live-diagnostics dd{font-size:12px;font-weight:600;line-height:1.5;color:#36506f;margin:0;overflow-wrap:anywhere}.camera-live-diagnostics small{display:block;font-size:9px;line-height:1.6;color:#8293a9;margin-top:4px}.camera-live-metric-note,.camera-live-lag,.camera-live-hint{font-size:10px;line-height:1.6;color:#7b8da6;margin:10px 0}.camera-live-hint:empty,.camera-live-lag:empty{display:none}.camera-live-lag{color:#55718d;margin:12px 0}.camera-live-surface:fullscreen{width:100vw;height:100dvh;aspect-ratio:auto;border-radius:0;background:#000}.camera-live-surface:fullscreen video{height:100%;max-height:none;background:#000}.camera-live-surface video:-webkit-full-screen{max-height:none;background:#000}
.camera-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.camera-heading h2{font-size:19px;letter-spacing:-.5px;margin:5px 0 0}.camera-heading .eyebrow{font-size:8px}.camera-heading .btn{flex-shrink:0;font-size:11px;min-height:39px;padding:9px 13px}
.camera-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;margin:19px 0 12px;color:#71839d}.camera-status strong{font-weight:600;color:#344b68}.camera-status>span:last-child:not(.status-dot){margin-left:auto}.camera-stale strong,.camera-error strong{color:#9b701f}.camera-picture{border-radius:12px;overflow:hidden;background:#eef2f8}.camera-picture img{display:block;width:100%;height:auto;max-height:520px;object-fit:contain}.camera-placeholder{display:grid;place-content:center;min-height:150px;border-radius:12px;background:#f5f7fb;text-align:center;color:#8797ad;font-size:12px}.camera-placeholder>span{font-size:32px;line-height:1}.camera-placeholder p{margin:8px 0 0}.camera-detail{font-size:11px;line-height:1.65;color:#73849b;margin:13px 0 0}.camera-stamps{display:flex;gap:7px 20px;flex-wrap:wrap;font-size:10px;line-height:1.7;color:#6b7f99;margin-top:8px}.camera-stamps time{color:#354e6e}.camera-caption{font-size:9px;line-height:1.6;color:#8c9bb0;margin:9px 0 0}
@media(max-width:767px){.camera-card{padding:18px;margin-top:20px}.camera-heading h2{font-size:18px}.camera-heading .eyebrow{font-size:7px}.camera-heading .btn{font-size:10px;padding:8px 10px}.camera-stamps{display:grid;gap:2px}.camera-status{font-size:10px}.camera-picture img{max-height:360px}}
@media(max-width:450px){.camera-heading{flex-wrap:wrap;gap:12px}.camera-card-actions{margin-left:auto}.camera-live-actions{gap:8px}.camera-live-actions .btn{flex:1 1 calc(50% - 8px);font-size:11px}.camera-live-diagnostics{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.camera-live-diagnostics>div:last-child{grid-column:1/-1}.camera-live-status{margin:13px 0;min-height:0}.camera-live-surface{border-radius:10px}}

/* Home camera: compact preview with one clear live action. */
.camera-card{padding:14px 14px 0;margin-bottom:22px;border-radius:20px;border-color:#e7e5ef;box-shadow:0 4px 18px #34245c04}
.camera-preview{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:16/9;max-height:280px;min-height:164px;border-radius:13px;overflow:hidden;isolation:isolate;color:#fff;background:#231a38}
.camera-preview-illustrated{background:repeating-radial-gradient(circle at center,#f4eaff12 0 1px,transparent 2px 35px),radial-gradient(ellipse at 52% 44%,#6d4ab4,#2c1e47 72%)}
.camera-preview>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2}
.camera-preview::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#171022b8,transparent 50%,#17102255)}
.camera-preview-heading{position:absolute;top:14px;left:16px;pointer-events:none}
.camera-preview-heading>span{font-size:9px;font-weight:650;letter-spacing:1px;color:#f1e8ff}
.camera-preview-heading h2{font-size:clamp(16px,3vw,22px);color:#fff;margin:3px 0 0;line-height:1.2}
.camera-open{display:flex;flex-direction:column;align-items:center;gap:7px;min-width:80px;min-height:44px;margin-top:24px;padding:4px;border-radius:12px;color:#fff;font-size:12px;font-weight:650;text-shadow:0 1px 5px #1b102d}
.camera-play-disc{display:grid;place-items:center;width:56px;height:56px;border:1px solid #ffffffa0;border-radius:50%;background:#7958df;box-shadow:0 4px 24px #130a3755;transition:background .15s,transform .15s}
.camera-play-disc svg{width:27px;height:27px;margin-left:2px}
.camera-open:hover:not(:disabled) .camera-play-disc{background:#6944d4;transform:scale(1.08)}
.camera-open:focus-visible{outline:3px solid #e9dbff;outline-offset:3px}
.camera-open:disabled{opacity:.5;cursor:default}
.camera-preview-label{position:absolute;bottom:8px;right:10px;color:#fff;font-size:10px;background:#181124aa;padding:4px 7px;border-radius:5px;pointer-events:none}
.camera-photo-details{margin-top:14px;border-top:1px solid #efedf4;color:#858095;font-size:11px}
.camera-photo-details summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;min-height:46px;padding:8px 3px;list-style:none}
.camera-photo-details summary::-webkit-details-marker{display:none}
.camera-photo-details summary:focus-visible{outline:2px solid #bda7ff;outline-offset:-2px;border-radius:6px}
.camera-photo-details .camera-status{margin:0;gap:5px;font-size:10px;color:#858095;line-height:1.5}
.camera-photo-details .camera-status strong{font-weight:500;color:inherit}
.camera-photo-details .camera-status>span:last-child{margin-left:0}
.camera-details-label{display:flex;align-items:center;gap:7px;font-size:10px;white-space:nowrap;color:#80728f}
.camera-details-label svg{height:14px;width:14px;transition:transform .15s}
.camera-photo-details[open] .camera-details-label svg{transform:rotate(180deg)}
.camera-photo-info{padding:0 3px 16px}
.camera-photo-info .camera-detail{margin:2px 0 0}
.camera-archived-picture{max-width:540px;margin:12px 0 0}
.camera-refresh{display:flex;align-items:center;gap:7px;min-height:44px;color:#6d5a9b;font-size:11px;white-space:nowrap}
.camera-refresh svg{width:16px;height:16px}

/* Player: a wide media surface, persistent transport controls and compact tools. */
html:has(dialog.camera-player-sheet[open]),body:has(dialog.camera-player-sheet[open]){overflow:hidden;overscroll-behavior:none}
dialog.sheet.camera-player-sheet{width:min(1240px,calc(100vw - 48px),calc(167dvh + 2px));height:fit-content;max-width:none;max-height:94dvh;inset:0;margin:auto;border-radius:20px;overflow:hidden;background:#fff;padding:0;box-shadow:0 24px 90px #10142655}
.camera-player-sheet::backdrop{background:#11131e99;backdrop-filter:blur(5px)}
.camera-player-sheet .handle{display:none}
.camera-player-sheet .sheet-top{height:54px;min-height:54px;margin:0;padding:7px 16px 7px 22px;border:0;display:flex;align-items:center;justify-content:space-between}
.camera-player-sheet .sheet-top>span{font-size:11px;letter-spacing:1.4px;font-weight:650;color:#66647b}
.camera-player-sheet .close{height:36px;width:36px;background:#f2f2f7;border-radius:50%;font-size:22px}
.camera-player-sheet .sheet-body{padding:0;max-height:calc(94dvh - 54px);overflow:auto;overscroll-behavior:contain}
.camera-viewer{display:grid;grid-template-columns:minmax(0,1fr) 184px;background:#0b0d13;color:#f3effa;outline-offset:-3px}
.camera-stage{position:relative;display:flex;flex-direction:column;width:100%;background:#0b0d13;isolation:isolate;overflow:hidden}
.camera-cloud-surface{position:relative;width:100%;aspect-ratio:16/9;overflow:hidden}
.camera-cloud-surface>div,.camera-cloud-surface .ezplayer-content-wrapper,.camera-cloud-surface .ezplayer-content{position:relative;width:100%;height:100%;overflow:hidden}
.camera-cloud-surface .ezplayer-content-video{position:absolute;inset:0;width:100%!important;height:100%!important;transform:none!important;left:0!important;top:0!important}
.camera-cloud-surface .ezplayer-canvas{object-fit:contain}
body:has(.camera-cloud-surface) .aichat-container{display:none!important}
.camera-player-bar{position:relative;z-index:3;display:flex;align-items:center;gap:4px;min-height:48px;flex-shrink:0;padding:2px 14px;background:#0b0d13;color:#fff}
.camera-control{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-shrink:0;min-width:44px;min-height:44px;padding:8px;border-radius:8px;line-height:1.2;font-size:12px;font-weight:600;transition:background .15s}
.camera-control svg{height:22px;width:22px;flex-shrink:0}
.camera-control:hover:not(:disabled){background:#ffffff26}
.camera-control:focus-visible{outline:2px solid #bda7ff;outline-offset:-2px}
.camera-control:disabled{opacity:.4}
.camera-player-spacer{flex:1}
.camera-player-status{display:flex;align-items:center;gap:7px;font-size:10px;letter-spacing:.8px;font-weight:650;color:#e0e0e6;white-space:nowrap}
.camera-player-status::before{content:'';width:7px;height:7px;border-radius:50%;background:#85858e}
.camera-player-status[data-phase=playing]::before{background:#f24b62}
.camera-player-status:empty{display:none}
.camera-playback{position:absolute;inset:0 0 48px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px;padding:24px 25px;color:#e6e3f0;text-align:center;background:#10121bd9}
.camera-playback p{font-size:13px;line-height:1.6;margin:0;max-width:360px}
.camera-playback .camera-control{padding:8px 16px;background:#7958df;color:#fff}
.camera-spinner{display:none;width:32px;height:32px;border:3px solid #ffffff25;border-top-color:#b49afc;border-radius:50%;animation:camera-spin 1s linear infinite}
.camera-viewer[data-phase=connecting] .camera-spinner{display:block}
@keyframes camera-spin{to{transform:rotate(360deg)}}
.camera-record-time{position:absolute;z-index:2;top:16px;left:16px;border-radius:5px;background:#b52340;color:#fff;padding:7px 9px;font-size:11px;font-weight:650;letter-spacing:1px;font-variant-numeric:tabular-nums}
.camera-viewer-info{padding:18px 12px;background:#181621;border-inline-start:1px solid #ffffff14}
.camera-tool-row{display:flex;flex-direction:column;align-items:center;gap:18px}
.camera-tool-group{display:flex;justify-content:center;gap:4px;width:100%}
.camera-tool-group .camera-control{flex:1;flex-direction:column;gap:4px;min-height:54px;padding:6px 2px;font-size:10px}
.camera-viewer-info .camera-control{background:#ffffff0e;color:#f3effa}
.camera-viewer-info .camera-control:hover:not(:disabled){background:#ffffff24}
.camera-viewer-info .camera-control[aria-pressed=true]{background:#96354a;color:#fff}
.camera-pan{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:2px;flex-shrink:0;color:#d2c6e5}
.camera-pan>span{grid-area:2/2;align-self:center;text-align:center;font-size:10px}
#camera-cloud-up{grid-area:1/2}
#camera-cloud-left{grid-area:2/1}
#camera-cloud-right{grid-area:2/3}
#camera-cloud-down{grid-area:3/2}
.camera-feedback{font-size:12px;line-height:1.6;color:#d2c6e5;margin:12px 0 0}
.camera-feedback:empty{display:none}
.camera-viewer [hidden]{display:none}
.camera-viewer:fullscreen,.camera-cloud-expanded .camera-viewer{width:100%;height:100dvh;overflow:auto}
.camera-cloud-expanded .sheet-top{display:none}
dialog.sheet.camera-player-sheet.camera-cloud-expanded{width:100vw;max-height:100dvh;height:100dvh;border-radius:0}
.camera-cloud-expanded .sheet-body{max-height:100dvh}
:is(.camera-viewer:fullscreen,.camera-cloud-expanded .camera-viewer) .camera-stage{min-height:0}
:is(.camera-viewer:fullscreen,.camera-cloud-expanded .camera-viewer) .camera-cloud-surface{flex:1;aspect-ratio:auto;min-height:0}
@media(max-width:767px){
 dialog.sheet.camera-player-sheet{width:100%;max-height:100dvh;inset:auto 0 0;margin:0;border-radius:18px 18px 0 0}
 .camera-player-sheet .sheet-top{height:50px;min-height:50px;padding:7px 12px 7px 18px}
 .camera-player-sheet .sheet-body{max-height:calc(100dvh - 50px);padding:0}
 .camera-viewer{grid-template-columns:minmax(0,1fr)}
 .camera-player-bar{padding:2px 6px;min-height:48px;gap:0}
 .camera-player-status{font-size:9px;gap:5px;letter-spacing:.3px}
 .camera-viewer-info{padding:14px 14px calc(16px + env(safe-area-inset-bottom));border-inline-start:0}
 .camera-tool-row{gap:12px}
 .camera-tool-group{max-width:320px}
 .camera-tool-group .camera-control{flex-direction:row;gap:6px;font-size:11px;min-height:44px}
 .camera-playback{padding:12px;gap:6px}
 .camera-playback p{font-size:12px}
 .camera-record-time{top:10px;left:10px;padding:5px 7px;font-size:10px}
 :is(.camera-viewer:fullscreen,.camera-cloud-expanded .camera-viewer){grid-template-rows:minmax(180px,1fr) auto}
}
@media(prefers-reduced-motion:reduce){.camera-spinner{animation-duration:2s}.camera-control,.camera-play-disc{transition:none}}

@media(max-width:767px){
 .camera-card{padding:10px 10px 0}
 .camera-preview-heading{top:10px;left:12px}
 .camera-open{margin-top:38px}
 .camera-play-disc{width:48px;height:48px}
 .camera-photo-details{margin-top:14px}
 .camera-photo-details summary{gap:8px}
 .camera-details-label{font-size:9px;gap:3px}
 .camera-photo-details .camera-status{font-size:9px;gap:4px}
}
/* A rotated phone keeps the video and controls alongside each other. */
@media(orientation:landscape) and (max-height:500px){
 dialog.sheet.camera-player-sheet{inset:0;width:100%;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
 .camera-player-sheet .sheet-top{height:40px;min-height:40px;padding:2px max(8px,env(safe-area-inset-right)) 2px max(14px,env(safe-area-inset-left))}
 .camera-player-sheet .sheet-body{max-height:calc(100dvh - 40px)}
 .camera-player-sheet .camera-viewer{grid-template-columns:minmax(0,1fr) calc(158px + env(safe-area-inset-right));grid-template-rows:minmax(0,1fr);height:calc(100dvh - 40px)}
 .camera-viewer .camera-stage{justify-content:space-between}
 .camera-viewer .camera-cloud-surface{width:min(100%,calc((100dvh - 88px) * 16 / 9));margin:auto}
 .camera-viewer .camera-player-bar{padding-left:max(6px,env(safe-area-inset-left))}
 .camera-viewer .camera-viewer-info{padding:10px calc(8px + env(safe-area-inset-right)) 10px 8px;overflow:auto}
 .camera-viewer .camera-tool-group .camera-control{flex-direction:column;font-size:9px}
 .camera-cloud-expanded .sheet-body{max-height:100dvh}
 :is(.camera-viewer:fullscreen,.camera-cloud-expanded .camera-viewer){grid-template-columns:minmax(0,1fr) calc(158px + env(safe-area-inset-right));grid-template-rows:minmax(0,1fr);height:100dvh}
 :is(.camera-viewer:fullscreen,.camera-cloud-expanded .camera-viewer) .camera-cloud-surface{flex:none;aspect-ratio:16/9;width:min(100%,calc((100dvh - 48px) * 16 / 9))}
}
