/* Construction Site Reports — Theme */

html { scroll-behavior: smooth; }

/* STE-1223 D1 — Attractful report.css:91, taken app-wide as written.
   Percentage, not 18px: scales the reader's own default. Desktop ≥1000px
   is untouched. The 390px checking pass this imposes on every other
   mobile screen is an AC, not an afterthought. */
@media (max-width: 999px) {
    html { font-size: 112.5%; }
}

:root {
    /* SCRX /v2 brand — see docs/brand/ and docs/superpowers/specs/2026-06-30-ste893-reskin-design.md */
    /* Type */
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Brand — violet-led */
    --nav-bg: #2C2740;        /* charcoal */
    --nav-text: #D8D3E6;      /* light violet-tinted gray on charcoal */
    --accent: #6C2BD9;        /* violet — buttons, links, active states */
    --accent-hover: #3E1A80;  /* deep violet — pressed/hover */
    --accent-soft: #D7C4FA;   /* subtle borders/accents */
    --accent-tint: #F4EEFE;   /* chips, hover fills */
    --highlight: #E5318C;     /* fuchsia — reserved; login gradient removed STE-1313 */

    /* Neutrals — violet-tinted (never pure gray) */
    --bg: #FAF9FD;            /* canvas */
    --bg-muted: #F1EFF8;      /* muted surface (was fallback-only) */
    --card-bg: #ffffff;
    --text: #26272B;          /* ink */
    --text-muted: #5C5566;    /* violet-tinted dark gray (AA on white; Slate #8A82A6 fails AA, reserved for icons) */
    --border: #E6E2F8;        /* mist */

    /* Semantic — meaning-bearing. STE-1304 retired --alert-warning #eab308
       and --success #5cb85c (both failed 4.5:1 on white). Canonical names
       are --r-attention / --r-ok (Attractful). Do not reintroduce the
       failing values. --r-attention-line is Joe's border token; Ask
       refused uses --r-attention for the stripe (house strong-stripe,
       ≥3:1). Report chrome consumes the line token in STE-1223.
       --homeowner is byte-identical to --r-attention; homeowner reports
       are deprecated, so no de-collision. */
    --danger: #B23A3A;       /* brand "bad" red — white text passes AA (old #d9534f was 3.96:1, failed); matches refreshed alert-error */
    --r-attention: #B45309;
    --r-attention-bg: #FEF6E7;
    --r-attention-line: #F0C475;
    --r-ok: #1E7A46;
    --r-ok-bg: #ECF7F0;
    --r-tap: 48px;            /* gloves-on minimum (jobsite default) */

    /* STE-1223 sizing / motion — Attractful report.css :root, namespaced
       --r-*. Shared 19 tokens above stay identical (do not rename). The
       six unused declarations he carried (--nav-bg, --nav-text, --highlight,
       --danger, --success, --alert-warning) are not re-pasted; two of them
       are the STE-1304 tripwire. */
    --r-live: #FF4D4D;
    --r-nav-bg: var(--card-bg);
    --r-shadow: 0 1px 2px rgba(38,39,43,.05), 0 4px 16px -8px rgba(38,39,43,.14);
    --r-radius: 12px;
    --r-gutter: 1rem;
    --r-header-h: 56px;
    --r-rail-h: 60px;
    --r-jump-h: 56px;
    --r-stick: 180px;           /* header + date rail + section row (oracle). Chrome stays visible. */
    --r-ease: cubic-bezier(.32, .72, 0, 1);
    --r-fast: .16s;
    --r-mid: .24s;

    /* Role */
    --homeowner: #B45309;     /* byte-identical to --r-attention; homeowner reports deprecated (STE-1304) */

    /* Flag / attention — STE-893 violet tokens. Portfolio/digest (STE-1309)
       use --r-attention via .r-status--check / .r-cal__dot instead of these
       bars, so amber does not flood the highest-traffic grid. */
    --flag-bg: #F4EEFE;
    --flag-stripe: #6C2BD9;
    --flag-text: #4A2398;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem; /* STE-1325: D1 body size, app-wide (John 2026-08-19) */
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ── Brand typography ───────────────────────────────── */
/* Display font (Oswald) on page titles. Weight is pinned at 500 to match
   Attractful (report.css:96); the UA default `bold` maps to Oswald 700,
   which reads as a different face next to Inter. Selector stops at h3 —
   Oswald 500 on an h5 at 0.9rem is light + condensed + small at once.
   h4–h6 fall back to Inter at the UA bold. Do not take Attractful's
   `margin: 0` — that is their layout, not ours. Uppercase stays
   per-selector (nav brand, eyebrows), so long report-body headings
   remain sentence-case. */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: .01em;
}
/* Mono (Roboto Mono) on numeric/data callouts. */
.cops-root .k-tile__num,
.lightbox-counter,
.ts-link,
.image-hour-heading {
    font-family: var(--font-mono);
}

/* ── Staging Banner ────────────────────────────────── */

.staging-banner {
    background: #e67e22;
    color: #fff;
    text-align: center;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* ── Navigation ─────────────────────────────────────── */

/* STE-1326: lose height, not just colour. Floor is the 48px tap target.
   Charcoal --nav-bg stays declared (login, etc.) but is not the bar.
   Wordmark uses currentColor + brand purple — unrecoloured-on-paper.
   STE-1305: scope to the shell bar so `.r-rail` / `.r-jump` (also <nav>)
   keep Joe's height, gap, and day-chip layout. Chrome stays sticky at all widths. */
body > nav {
    background: var(--bg-muted);
    color: var(--text);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: var(--r-tap);
    min-height: var(--r-tap);
    gap: 1.5rem;
}
/* STE-1325: 1.0625rem body grows the admin link row past 1024. Wrap before
   it overflows the viewport — do not 100vw. Items that fit stay one row. */
@media (max-width: 1100px) {
    body > nav { height: auto; flex-wrap: wrap; }
}

body > nav .brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    min-height: var(--r-tap);
}

body > nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: background 0.15s;
    min-height: var(--r-tap);
    display: inline-flex;
    align-items: center;
}

body > nav a:hover, body > nav a.active {
    background: var(--accent-tint);
    color: var(--text);
}

/* ── Layout ─────────────────────────────────────────── */

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-width: 0;           /* STE-1314: kit §0b on the box, not `.k-shell *` */
    overflow-x: clip;       /* clip, never hidden — hidden breaks sticky on iOS */
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Daily report only — .r-report is not on weekly. HTMX puts the IA inside
   #report-panel, so descendant :has, not a direct-child match. */
.card:has(.r-report) {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.two-col {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}
.two-col.narrow-sidebar {
    grid-template-columns: 220px 1fr;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-top: 0.5rem;
}

.image-grid a {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 3px;
    background: var(--border);
}

.image-grid a:hover img {
    opacity: 0.85;
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s;
}

/* ── Forms ──────────────────────────────────────────── */

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="tel"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    margin-bottom: 1rem;
}

textarea { resize: vertical; min-height: 80px; }

input[type="file"] { margin-bottom: 1rem; }

.form-group { margin-bottom: 1rem; }

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.7rem;
    margin-bottom: 1rem;
}

/* ── Buttons ────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

.btn-secondary { background: #e0e0e0; color: var(--text); }
.btn-secondary:hover { background: #d0d0d0; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8E2A2A; }

.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.email-status { font-size: 0.85rem; margin-left: 0.25rem; }
.portfolio-weekly-title { font-size: 1.3rem; margin: 0 0 1rem; }

/* ── Progress ───────────────────────────────────────── */

.progress-wrap {
    margin: 1.5rem 0;
}

.progress-bar-track {
    width: 100%;
    height: 22px;
    background: #e9ecef;
    border-radius: 11px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 11px;
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.progress-bar-indeterminate {
    width: 30% !important;
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0%   { margin-left: 0;   width: 30%; }
    50%  { margin-left: 35%; width: 30%; }
    100% { margin-left: 70%; width: 30%; }
}

/* STE-1499 — Generate Report console (pipeline.html).
   Two-column at ≥769 so SSE progress sits beside the form, not below the
   fold. ID-scoped grid, not the deleted .two-col family. */
@media (min-width: 769px) {
    #pipeline-console {
        display: grid;
        grid-template-columns: minmax(280px, 352px) minmax(0, 1fr);
        gap: 1.5rem;
        align-items: start;
    }
}
#pipeline-console > .k-card > .k-btn { width: 100%; }
#progress-area > .k-card { margin: 1.5rem 0; }
#pipeline-console > .k-card > .k-btn + .k-btn { margin-top: 0.5rem; }
#report-type-tabs.r-seg button {
    min-width: var(--r-tap);
    min-height: var(--r-tap);
}
#report-type-tabs.r-seg button[aria-pressed="true"] {
    background: var(--card-bg);
    box-shadow: var(--r-shadow);
}
#daily-options[hidden],
#weekly-options[hidden],
#run-btn[hidden],
#run-weekly-btn[hidden],
#no-activity-btn[hidden] { display: none; }

/* STE-1499 — Interior Uploads */
#drop-wrap { opacity: 0.5; pointer-events: none; }
#dropzone {
    border-style: dashed;
    text-align: center;
    padding: 1.5rem;
    cursor: pointer;
    margin-bottom: 0;
}
#interior-req-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}
#commit-btn { width: 100%; }
#commit-spinner[hidden],
#stage-progress[hidden],
#reject-list[hidden],
#plan-area[hidden],
#result-area[hidden],
#file_input[hidden] { display: none; }

/* ── Report header block ─────────────────────────────── */

.report-header-block {
    border-left: 3px solid var(--accent);
    padding: 0.55rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg);
    border-radius: 0 4px 4px 0;
}

.report-header-block .rh-site {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.report-header-block .rh-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.rh-sep { opacity: 0.35; margin: 0 0.4rem; }

/* ── Report content ─────────────────────────────────── */

.report-content {
    line-height: 1.7;
}

.report-content h1, .report-content h2, .report-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.report-content table {
    border-collapse: collapse;
    margin: 1rem 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.report-content th, .report-content td {
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    text-align: left;
}

/* ── Report IA (STE-1154) ───────────────────────────────
   Structure only. Color, type scale and card chrome are STE-1223's; this
   block uses existing tokens exclusively so the reskin has nothing to undo. */

.report-ia .report-section {
    margin-bottom: 1.25rem;
}

/* Answer zone. Semantics only — STE-1223 owns the card's visual language. */
.report-answer-card {
    display: block;
    margin: 0 0 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
}

.report-answer-state {
    margin: 0;
    font-weight: 600;
}

.report-answer-phase {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.report-answer-rows {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
}

.report-answer-rows > li { margin-bottom: 0.6rem; }
.report-answer-rows > li:last-child { margin-bottom: 0; }

.report-answer-rows ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

.report-answer-rows p { margin: 0 0 0.2rem; }

.report-answer-evidence {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.report-answer-overflow > summary {
    min-height: var(--r-tap);
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.report-answer-overflow > summary:hover { color: var(--accent); }

/* Carry-group: body-size content line (not an eyebrow), but tappable and
   escalation-colored — count is the signal, so it must not be the grayest
   line in Open items. */
.report-carry-group > summary {
    min-height: var(--r-tap);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.report-carry-group > summary::-webkit-details-marker { display: none; }

.report-carry-group > summary::before {
    content: "▸";
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    transition: transform 0.12s ease-in-out;
}

.report-carry-group[open] > summary::before { transform: rotate(90deg); }

.report-carry-group > summary:hover,
.report-carry-group > summary:hover::before { color: var(--accent); }

/* STE-1657: All my sites "Show these sites" fold — same 48px tap floor. */
[data-across-no-report-sites] summary {
    min-height: var(--r-tap);
    line-height: var(--r-tap);
    cursor: pointer;
}

/* One IA label system — Adam's .sec-label (style tile): Inter, 11px, 700,
   .16em tracking, uppercase. DOM stays sentence-case; paint is CSS.
   Color is --text (tile charcoal), not muted — 11px must survive bright sun.
   Does NOT style .report-answer-state (answer card sits above this system). */
.report-section-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text);
}

/* Open sections: hairline is part of the tile pattern, not decoration. */
h3.report-section-label {
    display: block;
    margin: 0 0 0.75rem;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
}

.report-nav a.report-section-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: var(--r-tap);
    padding: 0 0.75rem;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 4px;
    /* Nav chips: same type tokens; no hairline (rail/row already separates). */
    border-bottom: 0;
    padding-bottom: 0;
    margin: 0;
}

.report-nav a.report-section-label:hover { color: var(--accent); }

.report-nav a.report-section-label.is-active {
    color: var(--accent);
    background: var(--bg-muted);
}

.report-nav a.report-section-label:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Collapsed zones: same label type + a visible disclosure marker so the
   eyebrow still reads as tappable (count in the label is the other cue). */
details.report-section > summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: var(--r-tap);
    cursor: pointer;
    list-style: none;
    color: var(--text);
}

details.report-section > summary::-webkit-details-marker,
details.report-section > summary::marker { display: none; content: ""; }

details.report-section > summary::after {
    content: "";
    margin-left: auto;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.18s ease;
}

details.report-section[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

details.report-section > summary:hover,
details.report-section > summary:hover .report-section-label { color: var(--accent); }

details.report-section > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Photos as evidence-on-demand (§4 row 19) — same IA label + disclosure. */
details.report-photos {
    margin: 1.25rem 0 0;
}

details.report-photos > summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: var(--r-tap);
    cursor: pointer;
    list-style: none;
    color: var(--text);
}

details.report-photos > summary::-webkit-details-marker,
details.report-photos > summary::marker { display: none; content: ""; }

details.report-photos > summary::after {
    content: "";
    margin-left: auto;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.18s ease;
}

details.report-photos[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

details.report-photos > summary:hover,
details.report-photos > summary:hover .report-section-label { color: var(--accent); }

details.report-photos > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.report-photos-note {
    font-size: 0.8rem;
    margin: 0.5rem 0;
}

.photo-modality-heading {
    margin: 1rem 0 0.4rem;
    font-size: 0.95rem;
}

/* §6 section nav — same links at both widths; placement is CSS-only.
   Markup: .report-ia > .report-nav + .report-answer-card + .report-ia-main.
   Mobile: sticky row first (beneath page header, above fold). Desktop: card
   spans row 1; rail + main share row 2. Global `nav { height: 56px }` is site
   chrome — reset it on .report-nav. */
.report-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    margin: 0 0 1rem;
    padding: 0.25rem 0;
    height: auto;
    background: var(--bg);
    color: inherit;
    z-index: 4;
}

/* Hash / nav jumps land below the sticky stack (header + rail + jump). */
.report-ia [id],
.report-ia [data-section-kind] {
    scroll-margin-top: var(--r-stick);
}

/* 390px: sticky row under the header, horizontally scrollable. */
@media (max-width: 768px) {
    .report-ia > .report-nav {
        position: sticky;
        top: 0;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--border);
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Desktop: answer card full-width on top; sticky rail beside main below. */
@media (min-width: 769px) {
    .report-ia:has(> .report-nav) {
        display: grid;
        grid-template-columns: 11rem minmax(0, 1fr);
        column-gap: 1.25rem;
        align-items: start;
    }

    .report-ia > .report-answer-card {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .report-ia > .report-nav {
        grid-column: 1;
        grid-row: 2;
        position: sticky;
        top: 1rem;
        align-self: start;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        height: fit-content;
        margin: 0;
        padding: 0.25rem 0;
        border-right: 1px solid var(--border);
        background: transparent;
        /* Do not set overflow on the sticky rail — it collapses the used
           height to one link (~56px) while the anchors still paint over body. */
    }

    .report-ia > .report-ia-main {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
    }

    .report-nav a.report-section-label {
        justify-content: flex-start;
        width: 100%;
    }
}

/* Nested leftovers inside summary — keep .report-section-label type tokens. */
details.report-section > summary > h1,
details.report-section > summary > h2,
details.report-section > summary > h3,
details.report-section > summary > h4,
details.report-section > summary > strong {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

details.report-section > summary > .r-head,
details.report-photos > summary > .r-head {
    margin: 0;
    flex: 1;
    min-width: 0;
}
details.report-section > summary > .report-section-label,
details.report-section > summary .r-head h2 {
    margin: 0;
}

details.report-section[open] > summary { margin-bottom: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
    details.report-section > summary::after { transition: none; }
}

/* ── Login / standalone portal (STE-1313) ───────────── */
/* Gradient hero from STE-893 removed deliberately: kit cards are flat. */

.login-page,
.expired-page,
.homeowner-page {
    max-width: 28rem;
    margin: 4rem auto;
    padding: 0 var(--r-gutter, 1rem);
}
.login-page .k-card { text-align: center; }
.login-page .k-field,
.login-page form { text-align: left; }
.login-page .k-btn,
.expired-page .k-btn,
.homeowner-page .k-btn { width: 100%; }
.homeowner-page .k-card,
.homeowner-page .k-state { text-align: center; }
.login-mark { height: 30px; width: auto; display: block; margin: 0 auto 0.5rem; }
.expired-page .k-card { text-align: center; }
.expired-page .k-field,
.expired-page form { text-align: left; }
.expired-page .k-page__title { text-align: center; }
.expired-page .k-hint { margin-top: .75rem; text-align: center; }
.expired-page .k-hint a,
.expired-page__foot a { white-space: nowrap; }
.expired-page__foot { margin-top: 3rem; text-align: center; }
.legal-page { max-width: 40rem; }
.legal-page a,
.expired-page a { color: var(--accent); }
.legal-page h2 { font-size: 1.35rem; margin-top: 1.75rem; margin-bottom: .4rem; }
.legal-page p { line-height: 1.55; }

/* STE-1787: button sits on the right of the kit alert. On a phone the
   sentence takes the full width so it stays two lines, and the button
   sits under it, the same place a kit button row sits. */
.tou-notice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem 1rem;
}
.k-alert .tou-notice p { margin: 0; }
.k-alert .tou-notice a { color: var(--accent); text-decoration: underline; white-space: nowrap; }
@media (max-width: 480px) {
    .tou-notice { grid-template-columns: minmax(0, 1fr); }
    .tou-notice .k-btn { justify-self: start; }
}
.sms-optin { max-width: 34rem; margin: 2.5rem auto; }
.sms-optin .k-btn--primary { width: 100%; }

/* Kit controls: global, not a per-surface patch. Type-enumerated rules
   above still set padding / radius / margin at (0,1,1); this block matches
   that specificity and must stay later in the file. Font-size is no
   longer on the type enum (STE-1382 still owns tel/search + directory
   0.9rem). */
input.k-input,
select.k-select,
textarea.k-textarea {
    font-size: 1rem;
    margin-bottom: 0;
    border-radius: 8px;
    padding: .6rem .75rem;
}

/* ── Alerts ─────────────────────────────────────────── */

.alert {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Alerts re-skinned to the brand's muted severity scale (style tile --good/--warn/--bad);
   hue families preserved so meaning is unmistakable. Info = brand violet (neutral). */
.alert-info { background: var(--accent-tint); color: #4A2398; border: 1px solid var(--accent-soft); }
.alert-success { background: #E9F6EE; color: #2E6B45; border: 1px solid #BFE0CC; }
.alert-warning { background: #FBF3E3; color: #87580F; border: 1px solid #E7D3A0; }
.alert-error { background: #FBEAEA; color: #9A2A2A; border: 1px solid #ECC4C4; }

/* ── Utilities ──────────────────────────────────────── */

.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ── Site list & date list (admin reports panel) ─────────── */

.site-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-list > li {
    border-bottom: 1px solid var(--border);
}

.site-list > li:last-child { border-bottom: none; }

.site-list .site-name {
    display: block;
    padding: 0.5rem 0.25rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-list .site-name:hover { color: var(--accent); }
.site-list .site-name.active { color: var(--accent); font-weight: 600; }

.site-list .date-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.25rem;
}

.site-list .date-list li {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.site-list .date-list li:last-child { border-bottom: none; }

.site-list .date-list a {
    display: block;
    padding: 0.35rem 0.25rem 0.35rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.site-list .date-list a:hover { color: var(--accent); }

/* Builder groups in sites panel */
.builder-group { margin-bottom: 0.5rem; }
.builder-group:last-child { margin-bottom: 0; }
.builder-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.5rem 0.25rem 0.15rem;
    border-bottom: 1px solid var(--border);
}

/* Daily / Weekly toggle links */

.view-toggle {
    padding: 0.25rem 0.25rem 0.35rem;
    font-size: 0.8rem;
}

.view-toggle-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.view-toggle-link:hover {
    color: var(--accent);
}

.view-toggle-link.active {
    color: #fff;
    background: var(--accent);
}

.view-toggle-sep {
    color: var(--border);
    margin: 0 0.1rem;
}

/* ── Report type tabs (Daily / Weekly toggle) ── */

.report-type-tabs {
    display: flex;
    gap: 0;
    margin: 0.5rem 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.report-type-tabs > a,
.report-type-tabs > button,
.report-type-tabs > span {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

.report-type-tabs > :not(:last-child) {
    border-right: 1px solid var(--border);
}

.report-type-tabs > a:hover,
.report-type-tabs > button:hover {
    background: var(--card-bg);
    color: var(--text);
}

.report-type-tabs > .active {
    background: var(--accent);
    color: #fff;
}

.report-type-tabs > .active:hover {
    color: #fff;
}

/* Match button sizing on small screens */
@media (max-width: 640px) {
    .report-type-tabs > a,
    .report-type-tabs > button,
    .report-type-tabs > span { padding: 0.55rem 0.6rem; font-size: 0.875rem; min-height: var(--r-tap); display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Hourly image groups ───────────────────────────── */

.image-hour-group { margin-bottom: 1.25rem; }

.image-hour-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.2rem;
    margin-bottom: 0.4rem;
}

/* Clickable timestamp links in report text. STE-1667: the All my sites
   no-report names share it — links inside running text are prose, not
   controls, so they are exempt from the --r-tap floor (tools/sweep_grid.mjs). */
.ts-link,
[data-across-no-report] a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.ts-link:hover,
[data-across-no-report] a:hover { text-decoration-style: solid; }

/* Highlight target image when scrolled to */
.image-grid a[id] { scroll-margin-top: var(--r-stick); }
.image-grid a:target {
    outline: 3px solid var(--accent);
    outline-offset: 1px;
    border-radius: 3px;
}

/* ── Responsive ─────────────────────────────────────── */

/* Image grid: 6 cols → 3 → 2 as screens narrow */
@media (max-width: 700px) {
    .image-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) {
    .image-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Two-col layout: stack on tablet/phone */
@media (max-width: 768px) {
    /* Kill the grid entirely — simple block stacking */
    .two-col, .two-col.narrow-sidebar,
    #reports-index {
        display: block !important;
    }
    /* Site name: prevent overflow */
    .rh-site { word-break: break-word; font-size: 1.1rem; }
    /* Prevent iOS auto-zoom on inputs (requires ≥16px / 1rem) */
    input, select, textarea { font-size: 1rem; }
}

/* Phone layout fixes */
@media (max-width: 640px) {
    /* Nav: brand on its own row, links wrap below */
    body > nav { height: auto; flex-wrap: wrap; padding: 0.5rem 0.75rem; gap: 0.4rem; }
    body > nav .brand { width: 100%; padding: 0.25rem 0; }
    body > nav a { font-size: 0.8rem; padding: 0.4rem 0.5rem; }
    /* Page headers: stack title and back button vertically */
    .page-header { flex-wrap: wrap; gap: 0.5rem; }
    .page-header h1 { width: 100%; font-size: 1.3rem; }
    /* Larger touch targets for small buttons */
    .btn-sm { padding: 0.55rem 0.9rem; font-size: 0.875rem; }
    .btn { min-height: var(--r-tap); display: inline-flex; align-items: center; justify-content: center; }
}

/* Tighter spacing on small phones */
/* HTMX loading indicators */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

@media (max-width: 480px) {
    .container { padding: 0 0.75rem; margin: 1rem auto; }
    .card { padding: 1rem; }
    body > nav { padding: 0 0.75rem; gap: 0.75rem; }
    .login-page, .expired-page, .homeowner-page { margin-top: 2.5rem; }
}

/* STE-1223: 481–768 gets Attractful density (699/999), not the old 0.9rem
   shrink. Two-col still stacks at 768. Phone-only wrap/overflow stays under 699. */
@media (max-width: 699px) {
    .report-content { overflow-wrap: break-word; word-break: break-word; }
    .report-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .report-content pre, .report-content code { white-space: pre-wrap; word-break: break-all; }
}

/* ── Standalone date-list (portfolio/client report sidebars) ── */

.date-list { list-style: none; margin: 0; padding: 0; }
.date-list li { border-bottom: 1px solid var(--border); }
.date-list li:last-child { border-bottom: none; }
.date-list a {
    display: flex; align-items: center; min-height: var(--r-tap);
    padding: 0.4rem 0.25rem; color: var(--text);
    text-decoration: none; font-size: 0.95rem;
}
.date-list a:hover, .date-list a:active { color: var(--accent); }
.date-list a.active { color: var(--accent); font-weight: 600; }

/* ── Date archive modal ── */

.date-archive-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: var(--r-tap);
    margin-top: 0.25rem;
    padding: 0.5rem 0.25rem;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--accent);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.date-archive-trigger:hover,
.date-archive-trigger:focus {
    background: rgba(108, 43, 217, 0.08);
    outline: none;
}

.date-archive-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.date-archive-overlay.open { display: flex; }

.date-archive-dialog {
    width: 95vw;
    max-width: 480px;
    max-height: 80vh;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.date-archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.date-archive-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.date-archive-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.5rem;
    color: var(--text-muted, #888);
}
.date-archive-close:hover,
.date-archive-close:focus {
    color: var(--text, #333);
    outline: none;
}

.date-archive-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.25rem 1.25rem;
}

.customer-picker-header .section-label {
    margin-bottom: 0;
}

.customer-picker-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.date-archive-month {
    margin-top: 1rem;
}
.date-archive-month:first-child {
    margin-top: 0;
}

.date-archive-month-head {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #888);
}

@media (max-width: 768px) {
    .date-archive-dialog {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    .date-archive-header {
        position: sticky;
        top: 0;
        background: var(--card-bg, #fff);
        z-index: 1;
    }
}

@media (max-width: 700px) {
    .site-grid { grid-template-columns: 1fr; }
}

/* ── Back link ── */

.back-link {
    display: inline-block; margin-bottom: 1rem;
    font-size: 0.85rem; color: var(--accent);
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ── Jobsites / digest grid (STE-1309) — layout only; visual language is r-* ── */

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.site-grid.digest-site-grid {
    grid-template-columns: repeat(auto-fill, 300px);
    justify-content: start;
}
/* STE-1436: this selector matches the 300px rule above, so it has to come
   later or the fixed columns win on a phone and leave a right gutter. */
@media (max-width: 700px) {
    .site-grid.digest-site-grid { grid-template-columns: 1fr; }
}
.digest-builder-heading {
    grid-column: 1 / -1;
    margin-top: 0;
}
.digest-builder-heading:not(:first-child) {
    margin-top: 1.25rem;
}
.digest-instruction { margin: 0 0 1.25rem; font-size: 0.95rem; }

.site-grid > .r-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.site-grid > .r-card.is-muted { opacity: 0.94; }
/* STE-1349: a completed lot's flags are frozen at the last report, not a
   live punch list. Mute every status — including .r-status--check — and
   the amber attention dot so the card stays visually inert. The COMPLETED
   badge uses this same mute. Do not re-add :not(.r-status--check). */
.site-grid > .r-card.is-completed .r-status {
    background: var(--bg-muted);
    color: var(--text-muted);
    margin-bottom: .45rem;
}
.site-grid > .r-card.is-completed .r-cal__dot {
    background: var(--text-muted);
}
.site-grid .r-card > [hx-get] {
    flex: 1;
    cursor: pointer;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.site-grid .r-card > [hx-get]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-radius);
}
.site-grid .r-card [hx-get] > .r-frame,
.site-grid a.r-card > .r-frame {
    cursor: pointer;
    margin-bottom: .75rem;
}
.site-grid .r-card .r-frame:active { transform: none; }
.site-grid .r-card h3 {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 .25rem;
    font-size: 1.05rem;
}
.site-grid .r-card h3 .r-cal__dot { margin-left: auto; }
.site-grid .r-card p[data-story] {
    margin: .4rem 0 0;
    font-size: .92rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--text);
}
.site-grid .r-card p[data-story][data-muted] {
    color: var(--text-muted);
    font-style: italic;
}
/* STE-1437: weekly digest story is already compacted. The shared 2-line
   clamp hid it while the first flag ran the full sentence. Daily digest
   and My Jobsites keep the clamp. */
.digest-site-grid .r-card[data-digest="weekly"] p[data-story] {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.digest-site-grid .digest-flag-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.site-grid .r-card .r-status--check { margin-top: .5rem; align-self: flex-start; }
.site-grid .r-card .r-alert { margin-top: .5rem; }
.site-grid .r-card .r-live { margin-top: .65rem; align-self: flex-start; }
.site-grid .r-card .r-disclose { margin-top: .35rem; }
.site-grid a.r-card .r-btn {
    margin-top: auto;
    pointer-events: none;
    align-self: stretch;
}
.site-grid a.r-card:active { transform: scale(0.99); }

.site-status-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; font-weight: 600; padding: 0.18rem 0.55rem;
    border-radius: 6px; white-space: nowrap;
}
.site-status-badge.is-completed { background: #eef0f3; color: #5b6472; }
.site-status-badge.is-cancelled { background: #f4eee8; color: #6b5344; }
.site-row-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.portfolio-completed-toggle { margin: 0.5rem 0 0; font-size: 0.85rem; }
.portfolio-completed-toggle a { color: var(--accent); }

/* Portfolio dashboard header (client + admin) */
.portfolio-header { margin-bottom: 1.5rem; }
.portfolio-header-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.portfolio-header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.portfolio-header .text-muted { margin: 0; font-size: 0.9rem; }

/* ── Summary overlay (modal) ── */

#summary-overlay:not(:empty) {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}

.summary-modal {
    background: var(--card-bg, #fff);
    border-radius: var(--r-radius);
    max-width: 600px; width: 100%;
    max-height: 85vh; overflow-y: auto;
    box-shadow: var(--r-shadow);
    font-family: var(--font-body);
    line-height: 1.55;
}
.summary-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.summary-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
}
.summary-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    font-family: var(--font-body);
    color: var(--text-muted); padding: 0 0.25rem; line-height: 1;
    min-width: var(--r-tap); min-height: var(--r-tap);
}
.summary-modal-body { padding: 1.25rem 1.5rem; }
.summary-modal .summary-block + .summary-block { margin-top: 1.1rem; }
.summary-modal .r-item__detail p { margin: 0 0 0.75rem; }
.summary-modal .r-item__detail p:last-child { margin-bottom: 0; }
.summary-modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border);
    display: flex; gap: 0.75rem; flex-wrap: wrap;
}
a.r-btn { text-decoration: none; }
a.r-btn--primary { color: #fff; }
a.r-btn--ghost { color: var(--text); }

/* Setup tab panes toggle `hidden`. Author display on a later kit
   class would beat UA [hidden] (STE-1314 slice 4). */
#tab-customers[hidden],
#tab-cameras[hidden],
#tab-plans[hidden] {
    display: none !important;
}
/* Slice 5: kit display on picker / add-site containers beats UA [hidden]. */
#contact-picker-builder-wrap[hidden],
#contact-picker-sites-wrap[hidden],
#contact-picker-homeowner-wrap[hidden],
#contact-picker-cadence-wrap[hidden],
#contact-picker-rollup-wrap[hidden],
#contact-picker-rollup-disabled[hidden],
#contact-bulk-assignment-empty[hidden],
#contact-bulk-picker-builder-wrap[hidden],
#contact-bulk-picker-sites-wrap[hidden],
#contact-bulk-picker-homeowner-wrap[hidden],
#contact-bulk-picker-cadence-wrap[hidden],
#contact-bulk-picker-rollup-wrap[hidden],
#contact-bulk-picker-rollup-disabled[hidden],
#cameras-add-site-form[hidden] {
    display: none !important;
}
#tab-plans .k-tablewrap,
#cameras-detail .k-tablewrap,
#contact-bulk-review-form .k-tablewrap {
    min-width: 0;
    overflow-x: clip;
}
#tab-plans .k-table td[data-label="Plan File"] {
    overflow-wrap: anywhere;
}
#tab-plans .k-table td[data-label="Plan File"] a {
    overflow-wrap: anywhere;
}
#reports-index {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}
#cameras-detail details.k-card > summary {
    cursor: pointer;
    list-style: none;
}
#cameras-detail details.k-card > summary::-webkit-details-marker { display: none; }
/* kit.css styles `.k-tab` as a button; Setup uses links (hash router).
   Selected visual is kit `.k-tab[aria-selected="true"]`, which is invalid
   on a roleless <a>. Same hook, legal attribute (STE-1314 slice 4 R-001). */
a.k-tab {
    text-decoration: none;
}
a.k-btn { text-decoration: none; }
.k-tab[aria-current] {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.builder-group-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
/* ── Setup customers hub (STE-784) ─────────────────────────── */

/* One sans stack everywhere in this hub — no browser-default <code> mono in rows */
.setup-customers-hub {
    font-size: 0.9375rem;
    line-height: 1.45;
}
.setup-customers-hub code:not(.pw-mask),
.setup-customers-hub .site-key {
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 500;
    font-style: normal;
    letter-spacing: normal;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--border) 35%, var(--card-bg));
    padding: 0.12em 0.4em;
    border-radius: 4px;
}

.text-customer-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.text-counts {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0;
    font-weight: 400;
}
.text-section,
.setup-customers-hub .section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 0.35rem;
}
.setup-customers-hub .text-row-primary {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}
.setup-customers-hub .text-row-secondary {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.35;
}

.customer-picker {
    margin-bottom: 1.25rem;
}
.customer-picker .section-label {
    display: block;
    margin-bottom: 0.35rem;
}
.customer-picker-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem;
}
.add-customer-details {
    flex: 0 0 auto;
}
.add-customer-details summary {
    list-style: none;
    cursor: pointer;
}
.add-customer-details summary::-webkit-details-marker { display: none; }
.add-customer-form {
    margin-top: 0.5rem;
    padding: 0.75rem;
}
.add-customer-hint { font-size: 0.8rem; margin-top: 0; }

.customer-detail-pane {
    min-width: 0;
    transition: opacity 0.18s ease-out;
}
.customer-detail-pane.htmx-swapping {
    opacity: 0.55;
}
#customer-detail.htmx-settling {
    opacity: 0.7;
}

.customer-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.customer-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.customer-header-actions .btn { min-height: 36px; }

.customer-warnings { margin-bottom: 1rem; }
.customer-warning-line {
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.35rem;
}
.customer-saved-ftp-hint { font-size: 0.9rem; margin-top: 0.5rem; }

.customer-section { margin-bottom: 1.5rem; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.site-row.card {
    margin-bottom: 0.5rem;
    padding: 0;
    overflow: hidden;
}
.site-row-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.65rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    list-style: none;
}
.site-row-meta {
    font-size: 0.875rem;
    font-weight: 400;
}
.site-row-ftp {
    margin-left: auto;
    font-size: 0.8125rem;
    white-space: nowrap;
}
.site-row-summary::-webkit-details-marker { display: none; }
.site-row-body { padding: 0 0.75rem 0.75rem; }
.site-row-meta { flex: 1 1 auto; min-width: 0; }
.site-row-footer { margin-top: 0.5rem; }

.camera-ptz-cell { text-align: center; }
.camera-actions-cell { text-align: center; }
.btn-copy-sm { padding: 0 0.3rem; font-size: 0.7rem; }
.btn-icon { padding: 0 0.35rem; font-size: 0.85rem; min-width: 0; opacity: 0.65; }

.contact-row.card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.4rem;
}
.contact-row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    flex: 1 1 auto;
    min-width: 0;
}
.contact-row-ident {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    flex: 1 1 10rem;
    min-width: 0;
}
.delivery-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-width: 0;
}
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.pill-report {
    color: var(--accent-hover);
    background: color-mix(in srgb, var(--accent) 12%, var(--card-bg));
    border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.pill-portfolio {
    color: var(--text);
    background: color-mix(in srgb, var(--border) 25%, var(--card-bg));
    border-color: var(--border);
}
.pill-homeowner {
    color: var(--homeowner);
    background: color-mix(in srgb, var(--homeowner) 10%, var(--card-bg));
    border-color: color-mix(in srgb, var(--homeowner) 30%, var(--border));
}
.contact-send-test { flex: 0 0 auto; }

/* Contact inline editor — identity grid + delivery blocks */
.setup-customers-hub .contact-editor-card {
    padding: 1rem 1.1rem;
}
.setup-customers-hub .contact-editor-card label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.setup-customers-hub .contact-editor-card input[type="text"],
.setup-customers-hub .contact-editor-card input[type="email"],
.setup-customers-hub .contact-editor-card input[type="tel"],
.setup-customers-hub .contact-editor-card select {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.9375rem;
    line-height: 1.35;
    min-height: 40px;
    padding: 0.5rem 0.65rem;
}
.contact-editor-identity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem 1rem;
    margin-bottom: 1.1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}
.contact-editor-identity .form-group {
    margin: 0;
    min-width: 0;
}
.contact-editor-sms {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.55rem 0 0;
    min-height: 40px;
    align-self: end;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}
.contact-editor-sms input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
}
.contact-editor-sms span { line-height: 1.35; }

.contact-editor-delivery { margin-top: 0; }
.editor-block-title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    line-height: 1.3;
}
.contact-editor-block { margin-bottom: 0.85rem; }
.recipient-type-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.5rem;
}
.recipient-type-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
    margin: 0;
}
.recipient-type-label input { margin: 0; flex-shrink: 0; }
.recipient-mode-panel { margin-bottom: 0; }
.builder-mode-panel .cadence-control:last-child,
.builder-mode-panel .portfolio-control { margin-bottom: 0; }
.cadence-control,
.portfolio-control {
    margin-bottom: 0.85rem;
}
.cadence-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.segmented-control {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg);
    font-size: 0.875rem;
}
.segmented-option {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    font-size: inherit;
    font-weight: 500;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}
.segmented-option:last-child { border-right: none; }
.segmented-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}
.segmented-option:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 14%, var(--card-bg));
    color: var(--text);
    font-weight: 600;
}
.segmented-option span,
.segmented-option {
    padding: 0.4rem 0.65rem;
}
.cadence-choose-panel { margin-top: 0.45rem; }
.contact-sites-choose {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 100%;
}
.homeowner-site-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.homeowner-site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.homeowner-site-select {
    flex: 1 1 12rem;
    min-width: 10rem;
    min-height: 40px;
    margin-bottom: 0;
}
.homeowner-mode-hint { margin: 0.35rem 0 0; }
.contact-dual-notice {
    font-size: 0.875rem;
    margin: 0 0 0.85rem;
}
.portfolio-check-hidden {
    display: none !important;
}
.cadence-hidden-inputs:empty {
    display: none;
}
.cadence-hidden-inputs:not(:empty) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.setup-customers-hub .homeowner-mode-hint {
    font-size: 0.875rem;
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}
.setup-customers-hub .homeowner-site-row label {
    font-size: 0.8125rem;
}
.homeowner-test-status { margin-left: 0.35rem; font-size: 0.82rem; }
.homeowner-test-status-ok { color: var(--r-ok); }

.inline-editor {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, opacity 0.2s ease-out, margin 0.2s ease-out;
    margin: 0;
}
.inline-editor:not([hidden]),
.inline-editor.inline-editor-open {
    max-height: 2000px;
    opacity: 1;
    margin: 0.35rem 0 0.75rem;
    overflow: visible;
}
.add-site-form:not([hidden]),
.add-contact-form:not([hidden]) {
    max-height: 2000px;
    opacity: 1;
    margin-bottom: 0.75rem;
    overflow: visible;
}

.contact-sites-grid { margin: 0.5rem 0; }
.contact-sites-label {
    font-weight: 600;
    font-size: 0.82rem;
    display: block;
    margin-bottom: 0.35rem;
}
.contact-sites-tbody {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.contact-site-grid-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
}
.contact-site-grid-item-border {
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.contact-site-grid-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-site-flag {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
}
.contact-site-flag-homeowner { color: var(--homeowner); }

.contact-site-grid-full {
    display: grid;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}
.contact-site-grid-header,
.contact-site-grid-row {
    display: grid;
    grid-template-columns: 1fr repeat(3, 4.5rem);
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
}
.contact-site-grid-header {
    background: color-mix(in srgb, var(--border) 35%, transparent);
    font-weight: 600;
    font-size: 0.75rem;
}
.contact-site-grid-row + .contact-site-grid-row {
    border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.scope-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.scope-readonly {
    font-size: 0.78rem;
    color: var(--accent);
}
.builder-site-group {
    margin-bottom: 0.75rem;
}
.builder-site-group-title {
    font-weight: 600;
    cursor: pointer;
}
.pill-muted {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--border) 30%, var(--card-bg));
    border-color: var(--border);
}
.employer-group-title {
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

/* STE-918: flat searchable contacts directory */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* STE-1314 slice 1: directory chrome. Kit owns table/controls; this is layout + floor. */
#contact-directory-label {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
#contact-directory-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
#contact-directory-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
}
#contact-directory-filters .k-field {
    margin-bottom: 0;
    min-width: 9rem;
    flex: 1 1 9rem;
}
#contact-directory-body {
    min-width: 0;
    overflow-x: clip;
}
#contact-directory-body tbody tr {
    cursor: pointer;
}
#contact-directory-body tr[data-saved] {
    background: color-mix(in srgb, var(--r-ok) 12%, transparent);
    outline: 2px solid color-mix(in srgb, var(--r-ok) 35%, transparent);
}
#contact-directory [hidden] { display: none !important; }
#contact-directory details > summary {
    list-style: none;
    cursor: pointer;
}
#contact-directory details > summary::-webkit-details-marker { display: none; }
.contact-channel-icons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    white-space: nowrap;
    color: var(--text-muted);
}
.contact-channel-icon-token {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
.contact-channel-icon-token svg.channel-svg {
    width: 1em;
    height: 1em;
    display: block;
    color: var(--text-muted);
}
.contact-add-details {
    position: relative;
}
.contact-add-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
    margin-top: 0.35rem;
    min-width: 12rem;
    padding: 0.35rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-radius);
    box-shadow: var(--r-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.contact-add-menu .k-btn {
    width: 100%;
    justify-content: flex-start;
}
/* display:flex on the menu beats UA details-closed hiding (STE-1383). */
.contact-add-details:not([open]) .contact-add-menu {
    display: none;
}
/* `.k-pagehead__actions` is width:100% at ≤640px (kit.css). `right: 0` then
   hangs the 12rem panel off the left edge. */
@media (max-width: 640px) {
    .contact-add-menu {
        left: 0;
        right: auto;
    }
}

.contact-bulk-add {
    max-width: var(--container-max, 1100px);
}
.contact-bulk-add-header {
    margin-bottom: 1rem;
}
.contact-bulk-paste-form textarea {
    width: 100%;
    font-family: var(--font-mono);
}
.contact-bulk-default-assignment {
    margin-bottom: 1rem;
}
.contact-bulk-grid-wrap {
    overflow-x: auto;
}
.contact-bulk-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.contact-bulk-grid th,
.contact-bulk-grid td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.contact-bulk-grid th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.contact-bulk-grid-row-error {
    background: var(--r-attention-bg);
}
.contact-bulk-row-name,
.contact-bulk-row-phone {
    width: 100%;
    min-width: 8rem;
}
.contact-bulk-cadence-check,
.contact-bulk-sms-check {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}
.contact-bulk-status-merge {
    color: var(--accent);
    font-size: 0.85rem;
}
.contact-bulk-status-error {
    color: var(--danger);
    font-size: 0.85rem;
}
.contact-bulk-status-warning {
    color: var(--r-attention);
    font-size: 0.85rem;
}
.contact-bulk-unparseable-list {
    margin: 0.35rem 0 0;
    padding-left: 1.25rem;
}
.contact-bulk-save-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.setup-customers-hub .contact-editor-card .form-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.form-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.form-group-actions { align-self: flex-end; }
.more-fields { margin: 0.35rem 0; font-size: 0.82rem; }
.more-fields summary { cursor: pointer; color: var(--text-muted); }

.site-prompt-settings { margin: 0.75rem 0 0.25rem; }
.site-prompt-settings summary { cursor: pointer; font-size: 0.9rem; }
.site-prompt-settings .site-prompt-hint { font-weight: 400; }
.site-prompt-settings textarea {
    width: 100%;
    min-height: 6rem;
    font-size: 1rem; /* iOS auto-zoom prevention */
    resize: vertical;
}

/* STE-1411: site-direction homeowner panel. Kit island only; no dual-class.
   Do not set display on > summary — that replaces list-item and drops the triangle. */
.site-homeowner-panel { margin: 0.75rem 0 0.25rem; }
.site-homeowner-panel > summary { cursor: pointer; font-size: 0.9rem; }
.site-homeowner-summary { font-weight: 400; }
.site-homeowner-summary.is-muted { color: var(--text-muted); }
.site-homeowner-summary.is-ok { color: var(--r-ok); }
.site-homeowner-summary.is-attention { color: var(--r-attention); }
.site-homeowner-panel .k-shell { margin-top: 0.75rem; padding: 0.25rem 0 0.5rem; }
.site-homeowner-panel a { color: var(--accent); }
.site-homeowner-panel .k-btn {
    min-height: var(--r-tap);
    min-width: var(--r-tap);
}

.setup-customers-hub .ftp-help-line {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.ftp-help-line summary { cursor: pointer; }

.customer-empty-state {
    font-size: 0.88rem;
    padding: 0.5rem 0;
    margin: 0;
}

.delete-confirm-bar,
.portfolio-confirm-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.delete-confirm-text { color: var(--danger); }
.portfolio-status { font-size: 0.8rem; color: var(--text-muted); }
.portfolio-status-ok { color: var(--r-ok); font-weight: 500; }
.portfolio-status-error { color: var(--danger); }

.row-saved-highlight {
    animation: customer-row-highlight 1.2s ease-out;
}
@keyframes customer-row-highlight {
    0% { background: color-mix(in srgb, var(--accent) 25%, transparent); }
    100% { background: transparent; }
}

/* Camera password + PTZ (shared with setup sites) */
.sweep-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}
.sweep-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.sweep-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 18px;
    transition: background 0.2s;
}
.sweep-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.sweep-toggle input:checked + .sweep-slider {
    background: var(--accent);
}
.sweep-toggle input:checked + .sweep-slider::before {
    transform: translateX(16px);
}
.pw-mask {
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}
.camera-pw {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .customer-picker-row {
        flex-direction: column;
        align-items: stretch;
    }
    .contact-sites-tbody {
        grid-template-columns: 1fr;
    }
    .contact-row-main > * { flex: 1 1 100%; }
    .contact-editor-identity {
        grid-template-columns: 1fr;
    }
    .contact-editor-sms {
        align-self: start;
        padding-top: 0;
    }
    #contact-directory-filters {
        flex-direction: column;
    }
    #contact-directory-filters .k-field {
        width: 100%;
        min-width: 0;
    }
    .contact-add-overlay.open {
        padding: 0.75rem 0;
        align-items: stretch;
    }
    .contact-add-dialog {
        width: 100%;
        max-height: none;
        border-radius: 0;
    }
    .contact-bulk-grid thead { display: none; }
    .contact-bulk-grid tr {
        display: block;
        margin-bottom: 0.65rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
    }
    .contact-bulk-grid td {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.25rem;
        border: none;
        padding: 0.2rem 0;
    }
    .contact-bulk-grid td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-muted);
        flex: 0 0 100%;
    }
    .contact-bulk-grid td[data-label=""]::before { display: none; }
}

/* STE-919 / STE-1314 slice 2: contact person page */
.contact-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}
#contact-page-form {
    min-width: 0;
    overflow-x: clip;
}
#contact-page-root [hidden] {
    display: none !important;
}
.contact-page-nav {
    margin-bottom: 0.25rem;
}
.contact-page-subtitle-sep {
    margin: 0 0.35rem;
    color: var(--text-muted);
}
.contact-page-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 1.25rem;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}
.contact-page-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}
.contact-page-dl {
    margin: 0;
}
.contact-page-dl-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.5rem 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
    min-width: 0;
}
.contact-page-dl-row:last-child {
    border-bottom: none;
}
.contact-page-dl dt {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.contact-page-dl dd {
    margin: 0;
    font-size: 0.95rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.contact-page-channel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.contact-page-channel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}
.contact-page-channel-icon {
    flex-shrink: 0;
}
.contact-page-channel-icon svg.channel-svg {
    width: 1.15em;
    height: 1.15em;
    display: block;
    color: var(--text-muted);
}
.contact-page-assignment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.contact-page-assignment-line {
    font-size: 0.95rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.contact-page-assignment-marker {
    color: var(--accent);
    margin-right: 0.25rem;
}
.contact-page-bottom-line-summary {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.contact-page-bottom-line-count {
    font-family: var(--font-mono);
    font-weight: 600;
}
.contact-page-bottom-line-arrow {
    margin: 0 0.35rem;
    color: var(--text-muted);
}
.contact-page-portal-note {
    margin: 0.65rem 0 0;
    font-size: 0.88rem;
}
.contact-page-empty {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}
#contact-page-editor-fields {
    max-width: 560px;
}
#contact-page-form fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 1.1rem;
}
.contact-page-footer-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}
.contact-page-assignment-edit-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}
.contact-page-assignment-edit-line {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}
.contact-page-assignment-edit-label {
    flex: 1;
    min-width: 0;
}
.contact-assignment-picker {
    padding: 0.75rem;
    margin-top: 0.5rem;
}
.contact-assignment-picker-title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
}
.contact-picker-cadence label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
}

.contact-preview-slot {
    margin-top: 1rem;
}

.contact-preview-pane {
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.contact-preview-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.contact-preview-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
}

.contact-preview-note {
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

.contact-preview-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.contact-preview-block:last-of-type {
    border-bottom: none;
}

.contact-preview-block-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.contact-preview-meta {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.contact-preview-site-list,
.contact-preview-body {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.contact-preview-details {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.contact-preview-details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
}

.contact-preview-iframe {
    width: 100%;
    min-height: 320px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.5rem;
    background: #f5f5f5;
}

.contact-preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.contact-test-send-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.contact-test-send-kind {
    flex-shrink: 0;
}

.contact-test-send-status-ok {
    color: var(--r-ok);
}

@media (max-width: 768px) {
    .contact-page-footer-primary {
        flex-direction: column;
        align-items: stretch;
    }
    .contact-preview-iframe {
        min-height: 240px;
    }
}
@media (max-width: 768px) {
    .contact-page-grid {
        grid-template-columns: 1fr;
    }
    .contact-page-dl-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
    #contact-page-editor-fields {
        max-width: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Customer Ops Dashboard (STE-718) — triage-first layout

   Design intent: severity is the only color; chrome is neutral. Freshness
   is a quiet green line when healthy, a loud amber/red banner when
   degraded. Triage hero = today's actionable items. Fleet = 4 tiles +
   contradiction indicator. Customers = issues-first then chronic (hatched),
   healthy folded. Engagement strip is positive-only with a "reader
   unknown" count and a degraded "Unavailable — last good <t>" state.
   ───────────────────────────────────────────────────────────────────── */

/* Local severity palette — kept scoped so the rest of the app is untouched.
   Reds/ambers only; greens are demoted to neutral-positive. */
.cops-root {
    --cops-red: var(--danger);
    --cops-redbg: #fdeceb;
    --cops-amber: #8a5800;
    --cops-amberbg: #fbf3e3;
    --cops-green: #2f9e5f;
    --cops-muted: var(--text-muted);
    --cops-faint: #5C5566;
    --cops-faint-icon: #a7adb8;
    --cops-hair: #f1f2f5;
    --cops-never: #8a2f2f;
    min-width: 0;
    overflow-x: clip;
}
.cops-root .k-tablewrap { min-width: 0; overflow-x: clip; }
.cops-root a.k-tile { text-decoration: none; color: inherit; }
.cops-root .k-tile[aria-current="true"] {
    box-shadow: inset 0 0 0 2px var(--border);
    background: #fafbfc;
}
.cops-root .k-tile[data-cops="online"] .k-tile__num { color: var(--cops-faint); }
.cops-root .k-tile[data-cops="offline"] .k-tile__num { color: var(--cops-amber); }
.cops-root .k-tile[data-cops="dark"] .k-tile__num { color: var(--cops-red); }
.cops-root .k-tile[data-cops="never"] .k-tile__num { color: var(--cops-never); }
.cops-root .k-tile .k-sev[data-cops="online"]::before { background: var(--cops-faint); }
.cops-root .k-tile .k-sev[data-cops="offline"]::before { background: var(--cops-amber); }
.cops-root .k-tile .k-sev[data-cops="dark"]::before { background: var(--cops-red); }
.cops-root .k-tile .k-sev[data-cops="never"]::before { background: var(--cops-never); }
.cops-root .k-table a.k-table__primary { color: inherit; text-decoration: none; }
.cops-root .k-table tr[data-cops="acute"] td:first-child {
    box-shadow: inset 3px 0 0 var(--cops-red);
}
.cops-root .k-table tr[data-cops="chronic"] td:first-child {
    box-shadow: inset 3px 0 0 var(--cops-amber);
}
.cops-root .k-card[data-cops-card="hero"] { border-color: #f1dcda; box-shadow: 0 2px 10px rgba(214,69,63,.07); }
.cops-root .k-card[data-cops-card="muted"] { background: #fbfbfc; border-color: var(--cops-hair); box-shadow: none; }
#cops-rebuild-popover[hidden],
#cops-rebuild-toast[hidden] { display: none !important; }

.cops-refresh-time { font-size: 0.8rem; color: var(--text-muted); }
.cops-loading { font-size: 0.85rem; color: var(--text-muted); display: none; }
.htmx-request .cops-loading,
.cops-loading.htmx-request { display: inline; }

/* ── Freshness header — quiet line when healthy ──────────────────── */
.cops-freshness {
    font-size: 0.8rem; color: var(--text-muted);
    margin: 0.25rem 0 1.25rem; display: flex; align-items: center;
    flex-wrap: wrap; gap: 0.45rem;
}
.cops-freshness strong { color: var(--text); font-weight: 600; }
.cops-fdot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; flex-shrink: 0;
    background: var(--cops-green);
    box-shadow: 0 0 0 3px #e9f6ee;
}
.cops-fdot.is-amber { background: var(--cops-amber); box-shadow: 0 0 0 3px var(--cops-amberbg); }
.cops-fdot.is-red { background: var(--cops-red); box-shadow: 0 0 0 3px var(--cops-redbg); }

/* ── Freshness banner — loud amber/red trust state ───────────────── */
.cops-banner {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem;
    border-radius: 10px; padding: 0.7rem 0.9rem;
    font-size: 0.85rem; margin: 0 0 1.25rem;
}
.cops-banner-icon { flex: 0 0 auto; line-height: 0; }
.cops-banner b { font-weight: 700; }
.cops-banner.is-amber { background: var(--cops-amberbg); border: 1px solid #ecd9ac; color: var(--cops-amber); }
.cops-banner.is-red { background: var(--cops-redbg); border: 1px solid #f1c9c6; color: var(--cops-red); }
.cops-banner .k-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Card shell ──────────────────────────────────────────────────── */
.cops-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.9rem;
    box-shadow: 0 1px 2px rgba(20,24,40,.03);
}
.cops-chead {
    display: flex; align-items: baseline; gap: 0.6rem;
    padding: 0.85rem 1rem 0.55rem;
}
.cops-chead .t {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--text-muted);
}
.cops-chead .n {
    font-size: 0.75rem; color: var(--cops-faint);
    min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere;
}
.cops-filter-clear {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--r-tap); min-width: var(--r-tap);
    color: var(--accent); text-decoration: none; vertical-align: middle;
}
.cops-chead .more { margin-left: auto; font-size: 0.75rem; color: var(--accent); }

.cops-sevbar {
    width: 3px; align-self: stretch; min-height: 34px;
    border-radius: 0 3px 3px 0; flex: 0 0 3px;
    background: var(--border);
}
.cops-sevbar.is-r { background: var(--cops-red); }
.cops-sevbar.is-a { background: var(--cops-amber); }
.cops-sevbar.is-chronic {
    background: repeating-linear-gradient(45deg,#c9a14a,#c9a14a 2px,#e7d3a0 2px,#e7d3a0 4px);
}
.cops-chev { color: var(--cops-faint-icon); flex: 0 0 auto; margin-right: 0.9rem; line-height: 0; }
.cops-triage-empty { padding: 1.1rem 1rem; color: var(--text-muted); font-size: 0.9rem; }

.cops-contradiction {
    margin-top: 0.7rem; font-size: 0.8rem;
    display: flex; align-items: center; gap: 0.45rem;
    color: var(--cops-red);
}
.cops-contradiction .d { width: 9px; height: 9px; border-radius: 2px; background: var(--cops-red); flex: 0 0 9px; }
.cops-coverage-impaired {
    margin-top: 0.7rem; font-size: 0.8rem;
    display: flex; align-items: center; gap: 0.45rem;
    color: var(--cops-amber);
}
.cops-coverage-impaired .d { width: 9px; height: 9px; border-radius: 2px; background: var(--cops-amber); flex: 0 0 9px; }

/* ── Reports & delivery strip ─────────────────────────────────────── */
.cops-rep { display: flex; gap: 0.55rem; padding: 0.65rem 1rem 0.9rem; flex-wrap: wrap; }
.cops-repi {
    font-size: 0.78rem; padding: 0.35rem 0.65rem; border-radius: 8px;
    background: #f6f7f9; color: var(--text-muted);
}
.cops-repi b { color: var(--text); font-weight: 700; }
.cops-repi.is-warn { background: var(--cops-amberbg); color: var(--cops-amber); }
.cops-repi.is-warn b { color: var(--cops-amber); }
.cops-repi .ck { color: var(--cops-green); margin-right: 0.3rem; }
.cops-unavailable {
    padding: 0.85rem 1rem; font-size: 0.82rem; color: var(--cops-amber);
    background: var(--cops-amberbg); margin: 0 1rem 0.9rem; border-radius: 8px;
}

/* ── Customers — issues-first, chronic hatched, healthy folded ───── */
.cops-grp {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--cops-faint); padding: 0.7rem 1rem 0.3rem;
}
.cops-crow {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 0;
    border-top: 1px solid var(--cops-hair);
    text-decoration: none; color: inherit;
    cursor: pointer; list-style: none;
}
/* STE-718 Change B: native <details>/<summary> expand-in-place, no JS. */
.cops-crow::-webkit-details-marker { display: none; }
.cops-cdet > .cops-crow:hover { background: #fafbfc; }
.cops-cdet[open] > .cops-crow { background: #fafbfc; }
.cops-cdet[open] > .cops-crow .cops-chev { transform: rotate(90deg); }
.cops-chev { transition: transform 0.12s ease; }
.cops-cexp { padding: 0.2rem 1rem 0.7rem 1.55rem; background: #fbfbfc; border-top: 1px solid var(--cops-hair); }
.cops-csite { padding: 0.5rem 0; border-top: 1px solid var(--cops-hair); }
.cops-csite:first-child { border-top: none; }
.cops-csite-name { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.cops-csite-cams { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-top: 0.3rem; }
.cops-csite-cam { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; }
.cops-csite-cam .n { color: var(--text); }
.cops-csite-cam .d { color: var(--cops-faint); }
.cops-csite-note { display: block; font-size: 0.74rem; color: var(--cops-faint); margin-top: 0.25rem; font-style: italic; }
.cops-crow:hover { background: #fafbfc; }
.cops-crow .cops-sevbar { align-self: center; min-height: 34px; }
.cops-cname { font-size: 0.9rem; font-weight: 600; flex: 1; margin-left: 0.8rem; min-width: 0; }
.cops-cname small { display: block; font-weight: 400; color: var(--cops-faint); font-size: 0.72rem; margin-top: 1px; }
.cops-cams { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.cops-camct { font-size: 0.72rem; color: var(--cops-faint); white-space: nowrap; }
.cops-pips { display: flex; gap: 3px; flex-wrap: wrap; max-width: 160px; }
.cops-pip { width: 9px; height: 9px; border-radius: 2px; background: var(--cops-green); flex: 0 0 9px; }
.cops-pip.is-offline { background: var(--cops-amber); }
.cops-pip.is-dark { background: var(--cops-red); }
.cops-pip.is-never { background: var(--cops-never); }
.cops-tag {
    font-size: 0.72rem; font-weight: 600; padding: 0.18rem 0.55rem;
    border-radius: 6px; white-space: nowrap;
}
.cops-tag.is-r { background: var(--cops-redbg); color: var(--cops-red); }
.cops-tag.is-a { background: var(--cops-amberbg); color: var(--cops-amber); }
.cops-tag.is-chronic { background: #f3eeda; color: #8a6d22; }
.cops-fold {
    display: flex; align-items: center; padding: 0.8rem 1rem;
    border-top: 1px solid var(--border); color: var(--text-muted);
    font-size: 0.82rem;
}
.cops-fold .c { margin-left: auto; color: var(--cops-faint); }

/* ── Engagement strip — leads with quiet builders (STE-718 Change C) ── */
.cops-eng { padding: 0.65rem 1rem 0.9rem; }
.cops-eng-quiet { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.cops-eng-quiet .l { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-right: 0.15rem; }
.cops-chip { background: #f6f7f9; border-radius: 16px; padding: 0.25rem 0.65rem; font-size: 0.75rem; }
.cops-chip.is-quiet, .cops-chip.is-at_risk { background: var(--cops-amberbg); color: var(--cops-amber); font-weight: 600; }
.cops-chip.is-dormant { background: var(--cops-redbg); color: var(--cops-red); font-weight: 600; }
.cops-chip .a { color: var(--cops-faint); }
.cops-eng-ctx { font-size: 0.72rem; color: var(--cops-faint); margin-top: 0.45rem; }
.cops-eng-none { padding: 0.65rem 1rem 0.9rem; font-size: 0.8rem; color: var(--text-muted); }

.cops-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }

/* STE-1499 — Engagement body (header pagehead already shipped on STE-1314) */
#eng-view-toggle.r-seg button,
#eng-window-seg.r-seg button {
    min-width: var(--r-tap);
    min-height: var(--r-tap);
}
#eng-view-toggle.r-seg button[aria-pressed="true"],
#eng-window-seg.r-seg button[aria-pressed="true"] {
    background: var(--card-bg);
    box-shadow: var(--r-shadow);
}
#eng-body .cops-crow { min-height: var(--r-tap); }
#eng-body .k-tile { cursor: default; }
#eng-body .k-tile[data-eng="engaged"] .k-tile__num { color: var(--cops-green); }
#eng-body .k-tile[data-eng="quiet"] .k-tile__num { color: var(--cops-amber); }
#eng-body .k-tile[data-eng="unknown"] .k-tile__num { color: var(--text-muted); }
#eng-body .k-tile .k-hint { color: var(--cops-faint); margin: 0.15rem 0 0; }
#eng-body .k-pill[data-eng="engaged"] { background: #e9f6ee; color: var(--cops-green); }
#eng-body .k-pill[data-eng="at_risk"] { background: var(--cops-amberbg); color: var(--cops-amber); }
#eng-body .k-pill[data-eng="dormant"] { background: var(--cops-redbg); color: var(--cops-red); }
#eng-body .k-pill[data-eng="unknown"] { background: #eef1f5; color: #5b6470; }
#eng-body [data-eng-contact] {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0; border-top: 1px solid var(--cops-hair);
}
#eng-body [data-eng-contact]:first-child { border-top: none; }
#eng-body [data-eng-badges] { display: flex; gap: 0.3rem; flex-wrap: wrap; }
#eng-body [data-eng-tl] {
    margin: 0.2rem 0 0.5rem 0.6rem;
    border-left: 2px solid var(--border);
    padding: 0.15rem 0 0.15rem 0.75rem;
    color: var(--text-muted); font-size: 0.78rem;
}
#eng-body [data-eng-tl] div { padding: 0.15rem 0; }
#eng-body .cops-crow .cops-cname,
#eng-body [data-eng-contact] > .cops-cname {
    flex: 1 1 12rem;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}
#eng-body .cops-crow .cops-cname { margin-left: 1rem; }
#eng-body [data-eng-contact] > .cops-cname { margin-left: 0; }
#eng-body .cops-crow .k-hint { margin: 0; }
@media (max-width: 768px) {
    #eng-body .cops-crow,
    #eng-body [data-eng-contact] { flex-wrap: wrap; }
    #eng-body .cops-crow .cops-cname,
    #eng-body [data-eng-contact] > .cops-cname { flex: 1 1 100%; }
    #eng-body .cops-crow .k-hint { flex: 1 1 100%; }
}

/* ── Rebuild confirm popover ─────────────────────────────────────── */
.cops-popover {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 6px 20px rgba(20,24,40,.14);
    padding: 0.85rem; width: 240px; font-size: 0.82rem;
}
.cops-popover[hidden] { display: none; }
.cops-popover p { margin: 0 0 0.6rem; color: var(--text); }
.cops-popover-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

@media (max-width: 600px) {
    .cops-pips { display: none; }
    .cops-popover { width: 220px; }
}

/* STE-659 — Image lightbox overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overscroll-behavior: contain;
}
.lightbox-overlay.is-open { display: flex; }

.lightbox-stage {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 120ms ease-in;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    background: #111;
}
.lightbox-img.is-loaded { opacity: 1; }

.lightbox-spinner {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    display: none;
}
.lightbox-spinner.is-loading {
    display: block;
    animation: lightbox-spin 0.8s linear infinite;
}
@keyframes lightbox-spin {
    to { transform: rotate(360deg); }
}

.lightbox-caption-row {
    width: 100%;
    max-width: 1100px;
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #fff;
    font-size: 0.9rem;
}
.lightbox-caption {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lightbox-counter {
    flex: 0 0 auto;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

.lightbox-close,
.lightbox-nav-btn {
    position: absolute;
    /* Stage/image are siblings later in DOM order — explicit z-index keeps
       nav buttons tappable on phones where the image fills the stage edge to edge. */
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: inherit;
    transition: background-color 120ms ease;
}
.lightbox-close:hover,
.lightbox-nav-btn:hover {
    background: rgba(108, 43, 217, 0.85);
}
.lightbox-close:focus-visible,
.lightbox-nav-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
    width: var(--r-tap);
    height: var(--r-tap);
    font-size: 1.75rem;
}
.lightbox-nav-btn {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    font-size: 2.25rem;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.image-grid a { cursor: zoom-in; }

@media (max-width: 768px) {
    .portfolio-header-top { flex-direction: column; align-items: stretch; }
    .portfolio-header .r-seg { align-self: flex-start; }
    .lightbox-nav-btn {
        width: var(--r-tap);
        height: var(--r-tap);
        font-size: 1.75rem;
    }
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
    .lightbox-close { top: 0.5rem; right: 0.5rem; }
    .lightbox-img { max-height: 78vh; }
}

/* STE-800: digest back-navigation on report pages */
.digest-back-link { margin: 0 0 12px; font-size: 0.9rem; }
.digest-back-link a { color: var(--accent); text-decoration: none; font-weight: 500; }
.digest-back-link a:hover { text-decoration: underline; }

/* STE-865: Ask chat panel */
.ask-scope-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
    margin-bottom: 1.25rem; font-size: .95rem;
}
.ask-scope-pill {
    display: inline-block; padding: .15rem .7rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
    font-weight: 600; font-size: .85rem; color: var(--text);
}
.ask-scope-uncovered { color: var(--text-muted); font-size: .9rem; }
.ask-admin-scope-form,
.ask-client-scope-form {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.ask-scope-select {
    /* Width only — chrome comes from .k-select (1rem / 48px floors). */
    width: auto;
    min-width: 9rem;
    margin-bottom: 0;
    max-width: 16rem;
}
.ask-scope-select:disabled {
    opacity: .55; cursor: not-allowed;
}
.ask-messages { max-height: 55vh; overflow-y: auto; padding-right: .25rem; }

/* Conversation turns — clear sender distinction, de-emphasized question */
.ask-turn { margin-bottom: 1.5rem; }
.ask-turn:last-child { margin-bottom: 0; }
.ask-sender {
    font-size: .68rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; margin-bottom: .25rem;
}
.ask-q { margin-bottom: .6rem; }
.ask-q .ask-sender { color: var(--text-muted); }
.ask-q-text { color: var(--text-muted); font-size: .95rem; }
.ask-a .ask-sender { color: var(--accent); }
.ask-a-body {
    background: var(--bg); border-radius: 10px; padding: .8rem 1rem;
    line-height: 1.5;
}
.ask-a-body.ask-refused {
    background: var(--r-attention-bg); border-left: 3px solid var(--r-attention);
    color: var(--r-attention);
}
/* Optimistic "thinking" bubble shown the moment a question is submitted */
.ask-a-body.ask-thinking { color: var(--text-muted); animation: ask-pulse 1.2s ease-in-out infinite; }
@keyframes ask-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.ask-citations { font-size: .85rem; color: var(--text-muted); margin: .6rem 0 0; padding-left: 1.1rem; }
.ask-citations li { margin: .15rem 0; }
.ask-citations a { color: var(--accent); text-decoration: none; }
.ask-citations a:hover { text-decoration: underline; }
/* STE-1774: coverage line (no-image days, houses not read) sits with the sources, not in the answer */
.ask-coverage { font-size: .85rem; color: var(--text-muted); margin: .4rem 0 0; }

/* Empty state — inviting, on-brand, not an alert box */
.ask-examples { margin-top: 1rem; }

/* STE-911: follow-up chips rendered under an answered turn */
.ask-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .75rem;
    padding-top: .6rem;
    border-top: 1px solid var(--border);
}
.ask-chip {
    display: inline-flex;
    align-items: center;
    padding: .25rem .75rem;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .82rem;
    color: var(--accent);
    cursor: pointer;
    line-height: 1.4;
    font-family: var(--font-body);
    transition: background .15s, border-color .15s;
}
.ask-chip:hover {
    background: var(--accent-tint);
    border-color: var(--accent-soft);
}

/* STE-911: honest-empty answer styling — subdued, not a refusal */
.ask-a-body.ask-empty-answer {
    border-left: 3px solid var(--border);
    color: var(--text-muted);
    font-style: italic;
}

.ask-unavailable { margin-top: 1rem; }
.ask-form { display: flex; gap: .5rem; margin-top: 1.25rem; align-items: center; }
.ask-form .k-input,
.ask-input { flex: 1; }
/* Disable the submit affordance while a question is in flight */
.ask-form.htmx-request button { opacity: .6; pointer-events: none; }
@media (max-width: 640px) {
    .ask-input { font-size: 1rem; }
    /* STE-1389: empty state must not own a nested scroller. The 65vh
       bump buried the composer under nav + title + four full-width
       sample buttons; touch in the center only scrolled the examples. */
    .ask-messages:has(.ask-empty-state) {
        max-height: none;
        overflow: visible;
    }
    .ask-messages:has(.ask-empty-state) + .ask-new-chat-bar { display: none; }
    .ask-empty-state { padding: 1.25rem 1rem; }
    .ask-example:nth-child(n+3) { display: none; }
    .ask-form {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
        background: var(--card-bg);
    }
    .ask-a-body { overflow-x: auto; }
    .ask-citations { word-break: break-word; }
    .ask-chips { gap: .25rem; }
    /* STE-1774: the chip is on every answer now; gloves-on tap height */
    .ask-chip { min-height: var(--r-tap); padding: .5rem 1rem; }
}
/* STE-910: markdown table/list/code rendering inside ask answer bubbles */
.ask-a-body table {
    border-collapse: collapse;
    width: 100%;
    font-size: .9rem;
    margin: .6rem 0;
}
.ask-a-body th,
.ask-a-body td {
    border: 1px solid var(--border);
    padding: .35rem .65rem;
    text-align: left;
    vertical-align: top;
}
.ask-a-body th {
    background: var(--bg-muted);
    font-weight: 600;
    color: var(--text);
}
.ask-a-body tr:nth-child(even) td { background: var(--bg-muted); }
.ask-a-body ul,
.ask-a-body ol {
    margin: .4rem 0 .4rem 1.2rem;
    padding: 0;
}
.ask-a-body li { margin: .2rem 0; }
.ask-a-body code {
    font-family: var(--font-mono);
    font-size: .85em;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: .1em .35em;
}
.ask-a-body p { margin: .3rem 0; }
.ask-a-body p:first-child { margin-top: 0; }
.ask-a-body p:last-child { margin-bottom: 0; }
.ask-new-chat-bar { display: flex; justify-content: flex-end; margin-bottom: .5rem; }

.contact-resolution-hint {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
}
.contact-page-resolution-allowed {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}

/* ============================================================
   STE-1223 — Attractful daily-report components
   Declarations matched from docs/handoffs/attractful-2026-08-18/report.css.
   Unused until the report surface applies the .r-* classes (commit C).
   Photo / calendar / drawer / lightbox stay with STE-1305 / STE-1306.
   Bare element rules are scoped under .r-report so they cannot restyle
   the live app. .visually-hidden is not carried over — use ours.
   ============================================================ */

.r-report {
  line-height: 1.55;          /* type size inherits body 1.0625rem (STE-1325 / D1) */
}
.r-report [hidden] { display: none !important; }

.r-report p { margin: 0 0 .75rem; }
.r-report p:last-child { margin-bottom: 0; }
.r-report ul:not(.r-log):not(.report-answer-rows),
.r-report ol { padding-left: 1.1rem; margin: 0 0 .75rem; }
.r-report ul:not(.r-log):not(.report-answer-rows) li,
.r-report ol li { margin: 0 0 .55rem; }
.r-report a { color: var(--accent); }
.r-report a.r-alert,
.r-report a.r-alert:hover { color: inherit; text-decoration: none; }
.r-report button { cursor: pointer; font-family: inherit; font-size: inherit; }
.r-report :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.r-wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--r-gutter); }
.r-icon { width: 17px; height: 17px; flex: 0 0 auto; }

/* 2A took font-size; chrome follows Joe's 1.55. Body stays 1.5. */
.r-header, .r-jump, .r-rail, .r-side, .r-cal { line-height: 1.55; }
.r-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--r-nav-bg); color: var(--text);
  border-bottom: 1px solid var(--border);
  height: var(--r-header-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 var(--r-gutter);
}
.r-logo {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  min-height: 44px;
  text-decoration: none;
}
.r-logo__mark { height: 19px; width: auto; display: block; }
.r-header__site {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500;
  color: var(--text); letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.r-header__date {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500;
  letter-spacing: .02em; color: var(--text-muted); white-space: nowrap;
}
.r-header__sep { color: #B9B3C6; font-size: 1.05rem; line-height: 1; }
.r-header__spacer { flex: 1; }

@media (max-width: 699px) {
  .r-header__site { flex: 1 1 auto; min-width: 0; text-align: center; }
  .r-header__spacer { display: none; }
  .r-header { gap: 8px; }
  .r-live__word { display: none; }
  .r-header__date, .r-header__sep { display: none; }
}
@media (min-width: 700px) {
  .r-logo { margin-right: .35rem; }
  .r-logo__mark { height: 23px; }
}

.r-live {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--bg-muted); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .5rem .85rem; font: inherit; font-size: .8rem; font-weight: 600;
  line-height: normal;
  min-height: var(--r-tap); white-space: nowrap;
}
.r-live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--r-live); }
.r-live--now .r-live__dot { animation: r-pulse 2s ease-out infinite; }
.r-live--past { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
.r-live--past .r-live__dot { background: #C9C3D4; animation: none; }
@keyframes r-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,77,77,.65); }
  70%  { box-shadow: 0 0 0 7px rgba(255,77,77,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); }
}

.r-jump {
  position: sticky; top: calc(var(--r-header-h) + var(--r-rail-h)); z-index: 38;
  display: flex; gap: .4rem; align-items: center;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 0 var(--r-gutter); height: var(--r-jump-h);
  min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-shadow: none;
  transition: box-shadow .3s var(--r-ease), height var(--r-mid) var(--r-ease),
              padding var(--r-fast) var(--r-ease), border-width var(--r-fast) var(--r-ease);
}
.r-jump::-webkit-scrollbar { display: none; }
body[data-scrolled] .r-jump { box-shadow: 0 6px 20px -8px rgba(38,39,43,.18); }
.r-jump a {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .85rem; min-height: var(--r-tap);
  border-radius: 999px; background: var(--bg-muted); color: var(--text);
  text-decoration: none; font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.r-jump a[aria-current="location"] { background: var(--accent); color: #fff; }
.r-jump .r-icon { display: none; }

.r-rail {
  position: sticky; top: var(--r-header-h); z-index: 39;
  background: var(--bg); border-bottom: 1px solid var(--border);
  height: var(--r-rail-h);
  display: flex; align-items: center; gap: .35rem;
  padding: 0 var(--r-gutter);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.r-rail::-webkit-scrollbar { display: none; }
.r-day {
  flex: 0 0 auto; position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 54px; min-height: 52px; padding: .25rem .55rem 14px;
  border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text-muted);
  font-size: .72rem; line-height: 1.2; text-decoration: none;
}
.r-day b { font-size: .95rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.r-day[aria-current="date"] { background: var(--accent); border-color: var(--accent); }
.r-day[aria-current="date"], .r-day[aria-current="date"] b { color: #fff; }
.r-day[data-flag]::after {
  content: ""; position: absolute; bottom: 4px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--r-attention);
}
.r-day[aria-current="date"][data-flag]::after { background: #fff; }
.r-day--generating, .r-day--offline { opacity: .55; }
.r-rail__more {
  flex: 0 0 auto; margin-left: auto; padding-left: .75rem;
  background: none; border: none; color: var(--accent);
  font-family: inherit; font-size: .82rem; font-weight: 600; min-height: var(--r-tap); white-space: nowrap;
}

.container:has(> .r-page) { max-width: none; padding: 0; margin: 0; }
.r-page { width: 100%; }

/* STE-1433: Attractful sticky chrome assumes a full-bleed page. Nested in
   #report-panel it is column-sized and pins to the viewport, so scroll
   detaches a partial-width bar over the admin shell. Calendar overlay
   (data-sheet) stays position:fixed. Customer / full-page keep sticky. */
#report-panel .r-header,
#report-panel .r-rail,
#report-panel .r-jump,
#report-panel .r-side:not([data-sheet]) {
  position: relative;
  top: auto;
}

.r-long { display: none; }
.r-short { display: inline; }
@media (min-width: 700px) {
  .r-long { display: inline; }
  .r-short { display: none; }
}
@media (max-width: 699px) { .r-disclose__note--desc { display: none; } }

.r-tick { width: 15px; height: 15px; flex: 0 0 auto; color: var(--r-ok); }

.r-stack { display: grid; gap: .8rem; padding: 1rem 0 2rem; }
.r-stack > * { min-width: 0; }
.r-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--r-radius); box-shadow: var(--r-shadow); padding: 1.1rem;
}
.summary-modal .r-head,
.r-report .r-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; margin-bottom: .85rem; }
/* (0,2,1) beats .report-section-label Inter 700 at (0,1,0) — #373's twin. */
.summary-modal .r-head h2,
.r-report .r-head h2,
.r-photos .r-head h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.15rem; line-height: 1.55; margin: 0;
  text-transform: uppercase; letter-spacing: .06em;
}
.r-head__count { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.r-item { display: flex; gap: .75rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.r-item:first-of-type { border-top: none; padding-top: 0; }
.r-status {
  flex: 0 0 auto; align-self: flex-start; margin-top: .2rem;
  display: inline-flex; align-items: center;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .45rem; border-radius: 5px; white-space: nowrap;
}
.r-status--check { background: var(--r-attention-bg); color: var(--r-attention); }
.r-status--spacer { visibility: hidden; }
.r-status--ok { background: var(--r-ok-bg); color: var(--r-ok); }
/* D2: red is a row-level badge, never a tile-level state. */
.r-status--stop {
  background: color-mix(in srgb, var(--danger) 14%, var(--card-bg));
  color: var(--danger);
}
.r-item__title { font-weight: 600; margin-bottom: .1rem; }
.r-item__detail { color: var(--text-muted); font-size: .93rem; }

.r-time {
  font-family: var(--font-mono); font-size: .85em; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid var(--accent-soft);
  white-space: nowrap; padding: .35rem 0; margin: -.35rem 0;
}

.r-alert {
  display: flex; align-items: center; gap: .9rem;
  background: var(--r-attention-bg); border: 1px solid var(--r-attention-line);
  border-radius: var(--r-radius); padding: .95rem 1.1rem;
  text-decoration: none; color: inherit;
}
.r-alert__label {
  font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--r-attention); margin-bottom: .15rem;
}
.r-alert__value {
  font-family: var(--font-display); font-size: 2.3rem; line-height: 1;
  color: var(--r-attention); font-variant-numeric: tabular-nums;
}
.r-alert__sub { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.r-alert__go { margin-left: auto; color: var(--r-attention); font-size: 1.4rem; line-height: 1; }
.r-alert--clear { background: var(--r-ok-bg); border-color: #BFE3CD; }

/* STE-1614 view title. Deliberately not .r-header, which is the sticky 56px
   chrome bar built around .r-logo and would clip a heading. */
.r-view-head { padding: 1.25rem 0 .25rem; }
.r-view-head h1 { margin: 0 0 .25rem; font-size: 1.5rem; line-height: 1.25; }

.r-view-head__span { color: var(--text-muted); font-size: .93rem; margin: 0; }

/* STE-1614 record hierarchy. Everything under a view title used to be one muted
   detail class, so a date, a house name, an observation and a disposition all
   weighed the same and ran together on one line at 390px. Four levels now: the
   date heads the day, the house heads the row, the observation is the content,
   and anything about the record rather than the site sits under it. */
.r-entry__date {
  margin: 0 0 .35rem; font-size: 1rem; line-height: 1.3; font-weight: 600;
  color: var(--text);
}
.r-entry__house {
  display: block; margin: 0 0 .15rem;
  font-size: .95rem; font-weight: 600; color: var(--text);
}
a.r-entry__house { color: var(--accent); text-decoration: none; }
.r-entry__line { margin: 0 0 .25rem; color: var(--text); font-size: .97rem; }
.r-entry__meta { margin: 0; color: var(--text-muted); font-size: .88rem; }
/* Who handled it and when, on its own line: "4:12 PM Marked handled by Frank
   Reda" ran together as one sentence. */
.r-entry__disposition { display: inline-block; margin-top: .1rem; }
.r-entry__meta [data-frame] + .r-entry__disposition::before {
  content: "\00b7"; margin: 0 .35rem; color: var(--border);
}

/* The coverage sentence, the standing note and the house list are facts about the
   record, not the record. They sit here so the observations lead the page. */
.r-view-foot {
  margin: 1.75rem 0 0; padding: .9rem 0 0; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .88rem;
}
.r-view-foot p { margin: 0 0 .35rem; }
.r-view-foot p:last-child { margin-bottom: 0; }

/* STE-1614 view switcher. Wraps rather than scrolls, so every view stays
   reachable with one thumb at 390px. */
.r-switcher { margin: .75rem 0 1.25rem; }
.r-switcher ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.r-switcher a, .r-switcher__current {
  display: inline-block; padding: .5rem .85rem;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: .9rem; line-height: 1.2; text-decoration: none;
  min-height: 44px; box-sizing: border-box;
}
.r-switcher a { color: var(--text); }
.r-switcher a:hover { border-color: var(--accent-soft); }
/* Navigation state, not status. --r-ok-bg is the All clear colour, and reading
   it as "this page is fine" is exactly wrong on a page that lists open items, so
   the current chip takes the brand's own neutral tint instead. */
.r-switcher__current {
  background: var(--accent-tint); border-color: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}
.r-alert--clear .r-alert__label, .r-alert--clear .r-alert__value, .r-alert--clear .r-alert__go { color: var(--r-ok); }

/* STE-1619 security and site integrity view. A dated record, most recent first;
   each entry is one day and reads positively when the night was quiet. */
.r-security { list-style: none; margin: 1rem 0 0; padding: 0; }
.r-security li { padding: .9rem 0; border-top: 1px solid var(--border); }
.r-security li:first-child { border-top: none; padding-top: 0; }
.r-security__sites { list-style: none; margin: .4rem 0 0; padding: 0; }
.r-security__sites li { padding: .5rem 0 0; border-top: none; }
.r-security__sites [data-entry-site] { font-weight: 600; }

/* STE-1620 safety and compliance record. A dated record, most recent first;
   each entry is one day and lists the acts flagged that day with the human
   disposition, or reads as coverage when the day was quiet. */
.r-safety { list-style: none; margin: 1rem 0 0; padding: 0; }
.r-safety li { padding: .9rem 0; border-top: 1px solid var(--border); }
.r-safety li:first-child { border-top: none; padding-top: 0; }
.r-safety__acts { list-style: none; margin: .4rem 0 0; padding: 0; }
.r-safety__acts li { padding: .4rem 0; border-top: none; }

/* STE-1621 across my sites. A portfolio trend across a range, grouped by
   builder; each site drills in to its latest report and reads as covered when
   nothing is open. Deliberately plain, no alert colours. */
.r-across { margin: 1.25rem 0 0; }
.r-across__builder { margin: 0 0 .35rem; font-size: 1.05rem; }
.r-across__sites { list-style: none; margin: .5rem 0 0; padding: 0; }
.r-across__sites li { padding: .9rem 0; border-top: 1px solid var(--border); }
.r-across__sites li:first-child { border-top: none; padding-top: 0; }
.r-across__trend, .r-across__exceptions { list-style: none; margin: .4rem 0 0; padding: 0; }
.r-across__trend li, .r-across__exceptions li { padding: .3rem 0; border-top: none; }
/* A count per period is context for the items above it, so it reads lighter than
   them. It used to inherit full-weight body text and outweigh a critical item. */
.r-across__trend li { color: var(--text-muted); font-size: .88rem; }

/* STE-1720 My scope. One entry per site-day; under it the trade's crew, work,
   materials and trucks, each row linking into the day's report at its time.
   Other trades fold under the day, collapsed, so a miss stays visible. */
.r-trade__days { list-style: none; margin: 1rem 0 0; padding: 0; }
.r-trade__days > li { padding: .9rem 0; border-top: 1px solid var(--border); }
.r-trade__days > li:first-child { border-top: none; padding-top: 0; }
.r-trade__head {
  margin: .85rem 0 .3rem; font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.r-trade__items { list-style: none; margin: .25rem 0 0; padding: 0; }
.r-trade__items li { padding: .35rem 0; }
.r-trade__items a { color: var(--accent); }
.r-trade__other { margin: .75rem 0 0; }
.r-trade__other summary { cursor: pointer; min-height: var(--r-tap); display: flex; align-items: center; }
.r-trade__collapsed { margin: .5rem 0 0; }
.r-trade__collapsed summary { cursor: pointer; min-height: var(--r-tap); display: flex; align-items: center; }
.r-view-foot__fold summary { cursor: pointer; min-height: var(--r-tap); display: flex; align-items: center; }
.r-trade__not-visible { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--text-muted); font-size: .88rem; }

.r-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 360px) { .r-facts { grid-template-columns: 1fr; } }
.r-fact { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-radius); padding: .8rem .9rem; box-shadow: var(--r-shadow); }
.r-fact__label { font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.r-fact__value { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.1; margin-top: .3rem; }
.r-fact__sub { font-size: .78rem; color: var(--text-muted); }

.r-disclose { border-top: 1px solid var(--border); }
.r-disclose:last-child { border-bottom: none; }
.r-disclose__btn {
  width: 100%; display: flex; align-items: center; gap: .75rem;
  background: none; border: none; padding: .9rem .25rem;
  font-size: 16px; font-weight: 600; color: var(--text); text-align: left; min-height: var(--r-tap);
}
.r-report .r-disclose__btn { font-size: 16px; }
@media (max-width: 699px) {
  .r-report .r-disclose__btn { font-size: 18px; }
}
.r-disclose__btn::after {
  content: ""; margin-left: auto; flex: 0 0 auto;
  width: 9px; height: 9px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s ease;
}
.r-disclose__btn[aria-expanded="true"]::after,
.r-disclose[open] .r-disclose__btn::after { transform: rotate(-135deg) translate(-2px, -2px); }
.r-item__body { min-width: 0; flex: 1; }
.r-item > :not(.r-status) { min-width: 0; flex: 1; }
.r-disclose__note { font-size: .8rem; font-weight: 400; color: var(--text-muted); }
.r-disclose__note { min-height: 0; }
@media (min-width: 700px) {
  .r-disclose__note { min-height: auto; }
}
.r-disclose__panel { padding: 0 .25rem 1rem; }
.r-disclose__panel[hidden] { display: none; }
.r-disclose__panel ul { margin: 0 0 .75rem; padding-left: 1.1rem; }
.r-disclose__panel li { margin-bottom: .4rem; }
.r-disclose__panel h3 {
  font-size: .76rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); margin: 1rem 0 .4rem;
}

.r-log { list-style: none; margin: 0; padding: 0; }
.r-log li { display: flex; gap: .75rem; padding: .5rem 0; border-top: 1px dashed var(--border); }
.r-log li:first-child { border-top: none; }
.r-log time { flex: 0 0 5.4rem; font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); padding-top: .12rem; }

.r-seg {
  position: relative; display: inline-flex;
  background: var(--bg-muted); border-radius: 999px; padding: 3px; gap: 2px;
}
.r-seg__pill {
  position: absolute; top: 3px; bottom: 3px; left: 0;
  border-radius: 999px; background: var(--card-bg); box-shadow: var(--r-shadow);
  transform: translateX(0); width: 0;
  transition: transform var(--r-mid) var(--r-ease), width var(--r-mid) var(--r-ease);
  pointer-events: none;
}
.r-seg__pill[data-first] { transition: none; }
.r-seg button,
.r-seg a {
  position: relative; z-index: 1;
  border: none; background: none; border-radius: 999px;
  padding: .4rem .9rem; min-height: var(--r-tap);
  font-family: inherit; font-size: .82rem; font-weight: 600; color: var(--text-muted);
  transition: color var(--r-fast) var(--r-ease);
  display: inline-flex; align-items: center; text-decoration: none;
}
.r-seg button[aria-pressed="true"] { color: var(--text); }
.r-seg a[aria-current="true"] {
  color: var(--text);
  background: var(--card-bg);
  box-shadow: var(--r-shadow);
}

/* STE-1306 — Attractful photo surfaces (report.css:397–484, 614–664, 740–741).
   Per-frame aspect: camera 16/9, interior 4/3. Lightbox keeps contain. */
.r-photos .r-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; margin-bottom: .85rem;
}
.r-photos, .r-drawer, .r-lb { line-height: 1.55; }
.r-photos [hidden], .r-drawer [hidden], .r-lb [hidden] { display: none !important; }
#s-photos { scroll-margin-top: var(--r-stick); }
.r-scrub__btn, .r-allphotos, .r-frame, .r-drawer__close, .r-lb__close, .r-lb__nav {
  font-family: inherit; font-size: inherit;
}

.r-scrub__stage { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--bg-muted); }
.r-scrub__stage[data-ratio="16-9"] { aspect-ratio: 16/9; }
.r-scrub__stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.r-watermark {
  position: absolute; right: .6rem; bottom: .55rem;
  height: 13px; width: auto;
  --scrx-word: #fff; --scrx-crx: #fff;
  opacity: .55;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.55));
  pointer-events: none;
}
.r-lb__stage .r-watermark { height: 16px; right: .8rem; bottom: .8rem; }
.r-scrub__stamp {
  position: absolute; left: .55rem; bottom: .55rem;
  background: rgba(20,18,28,.8); color: #fff;
  font-family: var(--font-mono); font-size: .78rem; padding: .2rem .5rem; border-radius: 5px;
}
.r-scrub__flag {
  position: absolute; right: .55rem; top: .55rem;
  background: var(--r-attention); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .2rem .45rem; border-radius: 5px;
}
.r-scrub__controls { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }
.r-scrub__btn {
  flex: 0 0 auto; width: var(--r-tap); height: var(--r-tap);
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  font-size: 1.1rem; color: var(--text); display: grid; place-items: center;
}
.r-scrub__range { flex: 1; min-width: 0; }
.r-scrub__input { width: 100%; height: var(--r-tap); accent-color: var(--accent); }
.r-scrub__ticks { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .66rem; color: var(--text-muted); margin-top: -.4rem; }
.r-scrub__meta { margin-top: .5rem; font-size: .88rem; color: var(--text-muted); min-height: 2.6em; }

.r-frames { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.r-frame { position: relative; display: block; border: none; padding: 0; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--bg-muted); cursor: zoom-in; }
.r-frame[data-ratio="16-9"] { aspect-ratio: 16/9; }
.r-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.r-frame__time { position: absolute; left: .4rem; bottom: .4rem; background: rgba(20,18,28,.8); color: #fff; font-family: var(--font-mono); font-size: .66rem; padding: .15rem .4rem; border-radius: 4px; }
.r-frame__tag { position: absolute; right: .4rem; top: .4rem; background: var(--accent); color: #fff; font-size: .63rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .15rem .4rem; border-radius: 4px; }
.r-frame__tag--flag { background: var(--r-attention); }

.r-allphotos {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; margin-top: .7rem; min-height: var(--r-tap);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--accent); font-weight: 600;
}

.r-drawer {
  position: fixed; inset: 0; z-index: 60;
  visibility: hidden;
  transition: visibility 0s linear .24s;
}
.r-drawer[open] { visibility: visible; transition-delay: 0s; }
.r-drawer__scrim {
  position: absolute; inset: 0; background: rgba(20,18,28,.45); cursor: pointer;
  opacity: 0; transition: opacity .2s ease;
}
.r-drawer[open] .r-drawer__scrim { opacity: 1; }
.r-drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(560px, 92vw); background: var(--bg);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px -16px rgba(20,18,28,.4);
  transform: translateX(100%);
  transition: transform var(--r-mid) var(--r-ease);
}
.r-drawer[open] .r-drawer__panel { transform: none; }
/* STE-1533: the closed drawer is only translated off-screen, so Chrome's
   lazy-load margin (up to 2500px on slow links) still fetched every hour's
   thumbnails at page open — 71 requests before a single tap. Skip rendering
   the body until the drawer opens; [open] restores it, so #ts- deep links
   (which open the drawer first) and scroll-driven lazy loading are unchanged. */
.r-drawer:not([open]) .r-drawer__body { content-visibility: hidden; }
.r-drawer__head { display: flex; align-items: center; gap: .75rem; padding: .6rem var(--r-gutter); background: var(--card-bg); border-bottom: 1px solid var(--border); }
.r-drawer__title { font-family: var(--font-display); font-size: 1rem; font-weight: 500; }
.r-drawer__close { margin-left: auto; background: none; border: none; font-size: 1.5rem; line-height: 1; color: var(--text-muted); padding: 0 .5rem; min-height: var(--r-tap); }
.r-drawer__body { flex: 1; overflow-y: auto; padding: 0 var(--r-gutter) 1.5rem; -webkit-overflow-scrolling: touch; }
.r-hour { margin-top: 1.1rem; }
.r-hour__label { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: .4rem 0; font-family: var(--font-mono); font-size: .74rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.r-hour__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: .4rem; }
/* STE-1623: 4px left a straight gutter cross on a ~106px phone tile.
   12px is the report radius and opens that crossing. Gap stays 3px. */
.r-hour__grid a { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--bg-muted); display: block; color: var(--accent); }
.r-hour__grid a[data-ratio="16-9"] { aspect-ratio: 16/9; }
.r-hour__grid a[id] { scroll-margin-top: var(--r-stick); }
.r-hour__grid a[data-flag] { outline: 2px solid var(--r-attention); outline-offset: -2px; }
.r-hour__grid a[data-flag]::after {
  content: "!"; position: absolute; top: 3px; right: 3px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--r-attention); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 15px; text-align: center;
}
.r-hour__label b { color: var(--r-attention); font-weight: 700; }
.r-hour__grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

.r-lb {
  position: fixed; inset: 0; z-index: 70;
  visibility: hidden; opacity: 0;
  transition: opacity var(--r-fast) var(--r-ease), visibility 0s linear var(--r-fast);
  display: flex; align-items: center; justify-content: center;
  padding: var(--r-gutter);
}
.r-lb[open] { visibility: visible; opacity: 1; transition-delay: 0s; }
.r-lb__scrim { position: absolute; inset: 0; background: rgba(20,18,28,.72); cursor: pointer; }
.r-lb__panel {
  position: relative; z-index: 1;
  width: min(880px, 100%); max-height: 100%;
  background: var(--card-bg); border-radius: var(--r-radius);
  box-shadow: 0 24px 60px -24px rgba(20,18,28,.6);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.96); transition: transform var(--r-mid) var(--r-ease);
}
.r-lb[open] .r-lb__panel { transform: none; }
.r-lb__head { display: flex; align-items: center; gap: .75rem; padding: .55rem .5rem .55rem 1rem; border-bottom: 1px solid var(--border); }
.r-lb__count { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); }
.r-lb__close { margin-left: auto; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--text-muted); padding: 0 .6rem; min-height: var(--r-tap); }
.r-lb__stage { position: relative; background: #17151F; min-height: 62vh; }
.r-lb__stage img { width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.r-lb__stage .lightbox-spinner { top: 50%; left: 50%; z-index: 1; margin: -18px 0 0 -18px; }
.r-lb__stamp {
  position: absolute; left: .6rem; bottom: .6rem;
  background: rgba(20,18,28,.8); color: #fff;
  font-family: var(--font-mono); font-size: .8rem; padding: .2rem .5rem; border-radius: 5px;
}
.r-lb__flag {
  position: absolute; right: .6rem; top: .6rem;
  background: var(--r-attention); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .2rem .45rem; border-radius: 5px;
}
.r-lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: var(--r-tap); height: var(--r-tap);
  display: grid; place-items: center;
  background: rgba(20,18,28,.6); color: #fff;
  border: none; border-radius: 999px; font-size: 1.3rem;
}
.r-lb__nav:disabled { opacity: .3; }
.r-lb__nav--prev { left: .6rem; }
.r-lb__nav--next { right: .6rem; }
.r-lb__body { padding: .9rem 1rem 1.1rem; }
.r-lb__note { margin: 0; font-size: .95rem; }
.r-lb__meta { margin: .35rem 0 0; font-size: .82rem; color: var(--text-muted); }

.r-scrub__stage img, .r-lb__stage img { transition: opacity .16s ease; }
.r-scrub__stage img[data-swapping], .r-lb__stage img[data-swapping] { opacity: .25; }

@media (min-width: 700px) {
  :root { --r-gutter: 1.5rem; }
  .r-facts { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
  .r-frames { grid-template-columns: repeat(4, 1fr); }
  .r-hour__grid { grid-template-columns: repeat(5, 1fr); }
  .r-alert__value { font-size: 2.6rem; }
}

.r-side { display: none; }

/* STE-1415: admin Reports embeds the calendar in #sites-panel with no rail.
   Attractful hides .r-side below 1000px (rail + sheet). This panel never
   gets a rail, and expand does not load a report, so the list must stay
   visible. :not([data-sheet]) leaves the overlay to the existing sheet rule. */
#sites-panel .r-side:not([data-sheet]) {
  display: block;
  position: static;
}

@media (min-width: 1000px) {
  :root { --r-stick: 124px; } /* header + jump; rail is display:none (oracle) */
  .r-jump { top: var(--r-header-h); }
  .r-jump .r-icon { display: block; }
  .r-rail { display: none; }
  .r-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.75rem; align-items: start; }
  .r-side { display: block; position: sticky; top: calc(var(--r-header-h) + var(--r-jump-h) + 1.25rem); }
  .r-stack { padding-top: 1.25rem; }
}

.r-side[data-sheet] {
  display: block; position: fixed; inset: 0; z-index: 65;
  background: rgba(20,18,28,.45);
  padding: 0; margin: 0;
}
.r-side[data-sheet] .r-cal {
  position: absolute; left: 0; right: 0; bottom: 0;
  border-radius: var(--r-radius) var(--r-radius) 0 0;
  border-bottom: none; max-height: 88vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--r-mid) var(--r-ease);
  padding-bottom: 1.25rem;
}
.r-side[data-sheet][data-open] .r-cal { transform: none; }
.r-sheet-close {
  display: none; width: 100%; margin-top: .75rem; min-height: var(--r-tap);
  background: var(--bg-muted); border: none; border-radius: 10px;
  color: var(--text); font-weight: 600;
}
.r-side[data-sheet] .r-sheet-close { display: block; }

/* STE-1307: close-out sheet. Same data-sheet / data-open / overflow lock as
   the calendar overlay. z-index sits under the lightbox (70) and above the
   calendar (65) so Escape can close topmost-first. */
.r-closeout { display: none; }
.r-closeout[data-sheet] {
  display: block; position: fixed; inset: 0; z-index: 68;
  background: transparent;
}
.r-closeout__scrim {
  position: absolute; inset: 0; background: rgba(20,18,28,.45); cursor: pointer;
}
.r-closeout__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card-bg);
  border-radius: var(--r-radius) var(--r-radius) 0 0;
  box-shadow: 0 24px 60px -24px rgba(20,18,28,.6);
  max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--r-mid) var(--r-ease);
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}
.r-closeout[data-sheet][data-open] .r-closeout__panel { transform: none; }
.r-closeout__head {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .5rem .55rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.r-closeout__head h2 {
  margin: 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500;
}
.r-closeout__x {
  margin-left: auto; background: none; border: none;
  font-size: 1.6rem; line-height: 1; color: var(--text-muted);
  padding: 0 .6rem; min-width: var(--r-tap); min-height: var(--r-tap);
}
.r-closeout__body {
  overflow-y: auto; flex: 1 1 auto; min-height: 0;
  padding: 1.1rem var(--r-gutter) .5rem;
}
.r-closeout__lead { margin: 0 0 .25rem; font-size: .875rem; color: var(--text-muted); }
.r-closeout__quote { margin: 0 0 .75rem; font-size: .95rem; }
.r-closeout__choice {
  display: flex; gap: .5rem; align-items: flex-start;
  margin: .5rem 0; cursor: pointer;
  font-weight: 400; font-size: 1rem;
}
.r-closeout__choice strong { font-weight: 600; }
.r-closeout__consequence {
  display: block; margin-top: .15rem;
  font-size: .875rem; font-weight: 400; color: var(--text-muted);
}
.r-closeout__choice input[type="radio"] {
  width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto;
}
.r-closeout__note { display: block; margin: .75rem 0; font-weight: 400; font-size: 1rem; }
.r-closeout__note textarea {
  width: 100%; margin-top: .3rem; margin-bottom: .5rem;
  font-family: inherit; font-size: 1rem;
}
.r-closeout__error { color: var(--danger, #b42318); font-size: .9rem; margin: 0; }
.r-closeout__foot {
  flex-shrink: 0; padding: 1.25rem 1.5rem 0;
  border-top: 1px solid var(--border);
}
.r-closeout__actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.r-closeout__undo-hint { margin: .5rem 0 0; font-size: .8125rem; color: var(--text-muted); }
@media (min-width: 700px) {
  .r-closeout__panel {
    left: 50%; right: auto; bottom: 1.25rem;
    width: min(560px, calc(100vw - 2rem));
    transform: translate(-50%, 100%);
    border-radius: var(--r-radius);
  }
  .r-closeout[data-sheet][data-open] .r-closeout__panel {
    transform: translate(-50%, 0);
  }
}

.r-cal { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-radius); box-shadow: var(--r-shadow); padding: 1rem; }
.r-cal__head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .8rem; }
.r-cal__nav {
  width: var(--r-tap); height: var(--r-tap); flex: 0 0 auto;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 1rem; line-height: 1;
}
.r-cal__nav:disabled { opacity: .35; cursor: default; }
.r-cal__pager { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; }
.r-cal__pagelabel { flex: 1; text-align: center; font-size: .76rem; color: var(--text-muted); }
.r-cal__list { list-style: none; margin: 0; padding: 0; transition: transform var(--r-fast) var(--r-ease), opacity var(--r-fast) var(--r-ease); }
.r-cal__list[data-sliding="down"] { transform: translateY(-8px); opacity: 0; }
.r-cal__list[data-sliding="up"]   { transform: translateY(8px);  opacity: 0; }
.r-cal__heading { font-family: var(--font-display); font-size: .95rem; font-weight: 500; }
.r-cal__title { font-family: var(--font-display); font-size: .95rem; font-weight: 500; text-align: center; flex: 1; }
.r-cal__monthbar { display: flex; align-items: center; gap: .35rem; margin: 0 0 .7rem; }
.r-cal__seg { margin-left: auto; }
.r-cal__list li { padding: 4px 0; }
.r-cal__list li + li { border-top: 1px solid var(--border); }
.r-cal__list a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .5rem; min-height: var(--r-tap);
  border-radius: 8px; text-decoration: none; color: var(--text); font-size: .9rem;
}
.r-cal__list a[aria-current="date"] { background: var(--accent); color: #fff; }
.r-cal__list .r-cal__dot { margin-left: auto; }
.r-cal__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--r-attention); flex: 0 0 auto; }
.r-cal__list a[aria-current="date"] .r-cal__dot { background: #fff; }
.r-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
/* Author display:grid/flex beat the UA [hidden] default. Joe's global
   [hidden]{display:none !important} was scoped to .r-report; the calendar
   lives in .r-side / .r-rail outside that root. */
.r-side [hidden], .r-rail [hidden] { display: none !important; }
.r-cal__dow { text-align: center; font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding-bottom: .35rem; }
.r-cal__cell {
  position: relative; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text); font-size: .85rem; font-variant-numeric: tabular-nums;
  text-decoration: none; min-height: 38px; padding-bottom: 11px;
}
.r-cal__cell--empty { visibility: hidden; }
.r-cal__cell--none { color: #B9B3C6; }
.r-cal__cell--generating, .r-cal__cell--offline { color: var(--text-muted); font-style: italic; }
.r-cal__cell[aria-current="date"] { background: var(--accent); color: #fff; }
.r-cal__cell[data-flag]::after {
  content: ""; position: absolute; bottom: 3px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--r-attention);
}
.r-cal__cell[aria-current="date"][data-flag]::after { background: #fff; }
@media (max-width: 999px) {
  .r-cal__cell { min-height: var(--r-tap); min-width: 0; aspect-ratio: auto; }
}
.r-cal__foot { margin-top: .7rem; font-size: .76rem; color: var(--text-muted); display: flex; align-items: center; gap: .45rem; }
.r-side .report-type-tabs { margin: 0 0 .75rem; }

.r-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem; padding: 1rem 0 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.r-footer .r-logo { --scrx-word: var(--text); --scrx-crx: var(--accent); min-height: 32px; }
.r-footer .r-logo__mark { height: 20px; }
.r-footer__meta {
  margin-left: auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-muted);
}
.r-footer__meta a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.r-footer__meta a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }
.r-footer__dot { color: var(--border); }

@media (max-width: 499px) {
  .r-footer { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .r-footer__meta {
    margin-left: 0; font-size: .78rem;
    flex-direction: column; align-items: flex-start; gap: .3rem;
  }
  .r-footer__dot { display: none; }
}

.r-jump a, .r-disclose__btn, .r-live, .r-alert, .r-seg button, .r-seg a,
.r-scrub__btn, .r-allphotos, .r-frame, .r-lb__nav, .r-drawer__close, .r-lb__close {
  transition: background-color var(--r-fast) var(--r-ease),
              color var(--r-fast) var(--r-ease),
              border-color var(--r-fast) var(--r-ease),
              box-shadow var(--r-fast) var(--r-ease),
              opacity var(--r-fast) var(--r-ease),
              transform var(--r-fast) var(--r-ease);
}
.r-jump a:hover { background: var(--accent-tint); }
.r-jump a[aria-current="location"]:hover { background: var(--accent-hover); }
.r-allphotos:hover, .r-alert:hover { border-color: var(--accent-soft); }
.r-frame:active, .r-scrub__btn:active { transform: scale(.96); }
.r-disclose__btn:hover { color: var(--accent); }

.r-disclose__panel {
  overflow: hidden;
  transition: max-height var(--r-mid) var(--r-ease), opacity var(--r-fast) var(--r-ease);
}
.r-disclose__panel[data-animating] { display: block !important; }
.r-disclose__panel[data-collapsed] { opacity: 0; }

.r-fade-in { animation: r-fade var(--r-mid) var(--r-ease) both; }
@keyframes r-fade { from { opacity: 0; transform: translateY(6px) scale(.995); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .r-report, .r-report *, .r-jump, .r-alert, .r-disclose__btn, .r-disclose__panel,
  .r-live, .r-seg button, .r-seg a, .r-seg__pill,
  .r-scrub__stage img, .r-lb__stage img, .r-lb .lightbox-spinner,
  .r-drawer, .r-lb, .r-frame {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Commit C — leftover IA chrome must not fight .r-*. Red stays a row badge. */
.r-alert.report-answer-card[data-header-state="needs-attention"] {
  border-left: 1px solid var(--r-attention-line);
}
.r-alert.r-alert--clear.report-answer-card[data-header-state] {
  border-left: 1px solid #BFE3CD;
}
.report-ia [id],
.report-ia [data-section-kind],
.r-report [id] {
  scroll-margin-top: var(--r-stick);
}
.report-ia > .r-jump {
  padding: 0 var(--r-gutter);
  gap: .4rem;
  height: var(--r-jump-h);
  background: var(--card-bg);
}
@media (min-width: 769px) {
  .report-ia.r-report:has(> .r-jump) {
    display: block;
  }
  .report-ia.r-report > .r-jump {
    flex-direction: row;
    position: sticky;
    top: var(--r-header-h);
    align-self: auto;
    width: auto;
    height: var(--r-jump-h);
    margin: 0 0 1rem;
    padding: 0 var(--r-gutter);
    border-right: 0;
    overflow-x: auto;
  }
}

/* STE-1311: live-feed modal. Recording red #e53935 is semantic — never violet.
   z-index sits above lightbox (70) so Escape closes this first. */
.live-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 28, 0.85);
  z-index: 80;
  justify-content: center;
  align-items: center;
}
.live-modal-overlay.open { display: flex; }
.live-modal {
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--r-radius);
  box-shadow: var(--r-shadow);
  width: 95vw;
  max-width: 800px;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.live-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.live-modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.live-label {
  font-size: 0.75rem;
  background: #e53935;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.live-camera-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.live-camera-tabs.single { display: none; }
.live-camera-tab {
  min-height: var(--r-tap);
  padding: 0 1rem;
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.live-camera-tab:hover { background: var(--border); color: var(--text); }
.live-camera-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--k-on-accent, #fff);
}
.live-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.live-video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.live-badge {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e53935;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 2;
}
.live-badge.visible { display: block; }
.live-countdown {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #ccc;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}
.live-countdown.visible { display: block; }
.live-status-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 4;
  padding: 1rem;
  pointer-events: none;
}
.live-status-overlay.hidden { display: none; }
.live-status-overlay .k-state {
  max-width: 32rem;
  width: 100%;
  padding: 0.75rem 1rem 1rem;
  box-sizing: border-box;
  pointer-events: auto;
}
.live-status-overlay .k-spinner { width: 1.5rem; height: 1.5rem; margin-bottom: 0.5rem; }
.live-status-overlay .k-btnrow { justify-content: center; }
.live-status-overlay .k-state__body { margin-bottom: 0.75rem; }
/* Author display:flex on .k-btn / .k-btnrow beats the UA [hidden] default.
   Same trap as .r-side / .r-photos — the modal sits at body, outside those roots. */
.live-status-overlay [hidden] { display: none !important; }
@media (max-width: 480px) {
  .live-status-overlay .k-btnrow {
    flex-direction: column;
    align-items: stretch;
  }
}

/* STE-1387: past-pill reason. kit .k-toast is absolute-to-trigger; the header
   is 56px and clips, so pin this one under the header. Phones have no title=. */
#livePastReason:not([hidden]) {
  position: fixed;
  top: calc(var(--r-header-h) + 0.5rem);
  left: 1rem;
  right: 1rem;
  width: auto;
  max-width: none;
  z-index: 45;
}
