/* WordPress Malware Scanner — Professional Security UI
   All colours use CSS variables from main.css except where noted.
   The .wms-score-card uses a fixed-dark gradient (#1a1a2e → #16213e) by design —
   it is intentionally independent of the surface scale so it reads as a "terminal"
   or "dashboard" panel. White text values inside it are therefore intentional.

   The achievement badge colour is injected by JS as --wms-tier-color on
   .wms-badge — no tier hex values appear in this file. */

/* ─── Local severity tokens ─────────────────────────────────────────────────
   --color-critical and --color-high are not in main.css. Define them here so
   every reference in this file stays symbolic rather than hardcoded. */
:root {
    --color-critical: #f85149;   /* same hue family as --color-error */
    --color-high:     #d29922;   /* same as --color-warning */
}

/* ─── Form Section ──────────────────────────────────────────────────────────*/

.wms-form-section {
    margin-bottom: var(--space-6);
}

.wms-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.wms-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.wms-error {
    color: var(--color-error);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.wms-help-text {
    color: var(--color-text-2);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

/* Validation state */
.form-input[aria-invalid="true"] {
    border-color: var(--color-error);
    box-shadow: 0 0 0 1px var(--color-error);
}

/* ─── Scanner Container ─────────────────────────────────────────────────────*/

.wms-scanner {
    padding: 0;
}

/* ─── Scanning / Loading State ──────────────────────────────────────────────*/

.wms-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    padding: var(--space-8) var(--space-6);
    text-align: center;
}

.wms-state h3 {
    font-size: var(--text-2xl);
    color: var(--color-text-1);
    margin: 0;
    font-weight: 700;
}

.wms-state p {
    color: var(--color-text-2);
    margin: 0;
    font-size: var(--text-base);
    text-align: left;
}

/* Spinner */
.wms-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-surface-3);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: wms-spin 0.9s linear infinite;
    flex-shrink: 0;
}

@keyframes wms-spin {
    to { transform: rotate(360deg); }
}

/* Scan progress bar — fills as pages are scanned */
.wms-progress {
    width: 100%;
    max-width: 320px;
    height: 3px;
    background: var(--color-surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.wms-progress__fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    width: 5%;
    transition: width 0.6s ease;
    animation: wms-indeterminate 1.8s ease-in-out infinite;
}

@keyframes wms-indeterminate {
    0%   { transform: translateX(-100%); width: 40%; }
    50%  { transform: translateX(120%);  width: 60%; }
    100% { transform: translateX(120%);  width: 40%; }
}

/* When pages_scanned is known, JS removes animation and sets explicit width */
.wms-progress__fill--determinate {
    animation: none;
}

.wms-scanning-detail {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wms-scanning-detail__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: wms-pulse-dot 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes wms-pulse-dot {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ─── RESULTS STATE ─────────────────────────────────────────────────────────*/

.wms-state--complete {
    align-items: stretch;
    justify-content: flex-start;
    min-height: auto;
    gap: 0;
    padding: 0;
    text-align: left;
}

/* ─── Hero Security Score Card ──────────────────────────────────────────────*/

.wms-score-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-8) var(--space-4) var(--space-6);
    /* Sophisticated gradient for security dashboard aesthetic */
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-bottom: 2px solid rgba(240, 160, 48, 0.15);
    gap: var(--space-6);
    position: relative;
    overflow: hidden;
}

/* Decorative radial glow — top-right corner */
.wms-score-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
    opacity: 0.07;
    border-radius: 50%;
    pointer-events: none;
}

/* ─── Achievement Badge ─────────────────────────────────────────────────────
   --wms-tier-color is set inline by JS on .wms-badge.
   The ring arc, glow, and decorative elements all read from this single token.
   No hex colour values appear below — all tier colours live in JS only.

   Grid layout: ring on left column, identity + message in right column */

.wms-badge {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
    padding: 0 var(--space-4);
    max-width: 100%;
}

/* ── Ring wrapper: positions SVG and the inner score number as a stack ── */
.wms-badge__ring-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    grid-row: 1 / 3;
    grid-column: 1;
    align-self: center;
}

.wms-badge__svg {
    width: 120px;
    height: 120px;
    display: block;
    /* Drop-shadow filtered through the tier colour — softens against dark bg */
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 40%, transparent));
}

/* Track ring: the full grey circle behind the progress arc */
.wms-badge__track {
    stroke: rgba(255, 255, 255, 0.08);
}

/* Progress arc: drawn by JS animating stroke-dashoffset */
.wms-badge__arc {
    stroke: var(--wms-tier-color, var(--color-accent));
    transition: stroke-dashoffset 0.05s linear; /* smoothed by rAF, this is a safety */
}

/* Inner glow ring: a slightly smaller, low-opacity arc for depth */
.wms-badge__glow {
    stroke: var(--wms-tier-color, var(--color-accent));
    transition: opacity 0.6s ease;
}

/* Score number and "out of 100" label — centred inside the SVG ring */
.wms-badge__inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    pointer-events: none;
}

.wms-badge__score {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--wms-tier-color, var(--color-accent));
    line-height: 1;
    font-family: var(--font-mono);
    letter-spacing: -2px;
    /* Number glow — gentle text-shadow using the tier colour */
    text-shadow:
        0 0 16px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 60%, transparent),
        0 0 32px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 25%, transparent);
}

.wms-badge__of-100 {
    font-size: var(--text-xxs);
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-top: var(--space-1);
}

/* ── Tier identity: emoji + name (in a row) ── */
.wms-badge__identity {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    grid-row: 1;
    grid-column: 2;
    align-self: start;
}

.wms-badge__emoji {
    font-size: var(--text-2xl);
    line-height: 1;
    /* Subtle entrance animation applied when JS adds the tier modifier class */
    display: inline-block;
    flex-shrink: 0;
}

.wms-badge__tier {
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--wms-tier-color, var(--color-accent));
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── Message text (positioned on right side below tier) ── */
.wms-badge__message {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.65);
    max-width: 100%;
    text-align: left;
    line-height: 1.55;
    margin: 0;
    grid-row: 2;
    grid-column: 2;
    align-self: start;
}

/* ── Tier-specific animations ──
   High scores (guardian, defender): shimmer/glow — rewarding
   Low scores (at_risk, critical): pulse — urgent
   Mid scores: no extra animation (stable) */

/* Guardian: radiant shimmer on the ring */
.wms-badge--guardian .wms-badge__svg {
    animation: wms-badge-shimmer 3s ease-in-out infinite;
}

/* Defender: gentle breathe */
.wms-badge--defender .wms-badge__svg {
    animation: wms-badge-breathe 4s ease-in-out infinite;
}

/* At Risk: slow urgent pulse */
.wms-badge--at_risk .wms-badge__ring-wrap {
    animation: wms-badge-urgent 2s ease-in-out infinite;
}

/* Critical: faster urgent pulse */
.wms-badge--critical .wms-badge__ring-wrap {
    animation: wms-badge-urgent 1.4s ease-in-out infinite;
}

@keyframes wms-badge-shimmer {
    0%, 100% {
        filter: drop-shadow(0 0 12px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 40%, transparent));
    }
    50% {
        filter: drop-shadow(0 0 24px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 70%, transparent));
    }
}

@keyframes wms-badge-breathe {
    0%, 100% {
        filter: drop-shadow(0 0 10px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 35%, transparent));
    }
    50% {
        filter: drop-shadow(0 0 18px color-mix(in srgb, var(--wms-tier-color, var(--color-accent)) 55%, transparent));
    }
}

@keyframes wms-badge-urgent {
    0%, 100% { transform: scale(1);    }
    50%       { transform: scale(1.03); }
}

/* ── Entrance animation: badge fades + scales in when results appear ── */
.wms-state--complete .wms-badge {
    animation: wms-badge-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.1s;
}

@keyframes wms-badge-enter {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1);   }
}

/* Emoji pop-in (slightly delayed relative to ring) */
.wms-state--complete .wms-badge__emoji {
    animation: wms-emoji-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.6s;
}

@keyframes wms-emoji-pop {
    from { opacity: 0; transform: scale(0.5) rotate(-15deg); }
    to   { opacity: 1; transform: scale(1)   rotate(0deg);   }
}

/* Severity summary tiles */
.wms-score-details {
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 0 var(--space-4);
}

.wms-score-title {
    margin: var(--space-2) 0 var(--space-3) 0;
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    text-align: left;
}

.wms-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
}

.wms-summary-list li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-3);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.wms-summary-list li:hover,
.wms-summary-list li:focus-visible {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
    outline: none;
}

.wms-summary-list li:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Count number */
.wms-summary-list li strong {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
    font-family: var(--font-mono);
}

/* Severity label text */
.wms-summary-list li .wms-sev-label {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Coloured severity indicator dot inside each tile */
.wms-summary-list .badge {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    padding: 0;
    border: none;
    margin-bottom: var(--space-1);
}

/* ─── Severity Badge System ─────────────────────────────────────────────────
   Extends the shared .badge class. Each severity gets a distinct background,
   text colour, and border so colour is never the sole differentiator. */

.badge--critical {
    background: rgba(248, 81, 73, 0.18);
    color: var(--color-critical);
    border-color: rgba(248, 81, 73, 0.35);
}

.badge--high {
    background: rgba(210, 153, 34, 0.18);
    color: var(--color-high);
    border-color: rgba(210, 153, 34, 0.35);
}

.badge--medium {
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border-color: rgba(240, 160, 48, 0.35);
}

.badge--low {
    background: rgba(63, 185, 80, 0.12);
    color: var(--color-success);
    border-color: rgba(63, 185, 80, 0.3);
}

.badge--info {
    background: rgba(88, 166, 255, 0.12);
    color: var(--color-info);
    border-color: rgba(88, 166, 255, 0.3);
}

/* Dot variant inside summary tiles — strip all badge styling, just a coloured dot */
.wms-summary-list .badge--critical { background: var(--color-critical); }
.wms-summary-list .badge--high     { background: var(--color-high); }
.wms-summary-list .badge--medium   { background: var(--color-accent); }
.wms-summary-list .badge--low      { background: var(--color-success); }

/* ─── Actions Bar ───────────────────────────────────────────────────────────*/

.wms-actions {
    padding: var(--space-3) var(--space-4);
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    background: var(--color-surface-1);
    border-bottom: 1px solid var(--color-border);
}

.wms-actions__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-2);
}

.wms-actions__meta strong {
    color: var(--color-text-1);
}

/* ─── FINDINGS ──────────────────────────────────────────────────────────────*/

.wms-findings {
    padding: var(--space-5) var(--space-4);
}

.wms-findings-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.wms-findings-header h3 {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text-1);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wms-findings-count {
    font-size: var(--text-xs);
    color: var(--color-text-3);
    font-weight: 500;
    white-space: nowrap;
}

/* Timeline layout */
.wms-findings-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: var(--space-6);
}

/* Vertical timeline rule */
.wms-findings-list::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--color-critical) 0%,
        var(--color-critical) 15%,
        var(--color-high) 30%,
        var(--color-accent) 50%,
        var(--color-border) 85%,
        transparent 100%
    );
    opacity: 0.5;
    border-radius: 1px;
}

.wms-no-findings {
    color: var(--color-text-2);
    padding: var(--space-6) 0;
    background: var(--color-surface-1);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
    text-align: center;
    font-size: var(--text-sm);
}

/* ─── Finding Item ──────────────────────────────────────────────────────────*/

.wms-finding {
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-2);
    background: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    position: relative;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    text-align: left;
}

.wms-finding:hover {
    border-color: var(--color-border-hover);
    background: var(--color-surface-2);
}

/* Timeline dot — positioned to sit on the vertical rule */
.wms-finding::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-6) - 4px); /* align with rule */
    top: var(--space-5);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-surface-1);
    border: 2px solid var(--color-border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 1;
    box-shadow: 0 0 0 4px var(--color-surface-1);
}

.wms-finding:hover::before {
    transform: scale(1.3);
}

/* Severity-specific dot colours */
.wms-finding--critical::before {
    background: var(--color-critical);
    border-color: var(--color-critical);
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.2);
}

.wms-finding--high::before {
    background: var(--color-high);
    border-color: var(--color-high);
    box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.2);
}

.wms-finding--medium::before {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-dim);
}

.wms-finding--low::before {
    background: var(--color-success);
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.15);
}

/* Severity-specific left accent on the card itself */
.wms-finding--critical { border-left: 3px solid var(--color-critical); }
.wms-finding--high     { border-left: 3px solid var(--color-high); }
.wms-finding--medium   { border-left: 3px solid var(--color-accent); }
.wms-finding--low      { border-left: 3px solid var(--color-success); }

/* Finding header: badge + title on same row */
.wms-finding__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.wms-finding__header .badge {
    flex-shrink: 0;
}

.wms-finding__title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text-1);
    line-height: var(--line-height-snug);
}

.wms-finding__description {
    margin: 0 0 0 0;
    color: var(--color-text-2);
    font-size: var(--text-sm);
    line-height: 1.65;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Location path */
.wms-finding__location {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: var(--text-xs);
    color: var(--color-text-3);
    flex-wrap: wrap;
}

.wms-finding__location strong {
    color: var(--color-text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--text-xxs);
    flex-shrink: 0;
}

.wms-finding__location code {
    background: var(--color-surface-3);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-2);
    word-break: break-all;
}

/* Evidence block — shows suspicious code/content
   Amber left border signals "this is what was found" */
.wms-finding__evidence {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-3);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-accent);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wms-finding__evidence code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-2);
    white-space: pre;
    display: block;
}

/* Label above evidence */
.wms-finding__evidence-label {
    font-size: var(--text-xxs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}

/* Recommendation block — actionable guidance
   Green left border distinguishes it clearly from evidence (amber) */
.wms-finding__recommendation {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(63, 185, 80, 0.06);
    border-left: 3px solid var(--color-success);
    border-radius: var(--radius-sm);
    color: var(--color-text-1);
    font-size: var(--text-sm);
    line-height: 1.65;
}

.wms-finding__recommendation-label {
    display: block;
    font-size: var(--text-xxs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-success);
    margin-bottom: var(--space-1);
}

/* ─── Error State ───────────────────────────────────────────────────────────*/

.wms-state--error {
    background: linear-gradient(
        135deg,
        rgba(248, 81, 73, 0.04) 0%,
        transparent 60%
    );
}

.wms-state--error h3 {
    color: var(--color-error);
}

.wms-error-icon {
    font-size: var(--text-5xl);
    line-height: 2;
    animation: wms-pulse-error 2s ease-in-out infinite;
}

@keyframes wms-pulse-error {
    0%, 100% { transform: scale(1);   opacity: 1;   }
    50%       { transform: scale(1.1); opacity: 0.8; }
}

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

@media (max-width: 768px) {
    .wms-score-card {
        padding: var(--space-6) var(--space-4) var(--space-5);
    }

    .wms-badge {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .wms-badge__ring-wrap {
        width: 110px;
        height: 110px;
        grid-row: unset;
        grid-column: unset;
    }

    .wms-badge__identity {
        grid-row: unset;
        grid-column: unset;
    }

    .wms-badge__message {
        grid-row: unset;
        grid-column: unset;
    }

    .wms-badge__svg {
        width: 110px;
        height: 110px;
    }

    .wms-summary-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .wms-state {
        min-height: 220px;
        /*padding: var(--space-6) var(--space-4);*/
    }

    .wms-findings {
       /* padding: var(--space-4) var(--space-3);*/
    }

    .wms-findings-list {
        padding-left: var(--space-5);
    }

    .wms-findings-list::before {
        left: 6px;
        width: 2px;
    }

    .wms-finding::before {
        left: calc(-1 * var(--space-5) - 3px);
    }

    .wms-actions {
        padding: var(--space-3) var(--space-3);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .wms-summary-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .wms-summary-list li {
        padding: var(--space-2) var(--space-3);
    }

    .wms-badge__ring-wrap {
        width: 100px;
        height: 100px;
    }

    .wms-badge__svg {
        width: 100px;
        height: 100px;
    }

    .wms-badge__score {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .wms-badge__tier {
        font-size: var(--text-base);
    }

    .wms-badge__message {
        font-size: var(--text-xs);
    }

    .wms-finding {
        padding: var(--space-3) var(--space-3);
    }

    .wms-finding__header {
        gap: var(--space-2);
    }
}

/* ─── Security Audit Checklist ───────────────────────────────────────────────
   Terminal-style dark panel. Monospace check names, colored left-edge
   indicators, and a proportional stat bar at the top.                       */

.wms-audit {
    background: linear-gradient(160deg, #0d1117 0%, #111827 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: var(--space-5) var(--space-5) var(--space-6);
}

/* ── Header row ── */
.wms-audit__header {
    margin-bottom: var(--space-4);
}

.wms-audit__title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.wms-audit__label {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.wms-audit__counts {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.3s ease;
}

.wms-audit__counts--clean {
    color: #4ade80;
}

.wms-audit__counts--has-failures {
    color: #f87171;
}

/* ── Proportional stat bar ── */
.wms-audit__bar {
    display: flex;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    gap: 1px;
}

.wms-audit__bar-pass,
.wms-audit__bar-fail,
.wms-audit__bar-skip {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

.wms-audit__bar-pass { background: #4ade80; border-radius: 2px 0 0 2px; }
.wms-audit__bar-fail { background: #f87171; }
.wms-audit__bar-skip { background: rgba(255, 255, 255, 0.15); border-radius: 0 2px 2px 0; }

/* ── Pending / loading state ── */
.wms-audit__pending {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    grid-column: 1 / -1;
}

.wms-audit__pending-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    animation: wms-audit-pulse 1.4s ease-in-out infinite;
}

.wms-audit__pending-dot:nth-child(2) { animation-delay: 0.2s; }
.wms-audit__pending-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes wms-audit-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(1); }
    40%            { opacity: 0.8; transform: scale(1.3); }
}

/* ── Check items grid ── */
.wms-audit__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px 12px;
}

.wms-audit__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0 5px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    animation: wms-audit-row-in 0.25s ease forwards;
}

@keyframes wms-audit-row-in {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.wms-audit__item--pass {
    border-left-color: rgba(74, 222, 128, 0.5);
}

.wms-audit__item--fail {
    border-left-color: #f87171;
    background: rgba(248, 113, 113, 0.04);
}

.wms-audit__item--skip {
    border-left-color: rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: wms-audit-row-in 0.25s ease forwards;
}

/* Dot indicator */
.wms-audit__item-dot {
    flex-shrink: 0;
    font-size: 6px;
    line-height: 1;
}

.wms-audit__item--pass .wms-audit__item-dot { color: #4ade80; }
.wms-audit__item--fail .wms-audit__item-dot { color: #f87171; }
.wms-audit__item--skip .wms-audit__item-dot { color: rgba(255, 255, 255, 0.2); }

/* Check name */
.wms-audit__item-name {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wms-audit__item--pass .wms-audit__item-name { color: rgba(255, 255, 255, 0.55); }
.wms-audit__item--fail .wms-audit__item-name { color: #fca5a5; font-weight: 600; }
.wms-audit__item--skip .wms-audit__item-name { color: rgba(255, 255, 255, 0.2); }

@media (max-width: 768px) {
    .wms-audit__grid {
        grid-template-columns: 1fr;
    }
    .wms-audit {
        padding: var(--space-4) var(--space-4) var(--space-5);
    }
}

/* ─── Reduced-motion support ────────────────────────────────────────────────
   Respect the user's preference — disable all decorative animations but
   keep functional transitions (ring drawing is handled by JS rAF which
   will still run; only CSS animations are suppressed here). */
@media (prefers-reduced-motion: reduce) {
    .wms-badge--guardian .wms-badge__svg,
    .wms-badge--defender .wms-badge__svg,
    .wms-badge--at_risk .wms-badge__ring-wrap,
    .wms-badge--critical .wms-badge__ring-wrap {
        animation: none;
    }

    .wms-state--complete .wms-badge,
    .wms-state--complete .wms-badge__emoji {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .wms-spinner {
        animation-duration: 1.5s;
    }

    .wms-scanning-detail__dot,
    .wms-progress__fill,
    .wms-error-icon {
        animation: none;
    }

    .wms-audit__item {
        animation: none;
        opacity: 1;
    }

    .wms-audit__item--skip {
        opacity: 0.4;
    }

    .wms-audit__pending-dot {
        animation: none;
        opacity: 0.3;
    }
}
