/* ═══════════════════════════════════════════════════════════════════════
   Wally Monitor — Pro Design System
   Brand: Equallyze Solutions
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ────────────────────────────────────────────────── */
:root {
    /* Brand Palette */
    --wally-deep:       #0E2336;
    --wally-blue:       #0E4A70;
    --wally-blue-light: #1a6da0;
    --wally-green-dk:   #16543F;
    --wally-mint:       #38D39F;
    --wally-mint-light: #6ee7be;
    --wally-purple-dk:  #42307A;
    --wally-purple:     #9361FF;
    --wally-purple-light:#b794ff;

    /* Neutrals */
    --wally-bg:         #f0f2f5;
    --wally-surface:    #ffffff;
    --wally-border:     #e1e5eb;
    --wally-border-light:#f0f2f5;
    --wally-text:       #1a1d21;
    --wally-text-sec:   #5f6b7a;
    --wally-text-muted: #8c95a4;

    /* Severity */
    --wally-critical:   #e5484d;
    --wally-critical-bg:#fef2f2;
    --wally-serious:    #e5793a;
    --wally-serious-bg: #fff7ed;
    --wally-moderate:   #e5a537;
    --wally-moderate-bg:#fffbeb;
    --wally-minor:      #3b82f6;
    --wally-minor-bg:   #eff6ff;
    --wally-pass:       #22c55e;
    --wally-pass-bg:    #f0fdf4;

    /* Spacing scale (4 px grid) */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
    --sp-12: 48px; --sp-16: 64px;

    /* Radii */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-full:9999px;

    /* Shadows */
    --sh-xs:  0 1px 2px rgba(14,35,54,.04);
    --sh-sm:  0 1px 3px rgba(14,35,54,.06), 0 1px 2px rgba(14,35,54,.04);
    --sh-md:  0 4px 6px -1px rgba(14,35,54,.06), 0 2px 4px -2px rgba(14,35,54,.04);
    --sh-lg:  0 10px 15px -3px rgba(14,35,54,.08), 0 4px 6px -4px rgba(14,35,54,.04);
    --sh-xl:  0 20px 25px -5px rgba(14,35,54,.1), 0 8px 10px -6px rgba(14,35,54,.06);
    --sh-glow-mint:   0 0 20px rgba(56,211,159,.25);
    --sh-glow-purple: 0 0 20px rgba(147,97,255,.2);

    /* Transition */
    --ease: cubic-bezier(.4,0,.2,1);
    --dur:  220ms;
}

/* ─── Global Wrapper ───────────────────────────────────────────────── */
.wally-monitor-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--wally-text);
    -webkit-font-smoothing: antialiased;
}

/* ─── Page Header ──────────────────────────────────────────────────── */
.wally-page-header {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    margin-bottom: var(--sp-8);
}

.wally-page-header .wally-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--r-md);
    object-fit: contain;
    box-shadow: var(--sh-sm);
}

.wally-page-header-text {
    flex: 1;
    min-width: 0;
}

.wally-page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--wally-deep);
    letter-spacing: -0.4px;
    margin: 0 0 2px 0;
    line-height: 1.25;
}

.wally-page-subtitle {
    font-size: 14px;
    color: var(--wally-text-sec);
    margin: 0;
    line-height: 1.5;
}

.wally-page-header .wally-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--r-full);
    background: var(--wally-purple);
    color: #fff;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ─── Cards / Surfaces ─────────────────────────────────────────────── */
.wally-card {
    background: var(--wally-surface);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: var(--sp-6);
    transition: box-shadow var(--dur) var(--ease);
}

.wally-card:hover {
    box-shadow: var(--sh-md);
}

.wally-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--wally-border-light);
}

.wally-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--wally-deep);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
}

.wally-card-title .wally-card-icon {
    font-size: 20px;
}

/* ─── Primary Action Button ────────────────────────────────────────── */
.wally-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--wally-blue) 0%, var(--wally-purple-dk) 100%);
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--dur) var(--ease);
    box-shadow: var(--sh-md), 0 0 0 0 rgba(14,74,112,.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
}

.wally-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}

.wally-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--sh-lg), 0 0 0 3px rgba(14,74,112,.15);
}

.wally-btn-primary:hover::before {
    opacity: 1;
}

.wally-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--sh-sm);
}

.wally-btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--sh-xs);
}

.wally-btn-primary .wally-btn-icon {
    font-size: 18px;
}

.wally-btn-primary .wally-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wallySpinnerRotate .7s linear infinite;
}

@keyframes wallySpinnerRotate {
    to { transform: rotate(360deg); }
}

/* ─── Dashboard Gauge (Hero) ───────────────────────────────────────── */
.wally-dashboard-header {
    display: flex;
    align-items: center;
    gap: var(--sp-10);
    background: linear-gradient(135deg, var(--wally-deep) 0%, var(--wally-blue) 60%, #164e7a 100%);
    border-radius: var(--r-xl);
    padding: var(--sp-10) var(--sp-10);
    margin-bottom: var(--sp-6);
    color: #fff;
    box-shadow: var(--sh-lg);
    position: relative;
    overflow: hidden;
}

/* Subtle grid pattern overlay */
.wally-dashboard-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M0 20h40v1H0zM20 0v40h1V0z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Decorative glow blob */
.wally-dashboard-header::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56,211,159,.12) 0%, transparent 70%);
    pointer-events: none;
}

.wally-gauge-container {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    z-index: 1;
}

.wally-gauge-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    text-align: center;
    line-height: 1;
    animation: wallyGaugeFadeIn 0.8s ease-out 0.3s both;
}

.wally-gauge-score {
    font-size: 52px;
    font-weight: 800;
    display: block;
    letter-spacing: -2px;
    text-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.wally-gauge-max {
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    display: block;
    margin-top: 2px;
    font-weight: 500;
}

.wally-gauge-text {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    display: block;
    margin-top: 10px;
}

.wally-gauge-level {
    font-size: 11px;
    color: var(--wally-mint);
    font-weight: 700;
    display: block;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.wally-gauge-fill {
    filter: drop-shadow(0 0 8px currentColor);
}

@keyframes wallyGaugeFadeIn {
    from { opacity: 0; transform: translate(-50%, -30%); }
    to { opacity: 1; transform: translate(-50%, -40%); }
}

/* ─── Metrics Grid (inside hero) ───────────────────────────────────── */
.wally-summary-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
    flex: 1;
    z-index: 1;
}

.wally-metric-card {
    background: rgba(255,255,255,0.06);
    border-radius: var(--r-md);
    padding: var(--sp-5) var(--sp-4);
    text-align: center;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.wally-metric-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

.wally-metric-icon {
    font-size: 22px;
    display: block;
    margin-bottom: var(--sp-1);
    opacity: .9;
}

.wally-metric-value {
    font-size: 30px;
    font-weight: 800;
    display: block;
    color: #fff;
    letter-spacing: -1px;
}

.wally-metric-label {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: var(--sp-1);
}

.wally-metric-value--critical { color: var(--wally-critical, #e5484d); }
.wally-metric-value--serious  { color: var(--wally-serious, #e5793a); }
.wally-metric-value--moderate { color: var(--wally-moderate, #e5a537); }
.wally-metric-value--minor    { color: var(--wally-minor, #3b82f6); }

.wally-metric-icon svg {
    display: block;
}

/* ─── Summary Cards Row ────────────────────────────────────────────── */
.wally-summary-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.wally-summary-card {
    background: var(--wally-surface);
    padding: var(--sp-5);
    border-radius: var(--r-md);
    border: 1px solid var(--wally-border);
    box-shadow: var(--sh-xs);
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.wally-summary-card:hover {
    box-shadow: var(--sh-sm);
    border-color: var(--wally-purple-light);
}

.wally-summary-card p {
    margin: 0 0 var(--sp-2) 0;
    font-size: 12px;
    color: var(--wally-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.wally-summary-card strong {
    font-size: 18px;
    display: block;
    margin-top: var(--sp-1);
    color: var(--wally-deep);
}

.wally-block-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.wally-block-tag svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* ─── Filter Pills ─────────────────────────────────────────────────── */
.wally-filters {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-5);
    padding: var(--sp-3);
    background: var(--wally-bg);
    border-radius: var(--r-md);
}

.wally-filters .wally-pill {
    border-radius: var(--r-full);
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--dur) var(--ease);
    box-shadow: none;
    background: transparent;
    color: var(--wally-text-sec);
    cursor: pointer;
    line-height: 1.4;
}

.wally-filters .wally-pill:hover {
    background: var(--wally-surface);
    box-shadow: var(--sh-xs);
    color: var(--wally-text);
}

.wally-filters .wally-pill.active {
    background: var(--wally-surface);
    box-shadow: var(--sh-sm);
    color: var(--wally-text);
    font-weight: 600;
    transform: none;
}

.wally-filters .wally-pill.critical {
    background: transparent;
    color: var(--wally-text-sec);
    border-color: transparent;
}
.wally-filters .wally-pill.critical:hover,
.wally-filters .wally-pill.critical.active {
    background: var(--wally-critical-bg);
    color: var(--wally-critical);
    border-color: var(--wally-critical);
}
.wally-filters .wally-pill.serious {
    background: transparent;
    color: var(--wally-text-sec);
    border-color: transparent;
}
.wally-filters .wally-pill.serious:hover,
.wally-filters .wally-pill.serious.active {
    background: var(--wally-serious-bg);
    color: var(--wally-serious);
    border-color: var(--wally-serious);
}
.wally-filters .wally-pill.moderate {
    background: transparent;
    color: var(--wally-text-sec);
    border-color: transparent;
}
.wally-filters .wally-pill.moderate:hover,
.wally-filters .wally-pill.moderate.active {
    background: var(--wally-moderate-bg);
    color: var(--wally-moderate);
    border-color: var(--wally-moderate);
}
.wally-filters .wally-pill.minor {
    background: transparent;
    color: var(--wally-text-sec);
    border-color: transparent;
}
.wally-filters .wally-pill.minor:hover,
.wally-filters .wally-pill.minor.active {
    background: var(--wally-minor-bg);
    color: var(--wally-minor);
    border-color: var(--wally-minor);
}

/* ─── Advanced Filters Bar ─────────────────────────────────────────── */
.wally-advanced-filters {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
    flex-wrap: wrap;
}

.wally-filter-group {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.wally-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--wally-text-sec);
    white-space: nowrap;
}

.wally-filter-select {
    padding: 4px 12px;
    border: 1px solid var(--wally-border);
    border-radius: var(--r-sm);
    background: var(--wally-surface);
    color: var(--wally-text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease);
}

.wally-filter-select:focus {
    border-color: var(--wally-blue);
    outline: 2px solid var(--wally-blue-light);
    outline-offset: 1px;
}

/* ─── Action Plan ──────────────────────────────────────────────────── */
.wally-action-plan {
    background: var(--wally-surface);
    border: 1px solid var(--wally-border);
    border-left: 4px solid var(--wally-blue);
    border-radius: var(--r-lg);
    padding: var(--sp-5) var(--sp-6);
    margin-bottom: var(--sp-5);
    color: var(--wally-text);
    box-shadow: var(--sh-sm);
}

.wally-action-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
}

.wally-action-plan-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--wally-deep);
}

.wally-action-plan-stats {
    display: flex;
    gap: var(--sp-3);
}

.wally-action-stat {
    padding: 3px 12px;
    background: var(--wally-bg);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--wally-blue);
}

.wally-action-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--sp-3);
    counter-reset: none;
}

.wally-action-step {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--wally-border-light);
    font-size: 13px;
    line-height: 1.5;
}

.wally-action-step:last-child {
    border-bottom: none;
}

.wally-action-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--wally-blue);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.wally-action-text {
    flex: 1;
}

.wally-action-meta {
    color: var(--wally-text-muted);
    font-size: 12px;
}

.wally-action-hint {
    margin: 0;
    font-size: 12px;
    color: var(--wally-text-muted);
    font-style: italic;
}

/* ─── Page Group (multi-page scan) ─────────────────────────────────── */
.wally-page-group {
    margin-bottom: var(--sp-6);
}

.wally-page-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    background: var(--wally-deep);
    color: #fff;
    border-radius: var(--r-md) var(--r-md) 0 0;
    margin-bottom: 0;
}

.wally-page-group-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.wally-page-group-count {
    font-size: 12px;
    opacity: 0.75;
    white-space: nowrap;
}

.wally-page-group .wally-violation:first-of-type {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ─── Pagination ───────────────────────────────────────────────────── */
.wally-pagination-info {
    background: var(--wally-bg);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-sm);
    margin-bottom: var(--sp-4);
    font-size: 13px;
    color: var(--wally-text-sec);
    font-weight: 500;
}

.wally-pagination {
    display: flex;
    gap: var(--sp-1);
    justify-content: center;
    align-items: center;
    margin-top: var(--sp-6);
    padding: var(--sp-5) 0;
    border-top: 1px solid var(--wally-border-light);
}

.wally-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--wally-border);
    background: var(--wally-surface);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--wally-text-sec);
    transition: all var(--dur) var(--ease);
}

.wally-page-btn:hover:not(:disabled) {
    background: var(--wally-bg);
    border-color: var(--wally-blue);
    color: var(--wally-blue);
}

.wally-page-btn.active {
    background: var(--wally-blue);
    color: #fff;
    border-color: var(--wally-blue);
    font-weight: 600;
    box-shadow: var(--sh-sm);
}

.wally-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.wally-page-ellipsis {
    padding: 0 var(--sp-1);
    color: var(--wally-text-muted);
}

.wally-no-results {
    text-align: center;
    padding: var(--sp-16) var(--sp-8);
    color: var(--wally-text-muted);
    font-size: 15px;
}

/* ─── Violation Card ───────────────────────────────────────────────── */
.wally-violation {
    border: 1px solid var(--wally-border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-3);
    overflow: hidden;
    background: var(--wally-surface);
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.wally-violation:hover {
    box-shadow: var(--sh-md);
    border-color: #c8cdd4;
}

.wally-violation-header {
    background: var(--wally-bg);
    padding: var(--sp-4) var(--sp-5);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    transition: background var(--dur) var(--ease);
    user-select: none;
}

.wally-violation-header::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--wally-text-sec);
    border-bottom: 2px solid var(--wally-text-sec);
    transform: rotate(-45deg);
    transition: transform var(--dur) var(--ease);
    flex-shrink: 0;
    margin-right: var(--sp-1);
}

.wally-violation.expanded .wally-violation-header::before {
    transform: rotate(45deg);
}

.wally-violation-header:hover {
    background: #e8ebef;
}

.wally-violation-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--wally-text);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.wally-violation-header .impact-badge {
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wally-violation-body {
    padding: var(--sp-5);
    display: none;
    border-top: 1px solid var(--wally-border-light);
    animation: wallySlideDown .25s var(--ease);
}

@keyframes wallySlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wally-violation-body p {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--wally-text-sec);
}

.wally-violation-body a {
    color: var(--wally-blue);
    text-decoration: none;
    font-weight: 500;
}
.wally-violation-body a:hover {
    text-decoration: underline;
}

.wally-violation-body ul {
    list-style: none;
    padding: 0;
    margin: var(--sp-3) 0;
}

.wally-violation-body li {
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: var(--sp-1);
    background: var(--wally-bg);
    border-radius: var(--r-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.wally-violation-body li code {
    background: var(--wally-deep);
    color: var(--wally-mint-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    word-break: break-all;
}

/* ─── Priority Badges ──────────────────────────────────────────────── */
.priority-badge {
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.priority-badge.urgent {
    background: var(--wally-critical);
    color: white;
    animation: wallyPulseUrgent 2.5s ease-in-out infinite;
}

.priority-badge.quick-fix {
    background: var(--wally-pass);
    color: white;
}

@keyframes wallyPulseUrgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(229,72,77,0); }
}

/* ─── Highlight / Locate ───────────────────────────────────────────── */
.wally-highlighted {
    border: 3px solid var(--wally-critical) !important;
    box-shadow: 0 0 0 4px rgba(229,72,77,.2), 0 0 20px rgba(229,72,77,.3) !important;
    outline: 3px solid var(--wally-critical) !important;
    outline-offset: 2px !important;
    transition: all .3s var(--ease) !important;
}

.wally-highlight-btn {
    font-size: 11px !important;
    padding: 2px 10px !important;
    border-radius: var(--r-full) !important;
    font-weight: 500 !important;
    transition: all var(--dur) var(--ease) !important;
    border-color: var(--wally-border) !important;
    color: var(--wally-text-sec) !important;
}

.wally-highlight-btn:hover {
    background: var(--wally-blue) !important;
    color: #fff !important;
    border-color: var(--wally-blue) !important;
    transform: translateY(-1px);
    box-shadow: var(--sh-sm);
}

/* ─── Progress Bar ─────────────────────────────────────────────────── */
#wally-full-scan-progress {
    margin-top: var(--sp-5);
}

.wally-progress-stats {
    background: var(--wally-surface);
    border: 1px solid var(--wally-border);
    padding: var(--sp-6);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}

.wally-progress-stats p {
    margin: var(--sp-2) 0;
    font-size: 14px;
    color: var(--wally-text-sec);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--wally-bg);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: var(--sp-3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wally-blue), var(--wally-mint));
    border-radius: var(--r-full);
    transition: width .4s var(--ease);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
    animation: wallyShimmer 2s infinite;
}

@keyframes wallyShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.wally-complete-message {
    background: var(--wally-pass-bg);
    border: 1px solid #bbf7d0;
    color: var(--wally-green-dk);
    padding: var(--sp-5);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.wally-complete-message strong {
    font-size: 15px;
}

/* ─── Conformity Stats ─────────────────────────────────────────────── */
.wally-conformity-stats {
    background: var(--wally-surface);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    margin-bottom: var(--sp-6);
    box-shadow: var(--sh-sm);
}

.wally-conformity-title {
    margin: 0 0 var(--sp-5) 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--wally-deep);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--wally-border-light);
}

.wally-conformity-icon {
    font-size: 22px;
}

.wally-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--sp-4);
}

.wally-stat-card {
    background: var(--wally-bg);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-md);
    padding: var(--sp-5);
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
    transition: all var(--dur) var(--ease);
}

.wally-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
    border-color: var(--wally-purple-light);
}

.wally-stat-icon {
    font-size: 26px;
    flex-shrink: 0;
}

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

.wally-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--wally-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: var(--sp-2);
}

.wally-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--wally-text);
    margin-bottom: var(--sp-2);
}

.wally-stat-suffix {
    font-size: 12px;
    font-weight: 400;
    color: var(--wally-text-muted);
}

.wally-stat-bar {
    width: 100%;
    height: 5px;
    background: var(--wally-border);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: var(--sp-1);
}

.wally-stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wally-blue), var(--wally-mint));
    border-radius: var(--r-full);
    transition: width .8s var(--ease);
}

.wally-stat-percent {
    font-size: 13px;
    font-weight: 700;
    color: var(--wally-blue);
}

/* ─── Quick Fix Panel ──────────────────────────────────────────────── */
.wally-quickfix-panel {
    margin-top: var(--sp-4);
    background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--wally-mint);
    border-radius: var(--r-md);
    padding: var(--sp-4) var(--sp-5);
}

.wally-quickfix-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.wally-quickfix-header strong {
    color: var(--wally-green-dk);
    font-size: 13px;
}

.wally-quickfix-icon {
    font-size: 18px;
}

.wally-quickfix-desc {
    font-size: 13px;
    color: var(--wally-text-sec);
    margin: 0 0 var(--sp-3) 0;
    line-height: 1.6;
}

.wally-quickfix-code {
    background: var(--wally-deep);
    color: #e2e8f0;
    border-radius: var(--r-sm);
    padding: var(--sp-3) var(--sp-4);
    font-size: 12px;
    line-height: 1.7;
    overflow-x: auto;
    margin: 0 0 var(--sp-3) 0;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid rgba(255,255,255,.06);
}

.wally-quickfix-code code {
    background: none;
    color: inherit;
    padding: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.wally-copy-fix {
    background: var(--wally-blue) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--r-sm) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    padding: 5px 14px !important;
    transition: all var(--dur) var(--ease) !important;
}

.wally-copy-fix:hover {
    background: var(--wally-purple-dk) !important;
    transform: translateY(-1px);
    box-shadow: var(--sh-sm) !important;
}

/* ─── History Page ─────────────────────────────────────────────────── */
.wally-history-chart-wrap {
    background: var(--wally-surface);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    margin-bottom: var(--sp-6);
    box-shadow: var(--sh-sm);
}

.wally-history-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
    gap: var(--sp-3);
}

.wally-history-chart-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--wally-deep);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.wally-history-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 13px;
    color: var(--wally-text-sec);
    cursor: pointer;
    user-select: none;
}

.wally-history-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--wally-purple);
    cursor: pointer;
}

/* ─── Pro Table ────────────────────────────────────────────────────── */
.wally-table-wrap {
    border: 1px solid var(--wally-border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--sh-xs);
}

.wally-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wally-table thead {
    background: var(--wally-bg);
}

.wally-table th {
    padding: var(--sp-3) var(--sp-5);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wally-text-muted);
    text-align: left;
    border-bottom: 1px solid var(--wally-border);
}

.wally-table td {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--wally-border-light);
    color: var(--wally-text);
}

.wally-table tbody tr {
    transition: background var(--dur) var(--ease);
}

.wally-table tbody tr:hover {
    background: #f8f9fb;
}

.wally-table tbody tr:last-child td {
    border-bottom: none;
}

.wally-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.4;
}

.wally-mode-badge--wcag {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.wally-mode-badge--nbr {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.wally-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.wally-score-pill.excellent {
    background: var(--wally-pass-bg);
    color: var(--wally-green-dk);
}

.wally-score-pill.good {
    background: var(--wally-moderate-bg);
    color: #92400e;
}

.wally-score-pill.poor {
    background: var(--wally-critical-bg);
    color: #991b1b;
}

.wally-score-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.wally-score-pill.excellent .wally-score-dot { background: var(--wally-pass); }
.wally-score-pill.good .wally-score-dot      { background: var(--wally-moderate); }
.wally-score-pill.poor .wally-score-dot      { background: var(--wally-critical); }

.wally-empty-state {
    text-align: center;
    padding: var(--sp-16) var(--sp-8);
}

.wally-empty-state-icon {
    font-size: 48px;
    display: block;
    margin-bottom: var(--sp-4);
    opacity: .6;
}

.wally-empty-state p {
    color: var(--wally-text-muted);
    font-size: 15px;
    margin: 0;
}

.wally-empty-state a {
    color: var(--wally-blue);
    font-weight: 600;
    text-decoration: none;
}

.wally-empty-state a:hover {
    text-decoration: underline;
}

/* ─── Settings Page ────────────────────────────────────────────────── */
.wally-settings-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--wally-text);
    -webkit-font-smoothing: antialiased;
}

.wally-settings-section {
    background: var(--wally-surface);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-lg);
    padding: var(--sp-6) var(--sp-8);
    margin-bottom: var(--sp-6);
    box-shadow: var(--sh-sm);
}

.wally-settings-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--wally-deep);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-5) 0;
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--wally-border-light);
}

.wally-settings-section .form-table th {
    padding-top: var(--sp-4);
    padding-bottom: var(--sp-4);
    font-weight: 600;
    color: var(--wally-text);
    font-size: 14px;
}

.wally-settings-section .form-table td {
    padding-top: var(--sp-4);
    padding-bottom: var(--sp-4);
}

.wally-settings-section .form-table,
.wally-settings-section .form-table td,
.wally-settings-section .form-table th {
    border: none;
}

.wally-settings-section .description {
    color: var(--wally-text-muted);
    font-size: 12px;
    margin-top: var(--sp-1);
}

.wally-settings-section select,
.wally-settings-section input[type="number"],
.wally-settings-section input[type="email"],
.wally-settings-section input[type="text"] {
    border: 1px solid var(--wally-border);
    border-radius: var(--r-sm);
    padding: var(--sp-2) var(--sp-3);
    font-size: 14px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.wally-settings-section select:focus,
.wally-settings-section input:focus {
    border-color: var(--wally-blue);
    box-shadow: 0 0 0 3px rgba(14,74,112,.1);
    outline: 2px solid var(--wally-blue);
    outline-offset: 1px;
}

.wally-settings-section label {
    font-size: 14px;
    color: var(--wally-text);
    cursor: pointer;
}

.wally-settings-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--wally-blue);
    cursor: pointer;
    vertical-align: middle;
    margin-right: var(--sp-2);
}

.wally-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--wally-text);
    transition: color var(--dur) var(--ease);
}
.wally-checkbox-label:hover {
    color: var(--wally-blue);
}
.wally-checkbox-label span {
    line-height: 1.4;
}

.wally-cron-status {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-sm);
    background: var(--wally-minor-bg);
    border: 1px solid #bfdbfe;
    font-size: 13px;
    color: var(--wally-blue);
    font-weight: 500;
    margin-bottom: var(--sp-4);
}

.wally-cron-status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--wally-pass);
    animation: wallyPulse 2s infinite;
}

@keyframes wallyPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(1.3); }
}

.wally-settings-submit {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--sp-6);
    margin-top: var(--sp-4);
}

.wally-settings-submit .wally-btn-primary {
    font-size: 15px;
    padding: var(--sp-3) var(--sp-8);
}

/* ─── Toast / Notification ─────────────────────────────────────────── */
.wally-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100200;
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--sh-xl);
    animation: wallyToastIn .35s var(--ease);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    max-width: 380px;
}

.wally-toast.success, .wally-toast.wally-toast-success { background: var(--wally-green-dk); }
.wally-toast.warning, .wally-toast.wally-toast-warning { background: #92400e; }
.wally-toast.error,   .wally-toast.wally-toast-error   { background: #991b1b; }
.wally-toast.wally-toast-info { background: var(--wally-blue); }

.wally-toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.wally-toast-out {
    animation: wallyToastOut .35s var(--ease) forwards;
}

@keyframes wallyToastIn {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wallyToastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(.96); }
}

/* ─── Meta Box (Editor Sidebar) ────────────────────────────────────── */
#wally-editor-report {
    font-size: 13px;
}

#wally-editor-report .wally-meta-intro {
    color: var(--wally-text-sec);
    margin: 0 0 var(--sp-3) 0;
    line-height: 1.5;
}

#wally-editor-report .wally-meta-ready {
    padding: var(--sp-3);
    background: var(--wally-bg);
    border-radius: var(--r-sm);
    text-align: center;
    color: var(--wally-text-muted);
    font-size: 13px;
}

/* ─── Meta Box Mode Toggle (segmented control) ────────────────────── */
.wally-meta-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--wally-bg);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-md);
    padding: 3px;
    margin-bottom: var(--sp-3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.wally-meta-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    border: none;
    border-radius: calc(var(--r-md) - 2px);
    background: transparent;
    color: var(--wally-text-sec);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
    white-space: nowrap;
}

.wally-meta-mode-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04);
    color: var(--wally-text);
}

.wally-meta-mode-btn.active {
    background: var(--wally-blue);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.wally-meta-mode-btn:focus-visible {
    outline: 2px solid var(--wally-blue);
    outline-offset: 1px;
    z-index: 1;
}

.wally-meta-mode-icon {
    font-size: 13px;
    line-height: 1;
}

.wally-meta-mode-text {
    font-size: 11.5px;
}

.wally-meta-mode-feedback {
    font-size: 11px;
    font-weight: 600;
    color: var(--wally-green, #16a34a);
    text-align: center;
    overflow: hidden;
}

.wally-meta-scan-btn {
    width: 100%;
    margin-top: var(--sp-3) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 8px 0 !important;
    border-radius: var(--r-sm) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    background: var(--wally-blue) !important;
    color: #fff !important;
    border: none !important;
    transition: all var(--dur) var(--ease) !important;
}

.wally-meta-scan-btn:hover {
    background: var(--wally-purple-dk) !important;
}

#wally-editor-report .wally-violation {
    font-size: 12px;
    margin-bottom: var(--sp-2);
}

#wally-editor-report .wally-violation-header {
    padding: var(--sp-2) var(--sp-3);
}

#wally-editor-report .wally-violation-header h3 {
    font-size: 12px;
}

#wally-editor-report .wally-violation-body {
    padding: var(--sp-2) var(--sp-3);
}

/* ─── Report Header ────────────────────────────────────────────────── */
.wally-monitor-wrap .report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-5);
}

.report-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--wally-deep);
    margin: 0;
}

.wally-export-actions {
    display: flex;
    gap: var(--sp-2);
}

.wally-export-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 5px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: var(--r-sm) !important;
    border: 1px solid var(--wally-border) !important;
    background: var(--wally-surface) !important;
    color: var(--wally-text-sec) !important;
    text-decoration: none !important;
    transition: all var(--dur) var(--ease) !important;
    cursor: pointer;
}

.wally-export-btn:hover {
    background: var(--wally-blue) !important;
    color: #fff !important;
    border-color: var(--wally-blue) !important;
    transform: translateY(-1px);
    box-shadow: var(--sh-sm);
}

.wally-export-btn svg {
    flex-shrink: 0;
}

/* ─── Locate Element ───────────────────────────────────────────────── */
.wally-locate-element {
    transition: all var(--dur) var(--ease);
    font-weight: 600;
    box-shadow: var(--sh-xs);
    border-radius: var(--r-full);
}

.wally-locate-element:hover {
    background: var(--wally-purple-dk) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: var(--sh-sm);
}

/* ─── Onboarding Wizard ────────────────────────────────────────────── */
.wally-onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 35, 54, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wallyOverlayIn .3s var(--ease);
}

@keyframes wallyOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.wally-onboarding-modal {
    background: var(--wally-surface);
    border-radius: var(--r-xl);
    width: 560px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--sh-xl);
    position: relative;
    animation: wallyModalIn .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes wallyModalIn {
    from { opacity: 0; transform: scale(.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wally-onboarding-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--wally-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: color var(--dur), background var(--dur);
    z-index: 2;
}

.wally-onboarding-close:hover {
    color: var(--wally-text);
    background: var(--wally-bg);
}

.wally-onboarding-progress {
    display: flex;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-5) var(--sp-5) 0;
}

.wally-onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--wally-border);
    transition: all .3s var(--ease);
}

.wally-onboarding-dot.active {
    background: var(--wally-purple);
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(147,97,255,.15);
}

.wally-onboarding-dot.completed {
    background: var(--wally-mint);
}

.wally-onboarding-body {
    padding: var(--sp-6) var(--sp-8);
    text-align: center;
}

.wally-onboarding-step-icon {
    font-size: 48px;
    margin-bottom: var(--sp-2);
}

.wally-onboarding-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--wally-deep);
    margin: 0 0 var(--sp-4) 0;
}

.wally-onboarding-content {
    text-align: left;
    font-size: 14px;
    line-height: 1.7;
    color: var(--wally-text-sec);
}

.wally-onboarding-content ul,
.wally-onboarding-content ol {
    padding-left: 20px;
}

.wally-onboarding-content li {
    margin-bottom: var(--sp-2);
}

.wally-onboarding-tip {
    background: #fffbeb;
    border-left: 3px solid var(--wally-moderate);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    font-size: 13px;
    margin-top: var(--sp-3);
}

.wally-onboarding-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
}

.wally-onboarding-feature {
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
    background: var(--wally-bg);
    padding: var(--sp-3);
    border-radius: var(--r-md);
    font-size: 13px;
}

.wally-onboarding-feature-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.wally-onboarding-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4) var(--sp-8) var(--sp-6);
    border-top: 1px solid var(--wally-border-light);
}

.wally-onboarding-skip {
    color: var(--wally-text-muted) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    font-size: 13px !important;
}

.wally-onboarding-skip:hover {
    color: var(--wally-text-sec) !important;
}

.wally-onboarding-nav {
    display: flex;
    gap: var(--sp-2);
}

.wally-onboarding-nav .button-primary {
    background: linear-gradient(135deg, var(--wally-blue), var(--wally-purple-dk)) !important;
    border: none !important;
    padding: 8px 24px !important;
    border-radius: var(--r-md) !important;
    font-weight: 600 !important;
}

.wally-onboarding-nav .button-primary:hover {
    box-shadow: var(--sh-md) !important;
}

.wally-onboarding-highlight {
    position: relative;
    z-index: 100101;
    animation: wallyPulse 2s infinite;
    border-radius: var(--r-sm);
}

@keyframes wallyPulse {
    0%  { box-shadow: 0 0 0 0 rgba(147,97,255,.5); }
    50% { box-shadow: 0 0 0 10px rgba(147,97,255,0); }
    100%{ box-shadow: 0 0 0 0 rgba(147,97,255,0); }
}

/* ─── WP Admin Notice Override ─────────────────────────────────────── */
.wally-monitor-wrap .notice,
.wally-settings-wrap .notice {
    border-radius: var(--r-sm);
    border-left-width: 4px;
    padding: var(--sp-3) var(--sp-4);
    font-size: 14px;
    margin-bottom: var(--sp-4);
}

.wally-monitor-wrap .notice-success,
.wally-settings-wrap .notice-success {
    background: var(--wally-pass-bg);
    border-left-color: var(--wally-pass);
}

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .wally-dashboard-header {
        flex-direction: column;
        padding: var(--sp-6);
        gap: var(--sp-6);
        text-align: center;
    }
    .wally-gauge-container { width: 160px; height: 160px; }
    .wally-gauge-score { font-size: 40px; }
    .wally-summary-metrics { width: 100%; }
    .wally-summary-cards-row { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
    .wally-monitor-wrap,
    .wally-settings-wrap {
        padding: var(--sp-3);
    }
    .wally-page-header { flex-wrap: wrap; }
    .wally-page-title { font-size: 20px; }
    .wally-stats-grid { grid-template-columns: 1fr; }
    .wally-metric-value { font-size: 24px; }
    .wally-onboarding-body { padding: var(--sp-4) var(--sp-5); }
    .wally-onboarding-features { grid-template-columns: 1fr; }
    .wally-onboarding-footer { padding: var(--sp-3) var(--sp-5) var(--sp-5); }
    .wally-settings-section { padding: var(--sp-4) var(--sp-5); }
}

/* ─── Print ────────────────────────────────────────────────────────── */
@media print {
    .wally-dashboard-header { background: #fff !important; color: #000 !important; box-shadow: none !important; border: 2px solid #000; }
    .wally-gauge-fill { filter: none; }
    .wally-metric-card { border: 1px solid #ccc; background: #fff !important; }
    .wally-metric-value, .wally-gauge-score { color: #000 !important; }
    .wally-btn-primary, .wally-onboarding-overlay { display: none !important; }
    .wally-violation-body { display: block !important; }
}

/* ─── Animation Utilities ──────────────────────────────────────────── */
.wally-fade-in {
    animation: wallyFadeIn .4s var(--ease) both;
}

@keyframes wallyFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wally-stagger-1 { animation-delay: .05s; }
.wally-stagger-2 { animation-delay: .1s; }
.wally-stagger-3 { animation-delay: .15s; }
.wally-stagger-4 { animation-delay: .2s; }
.wally-stagger-5 { animation-delay: .25s; }
.wally-stagger-6 { animation-delay: .3s; }

/* ─── #wally-summary compat (legacy container) ─────────────────────── */
#wally-summary {
    margin-bottom: var(--sp-5);
}

/* ─── Analysis Mode Selector (Scanner Page — Segmented Toggle) ──── */
.wally-scanner-mode-toggle-wrap {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.wally-mode-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--wally-text);
    white-space: nowrap;
}

.wally-scanner-mode-toggle {
    display: inline-flex;
    gap: 0;
    background: var(--wally-bg);
    border: 1px solid var(--wally-border);
    border-radius: var(--r-md);
    padding: 3px;
}

.wally-scanner-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: calc(var(--r-md) - 2px);
    background: transparent;
    color: var(--wally-text-sec);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
    white-space: nowrap;
}

.wally-scanner-mode-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04);
    color: var(--wally-text);
}

.wally-scanner-mode-btn.active {
    background: var(--wally-blue);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.wally-scanner-mode-btn:focus-visible {
    outline: 2px solid var(--wally-blue);
    outline-offset: 1px;
    z-index: 1;
}

.wally-mode-icon {
    flex-shrink: 0;
}

.wally-mode-info {
    font-size: 11px;
    color: var(--wally-text-sec);
    font-style: italic;
}

/* Engine badge in results */
.wally-engine-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r-full);
    background: var(--wally-border-light);
    color: var(--wally-text-sec);
    font-size: 11px;
    font-weight: 500;
    margin: 0 2px;
}

/* ─── Reduced Motion ───────────────────────────────────────────────── */
/* WCAG 2.3.3 — Respect user motion preferences                       */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .wally-fade-in,
    .wally-stagger-1,
    .wally-stagger-2,
    .wally-stagger-3 {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─── Forced-Colors / High-Contrast Mode ───────────────────────────── */
/* WCAG 1.4.11 — Non-text Contrast & Windows High Contrast support     */
@media (forced-colors: active) {
    /* ── General resets ─────────────────────────────────────────────── */
    .wally-card,
    .wally-stat-card,
    .wally-violation,
    .wally-action-plan,
    .wally-page-group-header,
    .wally-advanced-filters,
    .wally-quickfix-panel {
        border: 1px solid ButtonText;
        forced-color-adjust: none;
        background: Canvas;
        color: CanvasText;
    }

    /* ── Buttons ────────────────────────────────────────────────────── */
    .wally-btn,
    .wally-btn-primary,
    .wally-btn-copy,
    .wally-highlight-btn,
    .wally-filter-select,
    .wally-export-btn {
        border: 1px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
        forced-color-adjust: none;
    }

    .wally-btn:focus,
    .wally-btn-primary:focus,
    .wally-highlight-btn:focus,
    .wally-filter-select:focus {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }

    /* ── Badges that rely on color-only differentiation ─────────────── */
    .impact-badge,
    .priority-badge,
    .wally-engine-badge,
    .wally-action-stat,
    .wally-mode-badge {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
        forced-color-adjust: none;
    }

    /* ── Filter pills ──────────────────────────────────────────────── */
    .wally-pill {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
        forced-color-adjust: none;
    }

    .wally-pill.active {
        border-color: Highlight;
        background: Highlight;
        color: HighlightText;
    }

    /* ── Gauge (SVG donut chart) ────────────────────────────────────── */
    .wally-gauge-fill {
        stroke: Highlight !important;
    }

    .wally-gauge-bg {
        stroke: ButtonText !important;
    }

    .wally-gauge-score {
        fill: CanvasText !important;
    }

    /* ── Stat progress bars ────────────────────────────────────────── */
    .wally-stat-bar {
        background: Canvas;
        border: 1px solid ButtonText;
    }

    .wally-stat-bar-fill {
        background: Highlight !important;
        forced-color-adjust: none;
    }

    /* ── Action plan (light surface) ───────────────────────────────── */
    .wally-action-plan {
        background: Canvas;
        border: 1px solid ButtonText;
        color: CanvasText;
    }

    .wally-action-plan-title {
        color: CanvasText;
    }

    .wally-action-number {
        border: 1px solid ButtonText;
        background: Highlight;
        color: HighlightText;
    }

    .wally-action-step {
        border-bottom-color: ButtonText;
    }

    /* ── Scanner mode toggle ────────────────────────────────────────── */
    .wally-scanner-mode-toggle {
        border: 1px solid ButtonText;
        background: Canvas;
    }

    .wally-scanner-mode-btn {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
        forced-color-adjust: none;
    }

    .wally-scanner-mode-btn.active {
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }

    /* ── Page group header ─────────────────────────────────────────── */
    .wally-page-group-header {
        background: Canvas;
        color: CanvasText;
    }

    .wally-page-group-title {
        color: CanvasText;
    }

    /* ── Links ──────────────────────────────────────────────────────── */
    .wally-violation a,
    .wally-action-plan a {
        color: LinkText;
    }

    /* ── WCAG level conformance badge ──────────────────────────────── */
    .wally-conformance-badge {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
        forced-color-adjust: none;
    }

    /* ── Pagination ────────────────────────────────────────────────── */
    .wally-page-btn {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
    }

    .wally-page-btn.active {
        border-color: Highlight;
        background: Highlight;
        color: HighlightText;
    }

    /* ── Summary stat cards ────────────────────────────────────────── */
    .wally-stat-card {
        background: Canvas;
        color: CanvasText;
    }

    .wally-stat-value {
        color: CanvasText;
    }
}
