/* ==========================================================================
   SB Studio CCTV styles: the SB Studio look shared with Lista de Compras and WEDPLANNER (taken from Lista de
   Compras' app.css), then the CCTV pieces at the end. Brand colours: keep in sync with Components/Layout/AppTheme.cs
   ========================================================================== */
html.wp-dark { color-scheme: dark; } /* native scrollbars and form controls follow the theme */
:root {
    --wp-gold: #B08D57;
    --wp-gold-dark: #8E6F3F;
    --wp-gold-light: #D9BE8E;
    --wp-ink: #1C1B1A;
    --wp-cream: #F7F5F2;
    --wp-line: #ECE8E2;
    --wp-muted: #6B6762;
    /* The one corner radius for everything rounded (cards, inputs, buttons, dialogs, chips, labels, images); keep in
       sync with DefaultBorderRadius in AppTheme.cs. Only true circles (avatars, icon buttons, dots, counters) differ. */
    --wp-radius: 6px;
    --wp-bottom-nav: 64px;
    /* Under the bottom bar's buttons, over the iPhone's home line: not the whole 34 pt the iPhone keeps clear (the
       buttons then floated high, ~44 pt of empty bar under their names), only what keeps them off the line itself
       (it takes the lowest ~13 pt): 10 pt, the names ~18 pt above the screen's edge (Bruno, 2026-11-05: lower still).
       0 where there is no home line. */
    --wp-nav-pad: max(0px, calc(env(safe-area-inset-bottom, 0px) - 24px));
}

html, body { font-family: "Titillium Web", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--mud-palette-background, var(--wp-cream)); }
/* Dark from the first paint: the page streams in, and MudBlazor's palette can arrive a frame after the body. */
html.wp-dark, html.wp-dark body { background: var(--mud-palette-background, #121110); color: var(--mud-palette-text-primary, #EDE9E3); }
html.wp-neon, html.wp-neon body { background: var(--mud-palette-background, #060C26); color: var(--mud-palette-text-primary, #EEF3FF); }

/* Scrollbars stay hidden and show only while something scrolls, fading out smoothly once it stops: app.js puts
   .is-scrolling on the scrolling element for a moment. The thumb colour is a registered property so it can fade. */
@property --wp-sb { syntax: '<color>'; inherits: false; initial-value: transparent; }
/* MudBlazor's theme injects "html, body * { scrollbar-color }" inline, so this needs a little more specificity. */
html:root, body :not(:root) { scrollbar-color: var(--wp-sb) transparent; }
:where(*) { transition: --wp-sb .6s ease; }
.mud-paper { transition: box-shadow 300ms cubic-bezier(.4, 0, .2, 1), --wp-sb .6s ease; } /* keeps Mud's own transition (menus, dropdown lists) */
:where(.is-scrolling) { --wp-sb: rgba(28, 27, 26, .38); transition-duration: .15s; }
:where(html.wp-dark .is-scrolling, html.wp-dark.is-scrolling) { --wp-sb: rgba(255, 255, 255, .34); }
/* Browsers without scrollbar-color (older Safari): same idea, without the fade. */
@supports not (scrollbar-color: auto) {
    :root ::-webkit-scrollbar-thumb, :root::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
    .is-scrolling::-webkit-scrollbar-thumb { background: rgba(128, 124, 120, .5); }
}

/* Every badge is one size, as in WEDPLANNER: chips and tags take the same height, text and icon; the width follows the
   text. Counters stay small circles. MudBlazor hard-codes pill-shaped chips in three sizes, hence its size classes here. */
:root { --wp-badge-h: 40px; --wp-badge-font: .88rem; --wp-badge-icon: 20px; }
.mud-chip, .mud-chip.mud-chip-size-small, .mud-chip.mud-chip-size-medium, .mud-chip.mud-chip-size-large, .tag {
    display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; height: var(--wp-badge-h); padding: 0 12px;
    border-radius: var(--wp-radius); font-size: var(--wp-badge-font); font-weight: 600; line-height: 1.2; white-space: nowrap; }
:is(.mud-chip, .tag) .mud-icon-root { width: var(--wp-badge-icon); height: var(--wp-badge-icon); font-size: var(--wp-badge-icon); flex: none; }
.mud-chip .mud-chip-icon { margin: 0; } /* the gap spaces it */
/* A category's picture in its badge, in place of the icon. */
.mud-chip .mud-chip-content:has(> .chip-photo) { display: inline-flex; align-items: center; gap: 8px; }
.mud-chip .chip-photo { width: 28px; height: 28px; margin-left: -6px; border-radius: calc(var(--wp-radius) * .75); object-fit: cover; flex: none; display: block; }
.tag { background: color-mix(in srgb, var(--wp-gold) 12%, transparent); color: var(--wp-gold-dark); }
html.wp-dark .tag { color: var(--wp-gold-light); }

/* Counters are always round: a circle for one digit, a pill with round ends for more. */
.mud-badge:not(.mud-badge-dot):not(.mud-badge-icon), .section-count, .nav-count {
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}

/* Clickable icons sit on a soft accent-tinted circle so they read as buttons. Icons inside inputs (clock, clear,
   dropdown) and chips stay bare, and filled icon buttons keep their own colour. */
.mud-icon-button:not(.mud-button-filled):not(.mud-switch-base):not(.mud-input-adornment *):not(.mud-input-clear-button):not(.mud-chip *) { background-color: color-mix(in srgb, var(--mud-palette-primary) 11%, transparent); border-radius: 50%; }
.mud-icon-button:not(.mud-button-filled):not(.mud-switch-base):not(.mud-input-adornment *):not(.mud-input-clear-button):not(.mud-chip *):hover { background-color: color-mix(in srgb, var(--mud-palette-primary) 22%, transparent); }
.mud-icon-button:disabled { background-color: transparent !important; }
.mud-input-adornment .mud-icon-button, .mud-chip .mud-icon-button, .mud-input-control .mud-input-adornment .mud-icon-button:hover { background-color: transparent; }
/* With a mouse, every clickable icon fills with its colour on hover: the accent by default, red for delete. */
.row-delete { --wp-hover-fill: var(--mud-palette-error); --wp-hover-ink: #fff; }
@media (hover: hover) {
    .mud-icon-button:not(.mud-button-filled):not(.mud-switch-base):not(.mud-input-adornment *):not(.mud-input-clear-button):not(.mud-chip *):not(:disabled) { transition: background-color .15s ease, color .15s ease; }
    .mud-icon-button:not(.mud-button-filled):not(.mud-switch-base):not(.mud-input-adornment *):not(.mud-input-clear-button):not(.mud-chip *):not(:disabled):hover {
        background-color: var(--wp-hover-fill, var(--mud-palette-primary)) !important; color: var(--wp-hover-ink, var(--mud-palette-primary-text)) !important; }
    .mud-input-adornment .mud-icon-button:not(:disabled):hover { color: var(--mud-palette-primary) !important; }
}
/* Keyboard focus shows as a ring on the same icons. */
.mud-icon-button:focus-visible { outline: 2px solid var(--wp-hover-fill, var(--mud-palette-primary)); outline-offset: 2px; }
/* One control height: buttons, inputs (all dense outlined, 40px) and icon buttons line up side by side. */
.mud-button-root.mud-button { min-height: 40px; }
.new-btn { text-transform: uppercase; letter-spacing: .04em; }
/* Dialog buttons in upper case, like the other buttons that act. */
.mud-dialog .mud-dialog-actions .mud-button-root { text-transform: uppercase; letter-spacing: .04em; }
/* ...and every round icon button is the same 40px, whatever the icon size. */
.mud-icon-button:not(.mud-input-adornment *):not(.mud-chip *):not(.mud-switch-base), .avatar-btn { width: 40px; height: 40px; min-width: 40px; padding: 0; flex: none; }
/* Switches: no halo around the thumb; red when off, green when on, in both themes. A focus ring stays for keyboard users. */
.mud-switch .mud-switch-base, .mud-switch .mud-switch-base:hover { background-color: transparent !important; }
.mud-switch .mud-ripple::after { display: none; }
.mud-switch [class*="mud-switch-thumb"] { background-color: var(--mud-palette-error) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.mud-switch .mud-switch-base.mud-checked [class*="mud-switch-thumb"] { background-color: var(--mud-palette-success) !important; }
.mud-switch .mud-switch-track { background-color: var(--mud-palette-error) !important; opacity: .35 !important; }
.mud-switch .mud-switch-base.mud-checked + .mud-switch-track { background-color: var(--mud-palette-success) !important; opacity: .45 !important; }
.mud-switch:has(.mud-switch-input:focus-visible) .mud-switch-track { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
a { color: var(--mud-palette-primary, var(--wp-gold)); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--mud-palette-text-secondary) !important; }
.small { font-size: .82rem; }
.min-w-0 { min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cursor-pointer { cursor: pointer; }
.text-warning { color: var(--mud-palette-warning) !important; }
.text-error, .text-danger { color: var(--mud-palette-error) !important; }
.text-success { color: var(--mud-palette-success) !important; }
.text-center { text-align: center; }

/* ---------- Layout ---------- */
.app-main { min-height: 100vh; min-height: 100dvh; }
/* Every page uses the whole width beside the menu, like an app, never a centred column (Bruno, 2026-11-01 22:14: "as
   páginas devem utilizar todo o espaço disponível sempre"). */
.app-container { padding-top: 20px; padding-bottom: 40px; max-width: none; }
.app-bar { border-bottom: 1px solid var(--mud-palette-lines-default); backdrop-filter: saturate(1.4) blur(8px); }
.app-bar .mud-toolbar { gap: 10px; }
@media (max-width: 599px) { .app-bar .mud-toolbar { gap: 6px; } }
@media (max-width: 419px) { .app-bar .theme-toggle, .app-bar .theme-menu { display: none !important; } .app-bar .mud-toolbar-gutters { padding-left: 12px; padding-right: 12px; } }
.brand { display: flex; align-items: center; min-width: 0; margin-left: 4px; color: var(--mud-palette-appbar-text); }
.brand:hover { text-decoration: none; }

/* The wordmark: a basket on an accent circle (40px like the bar's round buttons), a gold rule, then the app's name above
   "SB STUDIO", as in WEDPLANNER's. */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; }
.brand-icon { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: var(--wp-gold); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.brand-icon .mud-icon-root { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding-left: 10px; border-left: 1.5px solid var(--wp-gold); line-height: 1.1; }
.brand-name { font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .6rem; letter-spacing: .24em; color: var(--wp-gold); white-space: nowrap; }
/* Phones with several lists: the open list's name takes the wordmark's place. */
@media (max-width: 599.98px) { .app-bar:has(.list-switch) .brand-text { display: none; } }
@media (max-width: 379.98px) { .app-bar .brand-text { display: none; } }

/* The open list's name, which opens the others. */
.list-switch { min-width: 0; }
.list-switch-btn { display: inline-flex; align-items: center; gap: 2px; height: 36px; max-width: min(260px, 42vw); padding: 0 6px 0 12px; box-sizing: border-box;
    border: 1px solid var(--mud-palette-lines-default); border-radius: var(--wp-radius); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.list-switch-btn:hover { background: var(--mud-palette-action-default-hover); }
.list-switch-btn:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.list-switch-btn .mud-icon-root { flex: none; }

.file-pick { position: relative; cursor: pointer; }
.file-pick-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.file-pick-input::-webkit-file-upload-button { cursor: pointer; }
.avatar-btn { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.avatar-btn:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
/* Browser autofill paints a rectangular background that pokes out of the rounded outline. */
.mud-input input:-webkit-autofill,
.mud-input input:-webkit-autofill:hover,
.mud-input input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset;
    box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset;
    -webkit-text-fill-color: var(--mud-palette-text-primary);
    caret-color: var(--mud-palette-text-primary);
    transition: background-color 9999s ease-out 0s;
}
.mud-input.mud-input-outlined input:-webkit-autofill { border-radius: var(--mud-default-borderradius); }

.app-drawer .mud-drawer-content { display: flex; flex-direction: column; }
.app-drawer { border-right: 1px solid var(--mud-palette-lines-default); }
/* The first item touches the top bar (Bruno). */
.nav-wrap { display: flex; flex-direction: column; height: 100%; padding: 0 8px 12px; }
/* Side menu: every item a square band across the whole menu; the open one in the highlight green, on a faint green band
   with a bar on its left edge. */
.app-nav .mud-nav-item { margin: 0 -8px; width: auto; }
.app-nav .mud-nav-link { border-radius: 0 !important; margin: 0 !important; padding: 10px 24px; color: var(--mud-palette-drawer-text); }
.app-nav .mud-nav-link.active { background: color-mix(in srgb, var(--mud-palette-success) 12%, transparent) !important; box-shadow: inset 3px 0 0 var(--mud-palette-success); font-weight: 700; }
.app-nav .mud-nav-link.active, .app-nav .mud-nav-link.active :is(.mud-nav-link-text, .mud-nav-link-icon) { color: var(--mud-palette-success) !important; }
.app-nav .mud-nav-link.active .mud-nav-link-text { font-weight: 700; }
/* The counter on Compras sits at the right end of the item, red like the ones on the top bar icons (as in WedPlanner). */
.app-nav .mud-nav-link-text { display: flex; align-items: center; gap: 6px; }
.nav-count { background: var(--mud-palette-error); color: #fff; margin-left: auto; }
.bottom-nav a .mud-badge-root { display: flex; }
/* On the cart itself, not out at the corner of the green pill around it. */
.bottom-nav a .mud-badge.mud-badge-top.right.mud-badge-overlap { inset: auto auto calc(100% - 14px) calc(100% - 28px); }
.logout-form { margin: 0; }
.logout-btn { all: unset; display: flex; gap: 10px; align-items: center; padding: 8px 16px; width: 100%; box-sizing: border-box; cursor: pointer; font-size: .875rem; }
.logout-btn:hover { background: var(--mud-palette-action-default-hover); }

/* Bottom navigation (phones) */
.bottom-nav { display: none; }
@media (max-width: 959.98px) {
    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
        height: calc(var(--wp-bottom-nav) + var(--wp-nav-pad)); padding-bottom: var(--wp-nav-pad);
        background: var(--mud-palette-surface); border-top: 1px solid var(--mud-palette-lines-default);
    }
    .bottom-nav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
        color: var(--mud-palette-text-secondary); font-size: .68rem; text-decoration: none;
    }
    .bottom-nav a > span:not(.mud-badge-root) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* The open item in the highlight green, its icon on a green pill. */
    .bottom-nav a.active { color: var(--mud-palette-success); font-weight: 700; }
    .bottom-nav a .mud-icon-root { box-sizing: content-box; padding: 3px 16px; border-radius: 999px; transition: background-color .15s ease; }
    .bottom-nav a.active .mud-icon-root { background: color-mix(in srgb, var(--mud-palette-success) 20%, transparent); }
    .app-container { padding-bottom: calc(var(--wp-bottom-nav) + 32px + var(--wp-nav-pad)); }
    .app-drawer { display: none; }
    /* The keyboard is up (app.js sets kb-open): the bottom bar steps aside so the field being typed in stays in view. */
    html.kb-open .bottom-nav { display: none; }
}
/* Phones and tablets: no double-tap zoom, and text fields at 16px so iOS doesn't zoom in when one is tapped. */
html.is-phone, html.is-phone body { touch-action: manipulation; }
html.is-phone :is(input:not([type=checkbox]):not([type=radio]), textarea, select) { font-size: 16px; }

/* Installed on a phone the page runs under the status bar (viewport-fit=cover, black-translucent): the app bar grows
   by the status bar's height and everything under it moves down with it. */
:root { --wp-safe-top: env(safe-area-inset-top, 0px); }
:root { --wp-main-top: calc(var(--mud-appbar-height) - var(--mud-appbar-height) / 8 + var(--wp-safe-top)); } /* the app bar's height, as MudBlazor sizes it */
@media (orientation: landscape) { :root { --wp-main-top: calc(var(--mud-appbar-height) - var(--mud-appbar-height) / 4 + var(--wp-safe-top)); } }
@media (min-width: 600px) { :root { --wp-main-top: calc(var(--mud-appbar-height) + var(--wp-safe-top)); } }
.app-bar.mud-appbar { padding-top: var(--wp-safe-top); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.mud-layout .mud-main-content.app-main { padding-top: var(--wp-main-top); }
.mud-drawer-fixed.mud-drawer-responsive.mud-drawer-clipped-always.app-drawer { top: var(--wp-main-top); height: calc(100% - var(--wp-main-top)); }
/* iOS 26, installed: while the page is shorter than the screen, iOS gives it a window shorter than the screen by the
   status bar's height (WebKit bug 301108), so the bottom bar stopped that high and left an empty strip under it, about
   as tall as the bar itself (Gravações, now exactly the window's height, always). A page at least as tall as the screen
   gets the whole screen: so the page is made the screen's height, the window plus the status bar, never more than the
   screen itself (100lvh). Without a status bar over the page (a computer, Android) the inset is 0 and nothing changes. */
@media (display-mode: standalone) {
    html { min-height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
}
/* The status bar's clock is always white: in the light theme it gets a dark strip behind it. */
html:not(.wp-dark) .app-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--wp-safe-top); background: rgba(18, 17, 16, .6); pointer-events: none; }

/* ---------- Page chrome ---------- */
/* The title, with the page's search or add box under it, stays under the app bar while the page scrolls. It spans the
   container's gutters so what scrolls beneath is hidden edge to edge; once the page has scrolled, a line marks its lower
   edge (app.js sets "scrolled"). */
.page-top { position: sticky; top: var(--wp-main-top); z-index: 6; margin: -12px -16px 8px; padding: 12px 16px 10px; background: var(--mud-palette-background); }
@media (min-width: 600px) { .page-top { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; } }
html.scrolled .page-top { border-bottom: 1px solid var(--mud-palette-lines-default); }
.page-top > * + * { margin-top: 12px; }
.page-top > :is(.quick-add, .toolbar) { margin-bottom: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-header-text { display: flex; align-items: center; gap: 4px; min-width: 0; }
.page-header-text > div { min-width: 0; }
/* On the right, also when a long title (a camera's name) sends them to a line of their own. */
.page-header-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-left: auto; }
.page-title { font-size: 1.9rem !important; line-height: 1.15 !important; overflow-wrap: anywhere; }
@media (max-width: 599.98px) {
    .page-title { font-size: 1.5rem !important; }
    /* Header buttons shrink to their icon next to the title: square, as tall as the round ones, the icon in the middle. */
    .page-header-actions .btn-text { display: none; }
    .page-header-actions .mud-button-root:has(.btn-text) { box-sizing: border-box; width: 40px; min-width: 40px; height: 40px; padding: 0; }
    .page-header-actions .mud-button-root:has(.btn-text) .mud-button-label { justify-content: center; }
    .page-header-actions .mud-button-root:has(.btn-text) .mud-button-icon-start { margin: 0; }
}
/* Titles are upper case: page, section, card and dialog titles. The strings stay normally written (they translate as
   usual); names shown as a title (a person, a list) keep their case with .keep-case. */
.page-title, .mud-typography-h5, .mud-typography-h6, .mud-typography-subtitle2, .mud-dialog-title, .auth-title, .auth-hero h2,
.month-header { text-transform: uppercase !important; letter-spacing: .04em; }
.keep-case, .mud-dialog-title .keep-case { text-transform: none !important; letter-spacing: normal; }
.section-label { margin: 0 0 8px 2px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mud-palette-text-secondary); }
.field-label { margin: 6px 0 6px 2px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mud-palette-text-secondary); }
.month-header { font-weight: 600; color: var(--mud-palette-text-secondary); margin: 18px 4px 8px; font-size: .82rem; }

.card { border: 1px solid var(--mud-palette-lines-default); border-radius: var(--wp-radius) !important; background: var(--mud-palette-surface); overflow: hidden; }
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* Titles that stay: a card's (or a day's) title sticks at the top of the list that scrolls it while its rows scroll
   beneath, until its card has gone by and the next one takes its place. Where the window scrolls instead, it sticks
   under the page's title (app.js keeps --wp-top-h at that title's height). app.js puts "stuck" on a title while it is
   held, which draws its lower edge. A card holding one clips with overflow: clip,
   which unlike hidden doesn't stop it sticking. */
:root { --wp-stick: calc(var(--wp-main-top) + var(--wp-top-h, 0px)); }
.stick { position: sticky; top: var(--wp-stick); z-index: 3; background: var(--mud-palette-surface); }
.stick.stuck { box-shadow: 0 1px 0 var(--mud-palette-lines-default); }
/* In a list that scrolls on its own, a held title also covers the few pixels above it, in its own colour: the iPhone
   draws the scrolling rows and the held title separately and can leave the title a hair below the list's edge, with a
   line of the rows passing beneath showing above it (Bruno, 2026-10-30). The list's edge cuts it off, so it never shows
   above the list. */
:is(.fill-scroll, .pick-rows) .stick.stuck::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 4px;
    background: inherit; -webkit-backdrop-filter: inherit; backdrop-filter: inherit; pointer-events: none; }
.card:has(.stick) { overflow: clip; }
/* In a padded card the title spans the card's whole width, so nothing shows beside it as rows pass beneath. */
.card.pa-4 > .stick { margin-top: -16px; margin-inline: -16px; padding: 16px 16px 8px; }
.card-head > .mud-button-root { flex: none; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
/* MudBlazor repeats Class on inner elements, so size only the outer ones. */
.toolbar > .toolbar-search { max-width: 420px; flex: 1 1 240px; }

/* ---------- Lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--mud-palette-lines-default); color: inherit; }
.list-row:last-child { border-bottom: none; }
a.list-row:hover { text-decoration: none; }
.list-row-main { flex: 1; min-width: 0; color: inherit; }
a.list-row-main:hover { text-decoration: none; }
.list-row-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.list-row-sub { display: block; font-size: .8rem; color: var(--mud-palette-text-secondary); }
.row-actions { display: flex; gap: 4px; flex: none; }

.kv-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--mud-palette-lines-default); font-size: .9rem; }
.kv-list > div:last-child { border-bottom: none; }
.kv-list > div > span:first-child { color: var(--mud-palette-text-secondary); }
.kv-list > div > b { text-align: right; overflow-wrap: anywhere; }
.kv-list .kv-block { flex-direction: column; gap: 0; }
.kv-list .kv-block p { margin: 4px 0 0; white-space: pre-line; }

/* Dialogs get a visible edge in the accent colour and a deeper shadow, so they stand apart from the page behind. */
.mud-dialog { border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 80%, transparent); box-shadow: 0 18px 50px rgba(0, 0, 0, .28) !important; }
html.wp-dark .mud-dialog { box-shadow: 0 18px 50px rgba(0, 0, 0, .7) !important; }
/* Installed on an iPhone, no window goes under the status bar and the Dynamic Island (Bruno, 2026-10-28). */
.mud-dialog-container { padding-top: var(--wp-safe-top); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; }

/* ---------- Misc ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 16px; color: var(--mud-palette-text-primary); }
.empty-state > .muted { max-width: 460px; }
.empty-icon { font-size: 48px !important; width: 48px !important; height: 48px !important; color: var(--wp-gold); opacity: .75; margin-bottom: 4px; }
.install-banner .mud-alert-message { flex: 1; min-width: 0; }
.more-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.flag { width: 20px; height: 15px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex-shrink: 0; vertical-align: middle; }
/* The language button is the flag itself, filling the whole 40px circle. */
.lang-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 18px; color: inherit; white-space: nowrap; }
.lang-menu-item:hover { text-decoration: none; background: var(--mud-palette-action-default-hover); }
.lang-menu-item.active { font-weight: 600; color: var(--wp-gold); }
.lang-menu-item.active .mud-icon-root { color: inherit; }
/* The top bar's theme and list menus use the same rows as buttons. */
button.lang-menu-item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; justify-content: flex-start; }
.lang-option { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: var(--wp-radius); border: 1px solid var(--mud-palette-lines-default); text-align: center; color: inherit; font-weight: 600; }
.lang-option:hover { text-decoration: none; border-color: var(--wp-gold); }
.lang-option.active { border-color: var(--wp-gold); background: color-mix(in srgb, var(--wp-gold) 10%, transparent); color: var(--wp-gold-dark); }
.lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 599.98px) { .theme-grid { grid-template-columns: repeat(2, 1fr); } }
/* The user menu's row of themes (Claro, Escuro, Néon, Automático). */
.menu-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 10px 8px; }
.menu-theme { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 1px solid transparent; border-radius: var(--wp-radius);
    background: none; color: inherit; font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.menu-theme:hover { background: var(--mud-palette-action-default-hover); }
.menu-theme.active { border-color: var(--wp-gold); color: var(--wp-gold-dark); background: color-mix(in srgb, var(--wp-gold) 10%, transparent); }
.theme-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: var(--wp-radius); border: 1px solid var(--mud-palette-lines-default); background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.theme-option:hover { border-color: var(--wp-gold); }
.theme-option.active { border-color: var(--wp-gold); background: color-mix(in srgb, var(--wp-gold) 10%, transparent); color: var(--wp-gold-dark); }
/* Imagem ao vivo (Definições): two choices, each with what it costs. */
.theme-grid.quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quality-hint { font-size: .75rem; font-weight: 400; text-align: center; line-height: 1.35; }
html.wp-dark :is(.menu-theme, .theme-option, .lang-option).active { color: var(--wp-gold-light); }
.profile-avatar { width: 72px !important; height: 72px !important; font-size: 1.6rem !important; }
.user-avatar { font-weight: 600; font-size: .85rem; }
/* Profile: accent colour swatches. */
.accent-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--mud-palette-lines-default); }
.accent-swatch.active { box-shadow: 0 0 0 2px var(--mud-palette-surface), 0 0 0 4px var(--mud-palette-text-primary); }
.accent-swatch.custom { background: conic-gradient(#e57373, #ffd54f, #81c784, #64b5f6, #ba68c8, #e57373); color: #fff; }
.accent-swatch .mud-icon-root { width: 18px; height: 18px; }
.accent-preview { display: flex; align-items: center; justify-content: center; gap: 12px; }
/* Steps to put the app on the home screen by hand. */
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.install-steps li { display: flex; align-items: center; gap: 12px; counter-increment: step; }
.install-step-icon { position: relative; flex: none; width: 40px; height: 40px; border-radius: var(--wp-radius); display: grid; place-items: center;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); color: var(--mud-palette-primary); }
.install-step-icon::after { content: counter(step); position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
    font-size: .68rem; font-weight: 700; background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }

/* ==========================================================================
   Sign-in / registration (static pages, no MudBlazor interactivity)
   ========================================================================== */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--wp-cream); }
.auth-hero {
    background: radial-gradient(120% 120% at 10% 10%, #2e2a26 0%, var(--wp-ink) 55%, #0f0e0d 100%);
    color: #F3EEE6; display: flex; align-items: flex-end; padding: 56px; position: relative; overflow: hidden;
}
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--wp-gold) 35%, transparent); }
.auth-hero::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-hero::after { width: 300px; height: 300px; right: -40px; top: -20px; }
.auth-hero-inner { position: relative; max-width: 460px; }
.brand-mark.auth-hero-logo { margin-bottom: 32px; gap: 14px; }
.auth-hero-logo .brand-icon { width: 56px; height: 56px; }
.auth-hero-logo .brand-icon .mud-icon-root { width: 30px; height: 30px; }
.auth-hero-logo .brand-text { padding-left: 14px; }
.auth-hero-logo .brand-name { font-size: 1rem; }
.auth-hero-logo .brand-sub { font-size: .7rem; }
.auth-hero h2 { font-family: "Titillium Web", sans-serif; font-weight: 600; font-size: 2.4rem; line-height: 1.2; margin: 0 0 12px; }
.auth-hero p { opacity: .75; line-height: 1.6; margin: 0; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.brand-mark.auth-logo { display: none; margin-bottom: 28px; color: var(--wp-ink); }
.auth-title { font-family: "Titillium Web", sans-serif; font-weight: 600; font-size: 2rem; margin: 0 0 6px; color: var(--wp-ink); }
.auth-sub { color: var(--wp-muted); margin: 0 0 24px; }
.auth-label { display: block; font-size: .82rem; font-weight: 600; color: var(--wp-ink); margin-bottom: 14px; }
.auth-input {
    display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 12px 14px; font: inherit; font-size: 1rem;
    border: 1px solid #DDD6CC; border-radius: var(--wp-radius); background: #fff; color: var(--wp-ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus { border-color: var(--wp-gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp-gold) 18%, transparent); }
.auth-hint { display: block; font-weight: 400; color: var(--wp-muted); font-size: .76rem; margin-top: 4px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 20px; font-size: .86rem; }
.auth-check { display: flex; gap: 6px; align-items: center; color: var(--wp-ink); }
.auth-check input { accent-color: var(--wp-gold); width: 16px; height: 16px; }
.auth-btn {
    width: 100%; padding: 13px; border: none; border-radius: var(--wp-radius); background: var(--wp-ink); color: #fff; font: inherit; font-weight: 600;
    font-size: 1rem; cursor: pointer; transition: background .15s, transform .05s;
}
.auth-btn:hover { background: #33302c; }
.auth-btn:active { transform: translateY(1px); }
.auth-foot { text-align: center; margin-top: 22px; color: var(--wp-muted); font-size: .9rem; }
.auth-error { background: #fbeceb; color: #9b3b32; border: 1px solid #f1c9c4; padding: 10px 14px; border-radius: var(--wp-radius); margin-bottom: 14px; font-size: .9rem; }
.auth-ok { background: #ecf5ef; color: #2f6b45; border: 1px solid #c9e3d1; padding: 10px 14px; border-radius: var(--wp-radius); margin-bottom: 14px; font-size: .9rem; }
/* Profile > Linked accounts */
.linked-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--mud-palette-lines-default); }
.linked-row:first-of-type { border-top: none; padding-top: 0; }
.linked-row .provider-logo { width: 22px; height: 22px; }
.linked-row .provider-logo.apple { color: var(--mud-palette-text-primary); }
/* "Continue with Google / Apple / Microsoft": white outlined buttons with each provider's own mark, as their guidelines allow. */
.auth-ext { display: grid; gap: 10px; }
.auth-ext-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; font: inherit; font-weight: 600;
    font-size: .95rem; color: #1f1f1f; background: #fff; border: 1px solid #DDD6CC; border-radius: var(--wp-radius); cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}
.auth-ext-btn:hover { background: #faf8f5; border-color: #c9c0b3; }
.auth-ext-btn:active { transform: translateY(1px); }
.provider-logo { width: 18px; height: 18px; flex: 0 0 auto; }
.provider-logo.apple { color: #000; height: 20px; margin-top: -2px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--wp-muted); font-size: .82rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid #E4DDD3; }
/* Install offer on the sign-in pages (InstallHint), shown by app.js on a phone or tablet without the app. */
.auth-install { border: 1px solid color-mix(in srgb, var(--wp-gold) 45%, #DDD6CC); background: color-mix(in srgb, var(--wp-gold) 7%, #fff);
    border-radius: var(--wp-radius); padding: 14px; margin-bottom: 22px; font-size: .9rem; color: var(--wp-ink); }
.auth-install[hidden], .auth-install [hidden] { display: none; }
.auth-install-text { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.auth-install-text .mud-icon-root { flex: none; color: var(--wp-gold-dark); margin-top: 1px; }
.auth-install .install-steps { margin-top: 14px; }
.auth-install .install-step-icon { background: color-mix(in srgb, var(--wp-gold) 14%, transparent); color: var(--wp-gold-dark); }
.auth-install .install-step-icon::after { background: var(--wp-gold); color: #fff; }
.auth-install-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.auth-install-actions button { font: inherit; font-weight: 600; font-size: .86rem; border-radius: var(--wp-radius); padding: 8px 14px; cursor: pointer; border: none; }
.auth-install-later { background: transparent; color: var(--wp-muted); }
.auth-install-go { background: var(--wp-ink); color: #fff; }
.auth-langs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 32px; font-size: .8rem; }
.auth-langs a { display: inline-flex; align-items: center; gap: 6px; color: var(--wp-muted); }
.auth-langs a.active { color: var(--wp-gold-dark); font-weight: 600; }
@media (max-width: 899.98px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .brand-mark.auth-logo { display: inline-flex; }
    .auth-panel { align-items: flex-start; padding-top: calc(48px + var(--wp-safe-top)); }
}

/* ==========================================================================
   Néon theme (from WEDPLANNER): a deep navy page with a faint grid, translucent cards with a thin luminous outline
   and a soft glow, section titles followed by a rule, and numbers that shine. Corners are rounder than in the light
   theme. The colours are MudBlazor's neon dark palette (AppTheme.cs) plus the tokens below.
   ========================================================================== */
html.wp-neon {
    --wp-radius: 14px; --mud-default-borderradius: 14px;
    --nx-line: rgba(125, 170, 255, .40);
    --nx-line-soft: rgba(125, 170, 255, .20);
    --nx-glow: rgba(70, 130, 255, .28);
    --nx-fill: linear-gradient(160deg, rgba(48, 88, 200, .32), rgba(10, 20, 66, .66));
    --nx-fill-in: rgba(16, 32, 96, .42);
    --nx-well: rgba(5, 11, 38, .55);
    --nx-bar: rgba(7, 14, 44, .80);
    --nx-stick: rgba(14, 28, 82, .96);
    --nx-glass: rgba(7, 14, 44, .94);
    --nx-text-glow: 0 0 14px rgba(140, 185, 255, .50);
    --nx-ok: #4FE3B0; --nx-warn: #FFC857; --nx-bad: #FF5C7A;
}
/* The page: navy, lighter towards the top, under a faint grid. A fixed layer, so it stays put while lists scroll. */
html.wp-neon body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        linear-gradient(rgba(110, 150, 255, .055) 1px, transparent 1px) 0 0 / 36px 36px,
        linear-gradient(90deg, rgba(110, 150, 255, .055) 1px, transparent 1px) 0 0 / 36px 36px,
        radial-gradient(120% 70% at 50% 0%, #16337F 0%, #0B1A4C 42%, #050A22 100%);
}
/* The body stays see-through so this layer shows. */
html.wp-neon body, html.wp-neon .mud-main-content, html.wp-neon .mud-layout { background: transparent; }

/* The title at the top: see-through over the grid until something scrolls under it, then dark glass like the bars. */
html.wp-neon .page-top { background: transparent; }
html.wp-neon.scrolled .page-top { background: var(--nx-glass); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    border-bottom-color: var(--nx-line-soft); box-shadow: 0 1px 16px rgba(70, 130, 255, .14); }
/* Bars: dark glass with a glowing edge. */
html.wp-neon :is(.app-bar, .bottom-nav, .mud-drawer.app-drawer) {
    background: var(--nx-bar) !important; -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
html.wp-neon .app-bar { border-bottom: 1px solid var(--nx-line-soft); box-shadow: 0 1px 16px rgba(70, 130, 255, .18); }
html.wp-neon .bottom-nav { border-top: 1px solid var(--nx-line-soft); box-shadow: 0 -1px 16px rgba(70, 130, 255, .18); }
html.wp-neon .mud-drawer.app-drawer { border-right: 1px solid var(--nx-line-soft); }
html.wp-neon :is(.bottom-nav a.active, .app-nav .mud-nav-link.active) { text-shadow: 0 0 10px color-mix(in srgb, var(--mud-palette-success) 60%, transparent); }
html.wp-neon :is(.bottom-nav a.active, .app-nav .mud-nav-link.active) .mud-icon-root { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--mud-palette-success) 80%, transparent)); }
html.wp-neon .bottom-nav a.active .mud-icon-root { box-shadow: 0 0 12px color-mix(in srgb, var(--mud-palette-success) 30%, transparent); }
html.wp-neon .brand-icon { box-shadow: 0 0 14px color-mix(in srgb, var(--wp-gold) 55%, transparent); }

/* Cards: translucent navy with a thin luminous outline, a soft outer glow and a faint inner one. */
html.wp-neon .card {
    background: var(--nx-fill); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid var(--nx-line) !important;
    box-shadow: 0 0 18px var(--nx-glow), inset 0 0 18px rgba(90, 140, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
}
html.wp-neon .section-bar { border-color: var(--nx-line-soft); }
html.wp-neon .section-bar { background: rgba(90, 140, 255, .08); color: color-mix(in srgb, var(--mud-palette-primary) 45%, white); text-shadow: var(--nx-text-glow); }
/* Titles that stay: deep navy inside cards; over the page (tabs, days) see-through until held, then dark glass. */
html.wp-neon .stick { background: var(--nx-stick); }
html.wp-neon .section-bar.stick { background: linear-gradient(rgba(90, 140, 255, .08), rgba(90, 140, 255, .08)) var(--nx-stick); }
html.wp-neon .stick.stuck { box-shadow: 0 1px 0 var(--nx-line-soft), 0 6px 14px rgba(3, 8, 30, .45); }
html.wp-neon .day-head.stick { background: transparent; }
html.wp-neon .day-head.stick.stuck { background: var(--nx-glass) !important; -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
html.wp-neon .tag { color: color-mix(in srgb, var(--mud-palette-primary) 55%, white); background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); }
/* Wells: value boxes and settings sit in dark wells with a soft outline. */
html.wp-neon :is(.mini-stat:not(.card), .invite-box, .suggest-setting, .icon-pick:not(.active), .theme-option:not(.active)) { background: var(--nx-well); border-color: var(--nx-line-soft); }

/* Buttons: filled ones glow in the accent; outlined ones get a luminous edge; round ones a faint ring. */
html.wp-neon .mud-button-filled.mud-button-filled-primary {
    background: color-mix(in srgb, var(--mud-palette-primary) 26%, rgba(10, 20, 66, .6)) !important; color: color-mix(in srgb, var(--mud-palette-primary) 35%, white) !important;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 80%, transparent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--mud-palette-primary) 40%, transparent), inset 0 0 12px color-mix(in srgb, var(--mud-palette-primary) 18%, transparent);
}
html.wp-neon .mud-button-filled.mud-button-filled-primary:hover { background: color-mix(in srgb, var(--mud-palette-primary) 38%, rgba(10, 20, 66, .6)) !important; }
html.wp-neon .mud-button-outlined { box-shadow: 0 0 10px rgba(70, 130, 255, .16); }
html.wp-neon .mud-icon-button:not(.mud-button-filled):not(.mud-switch-base):not(.mud-input-adornment *):not(.mud-input-clear-button):not(.mud-chip *) {
    box-shadow: inset 0 0 0 1px var(--nx-line-soft), 0 0 10px rgba(70, 130, 255, .16);
}

/* Fields: dark wells with a luminous outline that brightens on focus. */
html.wp-neon .mud-input-outlined { background: var(--nx-well); border-radius: var(--wp-radius); }
html.wp-neon .mud-input-outlined .mud-input-outlined-border { border-color: var(--nx-line-soft); }
html.wp-neon .mud-input-outlined:hover .mud-input-outlined-border { border-color: var(--nx-line); }
html.wp-neon .mud-input-outlined:focus-within .mud-input-outlined-border { box-shadow: 0 0 12px color-mix(in srgb, var(--mud-palette-primary) 40%, transparent); }

/* Tabs: a glowing bar, the active tab and its indicator shine. */
html.wp-neon .history-tabs .mud-tabs-tabbar { background: rgba(90, 140, 255, .06) !important; border-bottom: 1px solid var(--nx-line-soft); }
html.wp-neon .history-tabs .mud-tabs-tabbar-wrapper > .mud-tooltip-root + .mud-tooltip-root { border-left-color: var(--nx-line-soft); }
html.wp-neon .mud-tab.mud-tab-active { text-shadow: var(--nx-text-glow); }
html.wp-neon .history-tabs .mud-tab.mud-tab-active .mud-icon-root { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--mud-palette-success) 70%, transparent)); }
html.wp-neon .history-tabs .mud-tab-slider { box-shadow: 0 0 10px var(--mud-palette-success); }

/* Section titles: glowing, upper case, followed by a thin rule. */
html.wp-neon :is(.card-head > .mud-typography-h6, .card > .mud-typography-h6:first-child, .section-label, .month-header:not(.day-head)) {
    display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0;
    color: color-mix(in srgb, var(--mud-palette-primary) 45%, white); text-shadow: var(--nx-text-glow); letter-spacing: .08em;
}
html.wp-neon :is(.card-head > .mud-typography-h6, .card > .mud-typography-h6:first-child, .section-label, .month-header:not(.day-head))::after {
    content: ""; flex: 1 1 0; min-width: 0; height: 1px; background: linear-gradient(90deg, var(--nx-line), transparent);
}
html.wp-neon .day-head { color: color-mix(in srgb, var(--mud-palette-primary) 45%, white); text-shadow: var(--nx-text-glow); }

/* Numbers and names that shine. */
html.wp-neon :is(.page-title, .mini-stat b, .invite-code, .day-total) { text-shadow: var(--nx-text-glow); }

/* ==========================================================================
   Reconnecting
   ========================================================================== */
/* Reconnecting quietly (ReconnectModal.razor.js): the page stays as it was, with a thin moving bar under the status bar. */
html.wp-reconnecting body::after { content: ""; position: fixed; z-index: 3000; left: 0; right: 0; top: var(--wp-safe-top, 0px); height: 3px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--mud-palette-primary), transparent) 0 0 / 40% 100% no-repeat; animation: wp-reconnect-bar 1.1s ease-in-out infinite; }
@keyframes wp-reconnect-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes wp-reconnect-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes wp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wp-spin { to { transform: rotate(360deg); } }
/* Reconnect dialog (ReconnectModal.razor), shown while the live connection is down, usually during an update: the app's
   look, centred, with the page behind it in black and white. ReconnectModal.razor.js toggles the state classes. */
.components-reconnect-first-attempt-visible, .components-reconnect-repeated-attempt-visible, .components-reconnect-failed-visible,
.components-pause-visible, .components-resume-failed-visible, .components-rejoining-animation { display: none; }
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible { display: block; }
/* A retry hides the first-attempt text, so only one message shows at a time. */
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-failed .components-rejoining-animation { display: none; }
#components-reconnect-modal {
    position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100dvh - 32px);
    width: min(22rem, calc(100vw - 32px)); box-sizing: border-box; padding: 28px 24px 24px;
    background: var(--mud-palette-surface, #fff); color: var(--mud-palette-text-primary, #222);
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 45%, transparent); border-radius: var(--wp-radius);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28); font-family: "Titillium Web", system-ui, sans-serif;
}
#components-reconnect-modal:focus, #components-reconnect-modal:focus-visible { outline: none; }
#components-reconnect-modal[open] { animation: wp-reconnect-in .4s cubic-bezier(.05, .89, .25, 1.02) .3s both; }
#components-reconnect-modal::backdrop { background: rgba(0, 0, 0, .18); -webkit-backdrop-filter: grayscale(1); backdrop-filter: grayscale(1); animation: wp-fade-in .5s ease-in-out; }
.components-reconnect-container { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.components-reconnect-container .reconnect-logo { color: var(--mud-palette-text-primary, #222); }
#components-reconnect-modal p { margin: 0; text-align: center; line-height: 1.45; }
#components-reconnect-modal p span { font-size: .875rem; color: var(--mud-palette-text-secondary, #666); }
#components-reconnect-modal button {
    min-height: 40px; padding: 0 22px; border: 0; border-radius: var(--wp-radius); cursor: pointer;
    background: var(--mud-palette-primary); color: var(--mud-palette-primary-text, #fff); font: inherit; font-weight: 600;
}
#components-reconnect-modal button:hover { filter: brightness(.92); }
.components-rejoining-animation {
    width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--mud-palette-primary) 20%, transparent); border-top-color: var(--mud-palette-primary);
    animation: wp-spin .9s linear infinite;
}

/* ==========================================================================
   CCTV
   ========================================================================== */
/* Live video: black 16:9 boxes, a gold spinner behind the picture until it comes. */
.live-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.live-player::before { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; box-sizing: border-box;
    border-radius: 50%; border: 3px solid rgba(255, 255, 255, .14); border-top-color: var(--wp-gold); animation: wp-spin .9s linear infinite; }
.live-player video-stream { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.live-player video { display: block; width: 100% !important; height: 100% !important; object-fit: contain; background: transparent; }

/* Ao vivo: two across on phones, three on a computer (six cameras, two rows). */
.cam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 960px) { .cam-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 419.98px) { .cam-grid { gap: 8px; } }
.cam-tile { position: relative; display: block; color: #fff; text-decoration: none !important; transition: border-color .15s ease, box-shadow .2s ease; }
.cam-tile .live-player { pointer-events: none; } /* the whole tile is the link */
/* A phone in HD: the camera in view's full stream over its small one (Live.razor). See-through and without its own
   spinner until its first picture, so the small stream shows meanwhile; then it covers it. */
.cam-tile .live-player.hd-layer { position: absolute; inset: 0; z-index: 1; background: transparent; }
/* A camera opened: both streams drawn in the very same 16:9 rectangle. The small stream is 800×448 (1.786:1), the full
   one 2304×1296 (16:9): each fitted on its own, the small picture came out ~0.45% wider (a few pixels across a phone
   on its side), and the picture shrank by that much when the full stream came over it (2026-11-15). So the player box
   is the largest 16:9 rectangle that fits, centred, and each picture fills it exactly (the small one stretched by
   0.45%, which can't be seen). Its size (--fw, --fh) is set by app.js on the tile: container query units kept the
   iPhone's upright size after it was turned on its side (2026-11-15). */
.live-page.focus .cam-tile .live-player video-stream { position: absolute; inset: 0; margin: auto;
    width: var(--fw, 100%); height: var(--fh, 100%); }
.live-page.focus .cam-tile .live-player video { object-fit: fill !important; }
.cam-tile .live-player.hd-layer:not([data-state=playing])::before { display: none; }
/* It fades in over the small stream once its first picture is drawn (app.js: data-state), instead of popping in
   (2026-11-18). */
.cam-tile .live-player.hd-layer video-stream { opacity: 0; transition: opacity .25s ease; }
.cam-tile .live-player.hd-layer[data-state=playing] video-stream { opacity: 1; }
/* Ao vivo: a tile dragged to another place (app.js cctv.sortable) lifts and follows the pointer, the others slide to
   where they would go; held by a finger, it brings no menu of its own. */
.live-page:not(.focus) .cam-grid { -webkit-touch-callout: none; }
.live-page:not(.focus) .cam-tile { -webkit-user-drag: none; }
.cam-grid.sorting { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.cam-grid.sorting .cam-tile:not(.dragging) { transition: transform .2s ease, border-color .15s ease, box-shadow .2s ease; }
.live-page:not(.focus) .cam-grid .cam-tile.dragging { z-index: 5; cursor: grabbing; border-color: var(--wp-gold) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .4), 0 0 0 2px var(--wp-gold) !important; }
/* Date, time and name drawn by the app over the picture (Live.razor, Recordings.razor), in the picture's own 16:9
   rectangle, at its bottom right, sized with it: where the cameras drew theirs. Never zoomed (it sits beside the player, not in it). */
.osd-box { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.osd-frame { position: absolute; inset: 0; margin: auto; width: var(--fw, 100%); height: var(--fh, 100%); }
.osd { position: absolute; right: calc(var(--fw, 100vw) * .022); bottom: calc(var(--fh, 56vw) * .032); display: flex; flex-direction: column; align-items: flex-end; gap: .2em;
    font: 600 max(9px, calc(var(--fh, 56vw) * .034))/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #fff; letter-spacing: .05em;
    text-shadow: 0 0 2px #000, 0 0 3px #000, 1px 1px 2px #000; white-space: nowrap; }
.osd-name { text-transform: uppercase; }
/* The corner chosen in Texto (AppTextService): bottom right is the default above. */
.osd.at-TopLeft, .osd.at-TopRight { top: calc(var(--fh, 56vw) * .032); bottom: auto; }
.osd.at-TopLeft, .osd.at-BottomLeft { left: calc(var(--fw, 100vw) * .022); right: auto; align-items: flex-start; }
.osd-date { margin-right: .6em; }
.osd-time:empty::before { content: "\00a0"; }
/* Not in the grid: every camera shows the same time, and the tile's label already has its name (Bruno, 2026-11-15). */
.live-page:not(.focus) .osd { display: none; }
.cam-label { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 22px 12px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .68)); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.cam-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-motion { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--mud-palette-error); color: #fff;
    font-size: .68rem; letter-spacing: .04em; }
.cam-motion .mud-icon-root { width: 14px; height: 14px; }
@media (max-width: 599.98px) { .cam-label { padding: 16px 8px 6px; font-size: .68rem; } .cam-motion { padding: 1px 6px; } .cam-motion .mud-icon-root { display: none; } }
/* Motion right now: a red edge around the picture. */
.card.moving { border-color: var(--mud-palette-error) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--mud-palette-error) 55%, transparent) !important; }


/* Event pictures: a strip on a camera's page and in Gravações, a grid in Eventos. */
.event-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.event-strip.compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.event-thumb { position: relative; display: block; width: 100%; padding: 0; color: #fff; font: inherit; cursor: pointer; text-align: left; text-decoration: none !important; }
.event-thumb img, .event-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.event-thumb-time { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 4px; padding: 12px 8px 4px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72)); font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-thumb-time .mud-icon-root { width: 14px; height: 14px; }
@media (hover: hover) { .event-thumb:hover { border-color: var(--wp-gold) !important; } }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
@media (max-width: 599.98px) { .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .event-info .mud-icon-button { display: none; } }
.event-info { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }

/* Gravações and Eventos: the camera from a list on the title's line, then the day, all on one line even on a phone (the
   summary under the title shortens instead). */
.page-top.title-and-pick .page-header { flex-wrap: nowrap; }
.page-top.title-and-pick .page-header-text { flex: 1 1 0; min-width: 0; }
.page-top.title-and-pick .page-title { white-space: nowrap; }
.page-top.title-and-pick .page-header-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-top.title-and-pick .page-header-actions { flex: none; flex-wrap: nowrap; gap: 10px; }
.cam-select { width: 220px; margin: 0 !important; }
.cam-select .mud-input-control-input-container { margin: 0; }
.cam-select input { font-weight: 600; text-overflow: ellipsis; }
.day-field { display: inline-flex; }
.day-field-icon, .list-day-step { display: none !important; }
.rec-day { display: inline-flex; align-items: center; gap: 2px; }
.event-day-head { display: none; }
/* A narrower window: the title a little smaller, the list narrower. */
@media (max-width: 1099.98px) { .cam-select { width: 180px; } }
@media (min-width: 600px) and (max-width: 799.98px) { .page-top.title-and-pick .page-title { font-size: 1.5rem !important; } }
/* A phone: the calendar as a round button, the date picker over it (transparent, so a tap opens it); ‹ › by the list. */
@media (max-width: 599.98px) {
    .page-top.title-and-pick .page-header-actions { gap: 6px; }
    .cam-select { width: 150px; }
    .page-top.title-and-pick .day-step { display: none !important; }
    .page-top.title-and-pick .day-field { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none;
        border: 1px solid var(--mud-palette-lines-inputs, var(--mud-palette-lines-default)); border-radius: 50%; color: var(--mud-palette-text-primary); }
    html.wp-neon .page-top.title-and-pick .day-field { background: var(--nx-well); border-color: var(--nx-line-soft); }
    .page-top.title-and-pick .day-field .day-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
    .page-top.title-and-pick .day-field-icon { display: inline-flex !important; width: 22px; height: 22px; pointer-events: none; }
    .list-day-step { display: inline-flex !important; }
    .event-day-head { display: flex; align-items: center; margin: -2px 0 8px; }
    .event-day-head .section-label { margin: 0 2px; }
    .rec-list-head .rec-day .section-label { margin: 0 2px; }
}
@media (max-width: 374.98px) { .cam-select { width: 104px; } .page-top.title-and-pick .page-title { font-size: 1.3rem !important; } }

/* Gravações and Eventos: the cameras as buttons, and the day with its arrows. */
.rec-toolbar { justify-content: space-between; margin-bottom: 0; }
.cam-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cam-pick .mud-button-root { min-height: 36px; }
.day-nav { display: flex; align-items: center; gap: 6px; }
.day-input { height: 40px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--mud-palette-lines-inputs, var(--mud-palette-lines-default));
    border-radius: var(--wp-radius); background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); font: inherit; font-weight: 600; }
html.wp-neon .day-input { background: var(--nx-well); border-color: var(--nx-line-soft); }

/* Gravações: the page is exactly the window's height (less the bottom bar on a phone or tablet). The title, the player,
   the list's box and its heading (the day) stay put; only the recordings inside the box scroll, and never sideways.
   Under the player on a phone or tablet; on a wide screen, or a phone turned sideways, beside it, the recording's
   events under the player. The picture is never taller than leaves the list room: past that it gets black edges (the
   player's own full-screen button still shows it whole). */
.app-container:has(.rec-page) { padding-bottom: 16px; }
.rec-page { --rec-h: calc(100dvh - var(--wp-main-top) - 36px); display: flex; flex-direction: column; height: var(--rec-h); overflow-x: clip; }
@media (max-width: 959.98px) {
    .app-container:has(.rec-page) { padding-bottom: calc(var(--wp-bottom-nav) + var(--wp-nav-pad) + 12px); }
    .rec-page { --rec-h: calc(100dvh - var(--wp-main-top) - 32px - var(--wp-bottom-nav) - var(--wp-nav-pad)); }
}
.rec-page > .page-top { flex: none; }
.rec-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.rec-player { flex: none; }
.rec-video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: calc(var(--rec-h) * .46); background: #000; }
.rec-side { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rec-side > * { flex: none; }
.rec-side { position: relative; }
.rec-side > .rec-list { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
    scrollbar-width: none; }
.rec-side > .rec-list::-webkit-scrollbar { display: none; }
/* The list's scroll bar, drawn over its right edge (app.js cctv.scrollbar) so it takes no room from the rows. */
.overlay-scrollbar { position: absolute; right: 3px; z-index: 3; width: 6px; border-radius: 3px; cursor: grab; touch-action: none;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 32%, transparent); transition: width .15s ease, background .15s ease; }
.overlay-scrollbar:hover, .overlay-scrollbar.dragging { width: 9px; background: color-mix(in srgb, var(--mud-palette-text-primary) 55%, transparent); }
.overlay-scrollbar.dragging { cursor: grabbing; }
.overlay-scrollbar[hidden] { display: none; }
/* Nothing in the list gets its own layer: in Safari a blurred (glass) box drawn over the scroll bar hides it. */
html.wp-neon .rec-list .card { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* A live tile is all picture (opaque, edge to edge): the glass blur behind it never shows, but it was worked out again
   for every video frame of all six, about a quarter of the graphics work. Isolated, so a hovered tile's glow still
   draws over its neighbours as with the blur. */
html.wp-neon .cam-tile.card { -webkit-backdrop-filter: none; backdrop-filter: none; isolation: isolate; }
.rec-events { display: none; }
.rec-row-events { padding: 8px 0 4px; }
@media (min-width: 1200px), (orientation: landscape) and (max-height: 499.98px) {
    .rec-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(380px, 1fr); grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas: "player list" "events list"; gap: 16px; }
    .rec-player { grid-area: player; }
    .rec-video { max-height: calc(var(--rec-h) - 166px); }
    .rec-row-events { display: none; }
    .rec-events { display: block; grid-area: events; align-self: start; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
    .rec-side { grid-area: list; }
}
@media (orientation: landscape) and (max-height: 499.98px) {
    .rec-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .rec-video { max-height: calc(var(--rec-h) - 154px); }
}
.rec-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px 8px; }
/* The app's own controls for recordings: a bar across the player's foot, then the buttons and the time of day. */
.rec-video { cursor: pointer; }
.rec-seek-wrap { position: relative; margin: 8px 10px 0; }
.rec-seek { display: block; width: 100%; margin: 0; height: 18px; accent-color: var(--wp-gold); background: transparent; cursor: pointer; }
/* An event's mark: a small icon just above the track at its moment (the thumb is 16 px, hence the inset). */
.rec-marks { position: absolute; left: 8px; right: 8px; top: -9px; height: 13px; pointer-events: none; }
.rec-marks .rec-mark { position: absolute; left: calc(var(--at) * 100%); top: 0; display: grid; place-items: center; width: 14px; height: 13px; margin-left: -7px;
    padding: 0; border: 0; background: transparent; cursor: pointer; pointer-events: auto; line-height: 0; }
.rec-marks .rec-mark .mud-icon-root { width: 13px; height: 13px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .8)); }
@media (hover: hover) { .rec-mark:hover .mud-icon-root { transform: scale(1.35); } }
.rec-seek:disabled { opacity: .35; cursor: default; }
.rec-ctl { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent;
    color: inherit; cursor: pointer; }
.rec-ctl:disabled { opacity: .35; cursor: default; }
@media (hover: hover) { .rec-ctl:not(:disabled):hover { background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); } }
/* Play/pause (Bruno, 2026-11-09): green while stopped, red while playing, with room either side so the previous and
   next buttons are not tapped by mistake; the time sits at the right end of the bar. */
.rec-play { width: 44px; height: 44px; margin-inline: 14px; background: var(--mud-palette-success); color: #fff; }
.rec-player.playing .rec-play { background: var(--mud-palette-error); }
@media (hover: hover) { .rec-play:not(:disabled):hover { background: color-mix(in srgb, var(--mud-palette-success) 82%, #000); }
    .rec-player.playing .rec-play:not(:disabled):hover { background: color-mix(in srgb, var(--mud-palette-error) 82%, #000); } }
.rec-player .when-playing, .rec-player.playing .when-paused, .rec-player .when-sound, .rec-player.sound .when-muted { display: none; }
.rec-player.playing .when-playing, .rec-player.sound .when-sound { display: inline-block; }
/* Sound, full screen and download over the picture's top right corner, on a dark round each so they show on any picture. */
.rec-stage { position: relative; }
.rec-overlay { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 6px; }
.rec-overlay .rec-ctl { width: 34px; height: 34px; background: rgba(0, 0, 0, .5); color: #fff; text-decoration: none; }
.rec-overlay .rec-ctl .mud-icon-root { width: 20px; height: 20px; }
@media (hover: hover) { .rec-overlay .rec-ctl:not(:disabled):hover { background: rgba(0, 0, 0, .72); } }
.rec-overlay .rec-ctl:disabled { display: none; }
.rec-overlay .rec-delete { color: #ff8a80; }
/* While a recording loads or waits for more (a jump, a slow connection): the live view's gold spinner over the picture,
   so a wait never looks like a fault (Bruno, 2026-11-07). */
.rec-spinner { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .14); border-top-color: var(--wp-gold); animation: wp-spin .9s linear infinite;
    pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.rec-player.loading .rec-spinner { opacity: 1; }
/* Deleting: the password, then "really?", under the controls. */
.rec-delete-panel { padding: 4px 14px 12px; }
.rec-delete-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.rec-delete-input { flex: 1 1 160px; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--mud-palette-lines-inputs); border-radius: 8px;
    background: transparent; color: inherit; font: inherit; }
.rec-delete-actions { display: flex; gap: 8px; margin-left: auto; }
.rec-delete-error { flex-basis: 100%; color: var(--mud-palette-error); }
.rec-end { font-weight: 500; font-size: .85em; }
.rec-clock { white-space: nowrap; }
@media (max-width: 599.98px) {
    .rec-bar { gap: 0; padding-inline: 8px 2px; } /* left edge as far in as the bottom one (Bruno, 2026-11-09) */
    .rec-bar .mud-icon-button { padding: 7px; }
    .rec-ctl { width: 36px; height: 36px; }
    .rec-play { width: 40px; height: 40px; }
    .rec-play { margin-inline: 10px; }
    .rec-clock { min-width: 0; margin-left: auto; margin-right: 6px; font-size: .95rem; letter-spacing: 0; }
}
.rec-clock { min-width: 96px; margin-left: auto; text-align: right; font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
html.wp-neon .rec-clock { text-shadow: var(--nx-text-glow); }
.rec-now { min-width: 0; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 599.98px) { .rec-now { display: none; } }
.rec-message { padding: 0 14px 12px; }

.rec-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 6px; }
.rec-list-head .section-label { margin: 0; }
@media (max-width: 599.98px) { .rec-list-head { padding: 6px 12px 2px 8px; } }
.rec-empty { padding: 4px 16px 16px; }
.rec-list { padding: 0 8px 8px; }
.rec-hour + .rec-hour { border-top: 1px solid var(--mud-palette-lines-default); }
.rec-hour-head { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 48px; padding: 6px 8px; overflow: hidden; border: 0;
    border-radius: var(--wp-radius); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rec-hour-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-hour-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-chevron { flex: none; transform: rotate(-90deg); transition: transform .2s ease; color: var(--mud-palette-text-secondary); }
.rec-hour.open .rec-chevron { transform: none; }
@media (hover: hover) { .rec-hour-head:hover { background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent); } }
.rec-cut-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--mud-palette-warning); }
/* The list inside its panel, without boxes of its own (Bruno, 2026-11-06): a day's name as a band that stays at the
   top while its hours scroll under it; an hour as a line that opens and closes; its recordings as plain rows set in a
   little, a thin line between them, the one playing marked in gold at its left edge (the one still recording in red). */
.rec-list { position: relative; }
.rec-dayg + .rec-dayg { margin-top: 6px; }
/* Edge to edge of the panel (out over the list's side padding), so it reads as the list's own band. */
.rec-day-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; width: calc(100% + 16px); min-width: 0; min-height: 44px;
    margin-inline: -8px; padding: 6px 16px; overflow: hidden; border: 0; border-bottom: 1px solid var(--mud-palette-lines-default); background: var(--mud-palette-surface);
    color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rec-day-name { display: inline-block; font-weight: 700; white-space: nowrap; }
.rec-day-name::first-letter { text-transform: uppercase; }
.rec-dayg.open > .rec-day-head .rec-chevron { transform: none; }
html.wp-neon .rec-day-head { background: rgb(22, 38, 104); border-bottom-color: var(--nx-line-soft); }
.rec-list .rec-hour-head { min-height: 40px; }
.rec-list .rec-hour-time { font-weight: 600; }
.rec-list .rec-rows { gap: 0; margin: 0 0 6px; padding-left: 26px; }
.rec-list .rec-rows > li + li { border-top: 1px solid var(--mud-palette-lines-default); }
.rec-list .rec-row, html.wp-neon .rec-list .rec-row { border: 0; border-radius: 8px; background: transparent; box-shadow: none; padding: 7px 8px; }
.rec-list .rec-row.playing, html.wp-neon .rec-list .rec-row.playing { background: color-mix(in srgb, var(--wp-gold) 12%, transparent); box-shadow: inset 3px 0 0 var(--wp-gold); }
.rec-list .rec-row.live { box-shadow: inset 3px 0 0 #e53935; }
/* Every other recording on a soft tint so the list reads easily (Bruno, 2026-11-09). */
.rec-list .rec-rows > li:nth-child(even) > .rec-row:not(.playing):not(:hover) { background: color-mix(in srgb, var(--mud-palette-text-primary) 5%, transparent); }
@media (hover: hover) { .rec-list .rec-row:not(.playing):hover { background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent); } }
html.wp-neon .rec-list .rec-rows > li + li { border-top-color: var(--nx-line-soft); }
@media (max-width: 599.98px) { .rec-list .rec-rows { padding-left: 12px; } }

/* A recording: play icon, its times and date, how long, its events and its state. The one playing in gold. */
.rec-rows { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.rec-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default); border-radius: var(--wp-radius); background: transparent; color: inherit; font: inherit;
    text-align: left; text-decoration: none !important; cursor: pointer; transition: border-color .15s ease; }
.rec-row-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: color-mix(in srgb, var(--wp-gold) 16%, transparent); color: var(--wp-gold); }
.rec-row-icon .mud-icon-root { width: 20px; height: 20px; }
.rec-row-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-row-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-row-meta { font-size: .75rem; line-height: 1.3; }
.rec-row-side { flex: none; display: flex; align-items: center; gap: 8px; }
.rec-row.playing { border-color: var(--wp-gold); box-shadow: inset 0 0 0 1px var(--wp-gold); }
.rec-row.playing .rec-row-icon { background: var(--wp-gold); color: #fff; }
@media (hover: hover) { .rec-row:not(.playing):hover { border-color: var(--wp-gold); } }
.rec-row.live { border-color: color-mix(in srgb, #e53935 50%, transparent); }
.rec-row.live .rec-row-icon { background: color-mix(in srgb, #e53935 15%, transparent); color: #e53935; }
@media (hover: hover) { .rec-row.live:hover { border-color: #e53935; } }
@media (max-width: 419.98px) {
    .rec-row { gap: 8px; padding: 8px; }
    .rec-row-side { flex-direction: column; align-items: flex-end; gap: 4px; }
    .rec-row-icon { width: 28px; height: 28px; }
    .rec-row-time { font-size: .9rem; }
}
html.wp-neon .rec-row { background: var(--nx-well); border-color: var(--nx-line-soft); }
html.wp-neon .rec-row.playing { background: color-mix(in srgb, var(--mud-palette-primary) 18%, rgba(10, 20, 66, .6)); border-color: var(--mud-palette-primary);
    box-shadow: 0 0 12px color-mix(in srgb, var(--mud-palette-primary) 40%, transparent); }
html.wp-neon .rec-row.playing .rec-row-icon { background: var(--mud-palette-primary); }

/* Its state. REC: red, fading to a darker red and back, while the file is being written; a thin red bar along the
   bottom says how far it has got (set a few seconds ahead, it slides there meanwhile). Both move by opacity and
   transform only, which the graphics chip does alone: animating colours, shadows or a width redrew or laid out the
   page on every frame, and on an iPhone the bottom bar then slid along with the list while scrolling. */
.rec-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .66rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.rec-badge.done { background: color-mix(in srgb, var(--mud-palette-success) 15%, transparent); color: var(--mud-palette-success); }
.rec-badge.cut { background: color-mix(in srgb, var(--mud-palette-warning) 18%, transparent); color: color-mix(in srgb, var(--mud-palette-warning) 60%, #000); }
html:is(.wp-dark, .wp-neon) .rec-badge.cut { color: var(--mud-palette-warning); }
.rec-badge.live { position: relative; isolation: isolate; background: #8c1d1a; color: #fff; }
.rec-badge.live::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: #e53935;
    box-shadow: 0 0 8px rgba(229, 57, 53, .55); animation: rec-live 1.6s ease-in-out infinite; will-change: opacity; }
.rec-badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rec-badge.small-badge { height: 18px; padding: 0 7px; font-size: .6rem; }
.rec-badge.small-badge::before { width: 6px; height: 6px; }
@keyframes rec-live { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.rec-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, #e53935 18%, transparent); }
.rec-progress > span { display: block; height: 100%; background: #e53935; transform-origin: left center; transition: transform 5s linear;
    will-change: transform; }

/* A stretch's events: an icon and a number per kind. */
.ev-counts { display: inline-flex; align-items: center; gap: 6px; }
.ev-count { display: inline-flex; align-items: center; gap: 1px; font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--mud-palette-error); }
.ev-count .mud-icon-root { width: 15px; height: 15px; }
.ev-count.ev-person { color: var(--mud-palette-primary); }
.ev-count.ev-animal { color: var(--mud-palette-info); }
.ev-count.ev-foto { color: var(--mud-palette-text-secondary); }

/* Definições: each camera's name with its alerts switch, and a handle on the left to drag it to another place (app.js
   cctv.sortable): the row lifts while dragged, the others slide out of its way. */
.cam-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.cam-row .cam-row-name { flex: 1; min-width: 0; }
.cam-list.sorting { -webkit-user-select: none; user-select: none; }
.cam-list.sorting .cam-row:not(.dragging) { transition: transform .18s ease; }
.drag-handle { flex: none; display: grid; place-items: center; width: 32px; height: 44px; margin: 0 -6px 0 -8px; padding: 0; border: 0;
    border-radius: var(--wp-radius); background: transparent; color: var(--mud-palette-text-secondary); cursor: grab; touch-action: none; }
.drag-handle:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }
@media (hover: hover) { .drag-handle:hover { color: var(--wp-gold); background: color-mix(in srgb, var(--wp-gold) 10%, transparent); } }
.cam-row.dragging { position: relative; z-index: 2; border-radius: var(--wp-radius); background: var(--mud-palette-surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28), 0 0 0 1px var(--wp-gold); }
.cam-row.dragging .drag-handle { color: var(--wp-gold); cursor: grabbing; }
html.wp-neon .cam-row.dragging { background: #0d1a4a; box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 1px var(--mud-palette-primary), 0 0 16px rgba(70, 130, 255, .25); }
.inline-icon.mud-icon-root { width: 1.15em; height: 1.15em; vertical-align: -.25em; }
/* go2rtc not answering: no spinner, a note instead. */
.live-player[data-state=offline]::before { content: "Sem ligação ao vídeo"; width: auto; height: auto; margin: 0; border: 0; border-radius: 0; animation: none;
    left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: rgba(255, 255, 255, .55); font-size: .8rem; letter-spacing: .04em; }
/* Definições: the clean-up limits side by side on a computer, one per line on a phone. */
.retention-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 599.98px) { .retention-fields { grid-template-columns: minmax(0, 1fr); } }
.live-player[data-state=playing]::before { display: none; }

/* Ao vivo on a computer or tablet: the page is exactly the window's height and the grid fills what the title (and the
   install offer) leave. Three across when that space is wider than 16:9, two across (three rows) when narrower:
   whichever keeps the tiles closest to the cameras' shape. The rows share the height (implicit 1fr rows). Phones keep
   16:9 tiles, two across, and scroll. */
@media (min-width: 960px) {
    .app-container:has(.live-page) { padding-bottom: 16px; }
    .live-page { display: flex; flex-direction: column; height: calc(100dvh - var(--wp-main-top) - 36px); }
    .live-page > :not(.cam-area) { flex: none; }
    .cam-area { flex: 1 1 auto; min-height: 240px; container: cams / size; }
    .cam-area .cam-grid { height: 100%; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
    @container cams (max-aspect-ratio: 16 / 9) {
        .cam-area .cam-grid { grid-template-columns: repeat(var(--cols-narrow, 2), minmax(0, 1fr)); }
    }
    .cam-area .cam-tile { height: 100%; min-height: 0; }
    .cam-area .live-player { aspect-ratio: auto; height: 100%; }
}
/* How the picture fits its tile (Ajuste, kept on each device). */
.cam-area.fit-cover .live-player video { object-fit: cover; }
.cam-area.fit-fill .live-player video { object-fit: fill; }
.cam-area.fit-contain .live-player video { object-fit: contain; }
/* go2rtc's own "MSE"/"RTC" label over the picture: technical, not for the household. */
.live-player video-stream .info { display: none !important; }
.fit-item { align-items: flex-start; max-width: 320px; white-space: normal; line-height: 1.3; text-align: left; }
.fit-item .mud-icon-root { margin-top: 2px; flex: none; }

/* Hover glow: the tile under the mouse lights up in a neon glow of the accent (red while it shows motion), above its
   neighbours so the glow isn't hidden under them. */
@media (hover: hover) {
    .live-page:not(.focus) .cam-tile:hover { z-index: 1; }
    .live-page:not(.focus) .cam-tile:not(.moving):hover {
        border-color: var(--mud-palette-primary) !important;
        box-shadow: 0 0 0 1px var(--mud-palette-primary), 0 0 12px 2px color-mix(in srgb, var(--mud-palette-primary) 75%, transparent),
            0 0 34px 8px color-mix(in srgb, var(--mud-palette-primary) 35%, transparent) !important;
    }
    .live-page:not(.focus) .cam-tile.moving:hover {
        box-shadow: 0 0 0 2px var(--mud-palette-error), 0 0 14px 3px color-mix(in srgb, var(--mud-palette-error) 75%, transparent),
            0 0 34px 8px color-mix(in srgb, var(--mud-palette-error) 35%, transparent) !important;
    }
    .live-page:not(.focus) .cam-tile:hover .cam-name { text-shadow: 0 0 8px color-mix(in srgb, var(--mud-palette-primary) 90%, transparent); }
}

/* A camera on its own (Ao vivo with a camera open): the grid's tiles in a row, one across, so a swipe slides to the next
   camera, already playing. The row is moved by app.js (cctv.carousel), never by the browser: its overflow is hidden, and
   a finger moving up or down still scrolls the page. The tile in view gets the full-resolution player on top, faded in
   once it plays; until then its small stream shows. */
.cam-area { position: relative; }
.live-page.focus .cam-grid { display: flex; gap: 0; overflow: hidden; touch-action: pan-y; border-radius: var(--wp-radius);
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.live-page.focus .cam-tile { flex: 0 0 100%; min-width: 0; border-radius: 0; cursor: default; }
/* Of its label, a camera on its own keeps the motion badge (while there is motion) and the signal bars, larger, in the
   bottom right corner of its picture (so each tile's slide along with it); its name is the page's title. */
.live-page.focus .cam-label { left: auto; right: 12px; bottom: 10px; padding: 0; background: none; pointer-events: none; }
.live-page.focus .cam-label .cam-name { display: none; }
.live-page.focus .cam-label .signal { width: 24px; height: 20px; }
/* Zoom on a camera on its own (cctv.carousel): the picture takes the tile's transform, and dragging a
   zoomed picture is the app's (not the page's scroll). */
.live-page.focus .cam-tile { overflow: hidden; }
.live-page.focus .cam-tile .live-player { transform: var(--zoom, none); transform-origin: 0 0; }
.live-page.focus .cam-tile.zoom-animate .live-player { transition: transform .2s ease, opacity .35s ease; }
.live-page.focus .cam-grid.zoomed { touch-action: none; cursor: grab; }
.live-page.focus .cam-grid.zoomed.panning { cursor: grabbing; }
/* Its bar: with a mouse, − slider + and the level, under the middle of the picture; on a touch screen (pinch) only the
   level, while zoomed in, above the signal bars. */
.zoom-bar { display: none; }
.live-page.focus .zoom-bar { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex;
    align-items: center; gap: 4px; padding: 4px 6px; border-radius: 999px; color: #fff; background: rgba(0, 0, 0, .62);
    border: 1px solid rgba(255, 255, 255, .22); }
.zoom-bar button { display: grid; place-items: center; height: 32px; min-width: 32px; padding: 0 6px; border: 0; border-radius: 999px;
    background: transparent; color: inherit; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.zoom-bar button:hover { background: rgba(255, 255, 255, .14); }
.zoom-bar .mud-icon-root { width: 22px; height: 22px; }
.zoom-bar input[type=range] { width: 140px; margin: 0 4px; accent-color: var(--mud-palette-primary); cursor: pointer; }
.zoom-bar .zoom-level { min-width: 46px; }
.live-page.focus .zoom-bar:not(.is-zoomed) .zoom-level { opacity: .6; }
@media (hover: none), (pointer: coarse) {
    .live-page.focus .zoom-bar { display: none; left: auto; right: max(8px, env(safe-area-inset-right)); bottom: 40px; transform: none; padding: 2px; }
    .live-page.focus .zoom-bar.is-zoomed { display: flex; }
    .zoom-bar :is(.zoom-step, input) { display: none !important; }
}
/* Sound and full screen: one button each, showing the state; full screen only where the browser has it. */
html:not(.cctv-sound) .sound-on-btn, html.cctv-sound .sound-off-btn { display: none !important; }
/* Today's pictures of that camera, in one row under it. */
.focus-events { flex: none; margin-top: 12px; min-width: 0; }
.focus-events .event-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.focus-events .event-thumb { flex: 0 0 150px; }
@media (min-width: 960px) { .live-page.focus .focus-events .event-thumb { flex-basis: 170px; } }
.focus-events-empty { font-size: .875rem; }
/* On a computer the picture takes what the page leaves: the strip under it keeps one height, with pictures or without
   ("Sem eventos hoje."), so the picture keeps its size from one camera to the next (it changed as an arrow was
   clicked, before the slide). Room for a row of pictures and, where scrollbars take room, the strip's own. */
@media (min-width: 960px) {
    .live-page.focus .focus-events .event-strip, .live-page.focus .focus-events-empty { height: 114px; box-sizing: border-box; }
    .live-page.focus .focus-events .event-strip { overflow-y: hidden; }
}

/* Round arrows on each side of the picture to the previous / next camera (gold on hover). */
.cam-area .cam-nav.mud-icon-button { position: absolute; top: 50%; z-index: 3; width: 52px !important; height: 52px !important; margin-top: -26px;
    background-color: rgba(0, 0, 0, .45) !important; color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cam-area .cam-nav .mud-icon-root { width: 32px; height: 32px; font-size: 32px; }
.cam-area .cam-nav-prev { left: 12px; }
.cam-area .cam-nav-next { right: 12px; }
@media (max-width: 599.98px) {
    .cam-area .cam-nav.mud-icon-button { width: 40px !important; height: 40px !important; margin-top: -20px; }
    .cam-area .cam-nav .mud-icon-root { width: 26px; height: 26px; font-size: 26px; }
    .cam-area .cam-nav-prev { left: 6px; }
    .cam-area .cam-nav-next { right: 6px; }
}

/* Phone on its side, a camera open: only the picture, edge to edge, still swipeable. The app's bars go; the title and
   buttons float over the top of the picture while .chrome is on (a tap, or a change; Live hides them again after a few
   seconds), and so do the arrows. */
@media (orientation: landscape) and (max-height: 500px) {
    html:has(.live-page.focus) :is(.app-bar, .bottom-nav) { display: none !important; }
    html:has(.live-page.focus), html:has(.live-page.focus) body { overflow: hidden; }
    .live-page.focus .cam-area { position: fixed; inset: 0; z-index: 1300; background: #000; }
    .live-page.focus .cam-grid { height: 100%; border-radius: 0; }
    .live-page.focus .cam-tile { height: 100%; border: 0 !important; box-shadow: none !important; }
    .live-page.focus .cam-tile .live-player { height: 100%; aspect-ratio: auto; }
    .live-page.focus .focus-events { display: none; }
    .live-page.focus .page-top { position: fixed; top: 0; left: 0; right: 0; z-index: 1301; margin: 0;
        padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
        background: linear-gradient(rgba(0, 0, 0, .78), rgba(0, 0, 0, 0)) !important; border: 0 !important; box-shadow: none !important;
        -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
        opacity: 0; pointer-events: none; transition: opacity .25s ease; }
    .live-page.focus .page-top .page-title { font-size: 1.15rem !important; color: #fff; }
    .live-page.focus .page-top .muted { color: rgba(255, 255, 255, .75) !important; }
    .live-page.focus .page-header { flex-wrap: nowrap; justify-content: flex-end; }
    /* The camera's name (and the way back) at the bottom left, over a shade of its own: the cameras print the date and
       time at the top left. The buttons stay at the top right. */
    .live-page.focus .page-header-text { position: fixed; z-index: 1; left: max(16px, env(safe-area-inset-left));
        bottom: max(10px, env(safe-area-inset-bottom)); max-width: 60vw; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
    .live-page.focus .page-top::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 96px; pointer-events: none;
        background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .7)); }
    /* The way back, round and dark like the arrows to the other cameras (with a light edge), so it shows over any picture.
       No blur behind it: it fades in with the title, and Safari blurs what is behind only once a fade has ended, a visible
       jump; a little more dark does the job instead. */
    .live-page.focus .page-header-text .mud-icon-button { width: 44px; height: 44px; margin-right: 10px !important; color: #fff;
        background-color: rgba(0, 0, 0, .62) !important; border: 1px solid rgba(255, 255, 255, .3); }
    .live-page.focus .page-header-text .mud-icon-button .mud-icon-root { width: 26px; height: 26px; font-size: 26px; }
    .live-page.focus .cam-nav { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
    .live-page.focus.chrome .page-top, .live-page.focus.chrome .cam-nav { opacity: 1; pointer-events: auto; }
    .live-page.focus .cam-area .cam-nav-prev { left: max(12px, env(safe-area-inset-left)); }
    .live-page.focus .cam-area .cam-nav-next { right: max(12px, env(safe-area-inset-right)); }
    .live-page.focus .cam-label { right: max(12px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
    .live-page.focus .zoom-bar.is-zoomed { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 30px); }
}


/* Eventos: the kind of event from a list (with how many of each this day), and the kind's colour on each card. The list
   sits on the title's line when the page is wide enough for camera, kind and day; otherwise above the pictures. */
.events-page { container: events / inline-size; }
/* Eventos is exactly the window's height, as Gravações: the title, the day and the kind stay put, and only the pictures
   scroll, up and down only. */
.app-container:has(.events-page) { padding-bottom: 16px; }
.events-page { display: flex; flex-direction: column; height: calc(100dvh - var(--wp-main-top) - 36px); overflow: clip; }
@media (max-width: 959.98px) {
    .app-container:has(.events-page) { padding-bottom: calc(var(--wp-bottom-nav) + var(--wp-nav-pad) + 12px); }
    .events-page { height: calc(100dvh - var(--wp-main-top) - 32px - var(--wp-bottom-nav) - var(--wp-nav-pad)); }
}
.events-page > :not(.events-scroll) { flex: none; }
.events-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
    scrollbar-width: thin; padding-bottom: 4px; }
.kind-select { width: 190px; margin: 0 !important; }
.kind-select .mud-input-control-input-container { margin: 0; }
.kind-select input { font-weight: 600; text-overflow: ellipsis; }
.kind-select.in-list { display: none !important; }
@container events (max-width: 839.98px) {
    .kind-select.in-title { display: none !important; }
    .kind-select.in-list { display: flex !important; flex: none; margin-left: auto !important; }
    .event-day-head { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px; }
    .event-day-head .rec-day { min-width: 0; }
    .event-day-head .section-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 599.98px) { .kind-select.in-list { width: 150px; } }
@media (max-width: 374.98px) { .kind-select.in-list { width: 132px; } .event-day-head { gap: 4px !important; } .event-day-head .list-day-step { width: 32px !important; min-width: 32px !important; height: 32px !important; } }
.kind-item { display: flex; align-items: center; gap: 10px; width: 100%; }
.kind-item .kind-name { flex: 1; }
.kind-icon { color: var(--mud-palette-text-secondary); }
.kind-icon.kind-person { color: var(--mud-palette-primary); }
.kind-icon.kind-animal { color: var(--mud-palette-info); }
.kind-icon.kind-motion { color: var(--mud-palette-warning); }
.kind-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .72rem;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent); }
.event-card .event-kind-icon { color: var(--mud-palette-text-secondary); }
.event-card.kind-person .event-kind-icon { color: var(--mud-palette-primary); }
.event-card.kind-animal .event-kind-icon { color: var(--mud-palette-info); }
.event-card.kind-motion .event-kind-icon { color: var(--mud-palette-warning); }
.event-card.kind-person { border-color: color-mix(in srgb, var(--mud-palette-primary) 60%, transparent) !important; }

/* Definições → Deteção e alertas: the three kinds, one per line, and the sensitivity as three choices. */
.detect-options { display: flex; flex-direction: column; gap: 2px; }
.sensitivity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sensitivity-grid .theme-option { gap: 2px; padding: 10px 8px; text-align: center; }
@media (max-width: 599.98px) { .sensitivity-grid { grid-template-columns: minmax(0, 1fr); } }

/* Ecrã inteiro: only the pictures, edge to edge in thin white boxes (the browser's full screen of the whole page, so its
   messages still show, or html.cctv-wall on an iPhone). As many across as in the grid on any computer screen, one fewer
   on one taller than 3:2, one above the other on a phone held upright; a camera opened from there fills it alone. A round
   button in the corner leaves (on a mouse it shows while hovering). */
:is(html:fullscreen, html.cctv-wall) .cam-area { position: fixed; inset: 0; z-index: 1400; background: #000; container: cams / size; }
html:is(:fullscreen, .cctv-wall), html:is(:fullscreen, .cctv-wall) body { overflow: hidden; }
/* A thin white line between the pictures and around them all, a box per camera: the grid's own colour showing through
   a 1px gap and a 1px edge, so each camera's space reads even with black bars (Original). */
:is(html:fullscreen, html.cctv-wall) .cam-area .cam-grid { box-sizing: border-box; height: 100%; gap: 1px; padding: 1px; border-radius: 0;
    background: rgba(255, 255, 255, .78);
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
:is(html:fullscreen, html.cctv-wall) .cam-area .cam-tile { background: #000; }
@container cams (max-aspect-ratio: 3 / 2) {
    :is(html:fullscreen, html.cctv-wall) .cam-area .cam-grid { grid-template-columns: repeat(var(--cols-narrow, 2), minmax(0, 1fr)); }
}
@container cams (max-aspect-ratio: 593 / 1000) {
    :is(html:fullscreen, html.cctv-wall) .cam-area .cam-grid { grid-template-columns: minmax(0, 1fr); }
}
:is(html:fullscreen, html.cctv-wall) .cam-area .cam-tile { height: 100%; min-height: 0; border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important; }
:is(html:fullscreen, html.cctv-wall) .cam-area .live-player { height: 100%; aspect-ratio: auto; }
:is(html:fullscreen, html.cctv-wall) .cam-area .cam-tile:hover { box-shadow: inset 0 0 0 2px var(--mud-palette-primary) !important; }
/* A camera opened from there fills it alone, without the lines: each tile is exactly the screen's width, so a swipe
   comes to rest exactly on the next. */
:is(html:fullscreen, html.cctv-wall) .live-page.focus .cam-area .cam-grid { gap: 0; padding: 0; background: #000; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .cam-area .cam-tile:hover { box-shadow: none !important; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .cam-area .cam-label { right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom)); }
.wall-exit { display: none; }
:is(html:fullscreen, html.cctv-wall) .cam-area .wall-exit { display: grid; place-items: center; position: absolute; z-index: 5;
    top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .25s ease; }
:is(html:fullscreen, html.cctv-wall) .cam-area:hover .wall-exit, html.is-handheld:is(:fullscreen, .cctv-wall) .cam-area .wall-exit { opacity: .85; }
.wall-exit:hover { background: var(--mud-palette-primary); opacity: 1 !important; }
/* A camera on its own in full screen, on a computer as on a phone: only the picture, and a click or a tap brings, for a
   few seconds, its name and the way back (bottom left: the cameras print the time at the top left), the buttons (top
   right, the one for full screen now leaving it, in place of the round one in the corner), the arrows and, with a mouse,
   the zoom bar (which stays while zoomed in). As on a phone on its side. */
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-top { position: fixed; top: 0; left: 0; right: 0; z-index: 1401; margin: 0;
    padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
    background: linear-gradient(rgba(0, 0, 0, .78), rgba(0, 0, 0, 0)) !important; border: 0 !important; box-shadow: none !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    opacity: 0; pointer-events: none; transition: opacity .25s ease; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-top .page-title { font-size: 1.15rem !important; color: #fff; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-header { flex-wrap: nowrap; justify-content: flex-end; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-header-text { position: fixed; z-index: 1; left: max(16px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom)); max-width: 70vw; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
/* With a mouse the zoom bar is in the middle at the bottom: the name stays left of it. Moving the mouse brings them all
   (app.js), and the pointer goes with them when it stops, as in a video player. */
@media (hover: hover) and (pointer: fine) {
    :is(html:fullscreen, html.cctv-wall) .live-page.focus .page-header-text { max-width: max(calc(50vw - 160px), 220px); }
    :is(html:fullscreen, html.cctv-wall) .live-page.focus:not(.chrome) .cam-area,
    :is(html:fullscreen, html.cctv-wall) .live-page.focus:not(.chrome) .cam-area * { cursor: none !important; }
}
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-top::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 96px;
    pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .7)); }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-header-text .mud-icon-button { width: 44px; height: 44px; margin-right: 10px !important;
    color: #fff; background-color: rgba(0, 0, 0, .62) !important; border: 1px solid rgba(255, 255, 255, .3); }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .page-header-text .mud-icon-button .mud-icon-root { width: 26px; height: 26px; font-size: 26px; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus :is(.cam-nav, .zoom-bar) { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus.chrome :is(.page-top, .cam-nav, .zoom-bar),
:is(html:fullscreen, html.cctv-wall) .live-page.focus .zoom-bar.is-zoomed { opacity: 1; pointer-events: auto; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .wall-exit, .fullscreen-exit-btn { display: none !important; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .fullscreen-btn { display: none !important; }
:is(html:fullscreen, html.cctv-wall) .live-page.focus .fullscreen-exit-btn { display: inline-flex !important; }
/* How well each camera is reached (SignalBars): lit bars green when good, amber when weak, red when bad; unlit ones faint.
   On the tile they sit at the right of its label; in Definições → Estado after the figures. */
.signal { display: inline-flex; flex: none; width: 17px; height: 14px; vertical-align: -2px; }
.signal svg { width: 100%; height: 100%; overflow: visible; }
.signal rect { fill: rgba(255, 255, 255, .28); }
.signal-4 rect.on, .signal-3 rect.on { fill: #4ade80; }
.signal-2 rect.on { fill: #fbbf24; }
.signal-1 rect.on { fill: #f87171; }
.signal-0 rect { fill: rgba(248, 113, 113, .45); }
/* Not measured yet: grey bars lighting up in turn, like a phone looking for its network. */
.signal-measuring rect { animation: signal-measure 1.6s ease-in-out infinite; }
.signal-measuring rect:nth-child(2) { animation-delay: .2s; }
.signal-measuring rect:nth-child(3) { animation-delay: .4s; }
.signal-measuring rect:nth-child(4) { animation-delay: .6s; }
@keyframes signal-measure { 0%, 60%, 100% { fill: rgba(255, 255, 255, .22); } 30% { fill: rgba(255, 255, 255, .75); } }
@keyframes signal-measure-light { 0%, 60%, 100% { fill: rgba(0, 0, 0, .14); } 30% { fill: rgba(0, 0, 0, .5); } }
html:not(.wp-dark) .link-status .signal-measuring rect { animation-name: signal-measure-light; }
@media (prefers-reduced-motion: reduce) { .signal-measuring rect { animation: none; } }
.signal-novideo { align-items: center; justify-content: center; color: #f87171; }
.signal-novideo .mud-icon-root { width: 100%; height: 100%; font-size: inherit; }
.cam-label .signal { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
html:not(.wp-dark) .link-status .signal rect:not(.on) { fill: rgba(0, 0, 0, .18); }
.link-status .signal { margin-left: 4px; }
/* What the detector found, on the tile: a person in the accent, an animal in blue. */
.cam-motion.find-person { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.cam-motion.find-animal { background: var(--mud-palette-info); }

/* Definições → Câmaras: adding (what was found, or an address) and the remove confirmation in a camera's row. */
.found-list { display: flex; flex-direction: column; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--wp-radius); }
.found-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.found-row:last-child { border-bottom: 0; }
.add-form { display: flex; flex-direction: column; gap: 4px; padding: 12px; max-width: 460px; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--wp-radius); }
html.wp-neon :is(.found-list, .add-form) { background: var(--nx-well); border-color: var(--nx-line-soft); }
.cam-row.remove-confirm { padding: 8px 10px; border-radius: var(--wp-radius); background: color-mix(in srgb, var(--mud-palette-error) 10%, transparent); }
.cam-row.remove-confirm > span { flex: 1; }

/* The user menu's rows (Definições, Sair): the icon in a circle of its own colour. */
.menu-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 16px; cursor: pointer;
    font-size: .9rem; font-weight: 600; color: var(--mud-palette-text-primary); }
.menu-row:hover { background: var(--mud-palette-action-default-hover); text-decoration: none; }
.menu-row:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }
.menu-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.menu-icon .mud-icon-root { width: 18px; height: 18px; }
.menu-icon.gold { background: color-mix(in srgb, var(--mud-palette-primary) 18%, transparent); color: var(--mud-palette-primary); }
.menu-icon.red { background: color-mix(in srgb, var(--mud-palette-error) 16%, transparent); color: var(--mud-palette-error); }
html.wp-neon .menu-icon { box-shadow: 0 0 10px color-mix(in srgb, currentColor 30%, transparent); }
.logout-form { margin: 0 0 4px; }
/* The narrowest phones: the end time gives way (the bar shows how far in). */
@media (max-width: 379.98px) { .rec-end { display: none; } .rec-bar .mud-icon-button { padding: 4px; } .rec-ctl { width: 32px; } .rec-play { width: 36px; height: 36px; } }

/* An alert arriving while the app is on screen (app.js showAlert): a card at the top with "Ver", which opens its
   recording; it goes by itself after 20 s. */
.app-alert { position: fixed; z-index: 2000; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%);
    width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px;
    border-radius: 14px; border: 1px solid var(--mud-palette-lines-default); background: var(--mud-palette-surface); color: var(--mud-palette-text-primary);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35); animation: wp-reconnect-in .25s ease-out; }
html.wp-neon .app-alert { background: rgb(22, 38, 104); border-color: var(--nx-line); }
.app-alert-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.app-alert-text span { color: var(--mud-palette-text-secondary); font-size: .8rem; }
.app-alert-go { flex: none; height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: var(--wp-gold); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.app-alert-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }

/* Definições → a câmara (CameraSettings.razor) */
.slider-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px; align-items: center; gap: 10px; min-height: 40px; }
.slider-row .slider-label { color: var(--mud-palette-text-secondary); font-size: .9rem; }
.slider-row .slider-value { text-align: right; font-size: .9rem; font-variant-numeric: tabular-nums; }
.cfg-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-grid.cfg-choice-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.theme-grid.cfg-choice-3 .theme-option { text-align: center; }
.cfg-save-row { display: flex; justify-content: flex-end; }
/* The picture as big as the room left on screen under the settings: its width is set by app.js (img[data-fit-screen]). */
.cfg-preview { display: block; width: 100%; max-width: 100%; height: auto; margin-inline: auto; border-radius: var(--wp-radius); background: #000; }
.zone-editor { display: grid; aspect-ratio: 16 / 9; width: min(100%, max(320px, calc((100dvh - var(--wp-main-top, 64px) - 300px) * 16 / 9))); margin-inline: auto; border-radius: var(--wp-radius); overflow: hidden; background: #111 center / 100% 100% no-repeat;
    user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; }
.zone-cell { border-right: 1px solid rgba(255, 255, 255, .16); border-bottom: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .35); }
.zone-cell.on { background: color-mix(in srgb, var(--wp-gold) 35%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp-gold-light) 70%, transparent); }
@media (hover: hover) { .zone-cell:hover { outline: 2px solid var(--wp-gold-light); outline-offset: -2px; } }
@media (max-width: 599.98px) {
    .page-header:has(.cfg-cam-pick) { flex-wrap: wrap; }
    .page-header .cfg-cam-pick { width: 100%; }
    .page-header-actions:has(.cfg-cam-pick) { flex: 1 1 100%; }
    .cfg-fields { grid-template-columns: minmax(0, 1fr); }
    .slider-row { grid-template-columns: 92px minmax(0, 1fr) 56px; gap: 6px; }
    .theme-grid.cfg-choice-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Definições: one panel at a time, in tabs (Settings.razor). */
/* The tab bar as a framed strip: a rounded border, the tabs sharing its width, a line between each. */
.settings-tabs .mud-tabs-tabbar { background: var(--mud-palette-surface) !important; border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--wp-radius); overflow: hidden; }
.settings-tabs .mud-tabs-tabbar-wrapper { width: 100%; }
.settings-tabs .mud-tabs-tabbar-wrapper > .mud-tooltip-root { flex: 1 1 0; min-width: 0; }
.settings-tabs .mud-tabs-tabbar-wrapper > .mud-tooltip-root + .mud-tooltip-root { border-left: 1px solid var(--mud-palette-lines-default); }
.settings-tabs .mud-tab { width: 100%; min-width: 0; padding: 12px 10px; justify-content: center; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; font-size: .8rem;
    color: var(--mud-palette-text-secondary); opacity: 1; }
.settings-tabs .mud-tab .mud-icon-root { margin-right: 6px; font-size: 1.15rem; }
.settings-tabs .mud-tab.mud-tab-active { color: var(--wp-gold); background: color-mix(in srgb, var(--wp-gold) 10%, transparent); }
.settings-tabs .mud-tab-slider { background: var(--wp-gold) !important; height: 2px; }
.settings-panel { padding-top: 16px; }
.settings-app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-app-grid > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 899.98px) { .settings-app-grid { grid-template-columns: minmax(0, 1fr); } }
/* Narrower windows (a tablet, the side menu open): tighter, so the longest name (NOTIFICAÇÕES) still fits. */
@media (min-width: 600px) and (max-width: 1099.98px) {
    .settings-tabs .mud-tab { padding: 12px 4px; letter-spacing: .02em; font-size: .74rem; }
    .settings-tabs .mud-tab .mud-icon-root { margin-right: 4px; font-size: 1.05rem; }
}
/* On a phone the six only fit as icons (each card's title says which it is); the name is still read out (aria). */
@media (max-width: 599.98px) {
    .settings-tabs .mud-tab { padding: 10px 0; font-size: 0; }
    .settings-tabs .mud-tab .mud-icon-root { margin: 0; font-size: 1.5rem; }
}
/* Definições → a câmara: Imagem and Texto with the camera's picture under the settings, as wide as the panel. */
.cfg-with-preview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cfg-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; }
@media (min-width: 1100px) { .cfg-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
    .cfg-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cfg-columns > div > .field-label:first-child { margin-top: 0 !important; }
}
/* Definições → a câmara: in Imagem, Movimento, Vídeo and Texto the settings are on the left and the camera's picture (in
   Movimento, the zone grid over it) on the right, in the same card; on narrower screens the picture goes under them. The
   picture stays in view while the settings scroll (sticky, under the page's header). */
.cfg-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 28px; }
/* Texto's preview: the picture with the app's text over it (the same .osd as Ao vivo), sized to the picture. */
.cfg-preview-wrap { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; }
.cfg-preview-wrap .osd-box { border-radius: var(--wp-radius); overflow: hidden; }
.cfg-preview-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cfg-preview-head .field-label { margin: 0; }
.cfg-preview-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; }
.cfg-split-side .zone-editor { width: 100%; }
@media (min-width: 1000px) {
    .cfg-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
    .card:has(.cfg-split) { overflow: clip; }
    .cfg-split-side { position: sticky; top: calc(var(--cfg-sticky-top, 150px)); }
    .cfg-split-main .cfg-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Definições → a câmara: the camera's name as the title is also the menu of the other cameras. */
.cfg-cam-title { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 6px 2px 0; border: 0; border-radius: var(--wp-radius);
    background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cfg-cam-title:hover .cfg-cam-caret, .cfg-cam-title:focus-visible .cfg-cam-caret { color: var(--wp-gold); }
.cfg-cam-title:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.cfg-cam-title .page-title { min-width: 0; }
.cfg-cam-caret { flex: none; font-size: 2rem !important; color: var(--mud-palette-text-secondary); }

/* An alert tapped (Alert.razor): its short clip, as large as fits, and under it the way to the whole recording. */
.alert-page { display: flex; flex-direction: column; gap: 12px; }
.alert-clip { padding: 0; overflow: hidden; }
.alert-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; max-height: calc(100dvh - 220px); }
.alert-video, .alert-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.alert-wait { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 10px 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: .9rem; }
.alert-spinner { width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2);
    border-top-color: var(--wp-gold); animation: wp-spin .9s linear infinite; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.alert-player { position: absolute; inset: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
/* Play/pause at the picture's bottom right, just above the gold line (Bruno, 2026-11-20 19:14): ❚❚ while it plays, ▶
   while paused; a tap anywhere on the picture does the same (app.js), so the button itself lets taps through. */
.alert-play { position: absolute; right: 10px; bottom: 28px; z-index: 4; width: 44px; height: 44px; border-radius: 50%;
    background: rgba(0, 0, 0, .55); pointer-events: none; }
.alert-play::before, .alert-play::after { content: ""; position: absolute; top: 14px; width: 5px; height: 16px; border-radius: 1px; background: #fff; }
.alert-play::before { left: 15px; }
.alert-play::after { left: 24px; }
.alert-player.paused .alert-play::before { left: 17px; top: 12px; width: 0; height: 0; border-radius: 0; background: none;
    border-style: solid; border-width: 10px 0 10px 15px; border-color: transparent transparent transparent #fff; }
.alert-player.paused .alert-play::after { display: none; }
/* Playback, not live (Bruno, 2026-11-20 19:14): a thin red edge with a soft red glow round an alert's clip or a
   recording while it shows, drawn over the picture; never on Ao vivo's tiles. */
.alert-player:not(.waiting)::after, .rec-stage.is-playback::after, .rec-early::after { content: ""; position: absolute; inset: 0; z-index: 3;
    pointer-events: none; border-radius: var(--wp-radius); box-shadow: inset 0 0 0 2px #e53935, inset 0 0 16px rgba(229, 57, 53, .40);
    animation: playback-breathe 2.6s ease-in-out infinite; }
/* The glow breathes, slowly (Bruno, 2026-11-20); the line itself stays. The frame's corners follow the card's. */
@keyframes playback-breathe {
    0%, 100% { box-shadow: inset 0 0 0 2px #e53935, inset 0 0 12px rgba(229, 57, 53, .28); }
    50% { box-shadow: inset 0 0 0 2px #e53935, inset 0 0 26px rgba(229, 57, 53, .62); }
}
@media (prefers-reduced-motion: reduce) { .alert-player:not(.waiting)::after, .rec-stage.is-playback::after, .rec-early::after { animation: none; } }
.rec-stage { border-top-left-radius: var(--wp-radius); border-top-right-radius: var(--wp-radius); }
/* Gravações' own play/pause, on the picture's bottom right (its colours as they were). */
.rec-stage .rec-play { position: absolute; right: 10px; bottom: 10px; z-index: 4; margin: 0; }
.rec-stage .rec-play:disabled { display: none; }
/* The early player of a notification's recording (app.js), over the picture's place until the page's own one plays;
   under the buttons over the picture, which taps reach through it. */
.rec-early { position: absolute; z-index: 1; background: #000; pointer-events: none; border-radius: var(--wp-radius); overflow: hidden; }
.rec-early video { display: block; width: 100%; height: 100%; object-fit: contain; }
.alert-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; cursor: pointer; touch-action: none; }
.alert-progress::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); }
.alert-progress-fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--wp-gold); }
/* Waiting for the clip (app.js): the camera live (small stream) over the alert's picture, with a label; the clip hidden
   until its first picture is there. After 90 s without it: the picture and a line under it. */
.alert-player .alert-live { position: absolute; inset: 0; width: auto; aspect-ratio: auto; background: transparent; }
.alert-player:not(.waiting) .alert-live { display: none; }
.alert-player.waiting .alert-video, .alert-player.missing .alert-video { visibility: hidden; }
.alert-player.waiting .alert-play, .alert-player.waiting .alert-progress,
.alert-player.missing .alert-play, .alert-player.missing .alert-progress { display: none; }
.alert-player.waiting, .alert-player.missing { cursor: default; }
.alert-live-label { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 4px 8px; border-radius: 6px; pointer-events: none;
    background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; }
.alert-player:not(.waiting) .alert-live-label { display: none; }
.alert-missing { display: none; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 10px 12px; text-align: center;
    color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: .9rem; }
.alert-player.missing .alert-missing { display: block; }
/* The chip on a camera opened from an alert (app.js): at the bottom, never over the picture's middle. */
.alert-chip { position: fixed; z-index: 1500; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); transform: translateX(-50%);
    max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 999px;
    background: rgba(0, 0, 0, .72); color: #fff; font-size: .85rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .35); -webkit-tap-highlight-color: transparent; }
.alert-chip-spin { flex: none; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: var(--wp-gold); animation: wp-spin .9s linear infinite; }
.alert-chip:not(.waiting) .alert-chip-spin { display: none; }
.alert-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; color: inherit;
    font: inherit; padding: 6px 2px; cursor: pointer; }
.alert-chip.waiting .alert-chip-text { cursor: default; }
.alert-chip.ready .alert-chip-text { color: var(--wp-gold); font-weight: 600; }
.alert-chip-close { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
    font-size: 1.1rem; line-height: 1; cursor: pointer; }
