/* Subete web UI, aligned to design/subete-design-handoff/SUBETE-DESIGN.md.
 * When this file and that document disagree, the document wins.
 *
 * Hallmark · design-system: design/subete-design-handoff/SUBETE-DESIGN.md
 *
 * Hard rules carried from the brand guide:
 * - Orange is NEVER text on light backgrounds and NEVER a background for
 *   white text. Orange fills take navy text.
 * - Wine means *clickable*, never a status color; fail/critical is --su-bad.
 * - Overpass 400/600/700/800; Overpass Mono for identifiers and numeric
 *   table cells. Arial fallback.
 */

:root {
    /* Brand primaries */
    --su-navy: #232f43;        /* ink, chrome */
    --su-orange: #f7a629;      /* marks, rules, selection, primary button fill */
    --su-coral: #ff6b4a;       /* brand-mark gradient only */
    --su-wine: #86002e;        /* INTERACTIVE: links, drill affordances */
    --su-wine-hover: #5f0021;  /* link hover: darken, never brighten */

    /* Status — traffic-light semantics, brand-tuned */
    --su-bad: #b41f3a;         /* critical / fail / reject-class */
    --su-bad-bg: #f9e9ec;      /* banded row / badge tint */
    --su-attn: #d97706;        /* warning / attention (brand Amber) */
    --su-attn-bg: #fdf3e3;
    --su-ok: #177d63;          /* pass / healthy (Mint hue, darkened) */
    --su-ok-bg: #e7f4ee;
    --su-na: #5c6a82;          /* none / not-evaluated */
    --su-na-bg: #f0ede7;

    /* Surfaces */
    --su-paper: #faf9f7;       /* page */
    --su-panel: #ffffff;
    --su-line: #e6e3dd;        /* hairlines */
    --su-line-faint: #f0ede7;  /* row separators */
    --su-muted: #5c6a82;
    --su-faint: #8a95a8;

    --su-accent-tint: #fdf1dd; /* nav active fill, claim banner */
    --su-shadow: 0 1px 2px rgba(35,47,67,.05);
    --su-shadow-raise: 0 4px 14px rgba(35,47,67,.14);

    /* Rendered height of .topbar (measured; padding + 20px logo + 3px
     * rule). The pinned app-shell chrome offsets against it. */
    --chrome-h: 60px;

    /* Chrome-only derived values (navy ground) */
    --su-chrome-divider: #415068;
    --su-chrome-muted: #9aa6bd;

    --font-body: "Overpass", Arial, sans-serif;
    --font-mono: "Overpass Mono", ui-monospace, monospace;

    --sp-2xs: 0.25rem;
    --sp-xs: 0.5rem;
    --sp-sm: 0.75rem;
    --sp-md: 1rem;
    --sp-lg: 1.5rem;
    --sp-xl: 2.5rem;
    --sp-2xl: 4rem;

    --text-label: 0.7rem;
    --text-data: 0.875rem;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-micro: 120ms;
    --dur-short: 200ms;
    --dur-long: 360ms;

    --pico-font-family: "Overpass", Arial, sans-serif;
}

html,
body {
    overflow-x: clip;
}

body {
    background: var(--su-paper);
    color: var(--su-navy);
    font-family: var(--font-body);
}

.mono {
    font-family: var(--font-mono);
}

.muted {
    color: var(--su-muted);
    font-size: 0.9rem;
}

a {
    color: var(--su-wine);
    transition: color var(--dur-micro) var(--ease-out);
}

a:hover {
    color: var(--su-wine-hover);
}

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(247, 166, 41, 0.35);
}

/* ---- chrome: navy top bar, 3px orange rule, on ALL pages ---- */

.topbar {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    padding: 0.65rem 1.5rem;
    background: var(--su-navy);
    border-bottom: 3px solid var(--su-orange);
    color: #fff;
}

.kumo-logo {
    height: 20px;
    display: block;
    flex: none;
}

.topbar .brand {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.12em;
    font-size: 0.95rem;
    color: #fff;
    border-left: 1px solid var(--su-chrome-divider);
    padding-left: var(--sp-md);
}

.topbar .tagline {
    color: var(--su-chrome-muted);
    font-size: 0.8rem;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-md);
}

.chrome-email {
    color: var(--su-chrome-muted);
    font-size: 0.75rem;
}

/* Signed-out chrome: a quiet ghost "Log in" on the navy ground. */
.chrome-login {
    color: #fff;
    border: 1px solid var(--su-chrome-divider);
    border-radius: 6px;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    text-decoration: none;
    transition: border-color var(--dur-micro) var(--ease-out);
}

.chrome-login:hover {
    color: #fff;
    border-color: var(--su-chrome-muted);
}

#error {
    color: #ffd9cf; /* readable on navy; empty div renders nothing */
    font-size: 0.85rem;
}

/* Severity pill in chrome: the one sanctioned white-on-status-color usage.
 * Hidden at zero (callers render it only when counts are non-zero). */
.sev-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--su-bad);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    white-space: nowrap;
}

.sev-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.content {
    max-width: 68rem;
    margin: 0 auto;
    padding: 2rem;
}

/* ---- landing ---- */

.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    padding-top: 3rem;
    text-align: center;
}

.landing .lead {
    font-size: 1.05rem;
    margin: 0;
}

.addr-card {
    border: 1px solid var(--su-line);
    background: var(--su-panel);
    border-radius: 12px;
    box-shadow: var(--su-shadow);
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.addr {
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 600;
    word-break: break-all;
}

.waiting {
    color: var(--su-muted);
    font-size: 0.9rem;
}

.copy {
    background: transparent;
    border: 1px solid var(--su-navy);
    color: var(--su-navy);
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
    width: auto;
    border-radius: 6px;
    transition: border-color var(--dur-micro) var(--ease-out),
        color var(--dur-micro) var(--ease-out);
}

.copy:hover {
    border-color: var(--su-wine);
    color: var(--su-wine);
    background: transparent;
}

.landing .explain {
    color: var(--su-muted);
    max-width: 36rem;
    font-size: 0.9rem;
}

/* ---- one-time report ---- */

/* Report + its section rail side by side; the rail vanishes on narrow
 * screens rather than stacking (a TOC above a scrollable document is
 * noise, not navigation). */
.reportwrap {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-lg);
}

.reportwrap > .report {
    flex: 1;
    min-width: 0;
}

.tocrail {
    flex: none;
    width: 13rem;
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.75rem;
    /* Rendered left of the report; the DOM keeps content-first order so
     * readers and search hit the report before the rail. */
    order: -1;
}

/* Under the pinned app chrome the rail hangs below the brand bar; on the
 * public shell the bar scrolls away, so the rail rides near the top. */
body:has(.app-shell) .tocrail {
    top: calc(var(--chrome-h) + 1rem);
}

.toclabel {
    font-size: 0.65625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--su-muted);
    padding: 0 0.65rem 0.35rem;
}

.tocrail a {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    color: var(--su-navy);
    text-decoration: none;
}

.tocrail a:hover {
    background: var(--su-line-faint);
    color: var(--su-navy);
}

/* Active section: the sidebar's own vocabulary — accent tint + inset
 * orange rule. */
.tocrail a.active {
    background: var(--su-accent-tint);
    box-shadow: inset 3px 0 0 var(--su-orange);
    font-weight: 700;
}

.tocno {
    font-size: 0.65625rem;
    color: var(--su-faint);
    min-width: 1.1rem;
}

.toctitle {
    flex: 1;
}

/* Severity marker: a dot, not a pill — the rail is a map, the sections
 * carry the words. */
.tocdot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
    align-self: center;
}

.tocdot.bad {
    background: var(--su-bad);
}

.tocdot.attn {
    background: var(--su-attn);
}

@media (max-width: 1100px) {
    .tocrail {
        display: none;
    }
}

/* Anchored sections land below the pinned chrome, not underneath it. */
.sec[id] {
    scroll-margin-top: 1rem;
}

body:has(.app-shell) .sec[id] {
    scroll-margin-top: calc(var(--chrome-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* The severity pill stays its own thing when it doubles as a jump link. */
a.sev-pill {
    color: #fff;
    text-decoration: none;
}

a.sev-pill:hover {
    color: #fff;
    background: #9d1b33; /* darken, never brighten */
}

.report {
    max-width: 56rem;
    margin-right: auto;
    font-variant-numeric: tabular-nums;
}

.report a {
    color: var(--su-wine);
    text-decoration-color: var(--su-line);
}

.report a:hover {
    color: var(--su-wine-hover);
    text-decoration-color: currentColor;
}

/* Masthead: kicker line, subject as the display headline, spec line. */

.masthead {
    padding: var(--sp-md) 0 var(--sp-lg);
    border-bottom: 1px solid var(--su-line);
}

.kicker {
    display: flex;
    align-items: baseline;
    gap: var(--sp-md);
    flex-wrap: wrap;
    margin: 0 0 var(--sp-sm);
    font-family: var(--font-mono);
    font-size: var(--text-label);
}

.kicker-type {
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--su-navy);
    white-space: nowrap;
}

.kicker-addr {
    color: var(--su-muted);
    overflow-wrap: anywhere;
}

.kicker-when {
    color: var(--su-faint);
}

.subjectline {
    font-size: clamp(1.5rem, 2.5vw + 0.9rem, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.specline {
    margin: var(--sp-sm) 0 0;
    font-family: var(--font-mono);
    font-size: var(--text-label);
    color: var(--su-muted);
}

.backlink {
    margin: var(--sp-md) 0 0;
    font-size: var(--text-data);
}

.sharebtn,
.printbtn {
    width: auto;
    background: transparent;
    border: 1px solid var(--su-navy);
    color: var(--su-navy);
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: border-color var(--dur-micro) var(--ease-out),
        color var(--dur-micro) var(--ease-out);
}

.sharebtn {
    margin-left: auto;
}

.sharebtn:hover,
.printbtn:hover {
    border-color: var(--su-wine);
    color: var(--su-wine);
    background: transparent;
}

.sharebtn:active,
.printbtn:active {
    transform: translateY(1px);
}

.sharebtn:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Claim banner: accent tint, sentence + right-aligned primary button.
 * Primary = orange fill, NAVY text (never white on orange), 6px radius. */

.claim {
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
    background: var(--su-accent-tint);
    color: var(--su-navy);
    border: none;
    border-bottom: 1px solid var(--su-line);
    border-radius: 0;
    box-shadow: none;
    padding: var(--sp-md) var(--sp-lg);
    margin: var(--sp-lg) 0 var(--sp-xs);
}

.claim strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.claim p {
    margin: var(--sp-2xs) 0 0;
    color: var(--su-muted);
    font-size: 0.9rem;
    max-width: 46ch;
}

.claim-actions {
    display: flex;
    gap: var(--sp-sm);
    flex: none;
    margin-left: auto;
}

.claim-actions [role="button"] {
    background: var(--su-orange);
    border-color: var(--su-orange);
    color: var(--su-navy);
    font-weight: 700;
    white-space: nowrap;
    border-radius: 6px;
    transition: background-color var(--dur-short) var(--ease-out),
        box-shadow var(--dur-short) var(--ease-out);
}

.claim-actions [role="button"]:hover {
    background: #e29417; /* darken, never brighten */
    border-color: #e29417;
    color: var(--su-navy);
    box-shadow: var(--su-shadow-raise);
}

.claim-actions [role="button"]:active {
    transform: translateY(1px);
}

.claim-actions [role="button"].secondary {
    background: transparent;
    border: 1px solid var(--su-navy);
    color: var(--su-navy);
}

.claim-actions [role="button"].secondary:hover {
    background: transparent;
    border-color: var(--su-wine);
    color: var(--su-wine);
    box-shadow: none;
}

/* Report sections are cards: white, hairline, 12px radius, soft shadow.
 * Heading row: title 15px/800, then the section number as a small mono
 * chip — numbers are metadata, not typography features (the markup emits
 * the number first; flex order swaps it behind the title). */

.report .sec {
    margin: var(--sp-lg) 0 0;
    padding: var(--sp-md) var(--sp-lg);
    background: var(--su-panel);
    border: 1px solid var(--su-line);
    border-radius: 12px;
    box-shadow: var(--su-shadow);
}

.report .sec h2 {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    font-size: 0.9375rem; /* 15px */
    font-weight: 800;
    letter-spacing: -0.005em;
    line-height: 1.2;
    color: var(--su-navy);
    margin: 0 0 var(--sp-md);
    overflow-wrap: anywhere;
    min-width: 0;
}

.secno {
    order: 2;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.7rem;
    line-height: 1;
    color: var(--su-muted);
    background: var(--su-na-bg);
    border: 1px solid var(--su-line);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    flex: none;
}

.report .sec h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--su-muted);
    margin: var(--sp-lg) 0 var(--sp-xs);
    max-width: 65ch;
}

.report .sec > p {
    max-width: 65ch;
}

/* "read:" interpretation lines: one muted italic sentence at the bottom. */
.readline {
    font-size: 0.75rem;
    color: var(--su-faint);
    font-style: italic;
    max-width: 75ch;
    margin: var(--sp-xs) 0 0;
}

/* Slim full-width claim bar directly below the chrome (mock 3a). */
.claimbar {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    background: var(--su-accent-tint);
    border-bottom: 1px solid var(--su-line);
    padding: 0.55rem 1.5rem;
    margin: -2rem calc(50% - 50vw) var(--sp-lg);
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
}

.claimbar p {
    margin: 0;
    font-size: 0.85rem;
}

.claimbar .claimbtn {
    margin-left: auto;
    background: var(--su-orange);
    border: 1px solid var(--su-orange);
    color: var(--su-navy);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.3rem 0.9rem;
    border-radius: 6px;
    white-space: nowrap;
    width: auto;
    transition: background-color var(--dur-short) var(--ease-out);
}

.claimbar .claimbtn:hover {
    background: #e29417;
    border-color: #e29417;
    color: var(--su-navy);
}

/* Report header: the ADDRESS is the headline (mock), pill at the right. */
.reporthead {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
    padding: var(--sp-xs) 0 0;
}

.addrline {
    font-weight: 700;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.whenline {
    color: var(--su-muted);
    font-size: 0.8rem;
}

.headactions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

/* Section-1 element table: STATUS | ELEMENT | NOTES. The pill carries
 * only the verdict word; the reason lives in the notes column. */
.elements td:first-child {
    white-space: nowrap;
    width: 7.5rem;
}

.elements .note {
    color: var(--su-muted);
    font-size: 0.8rem;
}

/* MX routing fingerprint line under an identity heading (v20): provider
 * label + kumod site_name, which can run long — wrap anywhere. */
.mxroute {
    font-size: 0.72rem;
    color: var(--su-muted);
    margin: 0.1rem 0 0.3rem;
    overflow-wrap: anywhere;
}

.mxroute strong {
    color: var(--su-navy);
}

/* Severity text column (mock: its own colored column, not a chip). */
.sev-reject { color: var(--su-bad); font-weight: 600; font-size: 0.8rem; }
.sev-adv { color: var(--su-attn); font-weight: 600; font-size: 0.8rem; }

/* Protected chip: the unsubscribe-guard state, dashed like .sev-pill kin. */
.v-prot {
    background: var(--su-accent-tint);
    color: var(--su-wine);
    border: 1px dashed var(--su-wine) !important;
}

/* Two-column section grids (transport KV + timings; SPF + DKIM). */
.kv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-lg);
    align-items: start;
}

/* Provider tiles (mock section 5). */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: var(--sp-sm);
    margin-bottom: var(--sp-md);
}

.tile {
    border: 1px solid var(--su-line);
    border-radius: 8px;
    padding: var(--sp-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2xs);
    background: var(--su-panel);
}

.tile-warn {
    border-color: var(--su-attn);
    background: var(--su-attn-bg);
}

.kvline {
    margin: var(--sp-xs) 0;
    font-size: var(--text-data);
}

/* DNS identities as side-by-side columns (mock section 7). */
.idgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--sp-lg);
    align-items: start;
}

.idcol h3 {
    margin-top: 0;
    overflow-wrap: anywhere;
}

.idcol th[scope="row"] {
    width: auto;
    font-weight: 400;
    font-size: 0.8rem;
}

/* Coherence node chips (mock section 9). */
.nodechips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-xs);
    margin-bottom: var(--sp-sm);
}

.nodechip {
    border: 1px solid var(--su-line);
    border-radius: 4px;
    background: var(--su-na-bg);
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    color: var(--su-navy);
}

.secdesc {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--su-muted);
    letter-spacing: 0;
}

.urlcell {
    font-size: 0.7rem;
    max-width: 22rem;
    overflow-wrap: anywhere;
}

td.num, th.num {
    text-align: right;
}

/* Data tables: quiet headers, hairline rows, mono evidence. */

.sec table {
    width: 100%;
    margin: 0 0 var(--sp-md);
    font-size: var(--text-data);
}

.sec table + table {
    margin-top: var(--sp-lg);
}

.sec thead th {
    font-family: var(--font-body);
    font-size: 0.65625rem; /* 10.5px */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--su-muted);
    background: transparent;
    border-bottom: 1px solid var(--su-line);
    padding: var(--sp-2xs) var(--sp-md) var(--sp-2xs) 0;
}

.sec td,
.sec tbody th {
    background: transparent;
    border-bottom: 1px solid var(--su-line-faint);
    padding: var(--sp-xs) var(--sp-md) var(--sp-xs) 0;
    vertical-align: top;
}

.sec tbody th[scope="row"] {
    font-weight: 600;
    color: var(--su-navy);
    width: 14rem;
}

/* Row banding: band the row, badge the verdict — never color the row
 * text wholesale. */
.sec tr:has(.v-fail) > td,
.sec tr:has(.v-fail) > th {
    background: var(--su-bad-bg);
}

.sec tr:has(.v-warn):not(:has(.v-fail)) > td,
.sec tr:has(.v-warn):not(:has(.v-fail)) > th {
    background: var(--su-attn-bg);
}

.runtime {
    font-size: var(--text-label);
}

.headers-table th {
    white-space: nowrap;
    vertical-align: top;
    font-weight: 600;
}

.headers-table td {
    word-break: break-all;
    font-size: 0.8rem;
}

.report details summary {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--text-data);
}

/* Pipeline index (section 01): numeral chips, wine drill links. */

.pipeline {
    list-style: none;
    margin: 0 0 var(--sp-md);
    padding: 0;
}

.pipeline li {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) max-content;
    grid-template-areas:
        "no label chip"
        "no detail detail";
    align-items: baseline;
    column-gap: var(--sp-md);
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid var(--su-line-faint);
}

.pipeline li:first-child {
    border-top: 1px solid var(--su-line-faint);
}

.pl-no {
    grid-area: no;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--su-muted);
}

.pl-label {
    grid-area: label;
    font-weight: 600;
    text-decoration: none;
}

.pipeline .pl-label {
    color: var(--su-wine);
}

.pipeline .pl-label:hover {
    color: var(--su-wine-hover);
}

.pl-label::after {
    content: " \203A"; /* drill affordances end with › */
}

.pl-chip {
    grid-area: chip;
    justify-self: end;
}

.pl-detail {
    grid-area: detail;
    font-size: var(--text-data);
    overflow-wrap: anywhere;
}

/* Verdict chips are pills: 10px radius, 11px/600, tint fill + status text.
 * On a banded row the pill goes white-filled with a 1px border so its
 * silhouette stays visible against the tint. */

.verdict {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem; /* 11px */
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.55rem;
    border-radius: 10px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.vdot {
    display: none; /* the pill carries the color; the word carries the truth */
}

.v-pass { background: var(--su-ok-bg); color: var(--su-ok); }
.v-fail { background: var(--su-bad-bg); color: var(--su-bad); }
.v-warn { background: var(--su-attn-bg); color: var(--su-attn); }
.v-none { background: var(--su-na-bg); color: var(--su-na); }

.sec tr:has(.v-fail) .v-fail {
    background: var(--su-panel);
    border-color: var(--su-bad);
}

.sec tr:has(.v-warn) .v-warn {
    background: var(--su-panel);
    border-color: var(--su-attn);
}

/* Tally lines: mono 11px colored counts. */
.tally {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
}

.tally .t-bad { color: var(--su-bad); }
.tally .t-attn { color: var(--su-attn); }
.tally .t-ok { color: var(--su-ok); }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media (max-width: 40rem) {
    .sec table {
        display: block;
        overflow-x: auto;
    }

    .sec tbody th[scope="row"] {
        width: auto;
        min-width: 9rem;
    }

    .claim {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-md);
        padding: var(--sp-md);
    }

    .claim-actions {
        margin-left: 0;
    }

    .pipeline li {
        grid-template-columns: 2rem minmax(0, 1fr);
        grid-template-areas:
            "no label"
            "no chip"
            "no detail";
        row-gap: var(--sp-2xs);
    }

    .pl-chip {
        justify-self: start;
    }

    .kv-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .claimbar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-xs);
    }

    .elements td:first-child {
        width: auto;
    }
}

/* ---- app-shell sections (reports list, verify banner) keep the card voice ---- */

.sec {
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--su-panel);
    border: 1px solid var(--su-line);
    border-radius: 12px;
    box-shadow: var(--su-shadow);
}

.sec h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.sec.pending {
    border-style: dashed;
    background: transparent;
    box-shadow: none;
}

.sec.pending h2 {
    color: var(--su-muted);
    margin-bottom: 0.25rem;
}

.sec h3 {
    font-size: 0.85rem;
    color: var(--su-muted);
    margin: 0.75rem 0 0.4rem;
}

/* ---- logged-in app shell: sidebar under the brand bar ---- */

.app-shell {
    display: flex;
    min-height: calc(100vh - var(--chrome-h));
}

/* The logged-in chrome is pinned: the brand bar sticks to the viewport
 * top and the sidebar to the space below it, so navigation and Log out
 * stay in reach however long the content runs. Only content scrolls. */
body:has(.app-shell) .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar {
    width: 200px;
    flex: none;
    background: var(--su-panel);
    border-right: 1px solid var(--su-line);
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--chrome-h);
    /* Explicit height (not flex stretch): a stretched child can't stick,
     * and viewport height is what keeps .sidefoot's margin-top:auto
     * placing Log out at the bottom of the *visible* rail. */
    height: calc(100vh - var(--chrome-h));
    overflow-y: auto;
}

.sidenav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidenav a,
.navsoon {
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--su-navy);
}

.sidenav a.active {
    background: var(--su-accent-tint);
    box-shadow: inset 3px 0 0 var(--su-orange);
    font-weight: 700;
}

.navsoon {
    color: var(--su-faint);
}

.sidefoot {
    margin-top: auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.sidefoot form {
    margin: 0;
}

.main-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-col .content {
    margin: 0;
    max-width: none;
    padding: 1rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

/* Pages open with their own header row (mock 2a: identity + actions);
 * there is no fixed title bar. */
.rangetabs {
    display: flex;
    border: 1px solid var(--su-line);
    border-radius: 6px;
    /* No overflow:hidden — it would clip the focus ring on the tabs;
     * the end tabs round themselves instead. */
}

.rangetabs a {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--su-navy);
    border-right: 1px solid var(--su-line);
    transition: background-color var(--dur-micro) var(--ease-out);
}

.rangetabs a:first-child {
    border-radius: 5px 0 0 5px;
}

.rangetabs a:last-child {
    border-right: 0;
    border-radius: 0 5px 5px 0;
}

.rangetabs a:hover {
    color: var(--su-navy);
    background: var(--su-line-faint);
}

.rangetabs a.active {
    background: var(--su-accent-tint);
    font-weight: 700;
    box-shadow: inset 0 -2px 0 var(--su-orange);
}

.addrfilter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.addrfilter select {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    width: auto;
    margin: 0;
    border: 1px solid var(--su-line);
    border-radius: 6px;
    background: var(--su-panel);
    height: auto;
}

.findingstoggle {
    font-size: 0.75rem;
    text-decoration: none;
    /* Solid hairline: dashed borders mean "future milestone stub" in this
     * design language, and this toggle is live. */
    border: 1px solid var(--su-line);
    border-radius: 10px;
    padding: 0.15rem 0.6rem;
    color: var(--su-muted);
    transition: background-color var(--dur-micro) var(--ease-out),
        color var(--dur-micro) var(--ease-out);
}

.findingstoggle:hover {
    color: var(--su-navy);
    background: var(--su-line-faint);
}

.findingstoggle.active {
    background: var(--su-accent-tint);
    border-color: var(--su-orange);
    color: var(--su-navy);
    font-weight: 600;
}

.findingstoggle.active:hover {
    background: var(--su-accent-tint);
}

.purposechip {
    display: inline-block;
    font-size: 0.7rem;
    border: 1px solid var(--su-line);
    border-radius: 10px;
    background: var(--su-na-bg);
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}

.listfoot {
    font-size: 0.75rem;
    margin: var(--sp-sm) 0 0;
}

/* The polled table region. When a refresh fails (session expired, server
 * gone) the data on screen is stale — dim it and say so rather than let
 * it keep looking live. */
.pollwrap.stale {
    opacity: 0.55;
}

.pollwrap.stale::before {
    content: "live updates paused — reload the page";
    display: block;
    font-size: 0.75rem;
    color: var(--su-attn);
    margin-bottom: var(--sp-sm);
}

.pagehead {
    display: flex;
    align-items: baseline;
    gap: var(--sp-sm);
    flex-wrap: wrap;
}

.pagehead strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
/* ---- auth forms: a card in the public shell, primary = orange fill,
 * navy text (never white on orange) ---- */

.authform {
    max-width: 24rem;
    margin: 3rem auto 0;
    background: var(--su-panel);
    border: 1px solid var(--su-line);
    border-radius: 12px;
    box-shadow: var(--su-shadow);
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.authform h2 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
}

.authform label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--su-muted);
}

.authform input {
    border: 1px solid var(--su-line);
    border-radius: 6px;
    background: var(--su-panel);
    color: var(--su-navy);
}

.authform button[type="submit"] {
    background: var(--su-orange);
    border: 1px solid var(--su-orange);
    color: var(--su-navy);
    font-weight: 700;
    border-radius: 6px;
    transition: background-color var(--dur-short) var(--ease-out),
        box-shadow var(--dur-short) var(--ease-out);
}

.authform button[type="submit"]:hover {
    background: #e29417; /* darken, never brighten */
    border-color: #e29417;
    color: var(--su-navy);
    box-shadow: var(--su-shadow-raise);
}

.authform .muted {
    margin: 0;
}

.formerror {
    color: var(--su-bad);
    font-size: 0.9rem;
    margin: 0;
}

/* ---- reports list (flat table, newest first) ---- */

.sec table.msglist {
    font-size: 0.8rem; /* the mock's 12.5px list scale */
}

/* In the list, band only reject-class rows. Report tables band warns too,
 * but here nearly every dev message carries warnings and a fully tinted
 * page stops signaling — the pills carry warn severity on their own. */
.sec table.msglist tr:has(.v-warn):not(:has(.v-fail)) > td {
    background: transparent;
}

/* And with the warn band gone, the warn pill reverts to its unbanded
 * tint-fill form instead of the white banded-row silhouette. */
.sec table.msglist tr:has(.v-warn):not(:has(.v-fail)) .v-warn {
    background: var(--su-attn-bg);
    border-color: transparent;
}

.msglist .whencell {
    color: var(--su-muted);
}

/* Received / Address / From are bounded identifiers — keep them on one
 * line (at the mock's 12px mono) and let Subject absorb the slack. */
.msglist td.mono {
    white-space: nowrap;
    font-size: 0.75rem;
}

.msglist .subjcell {
    overflow-wrap: anywhere;
    min-width: 10rem;
}

/* Findings chips wrap as whole pills when the row runs tight. */
.msglist .findings {
    width: 8.5rem;
}

/* Multiple chips stack as a column with a real gap (the td itself must
 * stay display:table-cell, so the flex lives on an inner wrapper). */
.findstack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.msglist td a {
    text-decoration-color: var(--su-line);
}

.msglist td a:hover {
    text-decoration-color: currentColor;
}

/* Drill affordance back to the reports list (owner report view). */
.olderlink {
    font-size: 0.75rem;
    white-space: nowrap;
}

.verifybanner {
    border: 1px solid var(--su-attn);
    background: var(--su-attn-bg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.verifybanner form {
    margin: 0 0 0 auto;
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    .addr {
        font-size: 1.2rem;
    }

    .claim {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar .tagline {
        display: none;
    }
}

/* ---- print: the report as a paper document ---- */

.printonly {
    display: none;
}

@media print {
    .topbar,
    .sidebar,
    .tocrail,
    .claim,
    .claimbar,
    .backlink,
    .sharebtn,
    .printbtn,
    .olderlink,
    #error {
        display: none !important;
    }

    .printonly {
        display: inline;
    }

    html,
    body {
        background: #fff;
    }

    .content {
        max-width: none;
        padding: 0;
    }

    .report {
        max-width: none;
    }

    .report .sec {
        break-inside: auto;
        box-shadow: none;
    }

    .report .sec h2,
    .report .sec h3 {
        break-after: avoid;
    }

    .report tr,
    .pipeline li {
        break-inside: avoid;
    }

    /* Pills are triage; keep their tint on paper. The word still carries
     * the meaning on grayscale printers. */
    .verdict,
    .report .sec tr:has(.v-fail) > td,
    .report .sec tr:has(.v-warn):not(:has(.v-fail)) > td {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .report a {
        color: inherit;
        text-decoration: none;
    }
}
