/* ==========================================================================
   components.css — reusable, page-agnostic UI components.
   Loaded last (after style.css + custom-style.css) via partials/head.php with a
   ?v=filemtime cache-bust. Keep selectors namespaced so they never collide with
   the existing .tooltip (JS-toggled) or Flowbite [role="tooltip"] styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   jsa-tooltip — info icon + hover/focus bubble (CSS-only, no JS / no Popper).
   Output by jsa_tooltip() in includes/ui-helpers.php. Accessible: the trigger
   is a real <button>; the bubble is shown on hover, on keyboard focus
   (:focus-within), and stays above lock overlays via a high z-index.
   -------------------------------------------------------------------------- */
.jsa-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 0;
}

.jsa-tip__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: help;
    line-height: 0;
    /* Match the existing info-icon convention: muted grey, theme purple on hover. */
    color: #9ca3af;
    transition: color .15s ease;
}

.jsa-tip__btn:hover,
.jsa-tip__btn:focus-visible {
    color: var(--bg-primary, #7e3af2);
}

.jsa-tip__btn:focus-visible {
    outline: 2px solid var(--bg-primary, #7e3af2);
    outline-offset: 2px;
    border-radius: 4px;
}

.jsa-tip__icon {
    font-size: 15px;
}

/* Smaller trigger for placement inside compact badge/pill labels. */
.jsa-tip--sm .jsa-tip__icon {
    font-size: 13px;
}

/* The bubble. Dark style mirrors the existing .tooltip (custom-style.css) for
   visual consistency. Hidden by default; revealed on hover/focus of the wrapper. */
.jsa-tip__bubble {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    z-index: 9999;
    width: max-content;
    max-width: min(260px, 80vw);
    padding: 9px 12px;
    border-radius: 8px;
    background: #1f2937;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    white-space: normal;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

/* Upward variant for triggers near the bottom of the viewport. */
.jsa-tip--top .jsa-tip__bubble {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
}

.jsa-tip:hover .jsa-tip__bubble,
.jsa-tip:focus-within .jsa-tip__bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Little arrow. */
.jsa-tip__bubble::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1f2937;
}

.jsa-tip--top .jsa-tip__bubble::before {
    bottom: auto;
    top: 100%;
    border-bottom-color: transparent;
    border-top-color: #1f2937;
}

/* ==========================================================================
   Dashboard page-scoped components (extracted from the dashboard.php inline
   <style> block, 2026-06-23). These are namespaced component classes
   (llm-*, status/box-*, generate-btn, pro-*/feature-*, dash-metric-*,
   dash-arc, rr-lock-*, pd-*, roi-*, dashbtn, dashfurbtn, missingsrow) that
   were verified absent from style.css / custom-style.css and unused on other
   pages, so globalizing them here changes nothing elsewhere. Generic utility
   classes (.text-*, .bg-*, .border-*, .truncate, etc.), the :root token, and
   .card-footer (used by dashboard-1.php) were intentionally left inline for a
   later prefix-rename pass.
   ========================================================================== */

/* --- LLMs.txt checker card -------------------------------------------------- */
.llm-checker-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05)
}

.llm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px
}

.llm-icon-title {
    display: flex;
    align-items: center;
    gap: 8px
}

.llm-icon {
    font-size: 18px;
    color: #64748b
}

.llm-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0
}

.llm-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 4px 0 0
}

.llm-status-badge {
    background: #fef2f2;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px
}

.llm-grid {
    display: flex;
    gap: 16px;
    margin-bottom: 10px
}

.status-box {
    flex: 1;
    border-radius: 12px;
    padding: 16px
}

.status-box-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px
}

.status-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b
}

.box-error {
    background: #fbf8f6
}

.box-error .status-indicator-icon {
    color: #ef4444
}

.box-error .status-label {
    color: #64748b
}

.box-success {
    background: #f4fbf7
}

.box-success .status-indicator-icon {
    color: #10b981
}

.box-success .status-label {
    color: #64748b
}

.box-warning {
    background: #fbf8f6
}

.box-warning .status-indicator-icon {
    color: #ef4444
}

.box-warning .status-label {
    color: #64748b
}

.llm-footer {
    display: flex;
    justify-content: center;
}

.generate-btn {
    border: none !important;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    transition: opacity .2s;
    background: #7e3af2;
    border-radius: 5px;
}

.generate-btn:hover {
    opacity: .8
}

.generate-btn .arrow {
    font-size: 16px
}

.generate-btn.is-locked {
    background: #7e3af2;
    opacity: .92;
}

.generate-btn .lock-ico {
    font-size: 15px;
    line-height: 1;
}

/* --- Try-our-pro-features section ------------------------------------------- */
.pro-features-section {
    margin: 15px auto;
    padding: 20px;
    background: #fff;
    border-radius: 15px
}

.pro-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px
}

.pro-main-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0
}

.pro-sub-title {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0
}

.pro-plan-badge {
    color: #4f46e5;
    font-size: 13px;
    font-weight: 600
}

.features-grid {
    display: flex;
    gap: 16px
}

.feature-card {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    min-height: 180px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .02)
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px
}

.icon-purple {
    background: #f3e8ff
}

.icon-blue {
    background: #e0f2fe
}

.icon-indigo {
    background: #e0e7ff
}

.feature-name {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0
}

.feature-desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0
}

.feature-action-btn {
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color .2s
}

.feature-action-btn:hover {
    color: #3730a3
}

.btn-arrow {
    transition: transform .2s
}

.feature-action-btn:hover .btn-arrow {
    transform: translateX(3px)
}

@media(max-width:768px) {
    .features-grid {
        flex-direction: column
    }
}

/* --- Dashboard buttons ------------------------------------------------------ */
.dashbtn {
    padding: 7px 10px !important;
    margin: 5px auto !important
}

.dashfurbtn {
    border-radius: 10px;
    width: 100% !important;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media(max-width:640px) {

    .roi-header,
    .roi-stats-grid,
    .roi-actions {
        flex-direction: column;
        gap: 12px
    }

    .roi-features-grid {
        grid-template-columns: 1fr
    }
}

.missingsrow {
    border: 1px solid #e5e7eb;
    padding: 6px 20px 6px 12px;
    border-radius: 10px;
}

/* --- Page Detail Modal (pd-*) ---------------------------------------------- */
.pd-wtm { background:#f8fafc; border-radius:8px; padding:14px 16px; margin-bottom:16px; }
.pd-wtm-label { font-size:11px; font-weight:600; letter-spacing:.5px; color:#64748b; text-transform:uppercase; margin-bottom:4px; }
.pd-wtm-body { font-size:13px; color:#334155; line-height:1.55; }
.pd-ref-section { margin-bottom:16px; }
.pd-ref-head { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; margin-bottom:8px; padding:6px 10px; border-radius:6px; }
.pd-ref-head-missing { color:#b91c1c; background:#fef2f2; border:1px solid #fecaca; }
.pd-ref-head-present { color:#047857; background:#f0fdf4; border:1px solid #bbf7d0; }
.pd-ref-head-amber   { color:#92400e; background:#fffbeb; border:1px solid #fde68a; }
.pd-ref-row { display:block; padding:12px 14px; border-radius:8px; margin-bottom:6px; border-left:3px solid #e2e8f0; }
.pd-ref-row-missing { background:#fef2f2; border-left-color:#fca5a5; }
.pd-ref-row-present { background:#f0fdf4; border-left-color:#86efac; }
.pd-ref-row-amber   { background:#fffbeb; border-left-color:#fde68a; }
.pd-ref-row-header  { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.pd-ref-left { flex:1; min-width:0; }
.pd-ref-name { font-weight:600; font-size:14px; margin-bottom:3px; }
.pd-ref-name-missing { color:#b91c1c; }
.pd-ref-name-present { color:#047857; }
.pd-ref-name-amber   { color:#92400e; }
.pd-ref-why { font-size:12px; color:#64748b; line-height:1.5; }
.pd-ref-doc { font-size:12px; color:#3C3489; text-decoration:none; background:#fff; border:.5px solid #cbd5e1; padding:5px 10px; border-radius:6px; display:inline-flex; align-items:center; gap:4px; cursor:pointer; white-space:nowrap; flex-shrink:0; }
.pd-ref-doc:hover { background:#f8fafc; }
.pd-ref-footer { flex-shrink:0; padding:14px 24px; border-top:1px solid #e2e8f0; background:#fafafa; display:flex; justify-content:space-between; align-items:center; gap:12px; box-shadow:0 -8px 12px -8px rgba(0,0,0,.04); }

/* --- Dashboard metric cards (dash-metric-*, dash-arc) ----------------------- */
.dash-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    display: grid;
    align-items: stretch;
}
@media (max-width: 640px) {
    .dash-metric-grid { grid-template-columns: 1fr 1fr !important; }
}
.dash-metric-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px 18px;
    transition: box-shadow .2s, border-color .2s, transform .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.dash-metric-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transform: translateY(-2px);
    z-index: 10; /* lift hovered card + its tooltip bubble above sibling cards (transform traps the bubble's stacking context) */
}
.dash-metric-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}
/* Footer-alignment helpers: equal-height cards keep their bottom title +
   subtext footer on the same baseline regardless of middle-content height. */
.dash-metric-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}
/* Shared arc size so all two-arc cards (Website Coverage + Schema
   Opportunity) render at an identical diameter. Real px instead of the
   arbitrary Tailwind w-[104px] class, which doesn't resolve in this
   no-build setup and let SVGs fall back to differing intrinsic sizes. */
.dash-arc {
    width: 104px;
    height: 104px;
    flex: 0 0 auto;
}
.dash-metric-title {
    min-height: 36px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    width: 100%;
}
.dash-metric-foot {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef0f3;
}

/* --- Free-plan lock overlay for the Rich Results cards (rr-lock-*) ---------- */
.rr-lock-card {
    position: relative;
}

.rr-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    border-radius: 16px;
    /* Light scrim + just a touch of blur so the inner content (values) reads as
       locked, while elements tagged .lock-clear are lifted above and stay crisp. */
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: pointer;
    text-align: center;
    padding: 16px;
}

/* Titles/labels lifted above the lock overlay so they stay fully readable
   while the surrounding content sits behind the light blur. */
.lock-clear {
    position: relative;
    z-index: 25;
}

.rr-lock-badge {
    width: 52px;
    height: 52px;
    border-radius: 9999px;
    background: rgba(126, 58, 242, 0.12);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rr-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    /* Match the page theme primary (#7e3af2), not a one-off indigo */
    background: var(--bg-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.rr-lock-btn:hover {
    background: var(--bg-primary-dark);
}

/* Lock glyph inside the "Try our pro features" buttons (free plan) */
.pro-lock-ico {
    margin-right: 5px;
    vertical-align: -2px;
}

/* ===== step-four.php - extracted page-scoped components (2026-06-23) ===== */
    .plan-card.free {
        display: none;
    }

    .plan-card {
        border: 1px solid #eeebf2;
        border-radius: 14px;
        padding: 24px 28px;
        margin-bottom: 20px;
        text-align: left;
        transition: 0.6s;
    }

    .plan-card:hover {
        transform: translateY(-4px);
    }

    .premium-card {
        text-align: center;
    }

    .premium-title {
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 16px;
    }

    .premium-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 40px;
        text-align: left;
        font-size: 14px;
        color: #334155;
    }

    .premium-item {
        display: flex;
        align-items: flex-start;
        gap: 8px;
    }

    .premium-check {
        color: #16a34a;
        font-size: 12px;
    }

    .alert-banner {
        position: relative;
        margin-top: 16px;
        border-radius: 14px;
        border: 1px solid #f3d3a7;
        background: #f6e7d3;
        padding: 18px 20px;
        display: flex;
        gap: 14px;
    }

    .alert-icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: #fff6ed;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ea580c;
        flex-shrink: 0;
    }

    .alert-text {
        font-size: 13px;
        color: #7c2d12;
        line-height: 1.5;
        text-align: left;
    }

    .dashboard-escape {
        text-align: center;
        margin: 0 0 8px;
    }

    .dashboard-escape a {
        color: #4a4458;
        font-size: 12px;
        text-decoration: none;
        font-weight: 500;
        cursor: pointer;
        border-bottom: 1px dashed #9a95a5;
        padding-bottom: 1px;
    }

    .dashboard-escape a:hover {
        color: #0f0a1e;
        border-bottom-color: #4a4458;
    }

    .fineprint {
        font-size: 11.5px;
        color: #6b6478;
        max-width: 440px;
        margin: 0 auto;
        line-height: 1.5;
    }

    .fineprint a {
        color: #6d28d9;
        text-decoration: none;
        font-weight: 500;
    }

    .plans-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .plan-card {
        border: 1.5px solid #eeebf2;
        border-radius: 12px;
        padding: 24px;
        display: flex;
        flex-direction: column;
        position: relative;
        transition: all 0.2s ease;
        cursor: pointer;
        text-align: left;
    }

    .plan-top-row {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 4px;
        gap: 8px;
    }

    .plan-name {
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .plan-price-inline {
        display: flex;
        align-items: baseline;
        gap: 3px;
    }

    .plan-price {
        font-size: 22px;
        font-weight: 600;
        color: #0f0a1e;
        letter-spacing: -0.02em;
        line-height: 1;
    }

    .plan-price .currency {
        font-size: 14px;
        font-weight: 700;
    }

    .plan-period {
        font-size: 11px;
        color: #4a4458;
    }

    .plan-discount.free-tag-style {
        background: #f7f5fa;
        color: #4a4458;
        border-color: #eeebf2;
        width: fit-content;
    }

    .plan-discount {
        display: inline-block;
        font-size: 12px;
        font-weight: 700;
        padding: 4px 8px;
        border-radius: 999px;
        letter-spacing: 0.04em;
        line-height: normal;
    }

    .plan-features {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 12px;
        margin-top: 18px;
        flex-grow: 1;
        padding: 0;
    }

    .plan-features li {
        display: flex;
        align-items: flex-start;
        gap: 6px;
        font-size: 14px;
        line-height: 1.35;
        min-height: 31px;
        color: #4b5563;
    }

    .plan-card.free .plan-features li {
        min-height: auto;
    }

    .plan-features li .check {
        width: 12px;
        height: 12px;
        background: #ecfdf5;
        color: #059669;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 8px;
        flex-shrink: 0;
        margin-top: 2px;
        font-weight: 700;
    }

    .plan-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: space-between;
    }

    .plan-card.free .plan-btn {
        background: white;
        color: #1f1a2e;
        border: 1px solid #d4d0dd;
    }

    .plan-btn {
        background: #0f0a1e;
        color: white;
        border: none;
        padding: 7px 12px;
        border-radius: 7px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        flex: 1;
        transition: all 0.15s;
        white-space: nowrap;
    }

    .plan-details-link {
        background: transparent;
        border: none;
        color: #6d28d9;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        font-family: inherit;
        padding: 4px 2px;
        text-decoration: underline;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .plan-card.recommended {
        border-color: #4759d6;
        background: linear-gradient(180deg, #faf7ff 0%, #ffffff 100%);
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
    }

    .plan-card .recommended-tag {
        position: absolute;
        top: -9px;
        right: 12px;
        color: white;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.06em;
        padding: 4px 10px;
        border-radius: 999px;
        white-space: nowrap;
        line-height: normal;
    }

    .plan-card.recommended .plan-btn {
        background: #6d28d9;
    }

    .plan-btn.is-disabled {
        background: #e5e7eb;
        color: #9ca3af;
        border: 1px solid #d1d5db;
        cursor: not-allowed;
        pointer-events: none;
        box-shadow: none;
    }

    @media screen and (max-width: 992px) {
        .plans-grid {
            grid-template-columns: 1fr;
        }
    }

    @media screen and (max-width: 576px) {
        .premium-card .premium-list {
            grid-template-columns: 1fr;
        }
    }

    /* Before vs After Comparison Layout */
    .cmp-health-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        padding: 1.5rem 2rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .cmp-health-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .cmp-label-tag {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.08em;
        color: #94a3b8;
        text-transform: uppercase;
    }

    .cmp-label-after {
        color: #16a34a;
    }

    .cmp-score-circle {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        border: 6px solid #dc2626;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #fff;
    }

    .cmp-circle-red { border-color: #dc2626; }
    .cmp-circle-amber { border-color: #d97706; }
    .cmp-circle-green { border-color: #16a34a; }

    .cmp-score-num {
        font-size: 1.5rem;
        font-weight: 700;
        color: #171717;
        line-height: 1;
    }

    .cmp-score-of {
        font-size: 9px;
        color: #737373;
        letter-spacing: 0.05em;
        margin-top: 2px;
    }

    .cmp-arrow-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 0 16px;
    }

    .cmp-delta-pill {
        font-size: 14px;
        font-weight: 700;
        padding: 6px 14px;
        border-radius: 999px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cmp-delta-pill.improved { background: #dcfce7; color: #16a34a; }
    .cmp-delta-pill.regressed { background: #fee2e2; color: #dc2626; }

    .cmp-summary-text {
        font-size: 12px;
        color: #64748b;
        text-align: center;
        line-height: 1.4;
        max-width: 160px;
    }

    .cmp-metrics-table {
        width: 100%;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
        margin-top: 20px;
    }

    .cmp-metrics-table th {
        background: #f8fafc;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #64748b;
        padding: 12px 20px;
        text-align: center;
        border-bottom: 1px solid #e5e7eb;
    }

    .cmp-metrics-table td {
        padding: 14px 20px;
        font-size: 14px;
        color: #334155;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
        text-align: center;
    }

    .cmp-metrics-table tr:last-child td {
        border-bottom: none;
    }

    .cmp-metrics-table .cmp-metric-label {
        font-weight: 600;
        color: #1e293b;
        text-align: left;
    }

    .cmp-metrics-table th:first-child {
        text-align: left;
    }

    .cmp-metrics-table .cmp-tbl-before {
        color: #dc2626;
        font-weight: 600;
    }

    .cmp-metrics-table .cmp-tbl-after {
        color: #1e293b;
        font-weight: 600;
    }

    .cmp-metrics-table .cmp-tbl-delta {
        font-size: 12px;
        font-weight: 600;
        padding: 2px 8px;
        border-radius: 999px;
        display: inline-block;
    }

    .cmp-metrics-table .cmp-tbl-delta.improved {
        background: #dcfce7;
        color: #16a34a;
    }

    .cmp-metrics-table .cmp-tbl-delta.regressed {
        background: #fee2e2;
        color: #dc2626;
    }

    .cmp-metrics-table .cmp-tbl-delta.neutral {
        background: #f3f4f6;
        color: #6b7280;
    }

    .cmp-metrics-table tr {
        cursor: pointer;
        transition: background 0.15s;
    }

    .cmp-metrics-table tbody tr:hover {
        background: #f8fafc;
    }

    .cmp-health-pill {
        font-size: 11px;
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 6px;
        color: #fff;
        letter-spacing: 0.04em;
    }

    .cmp-outer-card {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 1.5rem;
        width: 100%;
    }

    .cmp-two-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: stretch;
        width: 100%;
    }

    .cmp-inner-card {
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 1.25rem;
        display: flex;
        flex-direction: column;
    }

    .cmp-inner-card .cmp-health-row {
        margin: 0;
    }

    .cmp-right-col h6 {
        font-size: 15px;
        font-weight: 700;
        color: #1e293b;
        margin: 0 0 12px;
    }

    @media (max-width: 768px) {
        .cmp-two-col {
            grid-template-columns: 1fr;
        }
        .cmp-outer-card {
            padding: 1rem;
        }
        .cmp-metrics-table {
            font-size: 13px;
        }
        .cmp-metrics-table th,
        .cmp-metrics-table td {
            padding: 10px 12px;
        }
        .cmp-health-row {
            gap: 1rem;
            padding: 1rem;
        }
        .cmp-score-circle {
            width: 64px;
            height: 64px;
            border-width: 5px;
        }
        .cmp-score-num {
            font-size: 1.2rem;
        }
    }
     /* Drill-down section inside modal */
  .drill-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
  }

  .drill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .drill-dot-green {
    background: #16a34a;
  }

  .drill-dot-amber {
    background: #d97706;
  }

  .drill-dot-red {
    background: #dc2626;
  }

  .drill-count-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
  }

  .drill-url-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .drill-url-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    word-break: break-all;
    transition: background 0.15s;
  }

  .drill-url-item:hover {
    background: #f1f5f9;
  }

  .drill-url-item a {
    color: #2563eb !important;
    text-decoration: none;
    flex: 1;
    text-align: left !important;
  }

  .drill-url-item a:hover {
    text-decoration: underline;
  }

  .drill-text-item {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
  }

  .drill-empty {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
  }

  /* Live schema group tabs */
  .drill-group-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
  }

  .drill-group-tab.tab-green {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
  }

  .drill-group-tab.tab-amber {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
  }

  .drill-group-tab.tab-red {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
  }

  .drill-group-tab.tab-active {
    box-shadow: 0 0 0 2px #6366f1;
  }

  /* ── Step 4 Two-State Layout ─────────────────────────── */
  .s4-donut-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
  }
  .s4-donut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px 16px 18px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    text-align: center;
  }
  .s4-donut-card--risk {
    border: 2px solid #dc2626;
    background: #fff;
  }
  .s4-donut-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
  }
  .s4-donut-pill--green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
  .s4-donut-pill--red   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
  .s4-donut-title {
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    line-height: 1.3;
  }
  .s4-donut-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.3;
  }
  .s4-donut-ring-wrap {
    position: relative;
    width: 104px;
    height: 104px;
    flex-shrink: 0;
  }
  .s4-donut-svg { display: block; width: 104px; height: 104px; }
  .s4-donut-arc { /* transition handled via JS style property */ }
  .s4-donut-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    pointer-events: none;
  }
  .s4-section-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 22px;
    text-align: left;
    width: 100%;
  }
  .s4-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .s4-check-row, .s4-miss-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    padding: 6px 0;
  }
  .s4-check-row .s4-row-icon { color: #16a34a; flex-shrink: 0; font-weight: 700; }
  .s4-miss-row .s4-row-icon { color: #dc2626; flex-shrink: 0; font-weight: 700; }
  .s4-miss-row .s4-locked-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #dc2626;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .s4-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
  }
  .s4-offer-card {
    border: 2px solid #16a34a;
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60%);
    text-align: center;
    width: 100%;
    position: relative;
  }
  .s4-offer-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    letter-spacing: 0.04em;
  }
  .s4-upsell-row {
    width: 100%;
  }
  @media (max-width: 576px) {
    .s4-donut-row { grid-template-columns: 1fr; gap: 0.75rem; }
    .s4-donut-card { padding: 14px 10px 14px; }
  }
