:root { font: 15px/1.45 system-ui, sans-serif; color: #17202a; background: #f7f8fa; }
body { max-width: 1440px; margin: 20px auto; padding: 0 16px 30px; }
h1 { font-size: 24px; } h2 { font-size: 19px; margin-top: 0; } h3 { font-size: 16px; }
section { background: white; border: 1px solid #d4d9df; border-radius: 5px; padding: 16px; margin-top: 18px; }
button, input, select { font: inherit; padding: 6px 9px; border: 1px solid #a9b2bd; border-radius: 3px; }
button { background: #f4f6f8; cursor: pointer; } button:hover { background: #e7edf4; } button:disabled { opacity: .5; cursor: default; }
input:not([type="checkbox"]), select { max-width: 100%; box-sizing: border-box; }
input[type="checkbox"] { margin-right: 5px; } label { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; }
form h3, form p { flex-basis: 100%; margin: 3px 0; } #camera-source, #event-path { width: 440px; }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.scroll { overflow-x: auto; max-height: 420px; } table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
td, th { border-bottom: 1px solid #dce1e7; padding: 8px; vertical-align: top; overflow-wrap: anywhere; max-width: 420px; }
th { background: #f4f6f8; position: sticky; top: 0; } td button { margin: 0 4px 4px 0; }
tr.selected { background: #eaf3ff; } video { display: block; width: 100%; max-width: 900px; max-height: 500px; background: #111; }
.viewer { max-width: 1000px; border: 1px solid #d4d9df; background: #fafbfc; }
.viewer video { max-width: 100%; width: 100%; aspect-ratio: 16/9; object-fit: contain; }
.viewer:fullscreen { display: flex; flex-direction: column; justify-content: center; background: #111; color: white; padding: 12px; }
.viewer:fullscreen video { flex: 1; min-height: 0; max-height: none; }
.player-controls, .timeline-panel { padding: 8px 12px; margin: 0; }
#player-mode { margin-left: auto; color: #176537; }
.timeline-panel { border-top: 1px solid #d4d9df; } .legend { color: #176537; font-size: 13px; }
.legend i { display: inline-block; background: #22a56a; width: 12px; height: 9px; margin-right: 4px; }
#timeline { --coverage: #dce1e7; appearance: none; -webkit-appearance: none; width: 100%; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; }
#timeline::-webkit-slider-runnable-track { height: 10px; border-radius: 3px; background: var(--coverage); }
#timeline::-moz-range-track { height: 10px; border-radius: 3px; background: var(--coverage); }
#timeline::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 22px; margin-top: -6px; border: 2px solid white; border-radius: 3px; background: #1259a7; box-shadow: 0 0 1px #111; }
#timeline::-moz-range-thumb { width: 10px; height: 18px; border: 2px solid white; border-radius: 3px; background: #1259a7; }
.timeline-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
#timeline-message { min-height: 18px; margin: 6px 0 0; font-size: 13px; color: #a32020; }
.danger { color: #a32020; border-color: #d49a9a; background: #fff4f4; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 340px; overflow: auto; background: #f1f3f6; padding: 10px; font-size: 12px; }
summary { cursor: pointer; } a { color: #1259a7; } .hint { color: #586371; font-size: 13px; }
.warning { background: #fff3d6; padding: 10px; } #notice { padding: 8px; min-height: 20px; background: #eaf3ff; }
#notice.error, .error { color: #a32020; } .ok { color: #176537; } #rtsp-url { overflow-wrap: anywhere; }

#event-modal { width: min(1180px, 96vw); max-width: calc(100vw - 32px); padding: 0; border: 1px solid #d4d9df; border-radius: 8px; }
#event-modal::backdrop { background: #07101fcc; }
.event-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #d4d9df; }
.event-modal-header h2 { margin: 0; font-size: 17px; }
.event-modal-header p { margin: 4px 0 0; font-size: 12px; color: #586371; overflow-wrap: anywhere; }
.event-modal-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); height: min(700px, 75vh); }
.event-metadata, .event-media { min-width: 0; padding: 16px; overflow: auto; }
.event-metadata { border-right: 1px solid #d4d9df; }
.event-metadata h3, .event-media h3 { margin: 0 0 12px; }
#event-modal-payload { background: #0c1422; color: #dcecff; max-height: none; margin: 0; border-radius: 6px; padding: 14px; }
#event-modal-video { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #111; border-radius: 6px; }
#event-modal-video-message, #event-modal-images-message { font-size: 13px; color: #586371; }
.event-media h3:not(:first-child) { margin-top: 22px; }
.event-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-image { min-width: 0; margin: 0; }
.event-image img { width: 100%; height: 150px; object-fit: contain; border: 1px solid #d4d9df; border-radius: 6px; background: #eef3f8; box-sizing: border-box; }
.event-image figcaption { font-size: 12px; color: #586371; overflow-wrap: anywhere; margin-top: 6px; }
.event-image .error { display: block; font-size: 12px; margin-top: 4px; }
@media (max-width: 800px) {
  .event-modal-grid { grid-template-columns: 1fr; height: auto; max-height: 75vh; overflow: auto; }
  .event-metadata { max-height: 35vh; border-right: 0; border-bottom: 1px solid #d4d9df; }
  .event-media { overflow: visible; }
  .event-modal-header { align-items: flex-start; }
}
@media (max-width: 480px) { .event-images { grid-template-columns: 1fr; } }
