#mav-nvr { min-width: 0; }
.nvr-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.nvr-heading h2 { margin: 4px 0; font-size: 24px; }
.nvr-heading p, .nvr-camera-title p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.nvr-eyebrow { font-size: 12px; font-weight: 700; color: var(--brand); }
.nvr-button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 8px 14px; color: var(--ink); font-size: 14px; font-weight: 600; }
.nvr-button:hover:not(:disabled) { border-color: var(--brand); background: var(--surface-soft); }
.nvr-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.nvr-primary:hover:not(:disabled) { background: var(--brand); filter: brightness(.94); }
.nvr-button:disabled { opacity: .5; cursor: not-allowed; }
.nvr-danger { color: var(--red); }
.nvr-stage { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nvr-stage svg { flex: 0 0 18px; margin-top: 2px; color: var(--muted); }
.nvr-stage strong, .nvr-stage span { display: block; font-size: 14px; line-height: 1.5; }
.nvr-stage span { color: var(--muted); margin-top: 2px; }
.nvr-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 16px 0; }
.nvr-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 12px 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.nvr-tabs button[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.nvr-summary { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 18px 0; font-size: 13px; color: var(--muted); }
.nvr-summary strong { color: var(--ink); }
.nvr-empty { text-align: center; padding: 48px 12px; }
.nvr-empty h3 { font-size: 17px; margin: 0 0 8px; }
.nvr-empty p { margin: 0; font-size: 14px; color: var(--muted); }
.nvr-camera-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.nvr-camera { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.nvr-camera-info { padding: 16px; position: relative; }
.nvr-camera-title { padding-right: 40px; }
.nvr-camera-actions { position: absolute; top: 12px; right: 12px; z-index: 2; }
.nvr-camera-actions summary { display: grid; place-items: center; width: 36px; height: 36px; list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.nvr-camera-actions summary::-webkit-details-marker { display: none; }
.nvr-camera-actions summary svg { width: 18px; height: 18px; }
.nvr-camera-actions summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nvr-camera-menu { position: absolute; top: 42px; right: 0; width: 160px; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 4px 12px #0002; }
.nvr-camera-menu button { display: block; width: 100%; min-height: 40px; text-align: left; border: 0; border-radius: 4px; background: none; padding: 8px 12px; color: var(--ink); }
.nvr-camera-menu button.nvr-danger { color: var(--red); }
.nvr-camera-menu button:hover, .nvr-camera-menu button:focus-visible { background: var(--surface-soft); }
.nvr-camera-menu button:disabled { opacity: .5; }
.nvr-preview { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 7px 7px 0 0; background: #17191b; color: #e8eeee; overflow: hidden; cursor: pointer; }
.nvr-preview canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.nvr-preview-placeholder { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 16px; font-size: 13px; }
.nvr-preview-placeholder svg { width: 32px; height: 32px; }
.nvr-preview canvas[hidden], .nvr-preview-placeholder[hidden] { display: none; }
.nvr-preview-open { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border-radius: 4px; background: rgba(0,0,0,.7); font-size: 12px; }
.nvr-preview:hover .nvr-preview-open { background: var(--brand); color: var(--brand-ink); }
.nvr-preview-decoder { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: .01; pointer-events: none; }
.nvr-camera-slot { min-width: 0; min-height: 260px; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-soft); color: var(--muted); cursor: pointer; }
.nvr-camera-slot:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.nvr-camera-slot:disabled { cursor: not-allowed; opacity: .6; }
.nvr-camera-slot svg { width: 26px; height: 26px; }
.nvr-camera-slot strong { font-size: 14px; }
.nvr-camera-slot span { font-size: 12px; }
.nvr-signal { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.nvr-signal .nvr-status { margin: 0; }
.nvr-preview-time { color: var(--muted); font-size: 11px; }
.nvr-status[data-state="online"] { color: var(--brand); border-color: var(--brand); }
.nvr-status[data-state="offline"] { color: var(--red); }
.nvr-camera-title { display: flex; align-items: flex-start; gap: 12px; }
.nvr-camera-title > svg { flex: 0 0 22px; height: 22px; color: var(--brand); }
.nvr-camera-title h3 { margin: 0 0 4px; font-size: 17px; overflow-wrap: anywhere; }
.nvr-camera-title p { font-size: 13px; }
.nvr-status { display: inline-block; margin: 18px 0 6px; padding: 4px 8px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; color: var(--muted-strong); font-size: 12px; }
.nvr-camera dl { margin: 12px 0 20px; font-size: 13px; }
.nvr-camera dl div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.nvr-camera dt { color: var(--muted); }
.nvr-camera dd { margin: 0; font-weight: 600; }
.nvr-camera footer { display: flex; flex-wrap: wrap; gap: 8px; }
.nvr-message { padding: 12px; border-left: 3px solid var(--brand); background: var(--surface-soft); font-size: 14px; overflow-wrap: anywhere; }
.nvr-error { border-color: var(--red); color: var(--red); }
.nvr-admin-header h3 { margin: 22px 0 6px; font-size: 18px; }
.nvr-admin-header p { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.nvr-account { display: grid; grid-template-columns: minmax(160px, 1fr) auto auto; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.nvr-account strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.nvr-account span { color: var(--muted); }
.nvr-account div span { display: block; margin-top: 4px; }
.nvr-dialog { width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.nvr-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.nvr-dialog header, .nvr-dialog footer { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.nvr-dialog header h3 { margin: 0; font-size: 20px; }
.nvr-dialog footer { justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.nvr-icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; background: transparent; color: var(--muted); border: 0; border-radius: 4px; flex-shrink: 0; }
.nvr-fields { display: grid; gap: 18px; margin-top: 24px; }
.nvr-fields label { display: block; font-size: 14px; font-weight: 600; }
.nvr-fields input:not([type="checkbox"]), .nvr-fields select { width: 100%; min-width: 0; min-height: 42px; margin-top: 7px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 9px 10px; color: var(--ink); background: var(--surface); }
.nvr-fields .nvr-check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.nvr-check input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--brand); }
.nvr-optional, .nvr-pending { color: var(--muted); font-weight: 400; }
.nvr-field-hint { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.nvr-fields p.nvr-field-hint { margin: -8px 0 0; }
.nvr-quality { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-right: auto; font-size: 12px; }
.nvr-quality select { max-width: 190px; min-height: 36px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 12px; }
.nvr-pending { margin: 0; font-size: 13px; line-height: 1.5; }
.nvr-form-error { color: var(--red); font-size: 14px; overflow-wrap: anywhere; }
.nvr-account-name { font-weight: 600; overflow-wrap: anywhere; margin: 0; }
.nvr-live-dialog { width: min(900px, calc(100% - 24px)); }
.nvr-live-dialog header h3 { overflow-wrap: anywhere; min-width: 0; }
.nvr-video-wrap { position: relative; margin-top: 20px; aspect-ratio: 16 / 9; background: #17191b; }
.nvr-video-wrap video { width: 100%; height: 100%; display: block; object-fit: contain; }
.nvr-video-state { position: absolute; inset: 12px 12px 48px; display: grid; place-items: center; text-align: center; color: #fff; font-size: 14px; margin: 0; pointer-events: none; }
.nvr-video-state[hidden] { display: none; }
.nvr-fields textarea { width: 100%; resize: vertical; margin-top: 7px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 9px 10px; color: var(--ink); background: var(--surface); font-family: monospace; overflow-wrap: anywhere; }
.nvr-connection-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.nvr-connection-options[data-single="true"] { grid-template-columns: minmax(0, 1fr); }
.nvr-connection-option { display: grid; gap: 10px; min-width: 0; }
.nvr-connection-option .nvr-button { justify-self: start; }
#mav-nvr :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (max-width: 640px) {
  .nvr-connection-options { grid-template-columns: minmax(0, 1fr); }
  .nvr-heading { align-items: stretch; flex-direction: column; }
  .nvr-heading h2 { font-size: 22px; }
  .nvr-account { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .nvr-account > span { grid-column: 1; }
  .nvr-account > button { grid-column: 2; grid-row: 1 / 3; }
  .nvr-dialog { padding: 20px; }
  .nvr-camera-info { padding: 14px; }
}
.nvr-live-controls { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: #fff; pointer-events: none; }
.nvr-live-controls .nvr-icon-button { color: #fff; min-width: 44px; min-height: 44px; background: #17191ba6; pointer-events: auto; }
.nvr-live-label { margin-right: auto; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 4px; background: #17191ba6; }
.nvr-live-label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ef5252; margin-right: 7px; }
.nvr-resume { position: absolute; inset: 45% auto auto 50%; transform: translateX(-50%); }
.nvr-video-wrap:fullscreen { width: 100%; height: 100%; margin: 0; display: grid; place-items: center; background: #000; }
.nvr-video-wrap:fullscreen video { width: 100%; height: 100%; object-fit: contain; }
.nvr-recording-status { font-size: 13px; color: #47625b; }
.nvr-recording-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin: 20px 0; }
.nvr-recording-filters label { display: grid; gap: 6px; min-width: 0; flex: 1 1 220px; }
.nvr-recording-filters select, .nvr-recording-filters input { width: 100%; min-height: 42px; padding: 8px; border: 1px solid #cfdad6; border-radius: 4px; background: #fff; color: #152c25; }
.nvr-recording-row { display: grid; grid-template-columns: minmax(150px, 1fr) 50px auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #dce5e1; }
.nvr-recording-row .nvr-button { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.nvr-recording-row svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .nvr-recording-row { grid-template-columns: minmax(0,1fr) auto; } .nvr-tabs { flex-wrap: wrap; } }
.nvr-timeline { margin-top: 16px; min-width: 0; }
.nvr-timeline-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nvr-timeline-toolbar strong { margin-right: auto; font-size: 14px; }
.nvr-timeline-toolbar .nvr-icon-button { width: 44px; height: 44px; }
.nvr-timeline-toolbar svg { width: 20px; height: 20px; }
.nvr-timeline-toolbar [hidden] { display: none; }
.nvr-timeline-toolbar [aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.nvr-timeline-track { position: relative; height: 44px; margin: 4px 0; }
.nvr-timeline-segments { position: absolute; top: 17px; left: 10px; right: 10px; height: 10px; background: var(--line); overflow: hidden; border-radius: 3px; }
.nvr-timeline-segments span { position: absolute; height: 100%; background: var(--brand); }
.nvr-timeline-track input { appearance: none; -webkit-appearance: none; position: relative; width: 100%; height: 44px; margin: 0; padding: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.nvr-timeline-track input::-webkit-slider-runnable-track { height: 10px; background: transparent; }
.nvr-timeline-track input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 24px; margin-top: -7px; border: 2px solid var(--surface); border-radius: 5px; background: var(--ink); box-shadow: 0 0 0 1px var(--muted); }
.nvr-timeline-track input::-moz-range-track { height: 10px; background: transparent; }
.nvr-timeline-track input::-moz-range-thumb { width: 16px; height: 20px; border: 2px solid var(--surface); border-radius: 5px; background: var(--ink); }
.nvr-timeline-track input:disabled { opacity: .35; cursor: default; }
.nvr-timeline-times { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.nvr-timeline-times output { font-weight: 700; }
.nvr-speed { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-left: auto; }
.nvr-speed select { min-height: 44px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); }
.nvr-speed select:disabled { opacity: .5; }
.nvr-timeline-zoom { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.nvr-scales { display: flex; flex: 1; flex-wrap: wrap; gap: 4px; }
.nvr-scales .nvr-button { font-size: 12px; padding: 6px 10px; }
.nvr-scales [aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.nvr-period-navigation { display: flex; gap: 4px; }
.nvr-period-navigation .nvr-icon-button { width: 44px; height: 44px; border: 1px solid var(--line); }
.nvr-period-navigation svg { width: 18px; height: 18px; }
.nvr-period-navigation button:disabled { opacity: .35; }
.nvr-timeline-date { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.nvr-timeline-date label { display: grid; gap: 6px; min-width: 0; font-size: 12px; }
.nvr-timeline-date input { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); padding: 6px; }
@media (max-width: 640px) { .nvr-scales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .nvr-scales .nvr-button { min-height: 44px; padding: 6px; } .nvr-period-navigation { flex-direction: column; } }
.nvr-timeline .nvr-pending { margin-top: 10px; }
.nvr-live-dialog[data-mode="recording"] .nvr-live-label::before { background: #e7e7e7; }
.nvr-live-dialog.nvr-expanded { position: fixed; inset: 0; margin: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; box-sizing: border-box; border: 0; border-radius: 0; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
.nvr-expanded .nvr-video-wrap { flex: 1 1 auto; min-height: 140px; aspect-ratio: auto !important; margin-top: 12px; overflow: hidden; }
.nvr-expanded .nvr-video-wrap video { position: absolute; inset: 0; }
.nvr-expanded > header, .nvr-expanded > footer, .nvr-expanded > .nvr-timeline { flex-shrink: 0; }
@media (max-width: 640px) { .nvr-live-dialog { padding: 12px; } .nvr-live-dialog footer { margin-top: 12px; } }
.nvr-source-label { margin: 4px 0; font-size: 12px; color: #50605c; overflow-wrap: anywhere; }
.nvr-source-details { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 8px 16px; margin: 0; }
.nvr-source-details dt { font-weight: 600; }
.nvr-source-details dd { margin: 0; overflow-wrap: anywhere; }
