.cctv-toggle{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:38px;background:#eef5ff;color:#2b7ad5;border:0;border-radius:8px;font-size:11px;font-weight:500;margin-bottom:12px;cursor:pointer}.cctv-toggle[aria-pressed=true]{background:#dbe9fb;color:#1559b3}.cctv-toggle svg{width:15px;height:15px;flex-shrink:0}.map-mode svg,.cctv-list-icon svg,.cctv-marker svg{width:22px;height:22px;flex-shrink:0}.cctv-list-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.cctv-list-heading strong{font-size:16px}.cctv-list-heading span{color:#1769df}.cctv-list-heading button{border:1px solid #d4e2f0;border-radius:10px;background:white;min-width:44px;min-height:44px;font-size:24px;color:#225f9c}.cctv-hint,.cctv-credit{font-size:12px;line-height:1.7;color:#58718d}.cctv-hint{margin:7px 0 14px}.cctv-credit a{color:#235e9e;text-decoration:underline}.cctv-list-item{display:flex;align-items:flex-start;gap:10px;text-align:left;width:100%;padding:14px 0;border:0;border-top:1px solid #dce6f0;background:transparent;color:#183958}.cctv-list-item>span:nth-child(2){flex:1;min-width:0}.cctv-list-item b{font-size:14px;line-height:1.6;display:block}.cctv-list-item small{display:block;color:#667d93;font-size:12px;margin:3px 0 7px}.cctv-list-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#e6f0ff;color:#1c64be;flex-shrink:0}.cctv-status{display:inline-flex;align-items:center;gap:6px;color:#245c8f;background:#eaf3fe;padding:4px 8px;border-radius:6px;font-size:12px;line-height:1.5}.cctv-status i{width:9px;height:9px;border-radius:50%;background:currentColor;flex-shrink:0}.cctv-status.stale,.cctv-status.unknown{background:#fff2d9;color:#855313}.cctv-status.offline{background:#f3e8e8;color:#915353}.cctv-notice{padding:10px 12px;background:#fff2d9;border-radius:9px;color:#79501e;font-size:13px;line-height:1.7}.cctv-empty{padding:20px 4px;line-height:1.8;color:#4d6b87;font-size:14px}.cctv-empty small{display:block;margin-top:8px}.cctv-empty button{margin-top:15px}.cctv-marker{display:flex;align-items:center;gap:6px;transform:translate(-50%,-50%);padding:9px 11px;border:2px solid white;border-radius:12px;background:#155eb6;color:white;box-shadow:0 3px 12px #12335e45;font-size:12px;font-weight:700;white-space:nowrap;min-height:44px;min-width:44px;justify-content:center}.cctv-marker.offline{background:#686e7c}.cctv-marker.stale,.cctv-marker.unknown{background:#946318}.three-marker .cctv-marker{transform:none}.three-marker.compact .cctv-marker{padding:8px}.three-marker.compact .cctv-marker span{display:none}.cctv-dialog{width:min(840px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #dce7f3;border-radius:22px;color:#183858;background:#fff;box-shadow:0 25px 90px #0c26474d;overflow:auto}.cctv-dialog::backdrop{background:#132e4d88;backdrop-filter:blur(5px)}.cctv-dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:22px 24px 12px}.cctv-eyebrow{font-size:12px;letter-spacing:.06em;color:#59728b}.cctv-dialog h2{font-size:22px;line-height:1.5;margin:5px 0}.cctv-dialog-heading p{margin:0;color:#58718c;font-size:13px}.cctv-dialog-heading button{min-width:44px;min-height:44px;font-size:26px;border:0;border-radius:12px;background:#f0f5fa;color:#335878}.cctv-detail-status{padding:0 24px 16px}.cctv-image-wrap{background:#10243b;min-height:180px;display:grid;place-items:center;position:relative}.cctv-image-wrap img{display:block;width:100%;max-height:55dvh;object-fit:contain}.cctv-image-wrap img[hidden],.cctv-image-wrap p[hidden]{display:none}.cctv-image-wrap p{padding:28px;color:#e6f0ff;text-align:center}.cctv-detail-footer{padding:18px 24px 22px}.cctv-detail-footer>strong{font-size:15px;line-height:1.7}.cctv-detail-footer>p{color:#61778e;font-size:13px;line-height:1.8;margin:6px 0 14px}.cctv-actions{display:flex;gap:10px;flex-wrap:wrap;margin:15px 0}.cctv-actions button,.cctv-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid #c9dcef;border-radius:10px;background:#f5f9ff;color:#215e9e;font-size:14px;text-decoration:none}.cctv-detail-footer>small{font-size:12px;color:#61778e}.cctv-dialog.expanded{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-width:none;max-height:none;border-radius:12px}.cctv-dialog.expanded .cctv-image-wrap img{max-height:none;height:65dvh}.cctv-toggle:focus-visible,.cctv-list-item:focus-visible,.cctv-dialog button:focus-visible{outline:3px solid #68a4ed;outline-offset:3px}@media(max-width:680px){.cctv-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:18px}.cctv-dialog-heading{padding:18px 16px 12px}.cctv-dialog h2{font-size:19px}.cctv-detail-status{padding:0 16px 12px}.cctv-detail-footer{padding:16px}.cctv-image-wrap img{max-height:45dvh}.cctv-dialog.expanded .cctv-image-wrap img{height:55dvh}.cctv-actions{gap:7px}.cctv-actions button,.cctv-actions a{font-size:13px;padding:9px 10px}.cctv-list-item{padding:13px 0}}
@media(max-width:680px){.cctv-toggle{min-height:35px;font-size:11px}.workspace[data-chapter="1"] .cctv-toggle{order:0;margin:0 17px 11px;width:calc(100% - 34px)}.workspace[data-chapter="1"] #cctvList .inline-button{min-height:44px}}

/* size pass: icons in list + camera view fit */
.map-mode svg,.cctv-list-icon svg,.cctv-marker svg{width:18px;height:18px}
.cctv-list-icon{width:30px;height:30px;border-radius:9px}
.cctv-list-heading button{min-width:36px;min-height:36px;font-size:20px}
.cctv-marker{padding:7px 9px;min-height:36px;min-width:36px;border-radius:10px;gap:5px}
.cctv-image-wrap{min-height:240px}
.cctv-image-wrap img{max-height:min(52dvh,520px);background:#10243b}
.cctv-dialog{display:flex;flex-direction:column}
.cctv-dialog .cctv-image-wrap{flex:0 1 auto}
.cctv-dialog.expanded{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden}
.cctv-dialog.expanded .cctv-image-wrap{min-height:0}
.cctv-dialog.expanded .cctv-image-wrap img{height:100%;max-height:none;min-height:0}
/* Preserve the complete camera frame, including timestamps and water gauges. */
.cctv-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:16px;margin:14px 0}
.cctv-card-grid .cctv-list-item{display:flex;flex-direction:column;gap:0;padding:0;overflow:hidden;border:1px solid #d5e6f3;border-radius:20px;background:#fff;box-shadow:0 6px 20px #164c7909;cursor:pointer;transition:border-color .2s,box-shadow .2s}
.cctv-card-grid .cctv-list-item:hover{border-color:#79b9ec;box-shadow:0 8px 24px #164c791a}
.cctv-thumbnail{display:block;position:relative;aspect-ratio:16/9;width:100%;background:#eaf1f7;overflow:hidden}
.cctv-thumbnail img{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;background:#10243b;transition:opacity .2s}
.cctv-thumbnail.has-image img{opacity:1}.cctv-thumbnail img[hidden]{display:none}
.cctv-thumbnail-message{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;color:#617c93;font-size:12px;padding:15px;text-align:center}
.cctv-thumbnail-message[hidden]{display:none}.cctv-thumbnail-message svg{width:32px;height:32px}
.cctv-thumbnail-tag{position:absolute;top:10px;left:10px;padding:4px 8px;border-radius:8px;background:#113752dc;color:white;font-size:10px;font-weight:600}
.cctv-card-grid .cctv-card-body{display:block;width:100%;box-sizing:border-box;padding:15px;flex:1}
.cctv-card-title{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.cctv-card-grid .cctv-card-title b{font-size:15px;overflow-wrap:anywhere}.cctv-card-arrow{color:#2c80c4;font-size:20px}
.cctv-card-grid .cctv-card-area{line-height:1.7;margin:4px 0 10px}.cctv-card-facts{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;margin-top:13px;padding-top:10px;border-top:1px solid #e8eff5;font-size:12px;line-height:1.7;color:#254e6c}
.cctv-card-grid .cctv-card-facts small{margin:0 0 3px;font-size:10px;color:#70879b}.cctv-card-facts>span{min-width:0;overflow-wrap:anywhere}.cctv-card-owner{display:block;margin-top:10px;font-size:10px;line-height:1.6;color:#70879b;overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.cctv-card-grid .cctv-list-item,.cctv-thumbnail img{transition:none}}

/* Compact list: preview left, readable camera facts right. */
.cctv-card-grid{grid-template-columns:1fr;gap:10px}
.cctv-card-grid .cctv-list-item{flex-direction:row;align-items:flex-start;padding:10px;gap:12px;border-radius:15px}
.cctv-card-grid .cctv-thumbnail{flex:0 0 110px;width:110px;aspect-ratio:4/3;border-radius:10px;margin-top:2px}
.cctv-card-grid .cctv-card-body{padding:0;width:auto;min-width:0}
.cctv-card-grid .cctv-card-title b{font-size:13px;line-height:1.5}.cctv-card-arrow{font-size:15px}
.cctv-card-grid .cctv-card-area{font-size:10px;line-height:1.6;margin:3px 0 6px}
.cctv-card-grid .cctv-status{font-size:10px;padding:2px 6px;gap:4px}.cctv-card-grid .cctv-status i{width:6px;height:6px}
.cctv-card-grid .cctv-card-facts{font-size:10px;gap:7px;margin-top:6px;padding-top:5px}.cctv-card-grid .cctv-card-facts small{font-size:9px}
.cctv-card-grid .cctv-card-owner{display:none}.cctv-card-grid .cctv-thumbnail-tag{top:auto;bottom:4px;left:4px;padding:2px 5px;font-size:8px;border-radius:4px}
.cctv-card-grid .cctv-thumbnail-message{padding:6px;font-size:9px;gap:4px}.cctv-card-grid .cctv-thumbnail-message svg{width:20px;height:20px}
.cctv-water-info{display:block;font-size:12px;line-height:1.7;color:#195b8c;margin-top:8px}.cctv-water-info small{display:block;font-size:10px;color:#667d93}
.cctv-card-grid .cctv-water-info{font-size:11px;margin-top:5px}.cctv-card-grid .cctv-water-info small{font-size:9px;margin:0}
@media(max-width:400px){.cctv-card-grid .cctv-thumbnail{flex-basis:88px;width:88px}.cctv-card-grid .cctv-list-item{gap:9px;padding:9px}}
