/* ─────────────────────────────────────────────────────────────────────────
 *  CMMC Dashboard — Stagg Solutions
 *  "Editorial Pro" light theme.
 *  Warm cream canvas + floating white cards + Stagg navy/steel-blue accents.
 *  Designed for 8-hour daytime compliance review work; high text contrast,
 *  status colors saturated for at-a-glance scanning, restrained chrome.
 * ───────────────────────────────────────────────────────────────────────── */

:root {
    /* ── Surfaces ───────────────────────────────────────────────
       Three steps: cool grey-blue canvas → white cards → light cool hover.
       Aligned with the Stagg navy palette, no warm cast. */
    --bg:           #edf1f7;   /* cool light grey-blue — page floor */
    --bg-1:         #ffffff;   /* card surface (white tiles pop cleanly) */
    --bg-2:         #e3e9f1;   /* hover / nested elevated */
    --bg-3:         #cdd5e1;   /* pressed / active */

    /* ── Hairlines & borders ───────────────────────────────────
       Cool grey to harmonize with navy/blue brand. */
    --line:         #d2d9e3;
    --line-soft:    #e0e5ed;
    --line-strong:  #94a0b3;

    /* ── Type ──────────────────────────────────────────────────
       Near-black with warm undertone. Avoids the corporate-cold
       feeling of pure black on white. */
    --ink:          #1a1a1a;   /* primary text */
    --ink-strong:   #0a0a0a;   /* display + emphasis */
    --ink-dim:      #5b5b5a;   /* secondary text — readable on cream */
    --ink-faint:    #8a877e;   /* meta / labels */

    /* ── Stagg brand ───────────────────────────────────────────
       Deep navy from "Business Solutions" wordmark + steel blue from
       the puzzle pieces. Used for ALL action chrome and accents. */
    --brand-deep:   #1e2a52;   /* the wordmark navy — heads, primary CTA bg */
    --brand:        #2c4a8a;   /* puzzle-piece steel blue */
    --brand-bright: #3a5fb0;   /* hover / link bright */
    --brand-dim:    #6f86b5;   /* disabled / subdued */
    --brand-bg:     rgba(44, 74, 138, 0.08);
    --brand-bg-soft:rgba(44, 74, 138, 0.04);

    /* ── Status — saturated enough to read on cream ────────────
       Deeper, more editorial than typical Tailwind defaults. */
    --c-met:           #1f7a3f;
    --c-met-bg:        rgba(31, 122, 63, 0.10);
    --c-met-border:    rgba(31, 122, 63, 0.30);
    --c-not_met:       #b8253c;
    --c-not_met-bg:    rgba(184, 37, 60, 0.10);
    --c-not_met-border:rgba(184, 37, 60, 0.30);
    --c-needs_review:  #a35e0a;
    --c-needs_review-bg:rgba(163, 94, 10, 0.10);
    --c-needs_review-border:rgba(163, 94, 10, 0.30);
    --c-na:            #757261;
    --c-na-bg:         rgba(117, 114, 97, 0.10);
    --c-na-border:     rgba(117, 114, 97, 0.30);

    /* ── Shadows — light theme uses cool soft shadows ──────────
       Tint slightly cooler than the cream bg for a "lifted" feel. */
    --shadow-sm:    0 1px 1px rgba(30, 42, 82, 0.04), 0 1px 2px rgba(30, 42, 82, 0.06);
    --shadow-md:    0 1px 2px rgba(30, 42, 82, 0.05), 0 4px 12px rgba(30, 42, 82, 0.07);
    --shadow-lg:    0 2px 4px rgba(30, 42, 82, 0.06), 0 16px 32px rgba(30, 42, 82, 0.10);

    /* ── Type stack ────────────────────────────────────────────
       Keep Geist + Geist Mono — they're characterful enough not to
       read AI-default, and they suit dense data work. */
    --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", monospace;

    /* ── Scale ─────────────────────────────────────────────────
       Larger display sizes — page hero earns it on a light bg. */
    --display: clamp(1.875rem, 3vw, 2.375rem);
    --h1: 1.5rem;
    --h2: 0.8125rem;
    --h3: 0.9375rem;
    --body: 0.9375rem;
    --sm: 0.8125rem;
    --xs: 0.75rem;

    /* ── Radius ────────────────────────────────────────────────
       Slightly larger to feel premium / paper-like. */
    --r: 8px;
    --r-sm: 5px;
    --r-pill: 999px;

    /* ── Layout ─────────────────────────────────────────────── */
    --container: 1320px;
    --gutter: 1.75rem;

    /* ── Motion ──────────────────────────────────────────────── */
    --t: 160ms cubic-bezier(.2, .8, .2, 1);

    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font: 400 var(--body)/1.55 var(--sans);
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

/* Subtle ambient gradient — slight navy hints at corners, no warmth.
   Adds depth without competing with the white tiles. */
body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    background:
        radial-gradient(at 15% 5%, rgba(30, 42, 82, 0.035), transparent 55%),
        radial-gradient(at 90% 95%, rgba(44, 74, 138, 0.025), transparent 60%);
    z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

/* ─────────────────────────────────────────────────────────────
 *  Typography
 * ───────────────────────────────────────────────────────────── */

a {
    color: var(--brand-bright);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t), color var(--t);
}
a:hover { color: var(--brand-deep); border-bottom-color: var(--brand); }

h1, h2, h3, h4 {
    font-family: var(--sans);
    color: var(--ink-strong);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.018em;
}
h1 { font-size: var(--h1); font-weight: 600; letter-spacing: -0.022em; }
h2 {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-family: var(--mono);
    margin: 2.75rem 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
h3 { font-size: var(--h3); font-weight: 600; color: var(--ink-strong); }

p { margin: 0.4rem 0; }

code {
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--brand-deep);
    background: var(--brand-bg-soft);
    padding: 0.08em 0.4em;
    border-radius: var(--r-sm);
    font-feature-settings: "ss02", "cv11";
}
pre {
    font-family: var(--mono);
    font-size: var(--sm);
    background: var(--ink-strong);
    color: #e8e8eb;
    border: 1px solid var(--ink-strong);
    border-radius: var(--r);
    padding: 0.95rem 1.1rem;
    overflow-x: auto;
    line-height: 1.6;
}
pre code { font-size: inherit; background: none; padding: 0; color: inherit; }

.display {
    font-size: var(--display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.04;
    color: var(--brand-deep);
}

.muted  { color: var(--ink-dim); }
.faint  { color: var(--ink-faint); }
.lede   { font-size: 1rem; color: var(--ink); margin-top: 0.45rem; max-width: 60ch; }
.kicker {
    font-family: var(--mono);
    font-size: var(--xs);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--brand);
    font-weight: 600;
}
.fw-badge {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    background: var(--brand-deep);
    border: 1px solid var(--brand-deep);
    border-radius: var(--r-sm);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ─────────────────────────────────────────────────────────────
 *  Topbar
 * ───────────────────────────────────────────────────────────── */

.topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(237, 241, 247, 0.92);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.85rem var(--gutter);
    display: flex;
    align-items: center;
    gap: 1.75rem;
}
.brand {
    display: inline-flex; align-items: center; gap: 0.7rem;
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    letter-spacing: -0.015em;
    line-height: 1;
}
.brand:hover { border: none; color: var(--brand-bright); }
.brand:hover .brand-logo { filter: brightness(1.05); }
.brand-mark { color: var(--brand-deep); }
.brand-fallback { color: var(--brand-deep); font-weight: 700; font-size: 1.05rem; }
.brand-logo {
    display: block;
    height: 32px;
    width: auto;
    object-fit: contain;
    transition: filter var(--t);
}
@media (max-width: 720px) { .brand-logo { height: 26px; } }
.brand-mono {
    font-family: var(--mono);
    color: var(--brand);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    background: var(--brand-bg);
    border-radius: var(--r-sm);
}
.topnav {
    display: flex; gap: 0.25rem;
    margin-left: 0.5rem;
}
.topnav a {
    color: var(--ink-dim);
    font-size: var(--sm);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--r-sm);
    border: none;
    transition: color var(--t), background var(--t);
}
.topnav a:hover { color: var(--brand-deep); background: var(--bg-2); border: none; }
.topnav a.active { color: var(--brand-deep); background: var(--brand-bg); border: none; }

.topbar-right {
    margin-left: auto;
    display: flex; gap: 1rem; align-items: center;
    font-family: var(--mono);
    font-size: var(--xs);
    color: var(--ink-faint);
}
.topbar-right .user { color: var(--brand); font-weight: 500; }
.dev-flag {
    font-family: var(--mono);
    font-size: var(--xs);
    color: var(--c-needs_review);
    background: var(--c-needs_review-bg);
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-sm);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid var(--c-needs_review-border);
}

.user-logout, .user-admin {
    font-family: var(--mono);
    font-size: var(--xs);
    color: var(--ink-dim);
    text-decoration: none;
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    transition: background 0.12s, color 0.12s;
}
.user-logout:hover, .user-admin:hover { color: var(--ink); background: var(--bg-2); }
.user-admin {
    color: var(--brand);
    border-color: var(--brand);
}
.user-admin:hover { background: var(--brand); color: #fff; }

/* ─────────────────────────────────────────────────────────────
 *  Admin pages
 * ───────────────────────────────────────────────────────────── */
.admin-back {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--ink-dim);
}
.admin-back:hover { color: var(--ink); }

.admin-card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.4rem 1.4rem;
    margin-bottom: 1.5rem;
}
.admin-card-flash {
    border-left: 3px solid var(--c-met);
}
.admin-card-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.admin-card-title {
    font-size: 1rem; font-weight: 600; color: var(--ink-strong);
    margin: 0;
}
.admin-card-sub { font-size: 0.78rem; }
.admin-card-sub code {
    background: var(--bg-2); border: 1px solid var(--line-soft);
    border-radius: 3px; padding: 0.05rem 0.35rem; font-size: 0.72rem;
}
.admin-empty { padding: 1rem 0; }

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}
.admin-field { display: grid; gap: 0.35rem; min-width: 0; }
.admin-field-full { grid-column: 1 / -1; }
.admin-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.admin-hint { font-size: 0.72rem; margin-top: 0.1rem; }
.admin-form input[type=text],
.admin-form input[type=password],
.admin-form select {
    border: 1px solid var(--line-strong);
    background: var(--bg-1);
    border-radius: 3px;
    padding: 0.5rem 0.65rem;
    font-family: var(--sans);
    font-size: 0.88rem;
    color: var(--ink-strong);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.admin-form input:focus, .admin-form select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(44,74,138,0.15);
}
.admin-form fieldset {
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 0.5rem 0.9rem 0.7rem;
    display: grid; gap: 0.35rem;
    background: var(--bg-2);
}
.admin-form legend { padding: 0 0.3rem; }
.admin-check {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.admin-check input[type=checkbox] {
    width: 1rem; height: 1rem;
    accent-color: var(--brand);
}
.admin-actions {
    display: flex; gap: 0.6rem; justify-content: flex-end;
    margin-top: 0.4rem;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand-deep);
    border-radius: 3px;
    padding: 0.55rem 1.1rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}
.btn-primary:hover { background: var(--brand-bright); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger-small {
    background: transparent;
    color: var(--c-not_met);
    border: 1px solid var(--c-not_met);
    border-radius: 3px;
    padding: 0.25rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}
.btn-danger-small:hover { background: var(--c-not_met); color: #fff; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th, .admin-table td {
    padding: 0.55rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
}
.admin-table th {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    font-weight: 600;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .col-action { text-align: right; width: 1%; white-space: nowrap; }

.tenant-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-family: var(--mono); font-size: 0.72rem;
    padding: 0.18rem 0.55rem;
    border-radius: 3px;
    background: var(--bg-2); border: 1px solid var(--line);
    color: var(--ink-strong); text-decoration: none;
    margin-right: 0.35rem;
    transition: background 0.12s;
}
.tenant-pill:hover { background: var(--bg-3); }
.tenant-pill-fw {
    background: var(--brand-deep); color: #fff;
    padding: 0.05rem 0.35rem; border-radius: 2px;
    font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.05em;
}
.tenant-pill-mini {
    display: inline-block;
    font-family: var(--mono); font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    background: var(--bg-2); border: 1px solid var(--line-soft);
    margin-right: 0.25rem; margin-bottom: 0.18rem;
}

.tag {
    display: inline-block;
    font-family: var(--mono); font-size: 0.62rem;
    padding: 0.08rem 0.4rem;
    border-radius: 2px;
    text-transform: uppercase; letter-spacing: 0.08em;
    font-weight: 700;
    margin-left: 0.35rem;
}
.tag-admin { background: var(--brand); color: #fff; }
.tag-warn  { background: var(--c-needs_review-bg); color: var(--c-needs_review); border: 1px solid var(--c-needs_review-border); }

/* ─────────────────────────────────────────────────────────────
 *  Admin list (replaces table for rows that have an inline edit drawer)
 *  Layout: 4-column grid summary row; when <details open>, the body
 *  expands underneath at full row width so forms have room.
 * ───────────────────────────────────────────────────────────── */
.admin-list { display: flex; flex-direction: column; }
.admin-list-head,
.admin-list-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(80px, 0.7fr) minmax(0, 2fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
}
.admin-list-head {
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    font-weight: 600;
}
.admin-list-row {
    border-bottom: 1px solid var(--line-soft);
}
.admin-list-row:last-child { border-bottom: none; }
.admin-list-summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
    transition: background 0.12s;
    min-width: 0;
}
.admin-list-summary::-webkit-details-marker { display: none; }
.admin-list-summary:hover { background: var(--bg-2); }
.admin-list-row[open] > .admin-list-summary {
    background: var(--bg-2);
    border-bottom: 1px solid var(--line-soft);
}
.admin-list-summary .col-slug,
.admin-list-head .col-slug { font-size: 0.85rem; color: var(--ink-dim); }
.admin-list-summary .col-tenants,
.admin-list-summary .col-name { min-width: 0; }
.admin-list-summary .col-tenants {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.admin-list-summary .col-toggle { text-align: right; }
.admin-list-toggle {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-dim);
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    transition: color 0.12s, border-color 0.12s;
}
.admin-list-row[open] .admin-list-toggle {
    color: var(--brand);
    border-color: var(--brand);
}
.admin-list-body {
    padding: 1rem 1rem 1.15rem;
    background: var(--bg-2);
    border-top: 1px solid var(--line-soft);
}
.admin-list-danger {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--line);
    display: flex;
    justify-content: flex-end;
}
.admin-list-users .admin-list-head,
.admin-list-users .admin-list-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto;
}
.admin-list-users .col-display { color: var(--ink); font-size: 0.9rem; min-width: 0; }
.admin-list-users .col-tenants { display: flex; flex-wrap: wrap; gap: 0.25rem; min-width: 0; }

@media (max-width: 760px) {
    .admin-list-head { display: none; }
    .admin-list-summary {
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "name toggle"
            "slug toggle"
            "tenants tenants";
        gap: 0.4rem;
    }
    .admin-list-summary .col-name    { grid-area: name; min-width: 0; }
    .admin-list-summary .col-slug    { grid-area: slug; }
    .admin-list-summary .col-display { grid-area: slug; }
    .admin-list-summary .col-tenants { grid-area: tenants; }
    .admin-list-summary .col-toggle  { grid-area: toggle; }
}

.admin-edit {
    text-align: left;
}
.admin-edit > summary {
    display: inline-block;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-dim);
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    list-style: none;
    text-align: right;
}
.admin-edit > summary::-webkit-details-marker { display: none; }
.admin-edit[open] > summary { color: var(--brand); border-color: var(--brand); }
.admin-edit-form {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
}

.token-display {
    background: var(--bg-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 0.85rem 1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}
.token-display code {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--ink-strong);
    word-break: break-all;
}
.token-env {
    background: var(--bg-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 0.65rem 0.85rem;
    overflow-x: auto;
    font-size: 0.72rem;
    line-height: 1.5;
    margin: 0.4rem 0 0;
}
.token-env code { font-family: var(--mono); color: var(--ink-strong); }

@media (max-width: 760px) {
    .admin-form-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────
 *  Login
 * ───────────────────────────────────────────────────────────── */
.login-shell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding-top: 5vh;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    padding: 2rem 2rem 1.75rem;
}
.login-head { margin-bottom: 1.5rem; }
.login-head .display { font-size: 1.875rem; letter-spacing: -0.025em; }
.login-head .lede { font-size: 0.85rem; margin-top: 0.4rem; }
.login-head .lede code {
    background: var(--bg-2); border: 1px solid var(--line-soft);
    border-radius: 3px; padding: 0.05rem 0.35rem;
    font-size: 0.75rem; color: var(--ink-strong);
}
.login-form { display: grid; gap: 1rem; }
.login-field { display: grid; gap: 0.35rem; }
.login-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.login-form input[type=text], .login-form input[type=password] {
    border: 1px solid var(--line-strong);
    background: var(--bg-1);
    border-radius: 3px;
    padding: 0.55rem 0.7rem;
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink-strong);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.login-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint, rgba(44,74,138,0.15));
}
.login-submit {
    margin-top: 0.25rem;
    width: 100%;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand-deep);
    border-radius: 3px;
    padding: 0.65rem 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
}
.login-submit:hover { background: var(--brand-bright); }

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2.5rem var(--gutter) 5rem;
}

.section { margin-top: 2.75rem; }
.section:first-child { margin-top: 0; }

.page-head { margin-bottom: 1.75rem; }
.page-head .kicker { margin-bottom: 0.5rem; display: block; }

/* ─────────────────────────────────────────────────────────────
 *  Footer
 * ───────────────────────────────────────────────────────────── */

.footer {
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    padding: 1.25rem 0;
    text-align: center;
    font-size: var(--xs);
    color: var(--ink-faint);
    font-family: var(--mono);
    letter-spacing: 0.04em;
}
.footer code { color: var(--ink-dim); font-size: inherit; }

/* ─────────────────────────────────────────────────────────────
 *  Level toggle (L1 / L2 tabs in customer page header)
 * ───────────────────────────────────────────────────────────── */

.level-toggle {
    display: inline-flex;
    margin-top: 0.85rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 0.25rem;
    box-shadow: var(--shadow-sm);
    gap: 0.25rem;
}
.level-tab {
    display: inline-flex; align-items: baseline;
    gap: 0.55rem;
    padding: 0.55rem 1rem;
    border-radius: var(--r-sm);
    color: var(--ink-dim);
    text-decoration: none;
    border: none;
    transition: background var(--t), color var(--t);
}
.level-tab:hover { color: var(--brand-deep); background: var(--bg-2); border: none; }
.level-tab.active {
    background: var(--brand-deep);
    color: #fff;
}
.level-tab.active:hover { color: #fff; background: var(--brand-deep); border: none; }
.level-tab-short {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.level-tab-name {
    font-size: 0.85rem;
    font-weight: 500;
}
.level-tab.active .level-tab-name { color: rgba(255, 255, 255, 0.85); }

/* ─────────────────────────────────────────────────────────────
 *  Companies landing (one tile per company)
 * ───────────────────────────────────────────────────────────── */

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.5rem;
    margin-top: 1.75rem;
}
.company-tile {
    display: flex; flex-direction: column; gap: 1.1rem;
    padding: 1.4rem 1.6rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: inherit;
    text-decoration: none;
    transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
    box-shadow: var(--shadow-md);
}
.company-tile:hover {
    border-color: var(--brand);
    border-bottom: 1px solid var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.company-tile-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line-soft);
}
.company-tile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.015em;
}
.company-tile-id {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    margin-top: 0.25rem;
}
.company-tile-levels { display: flex; gap: 0.35rem; }
.company-tile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line-soft);
}
.cts {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
}
.cts .num { font-size: 1.5rem; color: var(--ink-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.025em; font-weight: 700; line-height: 1; }
.cts .lbl { font-size: 0.7rem; }
.cts .dot { margin-bottom: 0.3rem; }
.cts-met .dot { background: var(--c-met); }
.cts-not .dot { background: var(--c-not_met); }
.cts-rev .dot { background: var(--c-needs_review); }
.cts-na .dot  { background: var(--c-na); }
.cts-not .num { color: var(--c-not_met); }
.company-tile-foot {
    display: flex; justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─────────────────────────────────────────────────────────────
 *  Companies landing (legacy — kept for fallback only)
 * ───────────────────────────────────────────────────────────── */

.companies {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.75rem;
}
.company-card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1.4rem 1.6rem 1.4rem;
    box-shadow: var(--shadow-md);
}
.company-card-head {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-bottom: 1rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--line-soft);
}
.company-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-deep);
    letter-spacing: -0.015em;
}
.company-id {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    margin-top: 0.2rem;
}
.company-fw-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.fw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1rem;
}
.fw-card {
    display: flex; flex-direction: column; gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: inherit;
    text-decoration: none;
    transition: background var(--t), border-color var(--t), box-shadow var(--t), transform var(--t);
    box-shadow: var(--shadow-sm);
}
.fw-card:hover {
    background: var(--bg-1);
    border-color: var(--brand);
    border-bottom: 1px solid var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.fw-card-head { display: flex; align-items: center; gap: 0.6rem; }
.fw-card-head .fw-badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.18rem 0.55rem;
    background: var(--brand-deep);
    border: 1px solid var(--brand-deep);
    border-radius: var(--r-sm);
    color: #fff;
}
.fw-name {
    font-size: 0.95rem;
    color: var(--ink-strong);
    font-weight: 600;
}
.fw-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line-soft);
}
.fws {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
}
.fws .num { font-size: 1.05rem; color: var(--ink-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; font-weight: 600; }
.fws .lbl { font-size: 0.7rem; }
.fws .dot { margin-bottom: 0.3rem; }
.fw-card-foot {
    display: flex; justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.tenant-error {
    padding: 0.7rem 0.9rem;
    border-radius: var(--r-sm);
    background: var(--c-not_met-bg);
    color: var(--c-not_met);
    font-size: 0.8125rem;
    font-family: var(--mono);
    border: 1px solid var(--c-not_met-border);
}

/* ─────────────────────────────────────────────────────────────
 *  Action-required callout
 * ───────────────────────────────────────────────────────────── */

.remed-upload {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem;
    margin: 1rem 0 1.25rem;
    padding: 0.85rem 1.1rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
}
.remed-upload-info { min-width: 0; flex: 1 1 auto; }
.remed-upload-title {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.remed-upload-sub {
    font-size: 0.825rem;
    line-height: 1.45;
}
.remed-upload-sub code {
    background: var(--bg-2);
    border: 1px solid var(--line-soft);
    border-radius: 3px;
    padding: 0.05rem 0.35rem;
    font-size: 0.78rem;
    color: var(--ink-strong);
}
.remed-upload-form {
    display: flex; align-items: center; gap: 0.6rem;
    flex: 0 0 auto;
}
.remed-upload-form input[type=file] {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink);
    max-width: 240px;
}
.remed-upload-form input[type=file]::file-selector-button {
    font-family: var(--mono);
    font-size: 0.75rem;
    background: var(--bg-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0.35rem 0.7rem;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: background 0.12s;
}
.remed-upload-form input[type=file]::file-selector-button:hover {
    background: var(--bg-3);
}
.remed-upload-form .btn-primary {
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand-deep);
    border-radius: 3px;
    padding: 0.45rem 0.95rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, transform 0.08s;
}
.remed-upload-form .btn-primary:hover { background: var(--brand-bright); }
.remed-upload-form .btn-primary:active { transform: translateY(1px); }
@media (max-width: 900px) {
    .remed-upload { flex-direction: column; align-items: stretch; gap: 0.85rem; }
    .remed-upload-form { justify-content: flex-start; flex-wrap: wrap; }
}

.action-callout {
    margin: 1rem 0 2rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-left: 3px solid var(--c-not_met);
    border-radius: var(--r);
    padding: 1.25rem 1.4rem 1.25rem;
    box-shadow: var(--shadow-lg);
}
.action-callout-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line-soft);
}
.action-callout-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--c-not_met);
    font-weight: 700;
}
.action-callout-title {
    margin-top: 0.3rem;
    color: var(--ink-strong);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.45;
}
.action-callout-title strong { font-weight: 700; font-size: 1.625rem; letter-spacing: -0.025em; margin-right: 0.4rem; color: var(--c-not_met); }
.action-callout-foot {
    margin-top: 0.85rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line-soft);
    font-family: var(--mono);
    font-size: var(--sm);
    color: var(--ink-dim);
}

.action-list {
    list-style: none;
    padding: 0; margin: 0;
    display: grid; gap: 0.45rem;
}
.action-row {
    display: grid;
    grid-template-columns: 32px 140px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink);
    text-decoration: none;
    transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.action-row:hover {
    background: var(--bg-2);
    border-color: var(--brand);
    border-bottom: 1px solid var(--brand);
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}
.action-row.not_met       { border-left: 3px solid var(--c-not_met); }
.action-row.needs_review  { border-left: 3px solid var(--c-needs_review); }
.action-pid {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--brand-deep);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.action-title {
    font-size: 0.9375rem;
    color: var(--ink);
    line-height: 1.4;
    font-weight: 400;
}
.action-tags { display: flex; gap: 0.4rem; }
.action-tag {
    font-family: var(--mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.18rem 0.5rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-dim);
    font-weight: 500;
}
.action-tag-auto { color: var(--c-met); border-color: var(--c-met-border); background: var(--c-met-bg); }

.link-button {
    background: none; border: none;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    padding: 0;
    font-weight: 500;
}
.link-button:hover { color: var(--brand-deep); }

@media (max-width: 760px) {
    .action-row { grid-template-columns: 32px 1fr; gap: 0.65rem; }
    .action-pid, .action-title, .action-tags { grid-column: 2; }
}

/* ─────────────────────────────────────────────────────────────
 *  Dashboard 2-column (overview rail + content)
 * ───────────────────────────────────────────────────────────── */

.dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 1.25rem;
    align-items: start;
}
@media (max-width: 1080px) { .dashboard { grid-template-columns: 1fr; } }

.overview {
    display: grid;
    gap: 1.25rem;
    align-content: start;
    /* Flow with the page (no sticky, no internal overflow). On a tall
       framework view (L2 = 14 family bars + many panels) the rail simply
       scrolls off the top as you read the practices, same as the rest of
       the document — no wheel trap, no clipped panels. */
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--bg-1);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--shadow-sm);
}
.panel-header {
    display: flex; justify-content: space-between; align-items: baseline;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--brand);
    font-weight: 600;
    padding-bottom: 0.65rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--line-soft);
}
.panel-header .panel-meta { color: var(--ink-faint); font-weight: 500; }

/* Progress meter */
.progress { display: flex; flex-direction: column; gap: 0.6rem; }
.progress-num {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--brand-deep);
    letter-spacing: -0.025em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.progress-bar {
    display: flex; height: 8px;
    background: var(--bg-3);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar > span { display: block; height: 100%; }
.progress-meta {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}

/* Count list */
.count-list { display: grid; gap: 0.5rem; }
.count-row {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}
.count-row .count-label { color: var(--ink); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }
.count-row .count-num { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 600; }
.count-row.row-na { color: var(--ink-dim); }
.count-row.row-na .count-num { color: var(--ink-dim); }

/* KV list (re-assessment, host kv) */
.kv-list { display: grid; gap: 0.6rem; font-size: 0.875rem; }
.kv-list .kv-k {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    margin-bottom: 0.15rem;
    font-weight: 500;
}
.kv-list .kv-v { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 500; }
.kv-list .kv-v.alert { color: var(--c-not_met); }
.kv-list .kv-v.warn  { color: var(--c-needs_review); }

/* Family findings bars */
.family-bars { display: grid; gap: 0.55rem; }
.family-bar {
    display: grid;
    grid-template-columns: 28px 1fr 24px;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--mono);
    font-size: 0.75rem;
}
.family-bar .fb-code { color: var(--brand-deep); font-weight: 600; }
.family-bar .fb-track {
    height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden;
}
.family-bar .fb-fill { height: 100%; background: var(--c-not_met); }
.family-bar .fb-count { color: var(--ink-strong); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.family-bar.clean .fb-count { color: var(--ink-faint); }
.family-bar.clean .fb-track { opacity: 0.5; }

/* ─────────────────────────────────────────────────────────────
 *  Hosts overview page (STIG-Manager multi-asset view)
 * ───────────────────────────────────────────────────────────── */

.overall-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: center;
}
@media (max-width: 760px) { .overall-grid { grid-template-columns: 1fr; gap: 1.25rem; } }

.overall-pct {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 0.4rem;
    border-right: 1px solid var(--line-soft);
    padding-right: 1.5rem;
}
@media (max-width: 760px) { .overall-pct { border-right: none; padding-right: 0; padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); } }
.overall-pct-num {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.overall-pct-sym {
    font-size: 1.5rem;
    color: var(--ink-dim);
    margin-left: 0.1rem;
    font-weight: 600;
}
.overall-pct-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-dim);
    font-weight: 500;
}

.overall-bar-wrap { display: flex; flex-direction: column; gap: 0.85rem; }
.overall-bar {
    display: flex;
    height: 12px;
    background: var(--bg-3);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.overall-bar > span { display: block; height: 100%; }
.overall-counts {
    display: flex; flex-wrap: wrap;
    gap: 1.25rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.oc { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500; }
.oc .num { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.95rem; }

/* Host cards grid */
.host-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}
.host-card {
    display: flex; flex-direction: column; gap: 0.95rem;
    padding: 1.25rem 1.4rem 1.35rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: inherit;
    text-decoration: none;
    transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
    box-shadow: var(--shadow-md);
}
.host-card:hover {
    border-color: var(--brand);
    border-bottom: 1px solid var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.host-card-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line-soft);
}
.host-card-name {
    font-family: var(--mono);
    font-size: 1rem;
    color: var(--brand-deep);
    font-weight: 700;
    letter-spacing: 0.01em;
}
.host-card-meta {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
    font-weight: 500;
}
.host-card-pct {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.host-card-pct.good { color: var(--c-met); }
.host-card-pct.warn { color: var(--c-needs_review); }
.host-card-pct.bad  { color: var(--c-not_met); }
.host-card-pct-sym {
    font-size: 0.85rem;
    color: var(--ink-faint);
    margin-left: 0.05rem;
    font-weight: 600;
}
.host-card-bar {
    display: flex;
    height: 8px;
    background: var(--bg-3);
    border-radius: 4px;
    overflow: hidden;
}
.host-card-bar > span { display: block; height: 100%; }
.host-card-counts {
    display: flex; flex-wrap: wrap;
    gap: 0.85rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line-soft);
}
.host-card-counts .num { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.9rem; }

.host-card-fams { display: grid; gap: 0.4rem; }
.hcf {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--mono);
    font-size: 0.75rem;
}
.hcf-code { color: var(--brand-deep); font-weight: 700; }
.hcf-bar {
    display: flex;
    height: 5px;
    background: var(--bg-3);
    border-radius: 3px;
    overflow: hidden;
}
.hcf-bar > span { display: block; height: 100%; }
.hcf-count { color: var(--ink-strong); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hcf.hcf-clean .hcf-count { color: var(--ink-faint); }
.hcf.hcf-clean .hcf-bar { opacity: 0.55; }

.host-card-foot {
    display: flex; justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line-soft);
}
.host-card-runid { font-size: 0.625rem; letter-spacing: 0.04em; }

/* Per-host detail page — big compliance pct in the header */
.host-detail-pct {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 0.2rem;
}
.host-detail-pct-num {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.host-detail-pct.good .host-detail-pct-num { color: var(--c-met); }
.host-detail-pct.warn .host-detail-pct-num { color: var(--c-needs_review); }
.host-detail-pct.bad  .host-detail-pct-num { color: var(--c-not_met); }
.host-detail-pct-sym {
    font-size: 1.25rem;
    color: var(--ink-faint);
    font-weight: 600;
}
.host-detail-pct-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    font-weight: 500;
}

/* Host stat mini-cards */
.host-stat-list { display: grid; gap: 0.75rem; }
.host-stat {
    display: block;
    padding: 0.75rem 0.85rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink);
    text-decoration: none;
    transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.host-stat:hover { background: var(--bg-1); border-color: var(--brand); border-bottom: 1px solid var(--brand); box-shadow: var(--shadow-sm); }
.host-stat-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.45rem; }
.host-stat-name { font-family: var(--mono); font-size: 0.825rem; color: var(--brand-deep); font-weight: 600; }
.host-stat-count { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.host-stat-bar { display: flex; height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-bottom: 0.5rem; }
.host-stat-bar > span { height: 100%; }
.host-stat-foot { display: flex; align-items: center; gap: 0.7rem; font-family: var(--mono); font-size: 0.7rem; color: var(--ink-dim); }
.host-stat-dot { display: inline-flex; align-items: center; gap: 0.3rem; font-variant-numeric: tabular-nums; }
.host-stat-run { margin-left: auto; font-size: 0.625rem; color: var(--ink-faint); letter-spacing: 0.04em; }

/* ─────────────────────────────────────────────────────────────
 *  Filter bar
 * ───────────────────────────────────────────────────────────── */

.filters {
    display: flex; align-items: center;
    gap: 0.45rem; flex-wrap: wrap;
    margin: 0 0 1rem;
}
.filter-pill {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--ink-dim);
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--t), background var(--t), border-color var(--t);
}
.filter-pill:hover { color: var(--brand-deep); border-color: var(--brand); }
.filter-pill.active { color: #fff; background: var(--brand-deep); border-color: var(--brand-deep); }
.filter-pill .count { color: var(--ink-faint); font-size: 0.625rem; }
.filter-pill.active .count { color: rgba(255, 255, 255, 0.7); }

.filter-search {
    margin-left: auto;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    width: 240px;
    transition: border-color var(--t), box-shadow var(--t);
}
.filter-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg); }
.filter-search::placeholder { color: var(--ink-faint); }

/* ─────────────────────────────────────────────────────────────
 *  Status indicator (dot)
 * ───────────────────────────────────────────────────────────── */

.dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 999px;
    background: var(--ink-faint);
    flex-shrink: 0;
}
.status {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-dim);
    white-space: nowrap;
}
.status-met        { color: var(--c-met); }
.status-met        .dot { background: var(--c-met); }
.status-not_met    { color: var(--c-not_met); }
.status-not_met    .dot { background: var(--c-not_met); }
.status-needs_review { color: var(--c-needs_review); }
.status-needs_review .dot { background: var(--c-needs_review); }
.status-na         { color: var(--c-na); }
.status-na         .dot { background: var(--c-na); }

/* Status code chip (M / O / R / NA) — STIG-Manager style */
.scode {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 24px;
    border-radius: var(--r-sm);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: var(--bg-2);
    color: var(--ink-dim);
    border: 1px solid var(--line);
}
.scode.met        { color: #fff;             border-color: var(--c-met);            background: var(--c-met); }
.scode.not_met    { color: #fff;             border-color: var(--c-not_met);        background: var(--c-not_met); }
.scode.needs_review { color: #fff;           border-color: var(--c-needs_review);   background: var(--c-needs_review); }
.scode.na         { color: var(--ink);       border-color: var(--c-na);             background: var(--bg-2); }

/* Inline scope tag (A,M,P) */
.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--ink-dim);
    background: var(--bg-2);
    border: 1px solid var(--line);
    padding: 0.1rem 0.45rem;
    border-radius: var(--r-sm);
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
 *  Practice table
 * ───────────────────────────────────────────────────────────── */

.ptable {
    margin: 0.5rem 0 1rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.ptable-head, .ptable-row {
    display: grid;
    grid-template-columns: 32px minmax(130px, max-content) 1fr 70px 70px;
    gap: 1.1rem;
    align-items: center;
    padding: 0 0.95rem;
}
.ptable-head {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}
.ptable-head > span {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    font-weight: 600;
}
.ptable-head .col-findings { text-align: right; }

.ptable-row {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink);
    text-decoration: none;
    transition: background var(--t);
    position: relative;
}
.ptable-row:last-child { border-bottom: none; }
.ptable-row:hover { background: var(--bg-2); border-bottom-color: var(--line); }

.ptable-row .col-dot { display: flex; justify-content: center; }
.ptable-row .col-id {
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--brand-deep);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ptable-row .col-title {
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.45;
    font-weight: 400;
}
.ptable-row .col-scope {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
    font-weight: 600;
}
.ptable-row .col-findings {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-dim);
    text-align: right;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* MET rows recede; NOT_MET / REVIEW pull forward */
.ptable-row.met .col-title { color: var(--ink-dim); }
.ptable-row.met .col-id    { color: var(--ink-faint); }

.ptable-row.not_met      { box-shadow: inset 3px 0 0 var(--c-not_met); }
.ptable-row.needs_review { box-shadow: inset 3px 0 0 var(--c-needs_review); }
.ptable-row.not_met:hover      { box-shadow: inset 3px 0 0 var(--c-not_met); }
.ptable-row.needs_review:hover { box-shadow: inset 3px 0 0 var(--c-needs_review); }
.ptable-row.na           { opacity: 0.55; }

.ptable-row .col-note {
    grid-column: 2 / -1;
    font-size: 0.825rem;
    color: var(--ink-dim);
    margin-top: -0.15rem;
    padding-top: 0;
    line-height: 1.4;
}

/* Family divider row */
.family-divider {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 1.1rem 0.95rem 0.7rem;
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    background: var(--bg-2);
}
.family-divider:first-child { padding-top: 0.8rem; border-top: none; }
.family-divider .family-name {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--brand-deep);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}
.family-divider .family-name .fam-code {
    color: #fff;
    margin-right: 0.55rem;
    padding: 0.13rem 0.5rem;
    background: var(--brand-deep);
    border-radius: var(--r-sm);
    border: 1px solid var(--brand-deep);
    font-size: 0.72rem;
    font-weight: 700;
}
.family-divider .family-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.hidden { display: none !important; }

@media (max-width: 760px) {
    .ptable-head { display: none; }
    .ptable-row {
        grid-template-columns: 32px 1fr;
        gap: 0.85rem;
        padding: 0.95rem;
    }
    .ptable-row .col-id, .ptable-row .col-title,
    .ptable-row .col-scope, .ptable-row .col-findings,
    .ptable-row .col-note { grid-column: 2; text-align: left; }
}

/* ─────────────────────────────────────────────────────────────
 *  Practice detail page
 * ───────────────────────────────────────────────────────────── */

.detail-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}
.detail-head .display {
    font-family: var(--mono);
    font-size: 2.25rem;
    letter-spacing: -0.01em;
    margin: 0.2rem 0 0.5rem;
    color: var(--brand-deep);
}

.kv {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    grid-template-columns: minmax(160px, max-content) 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
}
.kv dt, .kv .k {
    color: var(--ink-faint);
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}
.kv dd, .kv .v { margin: 0; color: var(--ink-strong); font-weight: 500; }

/* Findings (expandable) */
.finding {
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin: 0.65rem 0;
    background: var(--bg-1);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.finding summary {
    list-style: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.85rem; align-items: center;
    font-size: var(--sm);
    transition: background var(--t);
}
.finding summary::-webkit-details-marker { display: none; }
.finding summary:hover { background: var(--bg-2); }
.finding[open] summary { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.finding-body {
    padding: 0.85rem 1rem 1rem;
    background: var(--bg-1);
}
.finding-meta {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────────────────────────
 *  Fix panel (STIG-Manager style)
 * ───────────────────────────────────────────────────────────── */

.fix-panel {
    margin: 1.75rem 0 0;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--bg-1);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.fix-not_met       { border-left: 4px solid var(--c-not_met); }
.fix-needs_review  { border-left: 4px solid var(--c-needs_review); }

.fix-header {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}
.fix-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--brand-deep);
    font-weight: 700;
}
.fix-status {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-dim);
    font-weight: 600;
}

.fix-body {
    padding: 1.1rem 1.2rem 1.25rem;
    display: grid;
    gap: 1.2rem;
}
.fix-block + .fix-block { padding-top: 1.1rem; border-top: 1px solid var(--line-soft); }
.fix-block-title {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brand);
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.fix-step + .fix-step { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line-soft); }
.fix-step-host {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-dim);
    margin-bottom: 0.5rem;
}

/* Code blocks in fix panel use dark inversion — high contrast for ops */
.fix-cmd {
    background: var(--ink-strong);
    border: 1px solid var(--ink-strong);
    border-radius: var(--r-sm);
    padding: 0.75rem 1rem;
    margin: 0;
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: #e6e8f1;
    overflow-x: auto;
    cursor: text;
    user-select: all;
    line-height: 1.55;
}
.fix-cmd code { background: none; padding: 0; color: inherit; font-size: inherit; }

.fix-note {
    font-size: 0.9375rem;
    color: var(--ink);
    line-height: 1.55;
    margin: 0;
}
.fix-hint {
    font-size: 0.8rem;
    color: var(--ink-dim);
    margin: 0.5rem 0 0;
    font-family: var(--sans);
}

/* OS two-column grid */
.fix-os-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 880px) { .fix-os-grid { grid-template-columns: 1fr; } }

.fix-os {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.95rem 1.05rem;
    min-width: 0; /* Grid items default min-width is auto; needed so .fix-cmd can scroll */
}
.fix-step { min-width: 0; }
.fix-cmd { white-space: pre; }
.fix-os-label { margin-bottom: 0.7rem; }
.os-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 0.2rem 0.65rem;
    border-radius: var(--r-sm);
    font-weight: 700;
}
.os-win   { background: rgba(30, 64, 175, 0.10); color: #1e40af; border: 1px solid rgba(30, 64, 175, 0.30); }
.os-linux { background: rgba(163, 94, 10, 0.10); color: var(--c-needs_review); border: 1px solid var(--c-needs_review-border); }

.fix-step-label {
    font-size: 0.85rem;
    color: var(--ink-strong);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

/* Provider sections */
.fix-providers { display: grid; gap: 0.6rem; }
.fix-provider {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.fix-provider summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 1rem;
    display: flex; justify-content: space-between; align-items: center;
    color: var(--ink-strong);
    transition: background var(--t);
}
.fix-provider summary::-webkit-details-marker { display: none; }
.fix-provider summary:hover { background: var(--bg-2); }
.fix-provider[open] summary { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.provider-name { font-size: 0.95rem; color: var(--brand-deep); font-weight: 600; }
.fix-provider-steps {
    margin: 0;
    padding: 0.85rem 1rem 0.95rem 2.15rem;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.6;
}
.fix-provider-steps li + li { margin-top: 0.45rem; }

/* Inline per-provider upload form (lives inside .fix-provider details) */
.provider-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem 1rem;
    background: var(--bg-2);
    border-top: 1px dashed var(--line);
}
.provider-upload-label {
    display: flex; flex-direction: column; gap: 0.35rem;
    flex: 1 1 280px;
}
.provider-upload-hint {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand);
    font-weight: 600;
}
.provider-upload-file {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.45rem 0.55rem;
    font-size: 0.85rem;
    color: var(--ink-dim);
    width: 100%;
    transition: border-color var(--t);
}
.provider-upload-file::file-selector-button {
    background: var(--brand-deep);
    color: #fff;
    border: 1px solid var(--brand-deep);
    border-radius: var(--r-sm);
    padding: 0.35rem 0.7rem;
    margin-right: 0.6rem;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t);
}
.provider-upload-file::file-selector-button:hover { background: var(--brand); }
.provider-upload .btn { flex-shrink: 0; }

.generic-upload { max-width: 720px; }

/* ─────────────────────────────────────────────────────────────
 *  Buttons + forms
 * ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 1rem;
    background: var(--brand-deep);
    color: #fff;
    border: 1px solid var(--brand-deep);
    border-radius: var(--r);
    font-family: var(--sans);
    font-size: var(--sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
    box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); border-bottom: 1px solid var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-secondary {
    background: var(--bg-1);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: none;
}
.btn-secondary:hover { background: var(--bg-2); color: var(--brand-deep); border-color: var(--brand); border-bottom: 1px solid var(--brand); box-shadow: var(--shadow-sm); }

.head-actions { display: flex; gap: 0.6rem; align-items: center; }

.form {
    display: grid;
    gap: 1.25rem;
    max-width: 720px;
    margin: 1.5rem 0;
}
.field { display: grid; gap: 0.4rem; }
.field-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand);
    font-weight: 600;
}
.field-hint {
    font-size: 0.75rem;
    color: var(--ink-faint);
    font-family: var(--mono);
}
.input, .textarea {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.6rem 0.8rem;
    color: var(--ink);
    font-family: inherit;
    font-size: var(--body);
    width: 100%;
    transition: border-color var(--t), box-shadow var(--t);
}
.input:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg); }
.textarea { font-family: var(--mono); font-size: var(--sm); resize: vertical; min-height: 150px; }
.file-input { font-size: var(--sm); color: var(--ink-dim); padding: 0.45rem 0.55rem; }
.field-actions { display: flex; gap: 0.6rem; align-items: center; padding-top: 0.5rem; }

/* ─────────────────────────────────────────────────────────────
 *  Flash messages
 * ───────────────────────────────────────────────────────────── */

.flashes { margin: 1rem 0; display: grid; gap: 0.55rem; }
.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--bg-1);
    font-size: var(--sm);
    color: var(--ink);
    border-left: 3px solid var(--ink-faint);
}
.flash-success { border-left-color: var(--c-met);            background: var(--c-met-bg);            color: var(--c-met); }
.flash-error   { border-left-color: var(--c-not_met);        background: var(--c-not_met-bg);        color: var(--c-not_met); }
.flash-warn    { border-left-color: var(--c-needs_review);   background: var(--c-needs_review-bg);   color: var(--c-needs_review); }

/* ─────────────────────────────────────────────────────────────
 *  Misc
 * ───────────────────────────────────────────────────────────── */

.empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--ink-dim);
    border: 1px dashed var(--line-strong);
    border-radius: var(--r);
    margin: 1.5rem 0;
    background: var(--bg-1);
}
.empty-title { color: var(--ink-strong); font-size: 1.05rem; margin-bottom: 0.5rem; font-weight: 600; }

.table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.table th, .table td { padding: 0.65rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table th { font-size: 0.75rem; color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--mono); }
.table tr:hover td { background: var(--bg-2); }

/* Hosts list (legacy compatibility) */
.hosts { margin: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.host-row { display: grid; grid-template-columns: 1.5fr 2fr auto; gap: 1rem; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid var(--line-soft); }
.host-row:last-child { border-bottom: none; }
.host-name { font-family: var(--mono); font-size: 0.95rem; color: var(--brand-deep); font-weight: 600; }
.host-run  { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-dim); letter-spacing: 0.04em; }

/* Doc viewer */
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 880px) { .doc-layout { grid-template-columns: 1fr; } }
.docs-side {
    position: sticky; top: 5rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1rem 1.1rem;
    background: var(--bg-1);
    box-shadow: var(--shadow-sm);
}
.docs-side h2 { margin-top: 0; border-bottom: none; padding: 0; }
.docs-list { list-style: none; padding: 0; margin: 0; }
.docs-list li { margin: 0.15rem 0; }
.docs-list a {
    color: var(--ink-dim);
    font-family: var(--mono);
    font-size: var(--sm);
    display: block;
    padding: 0.35rem 0.55rem;
    border-radius: var(--r-sm);
    border: none;
    text-decoration: none;
}
.docs-list a:hover { color: var(--brand-deep); background: var(--bg-2); border: none; }
.docs-list a.active { color: var(--brand-deep); background: var(--brand-bg); font-weight: 600; }

.prose {
    max-width: 72ch;
    color: var(--ink);
    font-size: var(--body);
    line-height: 1.7;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-sm);
}
.prose h1 { font-size: 1.625rem; margin: 0 0 1rem; color: var(--brand-deep); }
.prose h2 {
    font-family: var(--sans);
    font-size: 1.125rem;
    color: var(--brand-deep);
    text-transform: none;
    letter-spacing: -0.01em;
    border-bottom: none;
    padding: 0;
    margin: 2rem 0 0.65rem;
}
.prose h3 { font-size: 0.9375rem; margin: 1.5rem 0 0.45rem; color: var(--ink-strong); }
.prose p  { margin: 0.7rem 0; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin: 0.25rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--sm); margin: 1rem 0; }
.prose th, .prose td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 0.7rem; color: var(--brand); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.prose blockquote { border-left: 3px solid var(--brand); padding: 0.3rem 0 0.3rem 1.2rem; margin: 1rem 0; color: var(--ink-dim); background: var(--brand-bg-soft); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose img { max-width: 100%; }

/* ─────────────────────────────────────────────────────────────
 *  Bundle page — overrides the 72ch reading limit so the
 *  practices rollup table actually fits.
 * ───────────────────────────────────────────────────────────── */
.bundle-head { display: flex; flex-direction: column; gap: 0.5rem; }
.bundle-title {
    font-family: var(--mono);
    font-size: 1.625rem;
    word-break: break-all;
}
.bundle-actions {
    display: flex; gap: 0.85rem; align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.bundle-actions-hint { font-size: 0.78rem; }

.prose.prose-bundle {
    max-width: none;
    padding: 1.5rem 2rem 2rem;
}
.prose-bundle table {
    table-layout: auto;
    font-size: 0.78rem;
    line-height: 1.45;
    width: 100%;
}
.prose-bundle th, .prose-bundle td {
    padding: 0.45rem 0.6rem;
    word-break: normal;
    overflow-wrap: anywhere;   /* break long pids/notes inside the cell */
    vertical-align: top;
}
.prose-bundle th {
    background: var(--bg-2);
    position: sticky; top: 0;
    z-index: 1;
}
/* The bundle's roll-up table has 8 columns: practice / buckets / final /
   scripted / findings / manual / doc / notes. The first 7 are short, the
   notes column should take the rest of the row. */
.prose-bundle table tr > *:nth-child(1) { width: 8em; }
.prose-bundle table tr > *:nth-child(2) { width: 4em; text-align: center; }
.prose-bundle table tr > *:nth-child(3) { width: 6em; }
.prose-bundle table tr > *:nth-child(4) { width: 7em; }
.prose-bundle table tr > *:nth-child(5) { width: 5em; text-align: right; }
.prose-bundle table tr > *:nth-child(6) { width: 4.5em; }
.prose-bundle table tr > *:nth-child(7) { width: 3.5em; }
.prose-bundle table tr > *:nth-child(8) { width: auto; min-width: 18em; }

/* Highlight status keywords inside cells so the table is scannable */
.prose-bundle td:nth-child(3) { font-weight: 600; }

/* ─────────────────────────────────────────────────────────────
 *  Print / PDF
 * ───────────────────────────────────────────────────────────── */
@media print {
    @page { size: Letter landscape; margin: 0.5in 0.4in 0.55in; }
    body { background: #fff !important; }
    .topbar, .topnav, .footer, .no-print { display: none !important; }
    main.container { padding: 0 !important; }
    .page-head { margin: 0 0 0.6rem; padding: 0; }
    .bundle-title { font-size: 1.25rem !important; }
    .kicker { font-size: 0.65rem; }

    .prose.prose-bundle {
        padding: 0 !important;
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        max-width: none !important;
        font-size: 9.5pt;
        line-height: 1.35;
        color: #000;
    }
    .prose-bundle h1 { font-size: 14pt; color: #000; margin: 0 0 0.4em; }
    .prose-bundle h2 { font-size: 11pt; color: #000; margin: 0.8em 0 0.3em;
                       page-break-after: avoid; }
    .prose-bundle h3 { font-size: 10pt; color: #000; }
    .prose-bundle table { font-size: 8.5pt; }
    .prose-bundle th, .prose-bundle td {
        padding: 3pt 5pt;
        border-bottom: 0.5pt solid #999;
    }
    .prose-bundle th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        position: static; /* sticky doesn't make sense in print */
    }
    .prose-bundle tr { page-break-inside: avoid; }
    .prose-bundle pre, .prose-bundle code {
        font-size: 7.5pt;
        white-space: pre-wrap;
        word-break: break-all;
    }
    .prose-bundle blockquote { border-left: 2pt solid #555; }
    a { color: #000 !important; text-decoration: none; }
}

/* Manual gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.thumb {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    transition: border-color var(--t), box-shadow var(--t);
    box-shadow: var(--shadow-sm);
}
.thumb:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.thumb a { border: none; display: block; }
.thumb img { width: 100%; height: 160px; object-fit: cover; display: block; }
.thumb-meta {
    padding: 0.6rem 0.75rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-dim);
    letter-spacing: 0.02em;
    word-break: break-all;
}
.thumb-file {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--brand-deep);
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Bundle list */
.bundle-list { margin: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bundle-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--line-soft);
}
.bundle-row:last-child { border-bottom: none; }
.bundle-row .name { font-family: var(--mono); color: var(--brand-deep); border: none; font-weight: 600; }
.bundle-row .name:hover { color: var(--brand); border: none; }
.bundle-row .size { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); letter-spacing: 0.04em; }

/* Banner (re-assessment status, etc.) */
.banner {
    display: flex; align-items: center; gap: 0.95rem;
    padding: 0.95rem 1.15rem;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--bg-1);
    font-size: 0.9rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.banner::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--c-na);
}
.banner-ok::before   { background: var(--c-met); }
.banner-warn::before { background: var(--c-needs_review); }
.banner-bad::before  { background: var(--c-not_met); }
.banner strong { color: var(--brand-deep); font-weight: 700; }

.status-list { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.35rem; }
.status-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; }

.quote { background: var(--bg-2); border-left: 3px solid var(--brand); padding: 0.85rem 1.1rem; white-space: pre-wrap; font-family: inherit; font-size: 0.95rem; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); }

/* ─────────────────────────────────────────────────────────────
 *  Focus + selection
 * ───────────────────────────────────────────────────────────── */

::selection { background: var(--brand); color: #fff; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* ─────────────────────────────────────────────────────────────
 *  Stat strip (legacy from earlier rev; rarely used now)
 * ───────────────────────────────────────────────────────────── */

.stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    align-items: baseline;
    padding: 1rem 0;
    margin: 0.5rem 0 1.5rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.stat { display: inline-flex; align-items: baseline; gap: 0.6rem; padding: 0; border: none; }
.stat-num {
    font-size: 1.5rem; font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1;
    color: var(--ink-strong);
}
.stat-label {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink);
    font-weight: 600;
}
.stat.met .dot       { background: var(--c-met); }
.stat.not_met .dot   { background: var(--c-not_met); }
.stat.needs_review .dot { background: var(--c-needs_review); }
.stat.na .dot        { background: var(--c-na); }
.stat.na .stat-label { color: var(--ink-dim); }
.stat.not_met .stat-num { color: var(--c-not_met); }

@media (max-width: 720px) { .stat-strip { gap: 1.25rem; } }

.badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--r-pill);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--ink);
    letter-spacing: 0.04em;
}
