/* TheDnsSite panel — wwwroot/app.css.
   Styles the markup the Razor components already render. The few hooks it
   adds (.shell, .backdrop, .brand-mark, .crumbs, .type, .live, table classes,
   data-label) are listed in MARKUP.md.
   CSP: no inline styles, no script, fonts from 'self'. */

@font-face {
    font-family: "Inter";
    src: url("fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- tokens ---------- */
:root {
    color-scheme: dark;
    --bg: #050814;
    --surface: rgba(17, 24, 39, 0.58);
    --surface-solid: #0d1322;
    --surface-hover: rgba(30, 41, 59, 0.55);
    --field: rgba(5, 8, 20, 0.6);
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);
    --text: #f3f4f6;
    --text-2: #b8bfcc;
    --muted: #7c8598;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --cyan: #06b6d4;
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #fb7185;
    --brand: linear-gradient(110deg, #3b82f6, #8b5cf6 55%, #06b6d4);
    --glow: 0 10px 30px -12px rgba(99, 102, 241, 0.9);
    --ring: 0 0 0 3px rgba(59, 130, 246, 0.28);
    --radius-s: 8px;
    --radius: 12px;
    --radius-l: 16px;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
    --sidebar: 240px;
    --rail: rgba(9, 13, 28, 0.86);
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f4f6fb;
        --surface: rgba(255, 255, 255, 0.82);
        --surface-solid: #ffffff;
        --surface-hover: rgba(236, 241, 250, 0.95);
        --field: #ffffff;
        --line: rgba(15, 23, 42, 0.08);
        --line-strong: rgba(15, 23, 42, 0.15);
        --text: #0f172a;
        --text-2: #334155;
        --muted: #64748b;
        --ok: #059669;
        --warn: #b45309;
        --danger: #e11d48;
        --glow: 0 10px 24px -14px rgba(79, 70, 229, 0.7);
        --rail: rgba(255, 255, 255, 0.88);
    }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 400 14px/1.5 var(--sans);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

h1 { margin: 0 0 20px; font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
main h2 { margin-top: 28px; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono, textarea.mono, td.data { font-family: var(--mono); font-size: 13px; }
td.data { overflow-wrap: anywhere; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* The background is the landing page's: the moving network drawn by
   js/backdrop.js on #network, over two slow glows. Both sit outside the
   Blazor root, in index.html, so a re-render never touches them. */
#network {
    position: fixed; inset: 0; z-index: -1;
    width: 100%; height: 100%; opacity: 0.6; pointer-events: none;
}
.backdrop { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.backdrop::before, .backdrop::after {
    content: ""; position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%;
    filter: blur(120px); opacity: 0.16; animation: drift 28s ease-in-out infinite alternate;
}
.backdrop::before { background: var(--blue); top: -22vmax; left: -10vmax; }
.backdrop::after { background: var(--purple); bottom: -24vmax; right: -12vmax; animation-delay: -14s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }
@media (prefers-color-scheme: light) {
    #network { opacity: 0.45; }
    .backdrop::before, .backdrop::after { opacity: 0.08; }
}

/* ---------- shell: sidebar on a desk, top bar and tab bar on a phone ---------- */
.shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.topbar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 4px;
    padding: 20px 14px 16px;
    background: var(--rail);
    border-right: 1px solid var(--line-strong);
    box-shadow: 16px 0 48px -28px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
}

.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 2px 8px 22px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
}
.brand-mark {
    display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px;
    background: var(--brand); color: #fff; box-shadow: var(--glow);
}
.brand-mark svg { width: 18px; height: 18px; }

.topbar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.topbar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-s);
    color: var(--text-2); font-weight: 500; text-decoration: none;
}
.topbar nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.topbar nav a:hover { background: var(--surface-hover); color: var(--text); }
.topbar nav a.active { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.topbar nav a.active svg { color: var(--blue); }

.topbar .who {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 14px 10px 4px; border-top: 1px solid var(--line);
    font-weight: 600; overflow-wrap: anywhere;
}
.role {
    flex: none; padding: 1px 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; color: var(--text-2);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}
.topbar > button.link { align-self: flex-start; margin: 4px 10px 0; color: var(--muted); font-weight: 500; }
.topbar > button.link:hover { color: var(--text); }

/* One centred column of at most 1120 px. The side padding does the
   centring, so every child, inline ones like .tabs included, starts at the
   same left edge. */
main.content { min-width: 0; padding: 32px max(40px, calc((100% - 1120px) / 2)) 72px; }
.content.narrow { display: grid; align-content: center; min-height: 100vh; max-width: 400px; margin: 0 auto; padding: 24px 16px; }
.content.narrow > * { width: 100%; }

.crumbs { margin-bottom: 6px; font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

.banner {
    position: sticky; top: 0; z-index: 30;
    padding: 10px 20px; font-weight: 500;
    color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--bg));
    border-bottom: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}

/* ---------- surfaces ---------- */
.card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    backdrop-filter: blur(10px);
}
.card + .card, .card + section, section + .card, .card + form, form + .card { margin-top: 16px; }
.card > h2 { margin: 0 0 6px; }
.card > p.muted { margin-bottom: 2px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.danger-zone h2 { color: var(--danger); }

/* ---------- fields ---------- */
label { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%; min-height: 38px; padding: 8px 12px;
    font: inherit; color: var(--text);
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
input[readonly] { color: var(--text-2); }
input:disabled, select:disabled { opacity: 0.6; }

/* A checkbox is a switch; the label around it stays the hit target. */
label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
input[type="checkbox"] {
    appearance: none; position: relative; flex: none; margin: 0;
    width: 38px; height: 22px; border-radius: 999px;
    background: var(--line-strong); cursor: pointer;
}
input[type="checkbox"]::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; transition: transform 160ms ease;
}
input[type="checkbox"]:checked { background: var(--ok); }
input[type="checkbox"]:checked::after { transform: translateX(16px); }

label:has(> input[type="radio"]) { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--text); }
input[type="radio"] { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }

fieldset {
    display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; padding: 12px 14px 14px;
    border: 1px solid var(--line); border-radius: var(--radius);
}
legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }

.grid {
    display: grid; grid-template-columns: 10rem minmax(0, 1fr);
    gap: 10px 16px; align-items: center;
}
.grid label { margin-top: 0; }

dl.grid { margin: 0; }
dl.grid dt { color: var(--muted); font-size: 13px; }
dl.grid dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

ul.plain { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
ul.plain li {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 12px; border-radius: 10px;
    background: var(--field); border: 1px solid var(--line);
}
ul.plain li .link { margin-left: auto; }

/* ---------- buttons ---------- */
button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    align-self: flex-start;
    min-height: 36px; margin-top: 10px; padding: 0 16px;
    font: 600 13.5px/1 var(--sans); color: #fff;
    background: var(--brand); border: 0; border-radius: 10px;
    box-shadow: var(--glow); cursor: pointer; white-space: nowrap;
}
button:hover { filter: brightness(1.1); }
button[disabled] { opacity: 0.5; cursor: default; filter: none; }
button svg { width: 16px; height: 16px; }

button.secondary {
    color: var(--text); background: var(--surface);
    border: 1px solid var(--line-strong); box-shadow: none;
}
button.secondary:hover { background: var(--surface-hover); filter: none; }

button.danger {
    color: var(--danger); background: transparent;
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); box-shadow: none;
}
button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); filter: none; }

button.link {
    min-height: 0; margin: 0; padding: 0;
    color: var(--blue); background: none; border: 0; box-shadow: none; font-weight: 600;
}
button.link:hover { text-decoration: underline; text-underline-offset: 3px; filter: none; }
button.danger-text, .danger-text { color: var(--danger); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.actions button { margin-top: 0; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 16px; }
.filters label { margin: 0; }
.filters button { margin: 0; }
.filters input:not([type="checkbox"]):not([type="radio"]), .filters select { width: auto; flex: 1 1 160px; }
.card .filters { margin: 10px 0 0; }

/* ---------- tabs ---------- */
.tabs {
    display: inline-flex; gap: 2px; margin-bottom: 20px; padding: 3px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.tab {
    min-height: 32px; margin: 0; padding: 0 16px;
    color: var(--text-2); background: none; border: 0; border-radius: 9px; box-shadow: none;
    font-weight: 500;
}
.tab:hover { color: var(--text); filter: none; }
.tab.active { color: var(--text); background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 600; }

/* ---------- tables ---------- */
table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-l); overflow: hidden; backdrop-filter: blur(10px);
}
th {
    padding: 11px 16px; text-align: left;
    font-size: 12px; font-weight: 600; color: var(--muted);
    border-bottom: 1px solid var(--line);
}
td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-hover); }
td a { font-weight: 600; color: var(--text); }
td a:hover { color: var(--blue); }
.card table { margin-top: 8px; background: transparent; backdrop-filter: none; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions button + button { margin-left: 14px; }

/* Records read like a master file: owner, type, TTL and data in columns. */
table.records td:nth-child(1) { font-family: var(--mono); font-size: 13px; font-weight: 600; }
table.records td:nth-child(3) { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
table.records td.data { color: var(--text-2); }

.type {
    display: inline-block; min-width: 52px; padding: 1px 8px; text-align: center;
    font: 600 11.5px/18px var(--mono); color: var(--text-2);
    border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-strong);
}
.type[data-type="A"], .type[data-type="AAAA"] { color: #60a5fa; box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
.type[data-type="CNAME"], .type[data-type="PTR"] { color: #a78bfa; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4); }
.type[data-type="NS"], .type[data-type="SOA"] { color: #22d3ee; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.4); }
.type[data-type="MX"], .type[data-type="SRV"] { color: #fbbf24; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.4); }
.type[data-type="TXT"], .type[data-type="CAA"] { color: #34d399; box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.4); }
@media (prefers-color-scheme: light) {
    .type[data-type="A"], .type[data-type="AAAA"] { color: #2563eb; }
    .type[data-type="CNAME"], .type[data-type="PTR"] { color: #7c3aed; }
    .type[data-type="NS"], .type[data-type="SOA"] { color: #0891b2; }
    .type[data-type="MX"], .type[data-type="SRV"] { color: #b45309; }
    .type[data-type="TXT"], .type[data-type="CAA"] { color: #047857; }
}

/* ---------- messages ---------- */
.problem, .warning {
    margin-top: 8px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px;
}
.problem {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}
.warning {
    color: var(--text-2);
    background: color-mix(in srgb, var(--warn) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
}
.problem ul, .warning ul { margin: 6px 0 0; padding-left: 18px; }
p[role="status"], span[role="status"] { color: var(--ok); font-size: 13px; font-weight: 500; }

/* ---------- host liveness: the one loud element ---------- */
.live {
    display: grid; gap: 20px 32px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--ok) 11%, transparent), transparent 55%),
        var(--surface);
}
.live[data-state="offline"] {
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--warn) 9%, transparent), transparent 55%),
        var(--surface);
}
.live > h2 { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.live-age { display: grid; gap: 6px; align-content: start; }
.state { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pulse { position: relative; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--warn); }
.live[data-state="online"] .pulse { background: var(--ok); }
.live[data-state="online"] .pulse::after {
    content: ""; position: absolute; inset: -5px; border-radius: 50%;
    border: 2px solid var(--ok); opacity: 0;
    animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.8; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.live-when { font-size: 40px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.live-meta { color: var(--muted); font-size: 13px; }
.live-addr { display: grid; gap: 8px; align-content: start; }
.addr {
    display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px;
    background: var(--field); border: 1px solid var(--line);
}
.addr .mono { overflow-wrap: anywhere; }
.live dl.facts {
    grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
    margin: 0; padding-top: 16px; border-top: 1px solid var(--line);
}
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- dialogs: centred on a desk, a bottom sheet on a phone ---------- */
.dialog-backdrop {
    position: fixed; inset: 0; z-index: 40;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 8vh 16px; overflow-y: auto;
    background: rgba(3, 6, 15, 0.66); backdrop-filter: blur(4px);
}
@media (prefers-color-scheme: light) {
    .dialog-backdrop { background: rgba(15, 23, 42, 0.35); }
}
.dialog {
    display: flex; flex-direction: column; gap: 6px;
    width: min(560px, 100%); padding: 22px 24px 24px;
    color: var(--text); background: var(--surface-solid);
    border: 1px solid var(--line-strong); border-radius: 18px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.dialog h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.dialog h2:focus { outline: none; }
.dialog > p { color: var(--text-2); }
.dialog ul { margin: 4px 0 0; padding-left: 18px; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.editor { display: flex; flex-direction: column; gap: 6px; }
fieldset.rdata { gap: 6px; }
fieldset.rdata > button.link { align-self: flex-start; margin-top: 6px; color: var(--muted); font-weight: 500; }
fieldset.rdata > button.link:hover { color: var(--danger); }
.editor > button.secondary { align-self: stretch; border-style: dashed; }
.editor > button.link { align-self: flex-start; margin-top: 4px; }
.sentinel { width: 0; height: 0; overflow: hidden; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
    h1 { font-size: 22px; margin-bottom: 14px; }
    .shell { display: block; }

    .topbar {
        position: sticky; top: 0; z-index: 20; height: 56px;
        flex-direction: row; align-items: center; gap: 12px; padding: 0 16px;
        border-right: 0; border-bottom: 1px solid var(--line);
        /* backdrop-filter would make the fixed tab bar below position against
           this bar instead of the viewport. */
        backdrop-filter: none;
        background: color-mix(in srgb, var(--bg) 94%, transparent);
    }
    .brand { padding: 0; flex: 1; }
    .brand-mark { width: 28px; height: 28px; }
    .topbar .who { padding: 0; border: 0; font-size: 13px; }
    .topbar > button.link { align-self: center; margin: 0; font-size: 13px; }

    .topbar nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
        flex-direction: row; gap: 0;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px);
        border-top: 1px solid var(--line);
    }
    .topbar nav a {
        flex: 1; flex-direction: column; gap: 3px; padding: 6px 0;
        font-size: 11px; font-weight: 600; color: var(--muted);
    }
    .topbar nav a.active { background: none; box-shadow: none; }
    .topbar nav a svg { width: 21px; height: 21px; }

    main.content { padding: 16px 16px 100px; }
    .card { padding: 16px; }
    .grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .grid label { margin-top: 8px; }
    dl.grid { grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; }

    .filters { flex-direction: column; align-items: stretch; gap: 6px; }
    .filters input:not([type="checkbox"]):not([type="radio"]), .filters select { width: 100%; flex: none; }
    .filters button { align-self: flex-start; margin-top: 6px; }

    .tabs { display: flex; }
    .tab { flex: 1; }

    /* Tables become rows of labelled values. */
    table.stack, table.stack tbody, table.records, table.records tbody { display: block; }
    table.stack thead, table.records thead { display: none; }
    table.stack tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
        padding: 14px 16px; border-bottom: 1px solid var(--line);
    }
    table.stack tr:last-child { border-bottom: 0; }
    table.stack td { display: block; padding: 0; border: 0; }
    table.stack td:first-child { grid-column: 1 / -1; font-size: 15px; }
    table.stack td[data-label]::before {
        content: attr(data-label); display: block;
        font: 500 11.5px var(--sans); color: var(--muted);
    }
    table.stack td.data { grid-column: 1 / -1; }
    table.stack tbody tr:hover td { background: none; }

    table.records tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "name type ttl" "data data data" "act act act";
        gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
    }
    table.records tr:last-child { border-bottom: 0; }
    table.records td { display: block; padding: 0; border: 0; }
    table.records td:nth-child(1) { grid-area: name; }
    table.records td:nth-child(2) { grid-area: type; }
    table.records td:nth-child(3) { grid-area: ttl; align-self: center; }
    table.records td:nth-child(4) { grid-area: data; }
    table.records td:nth-child(5) { grid-area: act; }
    table.records .row-actions { text-align: left; }
    table.records tbody tr:hover td { background: none; }

    .live { grid-template-columns: minmax(0, 1fr); }
    .live-when { font-size: 34px; }
    .live dl.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .dialog-backdrop { align-items: flex-end; padding: 0; }
    .dialog {
        width: 100%; max-height: 92vh; overflow-y: auto;
        padding: 20px 16px 0; border-radius: 18px 18px 0 0; border-bottom: 0;
    }
    .dialog .actions {
        position: sticky; bottom: 0; margin: 10px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--surface-solid); border-top: 1px solid var(--line);
    }
    .dialog .actions button { flex: 1; min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .backdrop::before, .backdrop::after, .live[data-state="online"] .pulse::after { animation: none; }
    input[type="checkbox"]::after { transition: none; }
}
