/* ============================================================================
 * Compliance — kill-chain cascade, tenant strip, tactic rows, tenant×axis
 * matrix, and the right-side drilldown rail.
 *
 * Two-column layout owned by ``.fw-killchain-grid`` (cascade + rail at
 * desktop widths, stacked on narrow viewports).  The matrix subsection
 * covers both progression frameworks (MITRE-style worst-reached) and
 * parallel-measures frameworks (AWIA / CISA grade-glyph cells).  MITRE-
 * specific rail chrome (sparkline, phase-card drill, selection states)
 * lives in data/compliance/mitre/static/rail.css per Phase 15 §9.
 * ==========================================================================*/

/* ───────────────────────────── Kill-chain layout (cascade + rail) ───── */
/* Two-column grid: phase cascade on the left, drilldown rail on the
   right, matching the v2 mockup's ``grid-cols-[1fr_340px]``. At narrow
   viewports the rail stacks under the cascade so nothing clips. */
.fw-killchain-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 1024px) {
    .fw-killchain-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}
.fw-killchain-grid > .fw-rail {
    margin-top: 0;
    align-self: start;
    position: sticky;
    top: 1rem;
}

/* ───────────────────────────── Kill-chain cascade ────────────────────── */
.fw-cascade {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.fw-cascade-tenant {
    gap: 0.75rem;
}

.fw-phase {
    position: relative;
    padding-left: 3rem;
}
.fw-phase-marker {
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--fg-on-dark);
    z-index: 2;
}
.fw-phase::before {
    content: "";
    position: absolute;
    left: 0.9375rem;
    top: 2.875rem;
    bottom: -0.75rem;
    width: 2px;
    background: var(--cp-gray-200);
    z-index: 1;
}
.fw-phase:last-child::before {
    display: none;
}

.fw-phase-card {
    background: var(--bg-card);
    border: 1px solid var(--cp-gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    transition:
        box-shadow 0.15s,
        border-color 0.15s;
}
.fw-phase-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.fw-phase-active .fw-phase-card,
.fw-phase-active.fw-phase-card {
    border-color: var(--cp-red-border);
}
.fw-phase-active .fw-phase-head {
    background: linear-gradient(
        90deg,
        var(--cp-red-soft-bg),
        var(--bg-card) 70%
    );
}
.fw-phase-active .fw-phase-marker {
    background: var(--cp-red);
}

.fw-phase-leading .fw-phase-card {
    border-color: var(--cp-amber-leading-border);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}
.fw-phase-leading .fw-phase-head {
    background: linear-gradient(90deg, var(--cp-amber-bg), var(--bg-card) 70%);
}
.fw-phase-leading .fw-phase-marker {
    background: var(--cp-amber);
}

.fw-phase-clear .fw-phase-card {
    border-color: var(--cp-green-border);
}
.fw-phase-clear .fw-phase-head {
    background: linear-gradient(
        90deg,
        var(--cp-green-soft-bg),
        var(--bg-card) 70%
    );
}
.fw-phase-clear .fw-phase-marker {
    background: var(--cp-green);
}

.fw-phase-idle .fw-phase-card {
    border-color: var(--cp-gray-200);
    opacity: 0.85;
}
.fw-phase-idle .fw-phase-head {
    background: var(--bg-page);
}
.fw-phase-idle .fw-phase-marker {
    background: var(--cp-gray-400);
}

.fw-phase-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px dashed var(--cp-gray-200);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cp-gray-500);
}
.fw-phase-kicker {
    color: var(--cp-gray-500);
}
.fw-phase-name {
    color: var(--cp-gray-900);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    flex: 1;
}

.fw-phase-pill {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.fw-phase-pill-active {
    background: var(--cp-red-bg);
    color: var(--danger-deep-fg);
}
.fw-phase-pill-active::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 9999px;
    background: var(--cp-red);
}
.fw-phase-pill-clear {
    background: var(--cp-green-bg);
    color: var(--coverage-strong-fg);
}

.fw-phase-summary {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--cp-gray-100);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.75rem;
    color: var(--cp-gray-500);
}
.fw-phase-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--cp-gray-400);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-right: 0.25rem;
}
.fw-phase-empty {
    color: var(--cp-gray-500);
    font-style: italic;
}

/* ───────────────────────────── Tenant strip / chips ──────────────────── */
.fw-tenant-strip {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--bg-page);
}
.fw-tenant-strip-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--cp-gray-400);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-right: 0.25rem;
}
.fw-tenant-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
}
.fw-tenant-chip:hover {
    transform: translateY(-1px);
}
.fw-tenant-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
}
.fw-tenant-chip-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 0.6875rem;
    padding: 0 0.3125rem;
    border-radius: 9999px;
}
.fw-tenant-chip-high {
    background: var(--cp-red-bg);
    color: var(--danger-deep-fg);
    border-color: var(--cp-red-border);
}
.fw-tenant-chip-high .fw-tenant-chip-dot {
    background: var(--cp-red);
}
.fw-tenant-chip-high .fw-tenant-chip-count {
    background: color-mix(in srgb, var(--danger-fg) 15%, transparent);
}
.fw-tenant-chip-low {
    background: var(--cp-amber-bg);
    color: var(--coverage-partial-fg);
    border-color: var(--cp-amber-border);
}
.fw-tenant-chip-low .fw-tenant-chip-dot {
    background: var(--cp-amber);
}
.fw-tenant-chip-low .fw-tenant-chip-count {
    background: color-mix(in srgb, var(--banner-warning-fg) 15%, transparent);
}
.fw-tenant-chip-leading {
    background: var(--cp-amber-leading-bg);
    color: var(--coverage-partial-fg);
    border-color: var(--cp-amber-leading-border);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.15);
}
.fw-tenant-strip-more {
    font-size: 0.6875rem;
    color: var(--cp-gray-400);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: var(--cp-gray-100);
}

/* ───────────────────────────── Tactic rows (tenant cascade) ─────────── */
.fw-tactic-rows {
    padding: 0.5rem 0;
}
.fw-tactic-row {
    display: grid;
    grid-template-columns: 2fr 0.75fr 2fr 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--cp-gray-100);
    font-size: 0.8125rem;
}
.fw-tactic-row:last-child {
    border-bottom: 0;
}
.fw-tactic-name {
    font-weight: 500;
    color: var(--cp-gray-900);
}
.fw-tactic-code {
    font-family: monospace;
    font-size: 0.6875rem;
    color: var(--cp-gray-500);
    background: var(--cp-gray-100);
    padding: 2px 6px;
    border-radius: 0.25rem;
    justify-self: start;
}
.fw-tactic-progress {
    height: 0.5rem;
    background: var(--cp-gray-100);
    border-radius: 9999px;
    overflow: hidden;
}
.fw-tactic-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}
.fw-tactic-progress-fill-high {
    background: var(--cp-red);
}
.fw-tactic-progress-fill-low {
    background: var(--cp-amber);
}
.fw-tactic-progress-fill-leading {
    background: var(--cp-amber);
}
.fw-tactic-progress-fill-clear,
.fw-tactic-progress-fill-idle {
    background: var(--cp-gray-300);
}
.fw-tactic-count {
    font-size: 0.75rem;
    color: var(--cp-gray-500);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.fw-tactic-count strong {
    color: var(--cp-gray-900);
    font-weight: 600;
}

/* ───────────────────────────── Tenant x Axis matrix ─────────────────── */
.fw-matrix-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--cp-gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.fw-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.fw-matrix thead th {
    background: var(--cp-gray-50);
    color: var(--cp-gray-700);
    font-weight: 600;
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--cp-gray-200);
}
.fw-matrix-tenant-col {
    text-align: left;
    /* Tenant name + industry subtitle — compact so the phase columns
       and totals row can breathe. Long names wrap; they don't push
       the matrix wider. */
    min-width: 11rem;
    max-width: 16rem;
    width: 14rem;
}
.fw-matrix-phase-col,
.fw-matrix-item-col {
    text-align: center;
    width: 5rem;
}
.fw-matrix-phase-sub {
    display: block;
    font-size: 0.625rem;
    color: var(--cp-gray-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}
.fw-matrix-item-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.6875rem;
    color: var(--cp-sky-700);
}
.fw-matrix-worst-col {
    width: 11rem;
}
.fw-matrix-total-col {
    width: 5.625rem;
    text-align: center;
}

.fw-matrix tbody tr {
    border-bottom: 1px solid var(--cp-gray-100);
    transition: background 0.15s;
}
.fw-matrix tbody tr:last-child {
    border-bottom: 0;
}
.fw-matrix tbody tr:hover {
    background: var(--bg-page);
    cursor: pointer;
}

.fw-matrix-row-high {
    border-left: 3px solid var(--cp-red);
}
.fw-matrix-row-low {
    border-left: 3px solid var(--cp-amber);
}
.fw-matrix-row-leading {
    border-left: 3px solid var(--cp-amber);
}
.fw-matrix-row-clear {
    border-left: 3px solid var(--cp-green-border);
}
.fw-matrix-row-idle {
    border-left: 3px solid transparent;
}

.fw-matrix td,
.fw-matrix th[scope="row"] {
    padding: 0.75rem;
    vertical-align: middle;
}
.fw-matrix-tenant {
    font-weight: 600;
    text-align: left;
    /* Row-header cell matches the column width we set in thead so the
       tenant name never dominates the row. Anchor inherits those
       bounds and wraps cleanly on long display names. */
    line-height: 1.3;
}
.fw-matrix-tenant a {
    font-size: 0.8125rem;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Footer row — one "Org totals" row that mirrors the headers: column
   sums, worst-reached label spelled out, total alerts across all
   tenants. Visually heavier than body rows so eyes land on it last. */
.fw-matrix tfoot td,
.fw-matrix tfoot th {
    background: var(--cp-gray-50);
    border-top: 2px solid var(--cp-gray-200);
    padding: 0.625rem 0.75rem;
    font-weight: 700;
    color: var(--cp-gray-900);
    font-size: 0.75rem;
}
.fw-matrix tfoot .fw-matrix-tenant {
    font-weight: 700;
    color: var(--cp-gray-900);
}
.fw-matrix-cell-total {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.fw-matrix-totals-row:hover {
    /* Totals aren't a clickable tenant row; no hover cursor. */
    background: var(--cp-gray-50) !important;
    cursor: default;
}
.fw-matrix-cell {
    text-align: center;
}
.fw-matrix-total {
    text-align: center;
    font-weight: 600;
    color: var(--cp-gray-900);
    font-variant-numeric: tabular-nums;
}

.fw-cell-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 3px 0.5625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.fw-cell-pill-idle {
    color: var(--cp-gray-300);
    font-weight: 400;
}
.fw-cell-pill-low {
    background: var(--cp-amber-bg);
    color: var(--coverage-partial-fg);
    border: 1px solid var(--cp-amber-border);
}
.fw-cell-pill-high {
    background: var(--cp-red-bg);
    color: var(--danger-deep-fg);
    border: 1px solid var(--cp-red-border);
}
.fw-cell-pill-leading {
    background: var(--cp-amber-leading-bg);
    color: var(--coverage-partial-fg);
    border: 1px solid var(--cp-amber-leading-border);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.fw-worst-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 3px 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}
.fw-worst-badge-p3 {
    background: var(--cp-amber-leading-bg);
    color: var(--coverage-partial-fg);
    border: 1px solid var(--cp-amber-leading-border);
}
.fw-worst-badge-p2 {
    background: var(--cp-red-soft-bg);
    color: var(--danger-deep-fg);
    border: 1px solid var(--cp-red-border);
}
.fw-worst-badge-p1 {
    background: var(--cp-amber-bg);
    color: var(--coverage-partial-fg);
    border: 1px solid var(--cp-amber-border);
}
.fw-worst-badge-clear {
    background: var(--cp-green-soft-bg);
    color: var(--coverage-strong-fg);
    border: 1px solid var(--cp-green-border);
}

/* Phase 14.5.3 polish: catalog-style coloured BADGE inside the cell
   rather than colouring the whole ``<td>``. Matches the dashboard
   Catalog matrix convention (✓ on a green pill, ~ on amber, · on
   grey) so the visual language is identical across compliance
   surfaces. The empty-state em-dash is rendered without a box. */
.fw-matrix-cell-parallel {
    text-align: center;
}
.fw-matrix-cell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    font-weight: 700;
    line-height: 1;
}
.fw-matrix-cell-empty {
    color: var(--cp-gray-300);
    font-weight: 700;
}
.fw-matrix-parallel
    .fw-matrix-cell-parallel.grade-strong
    .fw-matrix-cell-badge {
    background: var(--cp-green-bg);
    color: var(--coverage-strong-fg);
}
.fw-matrix-parallel
    .fw-matrix-cell-parallel.grade-partial
    .fw-matrix-cell-badge {
    background: var(--cp-amber-bg);
    color: var(--coverage-partial-fg);
}
.fw-matrix-parallel
    .fw-matrix-cell-parallel.grade-supportive
    .fw-matrix-cell-badge {
    background: var(--cp-gray-100);
    color: var(--cp-gray-700);
}

.fw-matrix-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--cp-gray-500);
    font-style: italic;
}

/* ───────────────────────────── Rail (drilldown) ──────────────────────── */
.fw-rail {
    background: var(--bg-card);
    border: 1px solid var(--cp-gray-200);
    border-radius: 0.75rem;
    padding: 1.125rem;
    margin-top: 1.5rem;
}
.fw-rail-head {
    margin-bottom: 0.75rem;
}
.fw-rail-kicker {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--cp-gray-400);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.fw-rail-title {
    /* 0.875rem matches ``.section-h2``-ish weight elsewhere; a 16px
       title inside a 340px rail feels heavy next to the 14-ish body
       copy, especially for short names like "NEIKER". */
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cp-gray-900);
    margin: 0.25rem 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
a.fw-rail-title {
    /* Override the .table-cell-link-external default — same compact
       size, still clickable. */
    font-size: 0.875rem;
}
/* Restore the ``.link-internal`` green colour on the anchor variant
   of the rail title.  ``.fw-rail-title``'s gray-900 colour was winning
   over ``.link-internal`` because both are single-class selectors and
   compliance.css loads after design-system.css; raising the
   specificity here (element + two classes) puts the green back. */
a.fw-rail-title.link-internal {
    color: var(--link-internal-fg);
}
a.fw-rail-title.link-internal:hover {
    color: var(--color-brand-green-deep);
    text-decoration: underline;
}
.fw-rail-section {
    margin-top: 1rem;
}
.fw-rail-section-head {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--cp-gray-500);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.625rem;
}
.fw-rail-note {
    font-size: 0.75rem;
    color: var(--cp-gray-500);
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* MITRE-specific rail chrome (phase cascade + sparkline + phase-card
 * drill affordance + selection highlights) moved to
 * data/compliance/mitre/static/rail.css per Phase 15 §9.
 * Loaded via /compliance/_static/mitre/rail.css from base.html. */

/* Status banner — red / amber / clear strip under the rail header. */
.fw-rail-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    margin: 0.75rem 0;
    font-size: 0.75rem;
}
.fw-rail-status-banner-high,
.fw-rail-status-banner-attack {
    background: var(--cp-red-soft-bg);
    border-color: var(--cp-red-border);
    color: var(--danger-darkest-fg);
}
.fw-rail-status-banner-low,
.fw-rail-status-banner-warn {
    background: var(--cp-amber-bg);
    border-color: var(--cp-amber-border);
    color: var(--coverage-partial-fg);
}
.fw-rail-status-banner-leading {
    background: var(--cp-amber-leading-bg);
    border-color: var(--cp-amber-leading-border);
    color: var(--coverage-partial-fg);
}
.fw-rail-status-banner-clear {
    background: var(--cp-green-soft-bg);
    border-color: var(--cp-green-border);
    color: var(--coverage-strong-fg);
}
.fw-rail-status-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: currentColor;
    margin-top: 0.3125rem;
    animation: fw-rail-pulse 2s ease-in-out infinite;
}
@keyframes fw-rail-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}
.fw-rail-status-body {
    flex: 1;
    min-width: 0;
}
.fw-rail-status-title {
    font-weight: 600;
    line-height: 1.25;
}
.fw-rail-status-sub {
    font-size: 0.6875rem;
    opacity: 0.85;
    margin-top: 0.125rem;
}

/* Rail alert list — "Recent alerts" / "Firing alerts in this phase". */
.fw-rail-alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.fw-rail-alert-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    border-top: 1px solid var(--cp-gray-100);
    font-size: 0.75rem;
}
.fw-rail-alert-row:first-child {
    border-top: 0;
}
.fw-rail-alert-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    margin-top: 0.375rem;
}
.fw-rail-alert-dot-recent {
    background: var(--status-active-fg);
}
.fw-rail-alert-dot-old {
    background: var(--cp-gray-300);
}
.fw-rail-alert-body {
    flex: 1;
    min-width: 0;
}
.fw-rail-alert-head {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.fw-rail-alert-code {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--pill-warning-fg);
    background: var(--cp-amber-bg);
    padding: 1px 5px;
    border-radius: 0.25rem;
}
.fw-rail-alert-name {
    font-weight: 600;
    color: var(--cp-gray-900);
}
.fw-rail-alert-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2px;
    font-size: 0.6875rem;
    color: var(--cp-gray-500);
}
.fw-rail-alert-device {
    font-family: var(--font-mono);
    color: var(--cp-gray-400);
}
.fw-rail-alert-phase {
    font-weight: 500;
}
.fw-rail-alert-ago {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: var(--cp-gray-400);
    white-space: nowrap;
    margin-top: 0.125rem;
}
/* "View" affordance — a ``<button>`` for rows that have an alert_id
   (htmx-loads the alert details modal in-place) or an ``<a>`` for
   legacy rows without one (deep-links to the filtered alerts page).
   Both variants share the same chip look, so both selectors apply. */
.fw-rail-alert-view {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    padding: 0.125rem 0.5rem;
    border: 1px solid var(--cp-gray-200);
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--cp-gray-700);
    background: var(--bg-card);
    text-decoration: none;
    margin-top: 0.0625rem;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    transition:
        background-color 100ms ease,
        border-color 100ms ease;
}
.fw-rail-alert-view:hover,
.fw-rail-alert-view:focus-visible {
    background: var(--cp-gray-50);
    border-color: var(--cp-gray-300);
    color: var(--cp-gray-900);
    text-decoration: none;
}
.fw-rail-alert-view:focus-visible {
    outline: 2px solid var(--cp-blue);
    outline-offset: 1px;
}
.fw-rail-alert-more {
    font-size: 0.6875rem;
    color: var(--cp-gray-500);
    padding: 0.5rem 0.25rem 0;
    margin: 0;
}

/* Rail action buttons — thin inline CTAs. */
.fw-rail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.fw-rail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--cp-gray-200);
    background: var(--bg-card);
    color: var(--cp-gray-700);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition:
        background 0.12s,
        border-color 0.12s;
}
.fw-rail-btn:hover {
    background: var(--cp-gray-50);
    border-color: var(--cp-gray-300);
    color: var(--cp-gray-900);
}
.fw-rail-btn-primary {
    background: var(--cp-green-bg);
    color: var(--coverage-strong-fg);
    border-color: var(--cp-green-border);
}
.fw-rail-btn-primary:hover {
    background: var(--policy-stricter-bg);
}
.fw-rail-btn-danger {
    color: var(--danger-deep-fg);
    border-color: var(--cp-red-border);
    background: var(--cp-red-soft-bg);
}
.fw-rail-btn-danger:hover {
    background: var(--cp-red-bg);
}

/* Hint line at the bottom of the rail. */
.fw-rail-hint {
    border-top: 1px solid var(--cp-gray-100);
    padding-top: 0.625rem;
    margin-top: 0.875rem;
}

/* Chip cursor — chip is htmx-trigger, not a page-anchor link.
 * Generic across every framework's rail; MITRE-specific sparkline,
 * phase-card, and selection highlights moved to
 * data/compliance/mitre/static/rail.css per Phase 15 §9. */
.fw-tenant-chip[hx-get] {
    cursor: pointer;
}

/* Phase 14.5.3 polish: legend strip above the AWIA Tenants matrix.
   Mirrors the article-list legend on the Coverage tab so the same
   four-grade language decodes the cell glyphs (✓ / ~ / · / —). */
.fw-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--cp-gray-200);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.6875rem;
}
.fw-matrix-legend-label {
    color: var(--cp-gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fw-matrix-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 500;
}
.fw-matrix-legend-glyph {
    font-weight: 700;
}
.fw-matrix-legend-chip-strong {
    background: var(--cp-green-bg);
    color: var(--coverage-strong-fg);
}
.fw-matrix-legend-chip-partial {
    background: var(--cp-amber-bg);
    color: var(--coverage-partial-fg);
}
.fw-matrix-legend-chip-supportive {
    background: var(--status-neutral-bg);
    color: var(--fg-4);
}
.fw-matrix-legend-chip-none {
    background: var(--cp-gray-100);
    color: var(--cp-gray-500);
}
