.fi-modal.dark {
    background-color: #111418;
}

.fi-auth-layout {
    overflow-x: hidden;
}

/* Custom styles for threads table - Critical severity rows */
.fi-ta-table-row-critical, .danger-content:has(.danger-background) {
    background-color: rgba(239, 68, 68, 0.06) !important;
}

.dark .fi-ta-table-row-critical, .dark .danger-content:has(.danger-background) {
    background-color: rgba(96, 28, 28, 0.2) !important;
}

/* Ensure the background applies to all cells in the row */
.fi-ta-table-row-critical > td {
    background-color: inherit !important;
}

.thread-header-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0;
}

.thread-header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.thread-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(17, 24, 39);
    margin: 0;
    line-height: 1.2;
}

.dark .thread-header-title {
    color: rgb(255, 255, 255);
}

.thread-header-updated {
    font-size: 0.875rem;
    color: rgb(107, 114, 128);
    margin: 0;
}

.dark .thread-header-updated {
    color: rgb(156, 163, 175);
}

.thread-header-buttons {
    font-weight: bolder;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
}

.fi-in-entry-label, .fi-fieldset > legend {
    font-weight: bold !important;
    font-size: 14px !important;
}

.w-full {
    width: 100% !important;
}

.fi-simple-page-content {
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Center logo in header */
.fi-simple-header-logo-wrapper, .fi-simple-header-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.fi-simple-header-heading {
    font-size: 32px;
    margin-top: 32px;
    margin-bottom: 32px;
}

/* Hide signin heading on OTP page */
.fi-simple-header-heading:has(+ * .otp-input-container),
body:has(.otp-input-container) .fi-simple-header-heading {
    display: none !important;
}

.fi-simple-header-logo-wrapper .fi-logo {
    height: 4rem !important;
    margin: 0;
}

.fi-simple-page-content {
    row-gap: unset;

    button {
        font-weight: 500;
    }
}

/* Registration section on login page */
.fi-login-register-section {
    padding-top: 2rem;
}

.dark .fi-login-register-section {
    border-top: unset;
}

.fi-login-register-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.fi-login-register-divider::before,
.fi-login-register-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--gray-900);
}

.dark .fi-login-register-divider::before,
.dark .fi-login-register-divider::after {
    background-color: var(--gray-700);
}

.fi-login-register-divider-text {
    padding: 0 1rem;
    color: var(--gray-900);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.dark .fi-login-register-divider-text {
    color: var(--gray-50);
}

/* Vulnerability cards styling */
.vulnerability-card {
    display: flex;
    gap: .5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(234, 179, 8, 0.5);
    background-color: rgba(234, 179, 8, 0.1);
    margin-bottom: 0.75rem;
}

.dark .vulnerability-card {
    background-color: #161b22;
}

.vulnerability-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.vulnerability-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgb(234, 179, 8);
}

.dark .vulnerability-icon svg {
    color: rgb(250, 204, 21);
}

.vulnerability-content {
    flex: 1;
    min-width: 0;
}

.vulnerability-badge {
    font-size: 14px;
    font-weight: 700;
    padding-left: 4px;
    color: rgb(202, 138, 4);
}

.dark .vulnerability-badge {
    background-color: rgba(234, 179, 8, 0.3);
    color: rgb(253, 224, 71);
}

.vulnerability-description {
    font-size: 0.875rem;
    color: rgb(55, 65, 81);
    line-height: 1.625;
}

.dark .vulnerability-description {
    color: rgb(209, 213, 219);
}

.vulnerabilities-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.domain-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.domain-header-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-header-label-icon {
    width: 1rem;
    height: 1rem;
    color: rgb(156, 163, 175);
}

.dark .domain-header-label-icon {
    color: rgb(209, 213, 219);
}

.domain-header-label-text {
    font-size: 14px;
    font-weight: 500;
    color: rgb(156, 163, 175);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .domain-header-label-text {
    color: rgb(209, 213, 219);
}

.domain-header-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.domain-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Style Actions component to appear in header bottom-right */
.domain-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -3.5rem;
    margin-bottom: 1rem;
}

.domain-header-actions-right {
    float: right;
    justify-content: flex-end !important;
    margin-left: auto !important;
}

.domain-header-actions .fi-ac-action {
    margin-left: auto;
}

.domain-header-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Password field styling */
.password-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.password-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(55, 65, 81);
    margin-bottom: 0.25rem;
}

.dark .password-field-label {
    color: rgb(209, 213, 219);
}

.password-label-icon {
    width: 1rem;
    height: 1rem;
    color: rgb(107, 114, 128);
}

.dark .password-label-icon {
    color: rgb(156, 163, 175);
}

.password-not-found {
    color: rgb(107, 114, 128);
    font-size: 0.875rem;
    font-style: italic;
}

.dark .password-not-found {
    color: rgb(156, 163, 175);
}

.password-field-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: rgb(249, 250, 251);
    border: 1px solid rgb(229, 231, 235);
    border-radius: 0.375rem;
    min-height: 2.5rem;
}

.dark .password-field-content {
    background-color: rgb(31, 41, 55);
    border-color: rgb(55, 65, 81);
}

.password-masked,
.password-visible {
    font-size: 0.875rem;
    color: rgb(17, 24, 39);
    flex: 1;
    min-width: 0;
}

.dark .password-masked,
.dark .password-visible {
    color: rgb(243, 244, 246);
}

.password-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    color: rgb(107, 114, 128);
    background-color: transparent;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.password-toggle-btn:hover {
    color: rgb(55, 65, 81);
    background-color: rgb(243, 244, 246);
}

.dark .password-toggle-btn {
    color: rgb(156, 163, 175);
}

.dark .password-toggle-btn:hover {
    color: rgb(209, 213, 219);
    background-color: rgb(55, 65, 81);
}

.password-eye-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* External Attack Monitoring modal close button */
.external-attack-monitoring-modal-close-btn {
    margin-top: .5rem;
    margin-right: .5rem;
}

/* Toggle filter styling - applies to both relevant_to_me and under_control */
.threats-table .fi-sc-component:has([id="tableFiltersForm.relevant_to_me"]),
.leaks-table .fi-sc-component:has([id="tableFiltersForm.status"]),
.threats-table .fi-sc-component:has([id="tableFiltersForm.under_control"]) {
    align-items: flex-end;
    display: grid;
}

.threats-table [id="tableFiltersForm.relevant_to_me"],
.threats-table [id="tableFiltersForm.under_control"] {
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgb(228 48 117 / 12%);
}

.dark .threats-table [id="tableFiltersForm.relevant_to_me"]
{
    background-color: rgb(35 22 27);
}

.threats-table [id="tableFiltersForm.under_control"] {
    border: 1px solid var(--success-400);
    background-color: var(--success-100);
}

.dark .threats-table [id="tableFiltersForm.under_control"] {
    border: 1px solid var(--success-500);
    background-color: rgb(68, 81, 24);
}

/* Ensure the inner grid container also has the border styling */
.threats-table [id="tableFiltersForm.relevant_to_me"] > .fi-sc.fi-grid,
.threats-table [id="tableFiltersForm.under_control"] > .fi-sc.fi-grid {
    border: none !important;
    padding: 0 !important;
    gap: 0.75rem !important;
}

/* Style the field wrapper to ensure proper layout */
.threats-table [id="tableFiltersForm.relevant_to_me"] .fi-fo-field,
.threats-table [id="tableFiltersForm.under_control"] .fi-fo-field {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

/* Label text styling */
.threats-table [id="tableFiltersForm.relevant_to_me"] .fi-fo-field-label-content,
.threats-table [id="tableFiltersForm.under_control"] .fi-fo-field-label-content {
    font-weight: 600 !important;
}

.fi-auth-layout.media-left .fi-auth-content-section,
.fi-auth-layout.media-right .fi-auth-content-section {
    background: linear-gradient(180deg, #f0f7f4 0, #8DC63F 219%);
}

.dark .fi-auth-layout.media-left .fi-auth-content-section,
.dark .fi-auth-layout.media-right .fi-auth-content-section {
    background: linear-gradient(184deg, #101722 0, rgb(10 32 25) 71%)
}

.login-overlay-text {
    position: absolute;
    bottom: 5%;
    color: white;
    font-size: 42px;
}

span.fi-badge.\32 xl {
    font-size: 16px;
}

/* OTP Input Styling */
.otp-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.otp-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(55, 65, 81);
    text-align: center;
    margin-bottom: 0.5rem;
}

.dark .otp-label {
    color: rgb(209, 213, 219);
}

.otp-input-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.otp-resend-code {
    margin-bottom: .5rem;
    color: var(--gray-400);
    margin-left: auto;
    padding-right: 0.75rem;
    font-size: 14px;
    cursor: pointer;
}

.otp-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: rgb(17, 24, 39);
    background-color: rgb(255, 255, 255);
    border: 1.5px solid rgb(229, 231, 235);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    outline: none;
}

.dark .otp-input {
    background-color: rgb(31, 41, 55);
    border-color: rgb(55, 65, 81);
    color: rgb(243, 244, 246);
}

.otp-input:focus {
    border-color: rgb(8, 73, 41);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(8, 73, 41, 0.1);
    background-color: rgb(255, 255, 255);
}

.dark .otp-input:focus {
    border-color: rgb(95, 131, 57);
    box-shadow: 0 0 0 3px rgba(95, 131, 57, 0.2);
    background-color: rgb(31, 41, 55);
}

.otp-input:not(:placeholder-shown) {
    background-color: rgb(255, 255, 255);
    border-color: rgb(8, 73, 41);
}

.dark .otp-input:not(:placeholder-shown) {
    background-color: rgb(31, 41, 55);
    border-color: rgb(95, 131, 57);
}

/* Remove number input arrows */
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-input[type=number] {
    -moz-appearance: textfield;
}

.otp-error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: rgb(254, 242, 242);
    border: 1px solid rgb(239, 68, 68);
    border-radius: 0.5rem;
    color: rgb(185, 28, 28);
    font-size: 0.875rem;
}

.dark .otp-error-message {
    background-color: rgb(31, 41, 55);
    border-color: rgb(220, 38, 38);
    color: rgb(248, 113, 113);
}

.otp-error-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: rgb(239, 68, 68);
}

/* Resend code link */
.otp-resend-wrapper {
    text-align: right;
}

.otp-resend-code {
    color: rgb(59, 130, 246);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.otp-resend-code:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.otp-resend-code.otp-resend-disabled {
    color: rgb(107, 114, 128);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.dark .otp-resend-code {
    color: rgb(96, 165, 250);
}

.dark .otp-resend-code.otp-resend-disabled {
    color: rgb(156, 163, 175);
}

/* Loading overlay for OTP verification */
.otp-fieldset .relative {
    position: relative;
}

.otp-fieldset .relative > div[wire\\:loading] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
}

.dark .otp-fieldset .relative > div[wire\\:loading] {
    background-color: rgba(17, 24, 39, 0.8);
}

.dark .otp-error-icon {
    color: rgb(248, 113, 113);
}

/* Disabled button styling */
.fi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Responsive adjustments */
@media (max-width: 1111px) {
    .otp-input {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.25rem;
    }

    .otp-input-wrapper {
        gap: 0.5rem;
    }

    .otp-resend-code {
        padding-right: 0.5rem;
    }
}

@media (max-width: 425px) {
    .otp-input {
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1.15rem;
    }

    .otp-input-wrapper {
        gap: 0.4rem;
    }

    .otp-resend-code {
        padding-right: 0.4rem;
    }
}

.heading-text {
    font-size: 18px;
    font-weight: 800;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-4 {
    margin-top: 4rem;
}

/* ── CREX enrichment timeline ──────────────────────────────────────────────
   A credential can carry dozens of sightings. Rendering each as a card of
   fixed fields meant a dump sighting, which only has a date, a source and a
   leak name, still took the height of a full stealer record. This collapses
   each sighting to one line and reveals only the fields it actually has. */

.crex-timeline {
    display: flex;
    flex-direction: column;
}

.crex-timeline-empty {
    font-size: 0.875rem;
    color: rgb(107 114 128);
}

.crex-timeline-row {
    display: flex;
    gap: 0.75rem;
}

/* The rail is drawn on the row rather than the container so it stops at the
   last visible sighting instead of dangling past it when the list is collapsed. */
.crex-timeline-rail {
    position: relative;
    flex-shrink: 0;
    width: 1rem;
    display: flex;
    justify-content: center;
}

.crex-timeline-rail::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(148, 163, 184, 0.25);
}

.crex-timeline-row:first-child .crex-timeline-rail::before {
    top: 0.75rem;
}

.crex-timeline-row:last-of-type .crex-timeline-rail::before {
    bottom: auto;
    height: 0.75rem;
}

/* The rail is drawn per row, so each group has to be capped the same way the whole
   list was: it starts at the first dot of a group and stops at the last one, rather
   than running through the heading above it or the gap below. */
.crex-timeline-group + .crex-timeline-row .crex-timeline-rail::before {
    top: 0.75rem;
}

.crex-timeline-row:has(+ .crex-timeline-group) .crex-timeline-rail::before,
.crex-timeline-row:has(+ .crex-timeline-gap) .crex-timeline-rail::before {
    bottom: auto;
    height: 0.75rem;
}

.crex-timeline-dot {
    position: relative;
    margin-top: 0.6rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: rgb(148 163 184);
}

/* Stealer records are the ones that explain how the credential got out, so they
   are the only entries that get colour. */
.crex-timeline-dot-stealer {
    background-color: rgb(239 68 68);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.crex-timeline-body {
    flex: 1;
    min-width: 0;
    padding-bottom: 0.25rem;
}

.crex-timeline-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    text-align: left;
    cursor: pointer;
}

.crex-timeline-head:disabled {
    cursor: default;
}

.crex-timeline-head:not(:disabled):hover {
    background-color: rgba(148, 163, 184, 0.08);
}

.crex-timeline-date {
    flex-shrink: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: rgb(107 114 128);
}

.crex-timeline-headline {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgb(55 65 81);
}

.dark .crex-timeline-headline {
    color: rgb(209 213 219);
}

.crex-timeline-chevron {
    flex-shrink: 0;
    display: flex;
    color: rgb(107 114 128);
    transition: transform 150ms ease;
}

.crex-timeline-chevron svg {
    width: 1rem;
    height: 1rem;
}

.crex-timeline-chevron.is-open {
    transform: rotate(180deg);
}

/* The host a sighting was the first to name. Indented to the headline above it and
   quieter than the row itself: it is context for that row, not a row of its own. */
.crex-timeline-newhost {
    margin: -0.15rem 0 0.3rem 0.5rem;
    font-size: 14px;
    line-height: 1.3;
    word-break: break-all;
    color: rgb(107 114 128);
}

.dark .crex-timeline-newhost {
    color: rgb(156 163 175);
}

.crex-timeline-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.5rem 1.5rem;
    margin: 0.25rem 0 0.5rem 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: rgba(148, 163, 184, 0.07);
}

.dark .crex-timeline-details {
    background-color: #161b22;
}

.crex-timeline-detail {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.crex-timeline-detail-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(107 114 128);
}

.crex-timeline-detail-value {
    font-size: 14px;
    word-break: break-word;
    color: rgb(55 65 81);
}

.dark .crex-timeline-detail-value {
    color: rgb(229 231 235);
}

/* Group headings. A long history is now shown as its two ends plus the stealer
   records, and without a label the jump from August 2026 to January 2024 five rows
   later reads as a sorting bug. */
.crex-timeline-group {
    margin: 0.75rem 0 0.25rem 1.75rem;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(107 114 128);
}

.crex-timeline-group:first-child {
    margin-top: 0;
}

.crex-timeline-group-stealer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    color: rgb(220 38 38);
}

.dark .crex-timeline-group-stealer {
    color: rgb(248 113 113);
}

/* The gap between the two ends. It stands in for the hundreds of rows we do not
   store, so it has to read as "there is more here" rather than as an empty slot. */
.crex-timeline-gap {
    display: flex;
    gap: 0.75rem;
}

.crex-timeline-gap-rail {
    position: relative;
    flex-shrink: 0;
    width: 1rem;
}

/* A dotted rail, so the break in the timeline is visible at a glance and clearly
   not the same thing as the solid line between consecutive sightings. */
.crex-timeline-gap-rail::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 0;
    border-left: 1px dashed rgba(148, 163, 184, 0.55);
}

.crex-timeline-gap-body {
    flex: 1;
    min-width: 0;
    margin: 0.35rem 0 0.35rem 0.5rem;
    padding: 0.75rem 0.9rem;
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: 0.625rem;
    background-color: rgba(148, 163, 184, 0.05);
}

.dark .crex-timeline-gap-body {
    background-color: rgba(148, 163, 184, 0.07);
}

.crex-timeline-gap-count {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgb(55 65 81);
}

.dark .crex-timeline-gap-count {
    color: rgb(229 231 235);
}

.crex-timeline-gap-help {
    margin-top: 0.4rem;
    font-size: 14px;
    line-height: 1.4;
    color: rgb(107 114 128);
}

/* The span the hidden sightings cover, drawn to scale. The ticks say which years
   the exposure ran across; nothing here claims how many fell in each one. */
.crex-timeline-span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.7rem;
    /* Room for the year labels, which hang below the bar. */
    padding-bottom: 0.85rem;
}

.crex-timeline-span-edge {
    flex-shrink: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: rgb(107 114 128);
}

.crex-timeline-span-bar {
    position: relative;
    flex: 1;
    min-width: 3rem;
    height: 0.3rem;
    border-radius: 9999px;
    background: linear-gradient(
        90deg,
        rgba(148, 163, 184, 0.35) 0%,
        rgba(220, 38, 38, 0.45) 100%
    );
}

.crex-timeline-span-tick {
    position: absolute;
    top: -0.25rem;
    bottom: -0.25rem;
    width: 1px;
    background-color: rgba(107, 114, 128, 0.6);
}

/* Hidden under about 30rem of panel: the labels overlap before the bar itself
   becomes useless, so the bar survives the narrow case and the years do not. */
.crex-timeline-span-tick-label {
    position: absolute;
    top: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: rgb(107 114 128);
}

@media (max-width: 30rem) {
    .crex-timeline-span-tick-label {
        display: none;
    }
}

[x-cloak] {
    display: none !important;
}

/* ── CREX exposure summary ─────────────────────────────────────────────────
   The fact strip sits above the story on purpose. The narrative deliberately
   carries no counts or dates, because anything written into it is frozen while
   the record keeps growing; these read live and stay correct. */

.crex-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 1rem;
}

.crex-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.crex-stat-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(107 114 128);
}

.crex-stat-value {
    font-size: 1.375rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: rgb(17 24 39);
}

.dark .crex-stat-value {
    color: rgb(243 244 246);
}

.crex-stat-help {
    font-size: 14px;
    line-height: 1.35;
    color: rgb(107 114 128);
}

.crex-stat-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding-top: 0.25rem;
}

.crex-story {
    font-size: 0.875rem;
    line-height: 1.65;
    color: rgb(55 65 81);
}

.dark .crex-story {
    color: rgb(209 213 219);
}

.crex-story-muted {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgb(107 114 128);
}

.crex-story-pending {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crex-story-spinner {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ── CREX identity header ──────────────────────────────────────────────────
   A badge entry renders its badge as a block-level flex box, so a one-word
   status stretched the full width of its column and read as a coloured bar
   rather than a badge. Scoped to this panel: the same markup is used all over
   the app and the table badges are already laid out correctly. */

.crex-identity .fi-in-text-has-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.375rem;
}

.crex-identity .fi-in-text-has-badges .fi-badge {
    width: fit-content;
    flex: 0 0 auto;
}

/* ── CREX dashboard ────────────────────────────────────────────────────────
   The ranked list and the password panel are custom widgets, so they bring
   their own layout. Everything else on the page is stock Filament. */

.crex-rank-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgb(0 0 0 / 0.06);
}

.crex-rank-row:last-child {
    border-bottom: 0;
}

.crex-rank-index {
    flex: 0 0 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: rgb(107 114 128);
    line-height: 1.5rem;
}

.crex-rank-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* Long addresses must truncate rather than wrap: a two-line login pushes the
   score out of alignment with the rows above it. */
.crex-rank-login {
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crex-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.crex-chip {
    font-size: 14px;
    line-height: 1rem;
    padding: 0 0.375rem;
    border-radius: 0.25rem;
    background: rgb(0 0 0 / 0.05);
    color: rgb(55 65 81);
    white-space: nowrap;
}

.crex-chip-danger {
    background: rgb(220 38 38 / 0.12);
    color: rgb(153 27 27);
    font-weight: 600;
}

.crex-chip-muted {
    color: rgb(107 114 128);
}

.crex-rank-bar {
    margin-top: 0.375rem;
    height: 0.25rem;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.06);
    overflow: hidden;
}

.crex-rank-bar-fill {
    height: 100%;
    border-radius: 999px;
}

.crex-rank-bar-critical { background: rgb(220 38 38); }
.crex-rank-bar-elevated { background: rgb(245 158 11); }
.crex-rank-bar-watch    { background: rgb(156 163 175); }

.crex-rank-score {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.crex-rank-score-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.25rem;
}

/* The latest-exposures list puts a date where the ranking puts a score. Smaller
   than a score, because a date needs to be read rather than compared at a glance. */
.crex-rank-date {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.25rem;
    white-space: nowrap;
}



.crex-empty {
    font-size: 0.875rem;
    color: rgb(107 114 128);
    margin: 0.5rem 0 0;
}

/* An absence that is good news should not be styled like missing data. */
.crex-empty-good {
    color: rgb(21 128 61);
}

.dark .crex-rank-row { border-bottom-color: rgb(255 255 255 / 0.08); }
.dark .crex-rank-index { color: rgb(156 163 175); }
.dark .crex-chip { background: rgb(255 255 255 / 0.08); color: rgb(209 213 219); }
.dark .crex-chip-danger { background: rgb(220 38 38 / 0.2); color: rgb(252 165 165); }
.dark .crex-chip-muted { color: rgb(156 163 175); }
.dark .crex-rank-bar { background: rgb(255 255 255 / 0.1); }
.dark .crex-empty { color: rgb(156 163 175); }
.dark .crex-empty-good { color: rgb(134 239 172); }

/* ============================================================================
   EASM surface map
   ----------------------------------------------------------------------------
   public/js/easm/surface-map.js draws the picture and assigns classes; every
   colour in it lives here, so there is exactly one palette and it has a .dark
   twin on every rule. The severity ramp is the module's own, the same five
   values NVD publishes.

   Motion is CSS only: the rings turn, each node counter-turns so its label
   stays upright, and both pause together on hover or focus. A rotating click
   target is hostile, and prefers-reduced-motion switches all of it off.
   ========================================================================== */

.easm-map {
    --easm-sev-4: #991b1b;
    --easm-sev-3: #dc2626;
    --easm-sev-2: #f59e0b;
    --easm-sev-1: #3b82f6;
    --easm-sev-0: #9ca3af;

    --easm-ink: rgb(17 24 39);
    --easm-muted: rgb(107 114 128);
    --easm-line: rgb(15 23 42 / 0.14);
    --easm-sky-a: rgb(248 250 252);
    --easm-sky-b: rgb(241 245 249);
    --easm-core: #084929;
    --easm-accent: #8dc63f;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1.25rem;
    align-items: start;

    /* The drawing is a square capped by viewport height, so on a wide screen the
       pair is centred rather than stranded against the left edge. The explicit
       width is what keeps `auto` margins from turning this into a shrink-to-fit
       box, which would collapse the map column to its minimum. */
    width: 100%;
    max-width: calc(82vh + 22rem + 1.25rem);
    margin-inline: auto;
}

@media (max-width: 1023px) {
    .easm-map { grid-template-columns: minmax(0, 1fr); }
}

.dark .easm-map {
    --easm-ink: rgb(229 231 235);
    --easm-muted: rgb(156 163 175);
    --easm-line: rgb(255 255 255 / 0.12);
    --easm-sky-a: #0b1220;
    --easm-sky-b: #101722;
    --easm-core: #0f6b3c;
}

.easm-map-stage { position: relative; min-width: 0; }

/* Set from inside the wire:ignore subtree after a successful draw, so a morph
   cannot clear it and a thrown exception leaves the list on screen. */
.easm-map-canvas[data-easm-map-ready="1"] ~ .easm-map-fallback { display: none; }

.easm-map-figure {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, var(--easm-sky-a), var(--easm-sky-b));
    border: 1px solid var(--easm-line);
}

/* A square drawing, capped by the viewport height so the whole surface is visible
   without scrolling. Text inside is sized in viewBox units, not rem: the box scales
   and rem would not scale with it. */
.easm-map-figure {
    width: min(100%, 82vh);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
}

.easm-map-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- centre --------------------------------------------------------------- */

.easm-map-core-glow { fill: var(--easm-core); opacity: 0.10; }
.easm-map-core-disc { fill: var(--easm-core); }
.easm-map-core-halo { fill: none; stroke: var(--easm-accent); stroke-width: 1; opacity: 0.5; }
.easm-map-core-initials { fill: #fff; font-size: 42px; font-weight: 700; letter-spacing: 0.05em; }
.easm-map-core-label { fill: var(--easm-ink); font-size: calc(22px / var(--easm-zoom, 1)); font-weight: 600; }
.easm-map-core-counts { fill: var(--easm-muted); font-size: calc(19px / var(--easm-zoom, 1)); font-variant-numeric: tabular-nums; }

/* ---- seeds (the domains discovery walked) --------------------------------- */

.easm-map-seed-link { stroke: var(--easm-accent); stroke-width: 1; opacity: 0.35; }
.easm-map-seed-dot { fill: var(--easm-accent); opacity: 0.85; }
.easm-map-seed-label { fill: var(--easm-muted); font-size: calc(19px / var(--easm-zoom, 1)); }

/* ---- rings ---------------------------------------------------------------- */

.easm-map-track { fill: none; stroke: var(--easm-line); stroke-width: 1; }
.easm-map-track-inventory { stroke-dasharray: 2 8; }

.easm-map-link { stroke: var(--easm-line); stroke-width: 1; }

/* Origin is the line, status is the node border. Two facts, two channels. */
.easm-map-link.origin-1 { stroke-dasharray: 3 5; }
.easm-map-link.is-dimmed { opacity: 0.12; }
.easm-map-link-inventory { opacity: 0.4; }

.easm-map-orbit {
    transform-origin: 500px 500px;
    animation: easm-map-spin var(--easm-spin, 320s) linear infinite;
}

.easm-map-node {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    animation: easm-map-spin-back var(--easm-spin, 320s) linear infinite;
    transition: opacity 150ms ease;
}

/* Chasing a moving target is hostile, so any pointer or keyboard attention
   stops the whole figure, not just the node under the cursor. */
.easm-map-figure:hover .easm-map-orbit,
.easm-map-figure:hover .easm-map-node,
.easm-map-figure:focus-within .easm-map-orbit,
.easm-map-figure:focus-within .easm-map-node,
.easm-map-figure[data-easm-zoom="in"] .easm-map-orbit,
.easm-map-figure[data-easm-zoom="in"] .easm-map-node {
    animation-play-state: paused;
}

@keyframes easm-map-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes easm-map-spin-back {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .easm-map-orbit,
    .easm-map-node { animation: none; }
}

/* ---- nodes ---------------------------------------------------------------- */

.easm-map-node-hit { fill: transparent; }
.easm-map-node-aura { fill: currentColor; opacity: 0.16; }
.easm-map-node-disc { fill: currentColor; }

.easm-map-node.severity-4 { color: var(--easm-sev-4); }
.easm-map-node.severity-3 { color: var(--easm-sev-3); }
.easm-map-node.severity-2 { color: var(--easm-sev-2); }
.easm-map-node.severity-1 { color: var(--easm-sev-1); }
.easm-map-node.severity-0 { color: var(--easm-sev-0); }

.easm-map-node.is-inventory { opacity: 0.55; }
.easm-map-node.is-inventory .easm-map-node-disc { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 3 3; }

.easm-map-node-pending { fill: none; stroke: var(--easm-sev-2); stroke-width: 2; }

.easm-map-node-count { fill: #fff; font-size: 15px; font-weight: 700; }
.easm-map-node-label { fill: var(--easm-muted); font-size: calc(20px / var(--easm-zoom, 1)); transition: opacity 150ms ease; }

/* A crowded ring holds its names back rather than overprinting them. They come
   back on zoom, and immediately for whichever node is being pointed at, focused
   or read in the panel. */
.easm-map-node.is-crowded .easm-map-node-label { opacity: 0; }
.easm-map-figure[data-easm-detail="on"] .easm-map-node.is-crowded .easm-map-node-label,
.easm-map-node.is-crowded:hover .easm-map-node-label,
.easm-map-node.is-crowded:focus-visible .easm-map-node-label,
.easm-map-node.is-crowded.is-selected .easm-map-node-label { opacity: 1; }
.easm-map-node-hostcount { fill: var(--easm-muted); font-size: calc(16px / var(--easm-zoom, 1)); }
.easm-map-satellite { fill: var(--easm-muted); opacity: 0.7; }
.easm-map-satellite-more { fill: var(--easm-muted); font-size: calc(16px / var(--easm-zoom, 1)); }

/* Review state is the halo: something has changed since the customer last looked. */
.easm-map-node.review-1 .easm-map-node-aura,
.easm-map-node.review-2 .easm-map-node-aura { opacity: 0.42; animation: easm-map-pulse 2.4s ease-in-out infinite; }
.easm-map-node.review-3 .easm-map-node-aura { opacity: 0.08; }

@keyframes easm-map-pulse {
    0%, 100% { opacity: 0.42; }
    50% { opacity: 0.12; }
}

@media (prefers-reduced-motion: reduce) {
    .easm-map-node.review-1 .easm-map-node-aura,
    .easm-map-node.review-2 .easm-map-node-aura { animation: none; }
}

.easm-map-node.is-selected .easm-map-node-aura { opacity: 0.6; }
.easm-map-node.is-selected .easm-map-node-disc { stroke: var(--easm-accent); stroke-width: 2.5; }
.easm-map-node.is-dimmed { opacity: 0.12; }
.easm-map-node:focus { outline: none; }
.easm-map-node:focus-visible .easm-map-node-aura { opacity: 0.7; }
.easm-map-node:focus-visible .easm-map-node-disc { stroke: var(--easm-accent); stroke-width: 2.5; }

.easm-map-cluster-disc { fill: none; stroke: var(--easm-muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.easm-map-cluster-count { fill: var(--easm-ink); font-size: calc(22px / var(--easm-zoom, 1)); font-weight: 700; }
.easm-map-cluster.is-openable { cursor: zoom-in; }
.easm-map-bubble-disc { fill: var(--easm-sky-b); stroke: var(--easm-line); stroke-width: 1; }

/* ---- toolbar, legend, tooltip -------------------------------------------- */

.easm-map-toolbar {
    position: absolute;
    inset: 0.75rem 0.75rem auto 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 2;
}

.easm-map-search {
    pointer-events: auto;
    width: min(18rem, 55%);
    padding: 0.35rem 0.7rem;
    font-size: 14px;
    color: var(--easm-ink);
    background: rgb(255 255 255 / 0.75);
    border: 1px solid var(--easm-line);
    border-radius: 9999px;
}

.dark .easm-map-search { background: rgb(255 255 255 / 0.06); }

.easm-map-snapshot { font-size: 14px; color: var(--easm-muted); font-variant-numeric: tabular-nums; }
.easm-map-snapshot.is-stale { color: var(--easm-sev-2); }

/* ---- zoom ---------------------------------------------------------------- */

.easm-map-svg { cursor: grab; touch-action: none; }
.easm-map-svg.is-panning { cursor: grabbing; }

.easm-map-zoom {
    position: absolute;
    inset: auto 0.75rem 0.75rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 2;
}

.easm-map-zoom-button {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--easm-ink);
    background: rgb(255 255 255 / 0.75);
    border: 1px solid var(--easm-line);
    border-radius: 0.4rem;
    cursor: pointer;
}

.dark .easm-map-zoom-button { background: rgb(255 255 255 / 0.06); }
.easm-map-zoom-button:hover:not(:disabled) { border-color: var(--easm-accent); }
.easm-map-zoom-button:disabled { opacity: 0.35; cursor: default; }

.easm-map-legend {
    position: absolute;
    inset: auto 3.25rem 0.75rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    z-index: 2;
}

.easm-map-legend-chip {
    padding: 0.15rem 0.55rem;
    font-size: 14px;
    border-radius: 9999px;
    border: 1px solid currentColor;
    background: transparent;
    cursor: pointer;
    opacity: 0.65;
}

.easm-map-legend-chip:hover,
.easm-map-legend-chip[aria-pressed="true"] { opacity: 1; }
.easm-map-legend-chip[aria-pressed="true"] { background: currentColor; }
.easm-map-legend-chip[aria-pressed="true"] { color: #fff; }

.easm-map-legend-chip.severity-4 { color: var(--easm-sev-4); }
.easm-map-legend-chip.severity-3 { color: var(--easm-sev-3); }
.easm-map-legend-chip.severity-2 { color: var(--easm-sev-2); }
.easm-map-legend-chip.severity-1 { color: var(--easm-sev-1); }
.easm-map-legend-chip.severity-0 { color: var(--easm-sev-0); }
.easm-map-legend-chip[aria-pressed="true"].severity-4 { background: var(--easm-sev-4); }
.easm-map-legend-chip[aria-pressed="true"].severity-3 { background: var(--easm-sev-3); }
.easm-map-legend-chip[aria-pressed="true"].severity-2 { background: var(--easm-sev-2); }
.easm-map-legend-chip[aria-pressed="true"].severity-1 { background: var(--easm-sev-1); }
.easm-map-legend-chip[aria-pressed="true"].severity-0 { background: var(--easm-sev-0); }

.easm-map-tooltip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 0.6rem));
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    background: rgb(17 24 39 / 0.92);
    color: rgb(243 244 246);
    font-size: 14px;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    white-space: nowrap;
    z-index: 3;
}

.easm-map-tooltip.is-below { transform: translate(-50%, 0.6rem); }
.easm-map-tooltip.is-visible { opacity: 1; }
.easm-map-tooltip-value { font-weight: 600; }
.easm-map-tooltip-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; color: rgb(209 213 219); }
.easm-map-tooltip-chip.severity-4 { color: #fca5a5; }
.easm-map-tooltip-chip.severity-3 { color: #fca5a5; }
.easm-map-tooltip-chip.severity-2 { color: #fcd34d; }
.easm-map-tooltip-chip.severity-1 { color: #93c5fd; }
.easm-map-tooltip-chip.severity-0 { color: #d1d5db; }

/* ---- detail panel --------------------------------------------------------- */

.easm-map-panel {
    border: 1px solid var(--easm-line);
    border-radius: 1rem;
    padding: 1rem;
    background: rgb(255 255 255 / 0.6);
    max-height: 78vh;
    overflow-y: auto;
}

.dark .easm-map-panel { background: rgb(255 255 255 / 0.03); }

.easm-map-panel-idle { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 1rem; color: var(--easm-muted); font-size: 14px; text-align: center; }
.easm-map-panel-idle-icon { width: 1.75rem; height: 1.75rem; }
.easm-map-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.easm-map-panel-head h2 { font-size: 1rem; font-weight: 600; color: var(--easm-ink); margin: 0; }
.easm-map-panel-sub { font-size: 14px; color: var(--easm-muted); margin: 0.15rem 0 0; }
.easm-map-panel-close { color: var(--easm-muted); background: none; border: 0; cursor: pointer; }
.easm-map-panel-close svg { width: 1rem; height: 1rem; }
.easm-map-panel-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.easm-map-panel-note { font-size: 14px; color: var(--easm-muted); margin: 0.6rem 0 0; }
.easm-map-panel-section { margin-top: 1rem; }
.easm-map-panel-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--easm-muted); margin: 0 0 0.4rem; }
.easm-map-panel-hosts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.easm-map-panel-hosts li { font-size: 14px; color: var(--easm-ink); background: rgb(15 23 42 / 0.05); border-radius: 9999px; padding: 0.1rem 0.5rem; }
.dark .easm-map-panel-hosts li { background: rgb(255 255 255 / 0.07); }

.easm-map-port { border-top: 1px solid var(--easm-line); padding: 0.5rem 0; }
.easm-map-port-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.easm-map-port-name { font-size: 14px; color: var(--easm-ink); font-variant-numeric: tabular-nums; }
.easm-map-findings { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.easm-map-findings li { display: flex; align-items: baseline; gap: 0.35rem; font-size: 14px; color: var(--easm-muted); }
.easm-map-findings li > .fi-badge { flex: 0 0 auto; }
.easm-map-finding-cve { color: var(--easm-ink); font-weight: 600; }
.easm-map-panel-foot { margin-top: 1rem; font-size: 14px; }

/* ---- fallback list (also what a screen reader gets before the draw) ------- */

.easm-map-fallback { padding: 0.5rem 0; }
.easm-map-summary { font-size: 14px; color: var(--easm-ink); margin: 0 0 0.5rem; }
.easm-map-stale { font-size: 14px; color: var(--easm-sev-2); margin: 0 0 0.5rem; }
.easm-map-fallback-ring { margin-top: 0.75rem; }
.easm-map-fallback-ring h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--easm-muted); margin: 0 0 0.3rem; }
.easm-map-fallback-count { text-transform: none; letter-spacing: 0; }
.easm-map-fallback-ring ul { list-style: none; margin: 0; padding: 0; }
.easm-map-fallback-ring button { display: flex; gap: 0.5rem; align-items: baseline; width: 100%; text-align: start; padding: 0.2rem 0; background: none; border: 0; cursor: pointer; }
.easm-map-fallback-value { font-size: 14px; color: var(--easm-ink); }
.easm-map-fallback-meta { font-size: 14px; color: var(--easm-muted); }
.easm-map-fallback-rest { font-size: 14px; margin: 0.3rem 0 0; }
.easm-map-empty { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 3rem 1rem; text-align: center; }
.easm-map-empty-icon { width: 2rem; height: 2rem; color: var(--easm-muted); }
.easm-map-empty-heading { font-size: 0.9rem; color: var(--easm-ink); margin: 0; }
.easm-map-empty-hint { font-size: 14px; color: var(--easm-muted); margin: 0; }

/* =========================================================================
   HOME — the product's front door
   =========================================================================

   Two surfaces on one page. The feed is a dark console and stays dark in both
   themes: it is the world, not the customer's data, and the contrast is what
   makes the page open on something. The four cards below are the customer's own
   half and follow the panel's theme.

   Alignment is the whole job here, so the rules that hold it are grouped rather
   than scattered: one grid, equal auto-rows, fixed row heights inside the feed,
   tabular numerals everywhere a figure changes, and every card built head /
   body(flex:1) / foot so the footers line up whatever the bodies hold.
   -------------------------------------------------------------------------- */

.home {
    --home-dark: #0F1419;
    --home-dark-2: #161C22;
    --home-green: #006838;
    --home-lime: #8DC63F;
    --home-crit: #C5482B;
    --home-warn: #D89A1B;

    --home-ink: #16201A;
    --home-muted: #5D6B60;
    --home-line: #E3E9E0;
    --home-card: #FFFFFF;

    --home-gap: 1.25rem;

    display: flex;
    flex-direction: column;
    gap: var(--home-gap);
}

.dark .home {
    --home-ink: #E6EDE8;
    --home-muted: #93A398;
    --home-line: rgba(255, 255, 255, 0.10);
    --home-card: #161C22;
}

/* Figures must not shuffle when a poll changes them. */
.home [data-num] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ---- the feed --------------------------------------------------------- */

.home-feed {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    background:
        radial-gradient(60rem 22rem at 12% -10%, rgba(141, 198, 63, 0.10), transparent 70%),
        radial-gradient(45rem 20rem at 88% 120%, rgba(0, 104, 56, 0.22), transparent 70%),
        var(--home-dark);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* A faint scanline field. Decoration, but it is what makes the block read as a
   console rather than a dark card. */
.home-feed::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.035) 0,
        rgba(255, 255, 255, 0.035) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
}

.home-feed-inner { position: relative; padding: 1.15rem 1.35rem 1.25rem; }

.home-feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.home-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--home-lime);
}

.home-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--home-lime);
    box-shadow: 0 0 0 0 rgba(141, 198, 63, 0.55);
    animation: home-pulse 2.4s ease-out infinite;
}

@keyframes home-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(141, 198, 63, 0.55); }
    70%  { box-shadow: 0 0 0 0.55rem rgba(141, 198, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(141, 198, 63, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .home-live-dot { animation: none; }
}

.home-feed-title { margin: 0; font-size: 1.02rem; font-weight: 600; color: #fff; }
.home-feed-sub { margin: 0.15rem 0 0; font-size: 14px; color: #9FB0A4; }

.home-feed-tally { display: flex; align-items: baseline; gap: 0.45rem; }
.home-feed-tally b { font-size: 1.9rem; font-weight: 600; line-height: 1; color: #fff; }
.home-feed-tally span { font-size: 14px; color: #9FB0A4; }

/* Fixed row height. A two-line company name would otherwise push the rows below
   it out of step with the sector strip beside them. */
.home-feed-list { list-style: none; margin: 0.9rem 0 0; padding: 0; }

.home-feed-row {
    display: grid;
    grid-template-columns: 3.4rem minmax(0, 1fr) 9rem auto;
    align-items: center;
    gap: 0.75rem;
    height: 2.35rem;
    padding: 0 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.home-feed-row:last-child { border-bottom: 0; }

.home-feed-time {
    font-size: 14px;
    color: var(--home-lime);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.home-feed-victim {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-feed-sector {
    font-size: 14px;
    color: #8C9C91;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-feed-group {
    justify-self: end;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #C9D6CD;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.3rem;
    padding: 0.12rem 0.4rem;
    max-width: 7.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-feed-country {
    justify-self: end;
    font-size: 14px;
    color: #8C9C91;
    font-variant-numeric: tabular-nums;
}

/* Sector strip: proportion at a glance, no chart library. */
.home-sectors { margin-top: 1rem; }
.home-sectors-bar { display: flex; height: 0.3rem; border-radius: 0.15rem; overflow: hidden; background: rgba(255, 255, 255, 0.07); }
.home-sectors-bar i { display: block; height: 100%; }
.home-sectors-key { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-top: 0.55rem; }
.home-sectors-key span { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 14px; color: #9FB0A4; }
.home-sectors-key i { width: 0.5rem; height: 0.5rem; border-radius: 0.12rem; flex: none; }

.home-feed-note {
    margin: 0.9rem 0 0;
    font-size: 14px;
    color: #75857A;
}

.home-feed-empty { padding: 1.5rem 0 0.5rem; color: #9FB0A4; font-size: 14px; }

/* ---- the card grid ----------------------------------------------------- */

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Rows size to their own content; the two cards *within* a row still match,
       because grid stretches them. `1fr` here looked like the same thing and was
       not: it made every row as tall as the tallest one on the page, so the pair
       with three figures in them stood half empty under the pair with five rows. */
    grid-auto-rows: auto;
    gap: var(--home-gap);
}

.home-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--home-card);
    border: 1px solid var(--home-line);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* The accent rail. Same width on every card, so the heads line up. */
.home-card::before {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--home-green), var(--home-lime) 60%, transparent);
}

.home-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem 0.7rem;
}

.home-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--home-muted);
}

.home-card-link { font-size: 14px; color: var(--home-green); text-decoration: none; white-space: nowrap; }
.home-card-link:hover { text-decoration: underline; }
.dark .home-card-link { color: var(--home-lime); }

/* flex:1 is what pins every footer to the bottom of its card. */
.home-card-body { flex: 1; padding: 0 1.1rem; min-width: 0; }
.home-card-foot { padding: 0.7rem 1.1rem 0.95rem; font-size: 14px; color: var(--home-muted); }

/* ---- figures ----------------------------------------------------------- */

.home-figures { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.home-figure { min-width: 0; }
.home-figure b {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--home-ink);
    font-variant-numeric: tabular-nums;
}
.home-figure span {
    display: block;
    margin-top: 0.1rem;
    font-size: 14px;
    color: var(--home-muted);
}
.home-figure.is-warn b { color: var(--home-warn); }
.home-figure.is-crit b { color: var(--home-crit); }

/* ---- lists inside cards ------------------------------------------------ */

.home-list { list-style: none; margin: 0.9rem 0 0; padding: 0; }
.home-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    height: 2rem;
    border-top: 1px solid var(--home-line);
}
.home-list li:first-child { border-top: 0; }

.home-list-main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}
.home-list-name {
    font-size: 14px;
    color: var(--home-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-list-name.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.home-list-meta { font-size: 14px; color: var(--home-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.home-tag {
    flex: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    background: rgba(197, 72, 43, 0.12);
    color: var(--home-crit);
    border: 1px solid rgba(197, 72, 43, 0.25);
}

.home-score {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--home-muted);
}
.home-score.is-crit { color: var(--home-crit); }
.home-score.is-warn { color: var(--home-warn); }

/* The KEV row carries three things in the left column - id, target, badge - and
   the target is the one allowed to give way. Without a min-width on the id the
   ellipsis eats the CVE number first, which is the one part nobody can guess. */
.home-list.is-kev .home-list-name { flex: 0 0 auto; }
.home-kev-target {
    min-width: 0;
    font-size: 14px;
    color: var(--home-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-tag.is-warn {
    background: rgba(216, 154, 27, 0.14);
    color: #A8760F;
    border-color: rgba(216, 154, 27, 0.30);
}
.dark .home-tag.is-warn { color: var(--home-warn); }

/* ---- spark strip (30-day activity, TI card) ---------------------------- */

.home-spark { display: flex; align-items: flex-end; gap: 2px; height: 2.2rem; margin-top: 1rem; }
.home-spark i {
    flex: 1;
    min-width: 2px;
    background: linear-gradient(180deg, var(--home-lime), var(--home-green));
    border-radius: 1px 1px 0 0;
    opacity: 0.85;
}

/* ---- empty states ------------------------------------------------------ */

.home-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    min-height: 5.5rem;
    margin-top: 0.6rem;
}
.home-empty b { font-size: 14px; font-weight: 500; color: var(--home-ink); }
.home-empty span { font-size: 14px; color: var(--home-muted); }

/* ---- narrow screens ---------------------------------------------------- */

@media (max-width: 1024px) {
    .home-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
}

@media (max-width: 640px) {
    .home-feed-inner { padding: 1rem; }
    /* The sector column is the first thing to go: the name, the group and the
       time are what the row is for. */
    .home-feed-row { grid-template-columns: 3rem minmax(0, 1fr) auto; height: 2.2rem; }
    .home-feed-sector { display: none; }
    .home-feed-tally b { font-size: 1.5rem; }
    .home-figure b { font-size: 1.45rem; }
    .home-figures { gap: 1.1rem; }
}

/* =========================================================================
   EASM — web page previews on the asset detail page
   =========================================================================

   Deliberately small. The picture answers "what is this" in a glance and then
   gets out of the way of the findings below it, so the card is fixed at a
   width that fits four across on a wide screen and wraps on a narrow one.
   -------------------------------------------------------------------------- */

.easm-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.easm-preview {
    width: 15rem;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--easm-line, #E3E9E0);
    border-radius: 0.6rem;
    overflow: hidden;
    background: var(--easm-card, #fff);
}

.dark .easm-preview {
    border-color: rgba(255, 255, 255, 0.10);
    background: #161C22;
}

/* 16:10, the shape a browser window actually is. A fixed ratio keeps every card
   the same height whatever the page behind it looked like. */
.easm-preview-shot {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: #0F1419;
    overflow: hidden;
    text-decoration: none;
}

.easm-preview-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* The top of a page is the part that identifies it. */
    object-position: top center;
    display: block;
    transition: transform .25s ease;
}

.easm-preview-shot:hover img { transform: scale(1.03); }

/* A port we could not reach is the least interesting card on the page, so it is
   also the quietest. The first version filled it with the dark hero colour and in
   the light theme a black rectangle became the loudest thing on screen - exactly
   backwards. Light stripes here, dark stripes under .dark. */
.easm-preview-shot.is-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: repeating-linear-gradient(
        135deg,
        rgba(22, 32, 26, 0.05) 0,
        rgba(22, 32, 26, 0.05) 6px,
        transparent 6px,
        transparent 12px
    ), #F2F5F1;
}

.dark .easm-preview-shot.is-empty {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0,
        rgba(255, 255, 255, 0.03) 6px,
        transparent 6px,
        transparent 12px
    ), #0F1419;
}

.easm-preview-nothing { font-size: 14px; color: var(--easm-muted, #5D6B60); }
.dark .easm-preview-nothing { color: #7C8B81; }

/* The port badge sits on top of the picture, where it needs its own dark chip to
   stay legible. In the empty card there is no picture under it, so it drops back
   into the flow and the chip has to be readable on a pale background too. */
.easm-preview-shot.is-empty .easm-preview-port {
    background: rgba(22, 32, 26, 0.08);
    color: var(--easm-ink, #16201A);
}

.dark .easm-preview-shot.is-empty .easm-preview-port {
    background: rgba(255, 255, 255, 0.10);
    color: #E6EDE8;
}

.easm-preview-port {
    /* Now carries a hostname rather than a scheme, so it has to be able to run out
       of room gracefully - a CDN name is easily longer than the card. */
    max-width: calc(100% - 0.8rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: absolute;
    left: 0.4rem;
    top: 0.4rem;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #C9D6CD;
    background: rgba(15, 20, 25, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.25rem;
    padding: 0.1rem 0.35rem;
}

.easm-preview-shot.is-empty .easm-preview-port { position: static; }

.easm-preview-body {
    padding: 0.6rem 0.7rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.easm-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--easm-ink, #16201A);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .easm-preview-title { color: #E6EDE8; }
.easm-preview-title:hover { text-decoration: underline; }

.easm-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 14px;
    color: var(--easm-muted, #5D6B60);
    font-variant-numeric: tabular-nums;
}

/* Three states, not two. A 401 is a service working as intended; a 404 on a name
   the customer's DNS points at usually means nothing is configured there, which is
   the finding rather than a blemish. */
.easm-preview-status.is-ok { color: #006838; }
.easm-preview-status.is-guarded { color: #A8760F; }
.easm-preview-status.is-missing { color: #C5482B; }
.dark .easm-preview-status.is-ok { color: #8DC63F; }
.dark .easm-preview-status.is-guarded { color: #D89A1B; }
.dark .easm-preview-status.is-missing { color: #E4694A; }

.easm-preview-foot {
    font-size: 14px;
    color: var(--easm-muted, #5D6B60);
}

.easm-preview-warn {
    font-size: 14px;
    color: #C5482B;
}

@media (max-width: 640px) {
    .easm-preview { width: 100%; }
}
