/* frigate-nvr.php (added 2026-09-26). The picture of this page is the recorder's own view:
   a camera wall with its detections, one camera's day, a zone drawn on a picture, and where the
   footage lives. The wall and the zone are camera pictures, so they are ink in BOTH themes -
   like the security log - and read fixed ink/mist hexes inside, not the role tokens that flip.
   One copper accent (detections, the active zone); patina only for live / stored / recording. */

/* ---------- 1. the camera wall ---------- */
.nvr-console { margin: 0; padding: 10px; background: #12101A; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; box-shadow: var(--shadow-2); }
.nvr-wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.nvr-tile { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; background: #191622; }
.nvr-scene { position: absolute; inset: 0; background: linear-gradient(180deg, #1B1825 0 56%, #24202F 56% 100%); }
.nvr-scene i { position: absolute; display: block; }

/* the silhouettes - flat mist shapes, drawn in per-cent of the tile so they scale with it */
.is-gate .nvr-scene i:nth-child(1) { left: 6%; right: 48%; top: 26%; bottom: 40%; border-top: 3px solid #3A3550; background: repeating-linear-gradient(90deg, #3A3550 0 3px, transparent 3px 13px); }
.is-gate .nvr-scene i:nth-child(2) { left: 52%; top: 18%; width: 3%; bottom: 40%; background: #3A3550; }
.is-gate .nvr-scene i:nth-child(3) { left: 62.2%; top: 30%; width: 6%; aspect-ratio: 1; border-radius: 50%; background: #5A5470; }
.is-gate .nvr-scene i:nth-child(4) { left: 59.5%; top: 41%; width: 11.5%; height: 39%; border-radius: 40% 40% 12% 12%; background: #5A5470; }

.is-drive .nvr-scene { background: linear-gradient(180deg, #1B1825 0 44%, #24202F 44% 100%); }
.is-drive .nvr-scene i:nth-child(1) { left: 58%; right: 8%; top: 12%; height: 32%; background: repeating-linear-gradient(180deg, #2B283B 0 4px, #332F45 4px 9px); }
.is-drive .nvr-scene i:nth-child(2) { left: 29%; top: 41%; width: 27%; height: 14%; background: #5A5470; clip-path: polygon(14% 0, 78% 0, 100% 100%, 0 100%); }
.is-drive .nvr-scene i:nth-child(3) { left: 20%; top: 54%; width: 46%; height: 15%; border-radius: 10px 14px 6px 6px; background: #5A5470; }
.is-drive .nvr-scene i:nth-child(4) { left: 25%; top: 62%; width: 36%; height: 13%; }
.is-drive .nvr-scene i:nth-child(4)::before,
.is-drive .nvr-scene i:nth-child(4)::after { content: ''; position: absolute; top: 0; height: 100%; aspect-ratio: 1; border-radius: 50%; background: #12101A; box-shadow: inset 0 0 0 3px #3A3550; }
.is-drive .nvr-scene i:nth-child(4)::before { left: 0; }
.is-drive .nvr-scene i:nth-child(4)::after { right: 0; }

.is-shop .nvr-scene { background: linear-gradient(180deg, #1B1825 0 76%, #24202F 76% 100%); }
.is-shop .nvr-scene i:nth-child(1),
.is-shop .nvr-scene i:nth-child(2) { top: 14%; height: 64%; width: 24%; border-inline: 3px solid #3A3550; background: repeating-linear-gradient(180deg, #3A3550 0 3px, transparent 3px 24%); }
.is-shop .nvr-scene i:nth-child(1) { left: 5%; }
.is-shop .nvr-scene i:nth-child(2) { right: 5%; }
.is-shop .nvr-scene i:nth-child(3) { left: 47%; top: 28%; width: 6%; aspect-ratio: 1; border-radius: 50%; background: #5A5470; }
.is-shop .nvr-scene i:nth-child(4) { left: 44.2%; top: 39%; width: 11.5%; height: 40%; border-radius: 40% 40% 12% 12%; background: #5A5470; }

.is-yard .nvr-scene { background: linear-gradient(180deg, #1B1825 0 58%, #221E2D 58% 100%); }
.is-yard .nvr-scene i:nth-child(1) { left: 0; right: 0; top: 30%; height: 28%; background: repeating-linear-gradient(90deg, #2E2A3E 0 16px, #262233 16px 19px); }
.is-yard .nvr-scene i:nth-child(2) { right: 9%; top: 6%; width: 20%; aspect-ratio: 1; border-radius: 50%; background: #2B283B; }
.is-yard .nvr-scene i:nth-child(3) { left: 41%; top: 63%; width: 17%; height: 10%; border-radius: 40px; background: #5A5470; }
.is-yard .nvr-scene i:nth-child(3)::before,
.is-yard .nvr-scene i:nth-child(3)::after { content: ''; position: absolute; top: 70%; width: 12%; height: 110%; background: #5A5470; border-radius: 2px; }
.is-yard .nvr-scene i:nth-child(3)::before { left: 10%; }
.is-yard .nvr-scene i:nth-child(3)::after { right: 12%; }
.is-yard .nvr-scene i:nth-child(4) { left: 55%; top: 56%; width: 7%; height: 11%; border-radius: 45% 55% 40% 40%; background: #5A5470; }

/* the detection: a copper box, its label a copper tag with ink text (never white on copper) */
.nvr-box { position: absolute; border: 1.5px solid #FF7A45; border-radius: 2px; transform-origin: 50% 50%; transition: opacity 220ms var(--ease-out) var(--d, 0ms), transform 220ms var(--ease-out) var(--d, 0ms); }
.nvr-box b { position: absolute; bottom: 100%; left: -1.5px; padding: 2px 7px; border-radius: 3px 3px 0 0; background: var(--fill-copper, #E85622); color: #12101A; font: 600 11px/1.4 var(--font-mono); white-space: nowrap; }
.is-gate  .nvr-box { left: 56.5%; top: 26%; width: 17%; height: 57%; }
.is-drive .nvr-box { left: 17%; top: 36%; width: 52%; height: 41%; }
.is-shop  .nvr-box { left: 41%; top: 24%; width: 18%; height: 59%; }
.is-yard  .nvr-box { left: 38%; top: 50%; width: 27%; height: 33%; }
/* one reveal, once: the boxes settle onto their objects after the wall has faded in */
html.anim-ready .nvr-console:not(.revealed) .nvr-box { opacity: 0; transform: scale(1.06); }

.nvr-tile-top { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px 14px; background: linear-gradient(180deg, rgba(0,0,0,.5), transparent); font-size: 12.5px; color: #E4DFEE; }
.nvr-cam { display: inline-flex; align-items: baseline; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvr-cam em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: #ADA3C8; }
.nvr-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: #7FD6C4; white-space: nowrap; }
.nvr-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #35A08F; }
.nvr-ts { position: absolute; left: 8px; bottom: 7px; direction: ltr; unicode-bidi: isolate; padding: 1px 6px; border-radius: 3px; background: rgba(0,0,0,.4); font-family: var(--font-mono); font-size: 11px; color: #CFC9DC; }

/* one camera's day: recording the whole way (patina), detections marked on it (copper) */
.nvr-day { padding: 18px 8px 4px; }
.nvr-day-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font-size: 13px; color: #CFC9DC; }
.nvr-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: #ADA3C8; }
.nvr-legend li { display: inline-flex; align-items: center; gap: 7px; }
.nvr-legend li::before { content: ''; display: block; }
.nvr-legend .k-rec::before { width: 14px; height: 4px; border-radius: 2px; background: #35A08F; }
.nvr-legend .k-p::before { width: 3px; height: 12px; border-radius: 2px; background: #FF7A45; }
.nvr-legend .k-c::before { width: 7px; height: 12px; border-radius: 2px; box-sizing: border-box; border: 1.5px solid #FF7A45; }
.nvr-track { position: relative; height: 30px; margin-top: 12px; direction: ltr; border-radius: 4px; background: rgba(255,255,255,.04); }
.nvr-rec { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: #35A08F; opacity: .75; }
.nvr-ev { position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #FF7A45; }
.nvr-ev.k-c { width: 7px; margin-left: -3.5px; box-sizing: border-box; background: #12101A; border: 1.5px solid #FF7A45; }
.nvr-hours { display: flex; justify-content: space-between; margin: 7px 0 0; padding: 0; list-style: none; direction: ltr; font-family: var(--font-mono); font-size: 11px; color: #9891AD; }
.nvr-cap { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.nvr-console .nvr-cap { margin: 8px 0 4px; color: #9891AD; }

/* ---------- 2. zones ---------- */
.nvr-zones { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.nvr-rules { margin: 0; border-top: 1px solid var(--line-strong); }
.nvr-rules > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.nvr-rules dt { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.nvr-rules dd { margin: 0; font-size: 15px; color: var(--text-2); display: flex; align-items: baseline; gap: 9px; }
.nvr-rules .nvr-rules-head dt { font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-ink); }
html[dir="rtl"] .nvr-rules .nvr-rules-head dt { letter-spacing: 0; text-transform: none; font-size: 13px; }
.nvr-rules .nvr-rules-head dd { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 700; color: var(--text-strong); }
.nvr-rules .is-on dd { color: var(--copper-ink); font-weight: 600; }
.nvr-rules .is-on dd::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #E85622; transform: translateY(-1px); }
.nvr-rules .is-off dt, .nvr-rules .is-off dd { color: var(--text-muted); }

.nvr-zone-pic { margin: 0; }
.nvr-zone-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); background: #1B1825; box-shadow: var(--shadow-2); }
.nvr-zone-frame svg { display: block; width: 100%; height: 100%; }
.nvr-zone-frame .z-sky { fill: #1B1825; }
.nvr-zone-frame .z-road { fill: #262233; }
.nvr-zone-frame .z-wall { fill: #2B283B; }
.nvr-zone-frame .z-path { fill: #302B40; }
.nvr-zone-frame .z-door { fill: #3A3550; stroke: #4A4560; stroke-width: 2; }
.nvr-zone-frame .z-ignore { fill: rgba(152,145,173,.07); stroke: #807996; stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.nvr-zone-frame .z-zone { fill: rgba(232,86,34,.16); stroke: #FF7A45; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.nvr-zone-frame .z-pt { fill: #12101A; stroke: #FF7A45; stroke-width: 2; vector-effect: non-scaling-stroke; }
.nvr-zone-tag { position: absolute; padding: 3px 9px; border-radius: 4px; font: 600 12px/1.4 var(--font-mono); white-space: nowrap; }
.nvr-zone-tag.is-zone { left: 40%; bottom: 16%; background: var(--fill-copper, #E85622); color: #12101A; }
.nvr-zone-tag.is-ignore { left: 4%; top: 22%; background: rgba(18,16,26,.72); border: 1px dashed #807996; color: #CFC9DC; font-weight: 400; }

/* ---------- 3. where the footage lives ---------- */
.nvr-flow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .5fr) minmax(0, 1fr) minmax(90px, .5fr) minmax(0, 1fr); align-items: center; margin: 0; padding: 0; list-style: none; }
.nvr-node { padding: 22px 22px 24px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.nvr-node.is-home { border-color: var(--copper-ink); }
.nvr-ico { width: 30px; height: 30px; fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nvr-ico circle { fill: var(--text-2); stroke: none; }
.nvr-node h3 { margin: 14px 0 6px; font-size: 18px; color: var(--text-strong); }
.nvr-node p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.nvr-here { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 5px 11px; border-radius: 999px; background: rgba(53,160,143,.13); color: var(--patina-ink); font: 600 12px/1.4 var(--font-mono); }
.nvr-here::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #35A08F; }
/* the connection: a hairline with its name on it and a chevron at the far end, mirrored for RTL */
.nvr-link { position: relative; display: grid; place-items: center; min-height: 64px; padding-inline: 4px; }
.nvr-link::before { content: ''; position: absolute; inset-inline: 0 3px; top: 50%; border-top: 1px solid var(--text-muted); opacity: .55; }
.nvr-link::after { content: ''; position: absolute; inset-inline-end: 1px; top: 50%; width: 8px; height: 8px; margin-top: -4.5px; border-top: 1.5px solid var(--text-muted); border-right: 1.5px solid var(--text-muted); transform: rotate(45deg); }
html[dir="rtl"] .nvr-link::after { transform: rotate(-135deg); }
.nvr-link span { position: relative; z-index: 1; max-width: 100%; padding: 2px 8px; background: var(--bg); text-align: center; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.4; color: var(--text-muted); }
.nvr-nocloud { display: flex; align-items: center; gap: 14px; margin: 28px 0 0; padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--text-2); font-size: 15px; }
.nvr-nocloud-ico { position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--text-muted); font-size: 18px; }
.nvr-nocloud-ico::after { content: ''; position: absolute; left: 1px; right: 1px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-40deg); box-shadow: 0 0 0 1.5px var(--bg); }

/* ---------- 4. the two recorder builds, side by side on one shared edge ---------- */
.nvr-builds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nvr-build { padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line-strong); background: var(--surface); }
.nvr-build:first-child { border-start-start-radius: 18px; border-end-start-radius: 18px; }
.nvr-build:last-child { border-inline-start: 0; border-start-end-radius: 18px; border-end-end-radius: 18px; }
.nvr-build-k { margin: 0 0 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-ink); }
html[dir="rtl"] .nvr-build-k { letter-spacing: 0; text-transform: none; font-size: 13px; }
.nvr-build h3 { margin: 0 0 10px; font-size: clamp(20px, 2vw, 24px); color: var(--text-strong); }
.nvr-build > p:not(.nvr-build-k) { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.65; }
.nvr-build dl { margin: 22px 0 0; }
.nvr-build dl > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.nvr-build dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
html[dir="rtl"] .nvr-build dt { letter-spacing: 0; text-transform: none; font-size: 13px; }
.nvr-build dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.nvr-builds-note { margin: 18px 0 0; font-size: 14.5px; color: var(--text-muted); }

/* ---------- 5. the rail ---------- */
.nvr-rail { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 24px; margin: 0; padding: 0; list-style: none; counter-reset: r; }
.nvr-rail::before { content: ''; position: absolute; inset-inline: 0; top: 12px; border-top: 1px solid var(--line-strong); }
.nvr-rail li { position: relative; counter-increment: r; padding-top: 44px; }
.nvr-rail li::before { content: counter(r, decimal-leading-zero); position: absolute; top: 0; inset-inline-start: 0; padding: 3px 10px; border: 1px solid var(--copper-ink); border-radius: 999px; background: var(--bg); font: 600 12px/1.4 var(--font-mono); color: var(--copper-ink); }
.nvr-rail h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-strong); }
.nvr-rail p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }

/* ---------- 6. four facts in one row where they fit (the shared 260px floor left a 3 + 1 orphan at 1440) ---------- */
.sp-facts.nvr-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.nvr-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14.5px; font-weight: 600; color: var(--copper-ink); text-decoration: none; }
.nvr-more::after { content: '\2192'; transition: transform 180ms var(--ease-out); }
html[dir="rtl"] .nvr-more::after { content: '\2190'; }
.nvr-more:hover { text-decoration: underline; text-underline-offset: .2em; }
@media (pointer: coarse) { .nvr-more { min-height: 44px; } }

/* hover: movement only on a real pointer */
.nvr-node, .nvr-build { transition: border-color 160ms var(--ease-out), transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
    .nvr-node:hover { transform: translateY(-2px); border-color: var(--copper-ink); }
    .nvr-build:hover { border-color: var(--text-muted); }
    .nvr-more:hover::after { transform: translateX(3px); }
    html[dir="rtl"] .nvr-more:hover::after { transform: translateX(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .nvr-box, .nvr-node, .nvr-more::after { transition: none; }
    html.anim-ready .nvr-console:not(.revealed) .nvr-box { opacity: 1; transform: none; }
    .nvr-node:hover, .nvr-more:hover::after { transform: none !important; }
}

/* ---------- widths ---------- */
@media (max-width: 1060px) {
    .nvr-rail { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .nvr-rail::before { inset-inline: auto; inset-inline-start: 22px; top: 0; bottom: 0; border-top: 0; border-inline-start: 1px solid var(--line-strong); }
    .nvr-rail li { padding: 0 0 22px; padding-inline-start: 64px; }
    .nvr-rail li:last-child { padding-bottom: 0; }
    .nvr-rail li::before { top: -2px; }
}
@media (max-width: 900px) {
    .nvr-zones { grid-template-columns: minmax(0, 1fr); }
    .nvr-flow { grid-template-columns: minmax(0, 1fr); }
    .nvr-link { min-height: 70px; }
    .nvr-link::before { inset-inline: auto; left: 50%; top: 0; bottom: 6px; border-top: 0; border-left: 1px solid var(--text-muted); }
    .nvr-link::after, html[dir="rtl"] .nvr-link::after { inset-inline-end: auto; left: 50%; top: auto; bottom: 3px; margin: 0 0 0 -4.5px; transform: rotate(135deg); }
}
@media (max-width: 760px) {
    .nvr-builds { grid-template-columns: minmax(0, 1fr); }
    .nvr-build:first-child { border-radius: 18px 18px 0 0; }
    .nvr-build:last-child { border-inline-start: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 18px 18px; }
}
@media (max-width: 600px) {
    .nvr-wall { grid-template-columns: minmax(0, 1fr); }
    .nvr-tile { aspect-ratio: 16 / 9; }
    .nvr-console { padding: 6px; border-radius: 14px; }
    .nvr-nocloud { align-items: flex-start; }
}

/* Arabic words in the mono stack take Plex Mono's fixed-width space and read as gapped; the small
   labels below carry words, not figures, so under RTL they take the body face. Timestamps and hours stay mono. */
html[dir="rtl"] .nvr-here, html[dir="rtl"] .nvr-link span, html[dir="rtl"] .nvr-zone-tag,
html[dir="rtl"] .nvr-box b, html[dir="rtl"] .nvr-live { font-family: var(--font-body, inherit); }
