/* ============================================================================
   Camera page hero (AEY "camera" record page)
   ----------------------------------------------------------------------------
   Rendered by components/camera_page.rs on the record-scoped camera page
   (`/aeyvision/camera/{id}`). Designed as a monitoring console: a crumb
   trail (Sites → site → Camera), an identity head (glyph badge + display
   title + live-readiness chip), and a full-bleed 16:9 live stage — the
   click-to-start MJPEG relay reusing the camera-grid tile chrome
   (`.camera-tile-*` glass pills, LIVE + Stop, watch-live control, wired by
   static/app/camera-grid.js) or the camera's last stored frame as a still —
   then a facts strip that resolves the relations into real links.

   Layout: the `.block-panel.glass-card` frame zeroes its padding, so this
   file restores interior padding and lets the stage break out full-bleed
   (negative inline margins) like a monitor recessed into the console. Loaded
   after camera-grid.css in modern.css so the hero overrides win. Everything
   here is scoped to `.camera-page-*` (and `.camera-page-stage .camera-tile-*`
   overrides) so it never depends on the grid's own layout.
   ========================================================================== */

/* `.block-panel.glass-card` zeroes the frame's padding (related.css); this
   element+class form carries equal specificity and, loaded later in the
   bundle, restores interior padding around the head + facts while the stage
   below breaks out full-bleed. */
.camera-page.block-panel {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding: 1.15rem 1.25rem 1.25rem;
}

/* ── Head: crumb trail + identity ───────────────────────────────────────── */

.camera-page-head {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.camera-page-crumb-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
    font-family: var(--ta-mono);
    font-size: 0.76rem;
}

.camera-page-crumb {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ta-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    border-radius: var(--ta-r-sm);
    padding: 0.18rem 0.35rem;
    margin-left: -0.35rem;
    transition: color 0.14s ease, background 0.14s ease;
}

.camera-page-crumb:hover {
    color: var(--ta-accent);
    background: var(--ta-accent-soft);
}

.camera-page-crumb svg {
    width: 0.9rem;
    height: 0.9rem;
}

.camera-page-crumb-icon svg {
    width: 0.78rem;
    height: 0.78rem;
}

.camera-page-crumb-sep {
    color: var(--ta-faint);
    font-size: 0.72rem;
    user-select: none;
}

.camera-page-crumb-current {
    color: var(--ta-text);
    font-weight: 600;
    padding: 0.18rem 0.1rem;
}

/* The identity row: glyph badge, display title + sub, readiness meta. */
.camera-page-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.camera-page-badge {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: var(--ta-r);
    background: var(--ta-accent-soft);
    color: var(--ta-accent);
    border: 1px solid color-mix(in oklab, var(--ta-accent) 22%, var(--ta-border));
    box-shadow: inset 0 1px 0 color-mix(in oklab, #fff 60%, transparent);
}

.camera-page-badge svg {
    width: 1.4rem;
    height: 1.4rem;
}

.camera-page-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.camera-page-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    font-weight: 720;
    letter-spacing: -0.028em;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

/* Site / device / placement chips — the camera's context, sitting on the
   same row as its title (next to it, not stacked below). Vertically centred
   by the identity row's `align-items: center`. */
.camera-page-context {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
}

.camera-page-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    border: 1px solid var(--ta-border);
    background: var(--ta-surface-2);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ta-muted);
    white-space: nowrap;
}

.camera-page-chip-link {
    color: var(--ta-text);
    text-decoration: none;
    transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.camera-page-chip-link:hover {
    border-color: color-mix(in oklab, var(--ta-accent) 45%, var(--ta-border));
    color: var(--ta-accent);
    background: var(--ta-accent-soft);
}

.camera-page-chip-icon {
    display: grid;
    place-items: center;
    flex: none;
    color: var(--ta-accent);
}

.camera-page-chip-icon svg {
    width: 0.82rem;
    height: 0.82rem;
}

.camera-page-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.camera-page-head-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Status + readiness chips (in the head, right-aligned). */
.camera-page-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.26rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--ta-border-strong);
    background: var(--ta-surface-2);
    font-family: var(--ta-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ta-muted);
    white-space: nowrap;
}

.camera-page-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--ta-err);
}

.camera-page-status.online {
    color: var(--ta-ok);
}

.camera-page-status.online .camera-page-dot {
    background: var(--ta-ok);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--ta-ok) 25%, transparent);
}

.camera-page-ready {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.26rem 0.7rem;
    border-radius: 999px;
    border: 1px solid color-mix(in oklab, var(--ta-ok) 38%, var(--ta-border));
    background: color-mix(in oklab, var(--ta-ok) 8%, var(--ta-surface-2));
    font-family: var(--ta-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: color-mix(in oklab, var(--ta-ok) 88%, var(--ta-text));
    white-space: nowrap;
}

.camera-page-ready-dot {
    width: 0.44rem;
    height: 0.44rem;
    border-radius: 50%;
    background: var(--ta-ok);
    animation: camera-page-ready-pulse 2.4s ease-in-out infinite;
}

@keyframes camera-page-ready-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--ta-ok) 45%, transparent);
    }

    50% {
        box-shadow: 0 0 0 5px color-mix(in oklab, var(--ta-ok) 0%, transparent);
    }
}

/* The settings cog — jumps to the camera's dedicated settings page
   (`/aeyvision/camera-settings/{id}`) instead of a tab below the stage. */
.camera-page-settings {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: var(--ta-r-sm);
    border: 1px solid var(--ta-border-strong);
    background: var(--ta-surface-2);
    color: var(--ta-muted);
    text-decoration: none;
    transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease,
        transform 0.14s ease;
}

.camera-page-settings:hover {
    border-color: color-mix(in oklab, var(--ta-accent) 50%, var(--ta-border));
    color: var(--ta-accent);
    background: var(--ta-accent-soft);
    transform: translateY(-1px);
}

.camera-page-settings svg {
    width: 1.05rem;
    height: 1.05rem;
}

/* ── The stage: a full-bleed 16:9 monitoring console ────────────────────── */

.camera-page-stage {
    position: relative;
    overflow: hidden;
    /* Sized to the video itself (16:9) rather than stretched to fill the
       container — the full frame is visible edge-to-edge with no black
       bars. No height cap here: a cap would widen the box past 16:9 and
       reintroduce side (pillarbox) bars. */
    aspect-ratio: 16 / 9;
    background: #000;
    isolation: isolate;
    /* Break out of the hero's interior padding to sit flush with the card,
       like a monitor recessed into the console frame.

       The width MUST stay `auto` + `align-self: stretch`: the hero is a
       COLUMN flex container, so width is the cross size. A definite
       `width: 100%` resolves to the padding-box width and the negative
       margins then only SHIFT the box — it renders 2.5rem narrow and leaves
       a bar of card surface beside the video. Stretched, the used width is
       the line's cross size minus the (negative) margins, i.e. exactly
       card-width — genuinely edge-to-edge. */
    width: auto;
    align-self: stretch;
    margin-inline: -1.25rem;
    border-radius: 0;
    border: 0;
    /* A faint screen rim so the frame reads as hardware, not a hole. */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Quiet bottom scrim so name + host stay legible over any frame/still. The
   camera-grid chrome floats at z-index 3–4 and the watch-live control sits
   centred, so the scrim (z-index 2, last-in-tree) sits above the frame but
   never above the controls. */
.camera-page-stage::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 34%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.58), transparent);
    pointer-events: none;
    z-index: 2;
}

/* A still with a stored frame: full-bleed, full-brightness thumbnail (the
   grid's fallback dims + glyphs it — a hero should show the frame). */
.camera-page-stage.has-thumb .camera-tile-thumb {
    opacity: 1;
    filter: none;
}

/* Dead camera with no stored frame: an explicit "no signal" state. */
.camera-page-nosignal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    color: rgba(232, 235, 241, 0.66);
}

.camera-page-nosignal-ring {
    display: grid;
    place-items: center;
    width: 4.6rem;
    height: 4.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.camera-page-nosignal-ring svg {
    width: 2rem;
    height: 2rem;
}

.camera-page-nosignal-label {
    font-family: var(--ta-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ── Scale the camera-grid tile chrome up for the console ───────────────── */

/* The hero feed must always fill the stage. The grid's `object-fit: contain`
   can fail to UPSCALE the streamed frame in some renderings — the 640×360
   feed stays at its native size in the corner with bars under and to the
   side. `cover` always scales to fill; because the stage is exactly the
   feed's 16:9, nothing is cropped — it fills edge-to-edge. */
.camera-page-stage .camera-page-img {
    object-fit: cover;
}

.camera-page-stage .camera-tile-top {
    top: 1.15rem;
    left: 1.25rem;
    right: 1.25rem;
}

.camera-page-stage .camera-tile-bottom {
    bottom: 1.1rem;
    left: 1.25rem;
    right: 1.25rem;
}

.camera-page-stage .camera-tile-status,
.camera-page-stage .camera-tile-live,
.camera-page-stage .camera-tile-mode {
    padding: 0.28rem 0.75rem;
    font-size: 0.74rem;
    gap: 0.45rem;
}

/* The mode pill carries a semantic icon on this surface (edge → Zap, cloud
   → Cloud), so give the icon room and a steady colour. */
.camera-page-stage .camera-tile-mode svg {
    width: 0.82rem;
    height: 0.82rem;
}

.camera-page-stage .camera-tile-top-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.camera-page-stage .camera-tile-stop {
    width: 2.1rem;
    height: 2.1rem;
}

.camera-page-stage .camera-tile-stop svg {
    width: 0.9rem;
    height: 0.9rem;
}

/* Bottom deck: the camera name on the left, the RTSP host on the right —
   a compact ops readout over the footage. */
.camera-page-stage .camera-tile-bottom {
    justify-content: space-between;
    align-items: flex-end;
}

.camera-page-bottom-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.camera-page-bottom-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: none;
}

.camera-page-bottom-host {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.26rem 0.7rem;
    border-radius: 999px;
    background: rgba(10, 12, 16, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(232, 235, 241, 0.92);
    font-family: var(--ta-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.camera-page-bottom-host svg {
    width: 0.8rem;
    height: 0.8rem;
    color: color-mix(in oklab, var(--ta-ok) 80%, #fff);
}

/* The watch-live control — the console's primary affordance. Centred,
   glass ring with a one-time entrance and a gentle idle pulse while the
   feed is stopped, so the frame reads as "alive" even before streaming. */
.camera-page-stage .camera-tile-play-ring {
    width: 5.1rem;
    height: 5.1rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    animation: camera-page-play-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both,
        camera-page-play-idle 3.2s ease-in-out 0.9s infinite;
}

.camera-page-stage .camera-tile-play-ring svg {
    width: 1.9rem;
    height: 1.9rem;
    margin-left: 0.18rem;
}

.camera-page-stage .camera-tile-play-label {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.camera-page-stage .camera-tile-play:hover .camera-tile-play-ring {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.22);
}

@keyframes camera-page-play-enter {
    from {
        opacity: 0;
        transform: scale(0.82);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes camera-page-play-idle {

    0%,
    100% {
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }

    50% {
        box-shadow: 0 10px 36px rgba(0, 0, 0, 0.46),
            inset 0 1px 0 rgba(255, 255, 255, 0.3),
            0 0 0 6px rgba(255, 255, 255, 0.05);
    }
}

.camera-page-stage .camera-tile-glyph {
    width: 4rem;
    height: 4rem;
}

.camera-page-stage .camera-tile-glyph svg {
    width: 2rem;
    height: 2rem;
}

/* ── Facts strip ────────────────────────────────────────────────────────── */

.camera-page-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.7rem;
}

.camera-page-fact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--ta-r);
    border: 1px solid var(--ta-border);
    background: var(--ta-surface);
    color: inherit;
    text-decoration: none;
    min-width: 0;
    transition: border-color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

a.camera-page-fact:hover {
    border-color: color-mix(in oklab, var(--ta-accent) 50%, var(--ta-border));
    transform: translateY(-1px);
    box-shadow: 0 4px 14px color-mix(in oklab, var(--ta-accent) 12%, transparent);
}

.camera-page-fact-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: var(--ta-r-sm);
    background: var(--ta-accent-soft);
    color: var(--ta-accent);
}

.camera-page-fact-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.camera-page-fact-body {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.camera-page-fact-label {
    font-family: var(--ta-mono);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ta-muted);
}

.camera-page-fact-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--ta-text);
}

.camera-page-fact-mono {
    font-family: var(--ta-mono);
    font-variant-numeric: tabular-nums;
}

.camera-page-fact-value.is-enabled {
    color: var(--ta-ok);
}

/* ── Hikvision auto-calibration panel ─────────────────────────────────────
   The camera page's one-click "Auto-calibrate" (components/camera_page.rs).
   A head (icon + title + a status badge in a `tone-*` hue), the action row
   (button + hint), and the result box that static/app/hik-calibrate.js fills
   with the old AEY AlarmEmailResult panel (shared `.hik-result-*` styles,
   also used by the site grid's shared result area). */

.camera-calibrate {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 1rem 1.1rem;
    border-radius: var(--ta-r);
    border: 1px solid var(--ta-border);
    background: linear-gradient(180deg,
            color-mix(in oklab, var(--ta-accent) 4%, var(--ta-surface)),
            var(--ta-surface-2));
    box-shadow: inset 0 1px 0 color-mix(in oklab, #fff 60%, transparent);
}

.camera-calibrate-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.camera-calibrate-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--ta-r);
    background: var(--ta-accent-soft);
    color: var(--ta-accent);
    border: 1px solid color-mix(in oklab, var(--ta-accent) 22%, var(--ta-border));
}

.camera-calibrate-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.camera-calibrate-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    flex: 1 1 auto;
}

.camera-calibrate-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 720;
    letter-spacing: -0.01em;
}

.camera-calibrate-sub {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--ta-muted);
}

.camera-calibrate-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-family: var(--ta-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1px solid color-mix(in oklab, var(--tone) 34%, var(--ta-border));
    background: color-mix(in oklab, var(--tone) 9%, var(--ta-surface-2));
    color: var(--tone-ink, var(--tone));
}

.camera-calibrate-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.camera-calibrate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.05rem;
    border-radius: var(--ta-r-sm);
    border: 1px solid var(--ta-accent);
    background: var(--ta-accent);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 650;
    cursor: pointer;
    transition: filter 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 8px color-mix(in oklab, var(--ta-accent) 30%, transparent);
}

.camera-calibrate-btn:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
}

.camera-calibrate-btn:disabled {
    opacity: 0.65;
    cursor: default;
    transform: none;
}

.camera-calibrate-btn svg {
    width: 0.95rem;
    height: 0.95rem;
}

.camera-calibrate-btn.is-busy svg {
    animation: camera-calibrate-spin 0.9s linear infinite;
}

@keyframes camera-calibrate-spin {
    to {
        transform: rotate(360deg);
    }
}

.camera-calibrate-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: var(--ta-muted);
}

.camera-calibrate-hint svg {
    width: 0.82rem;
    height: 0.82rem;
    flex: none;
}

/* ── Hikvision result panel (camera page inline + site grid shared) ─────── */

.camera-calibrate-result,
.camera-grid-hik-result {
    min-width: 0;
}

.camera-grid-hik-result {
    margin-top: 0.85rem;
}

.hik-result-panel {
    padding: 0.8rem 0.95rem;
    border-radius: var(--ta-r-sm);
    border: 1px solid var(--ta-border);
    background: var(--ta-surface);
    font-size: 0.82rem;
    line-height: 1.5;
    animation: hik-result-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hik-result-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hik-result-panel.is-good {
    border-color: color-mix(in oklab, var(--tone-ok, var(--ta-ok)) 46%, var(--ta-border));
    background: color-mix(in oklab, var(--tone-ok, var(--ta-ok)) 6%, var(--ta-surface));
}

.hik-result-panel.is-caveat {
    border-color: color-mix(in oklab, var(--tone-warn, var(--ta-warn)) 50%, var(--ta-border));
    background: color-mix(in oklab, var(--tone-warn, var(--ta-warn)) 7%, var(--ta-surface));
}

.hik-result-panel.is-bad {
    border-color: color-mix(in oklab, var(--tone-err, var(--ta-err)) 50%, var(--ta-border));
    background: color-mix(in oklab, var(--tone-err, var(--ta-err)) 6%, var(--ta-surface));
}

.hik-result-head {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.hik-result-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.05rem;
    color: var(--tone-err, var(--ta-err));
}

.hik-result-panel.is-good .hik-result-icon {
    color: var(--tone-ok, var(--ta-ok));
}

.hik-result-panel.is-caveat .hik-result-icon {
    color: var(--tone-warn, var(--ta-warn));
}

.hik-result-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.hik-result-msg {
    margin: 0;
    color: var(--ta-text);
}

.hik-result-meta {
    margin: 0.35rem 0 0 1.9rem;
    color: var(--ta-muted);
    font-size: 0.78rem;
}

.hik-result-changes {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hik-result-changes li {
    position: relative;
    margin-left: 1.9rem;
    padding-left: 0.8rem;
    color: var(--ta-muted);
    font-size: 0.78rem;
}

.hik-result-changes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 0.32rem;
    height: 0.32rem;
    border-radius: 50%;
    background: color-mix(in oklab, var(--ta-accent) 55%, transparent);
}

.hik-result-busy {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--ta-r-sm);
    border: 1px dashed var(--ta-border-strong);
    background: var(--ta-surface);
    font-size: 0.82rem;
    color: var(--ta-muted);
}

.hik-result-spinner {
    flex: none;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid color-mix(in oklab, var(--ta-accent) 25%, transparent);
    border-top-color: var(--ta-accent);
    animation: camera-calibrate-spin 0.9s linear infinite;
}

.camera-page-fact-value.is-disabled {
    color: var(--ta-err);
}

/* ── Compact / mobile ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .camera-page.block-panel {
        padding: 1rem;
    }

    .camera-page-stage {
        margin-inline: -1rem;
    }

    .camera-page-title {
        font-size: 1.4rem;
    }

    .camera-page-badge {
        width: 2.5rem;
        height: 2.5rem;
    }

    .camera-page-facts {
        grid-template-columns: 1fr 1fr;
    }

    .camera-page-stage .camera-tile-play-ring {
        width: 4.2rem;
        height: 4.2rem;
    }

    .camera-page-bottom-meta {
        display: none;
    }
}

@media (max-width: 420px) {
    .camera-page-facts {
        grid-template-columns: 1fr;
    }

    .camera-page-head-meta {
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* ── Hikvision before/after table (the old AEY SettingsTable) ──────────────
   The "Review" result: Setting | Before | Recommended | Now. Colour lives on
   the CELLS, not on a status word: the recommended cell is always green (it
   is by definition right), the now cell is green when it matches and amber
   when it does not, grey for history, red for a change no write of ours can
   make. Built client-side by static/app/hik-calibrate.js. */

.hik-settings {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.hik-settings-msg {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--ta-text);
}

.hik-settings-msg.is-plan {
    color: var(--ta-muted);
}

.hik-settings-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-r-sm);
    overflow: hidden;
    font-size: 0.82rem;
}

.hik-settings-table th,
.hik-settings-table td {
    padding: 0.5rem 0.7rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--ta-border);
}

.hik-settings-table tr:last-child th,
.hik-settings-table tr:last-child td {
    border-bottom: 0;
}

.hik-cell-head {
    font-family: var(--ta-mono);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ta-muted);
    background: var(--ta-surface-2);
    white-space: nowrap;
}

.hik-cell-label {
    font-weight: 600;
    color: var(--ta-text);
}

.hik-cell {
    color: var(--ta-text);
    overflow-wrap: anywhere;
}

.hik-cell-ic {
    display: inline-flex;
    vertical-align: -0.2em;
    margin-right: 0.35rem;
}

.hik-cell-ic svg {
    width: 0.85rem;
    height: 0.85rem;
}

/* History takes no side. */
.hik-cell.was {
    background: color-mix(in oklab, var(--ta-border) 28%, transparent);
    color: var(--ta-muted);
    font-variant-numeric: tabular-nums;
}

/* The recommendation is by definition right. */
.hik-cell.want {
    background: color-mix(in oklab, var(--tone-ok, var(--ta-ok)) 12%, var(--ta-surface));
    color: var(--tone-ok, var(--ta-ok));
    font-variant-numeric: tabular-nums;
}

/* The now cell: green when it matches, amber when it does not. */
.hik-cell.ok {
    background: color-mix(in oklab, var(--tone-ok, var(--ta-ok)) 10%, var(--ta-surface));
    color: var(--tone-ok, var(--ta-ok));
}

.hik-cell.ok .hik-cell-ic {
    color: var(--tone-ok, var(--ta-ok));
}

.hik-cell.gap {
    background: color-mix(in oklab, var(--tone-warn, var(--ta-warn)) 12%, var(--ta-surface));
    color: var(--tone-warn, var(--ta-warn));
}

.hik-cell.gap .hik-cell-ic {
    color: var(--tone-warn, var(--ta-warn));
}

/* A change no write of ours can make — the recorder's own UI is the door. */
.hik-cell.manual {
    background: color-mix(in oklab, var(--tone-err, var(--ta-err)) 9%, var(--ta-surface));
    color: var(--tone-err, var(--ta-err));
}

.hik-cell.manual .hik-cell-ic {
    color: var(--tone-err, var(--ta-err));
}

.hik-settings-changes {
    margin-left: 0;
}

.hik-settings-changes li {
    margin-left: 0;
}

.hik-settings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding-top: 0.15rem;
}

.hik-apply:disabled {
    border-color: var(--ta-border-strong);
    background: var(--ta-surface-2);
    color: var(--ta-muted);
    box-shadow: none;
}

@media (max-width: 640px) {
    .hik-settings-table {
        font-size: 0.76rem;
    }

    .hik-settings-table th,
    .hik-settings-table td {
        padding: 0.42rem 0.5rem;
    }

    .hik-cell-ic {
        display: none;
    }
}