/* ── SEO landing hero (sits on the page background, no banner card) ── */
.ww-seo-landing {
    text-align: center;
    padding: clamp(20px, 5vw, 52px) 0 8px;
}

.ww-seo-landing h1 {
    margin: 18px auto 0;
    max-width: 720px;
    font-size: clamp(2.1rem, 6vw, 3.3rem);
    letter-spacing: -0.02em;
    line-height: 1.06;
    color: var(--text);
}

.ww-seo-landing .grad {
    background: var(--brand-gradient, linear-gradient(120deg, #4f46e5, #06b6d4));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ww-seo-landing-lede {
    margin: 16px auto 0;
    max-width: 600px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.6;
}

.ww-seo-landing-form {
    margin: 24px auto 0;
    max-width: 600px;
}

.ww-seo-landing .ww-micro { margin-top: 10px; }

.ww-seo-landing-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
}

.ww-seo-landing-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.ww-seo-landing-chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    opacity: 0.75;
}

/* Section head framing the explainer cards */
.ww-seo-landing-head {
    text-align: center;
    margin-bottom: 4px;
}

.ww-seo-landing-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand);
}

.ww-seo-landing-eyebrow .ico {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.18);
    color: var(--brand);
}

.ww-seo-landing-eyebrow .ico i { font-size: 14px; }

.ww-seo-landing-head h2 {
    margin: 12px 0 0;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.16;
}

@media (prefers-color-scheme: dark) {
    .ww-seo-landing-eyebrow { color: #a5b4fc; }
    .ww-seo-landing-eyebrow .ico {
        background: rgba(165, 180, 252, 0.12);
        border-color: rgba(165, 180, 252, 0.24);
        color: #a5b4fc;
    }
    .ww-seo-landing-chip .dot { background: #a5b4fc; }
}

/* ── SEO Score Hero ── */
.ww-seo-hero {
    display: flex;
    gap: 28px;
    align-items: center;
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.ww-seo-score-wrap {
    position: relative;
    flex-shrink: 0;
}

.ww-seo-score-ring {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background: conic-gradient(
        var(--ring-color, #4f46e5) calc(var(--pct, 0) * 1%),
        rgba(79, 70, 229, 0.10) 0
    );
    transition: background 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.ww-seo-score-ring.ww-seo-green {
    --ring-color: #16a34a;
    background: conic-gradient(
        #22c55e calc(var(--pct, 0) * 1%),
        rgba(34, 197, 94, 0.12) 0
    );
}

.ww-seo-score-ring.ww-seo-amber {
    --ring-color: #d97706;
    background: conic-gradient(
        #f59e0b calc(var(--pct, 0) * 1%),
        rgba(245, 158, 11, 0.14) 0
    );
}

.ww-seo-score-ring.ww-seo-red {
    --ring-color: #dc2626;
    background: conic-gradient(
        #ef4444 calc(var(--pct, 0) * 1%),
        rgba(239, 68, 68, 0.14) 0
    );
}

.ww-seo-score-inner {
    background: var(--surface);
    width: 108px;
    height: 108px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 6px rgba(16, 24, 40, 0.04);
}

.ww-seo-score-num {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.ww-seo-score-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.ww-seo-grade {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.18);
    border: 3px solid var(--surface);
}

.ww-seo-grade.ww-seo-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.ww-seo-grade.ww-seo-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ww-seo-grade.ww-seo-red { background: linear-gradient(135deg, #ef4444, #dc2626); }

.ww-seo-hero-body {
    flex: 1;
    min-width: 0;
}

.ww-seo-hero-eyebrow {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.ww-seo-hero-title {
    margin: 6px 0 8px;
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.ww-seo-hero-url {
    margin: 0 0 14px;
    font-size: 0.95rem;
    word-break: break-all;
}

.ww-seo-hero-url .ww-link {
    color: var(--brand);
}

/* ── Recommendation chip on KPI cards ── */
.ww-seo-rec {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 10px;
    color: var(--brand-2);
    font-size: 0.86rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
}

.ww-seo-rec svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--brand);
}

.ww-kpi-red .ww-seo-rec {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

.ww-kpi-red .ww-seo-rec svg { color: #dc2626; }

.ww-kpi-amber .ww-seo-rec {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.20);
    color: #92400e;
}

.ww-kpi-amber .ww-seo-rec svg { color: #d97706; }

/* ── Heading outline ── */
.ww-seo-outline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ww-seo-outline-row {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text);
    align-items: center;
    line-height: 1.4;
}

.ww-seo-outline-h2 {
    margin-left: 22px;
}

.ww-seo-outline-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand);
    background: rgba(79, 70, 229, 0.10);
    padding: 3px 6px;
    border-radius: 6px;
    text-align: center;
    letter-spacing: 0.04em;
}

.ww-seo-outline-h2 .ww-seo-outline-tag {
    color: var(--accent);
    background: rgba(6, 182, 212, 0.10);
}

/* ── Tag cloud (structured data types) ── */
.ww-seo-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ww-seo-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.18);
    color: var(--brand-2);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ── Compact SEO snapshot (used on saved-site detail) ── */
.ww-seo-snapshot {
    display: block;
}

.ww-seo-snapshot-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
    padding: 22px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.ww-seo-snapshot-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: conic-gradient(
        var(--ring-color, #4f46e5) calc(var(--pct, 0) * 1%),
        rgba(79, 70, 229, 0.10) 0
    );
}

.ww-seo-snapshot-ring.ww-seo-green {
    --ring-color: #16a34a;
    background: conic-gradient(
        #22c55e calc(var(--pct, 0) * 1%),
        rgba(34, 197, 94, 0.12) 0
    );
}

.ww-seo-snapshot-ring.ww-seo-amber {
    --ring-color: #d97706;
    background: conic-gradient(
        #f59e0b calc(var(--pct, 0) * 1%),
        rgba(245, 158, 11, 0.14) 0
    );
}

.ww-seo-snapshot-ring.ww-seo-red {
    --ring-color: #dc2626;
    background: conic-gradient(
        #ef4444 calc(var(--pct, 0) * 1%),
        rgba(239, 68, 68, 0.14) 0
    );
}

.ww-seo-snapshot-inner {
    background: var(--surface);
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 6px rgba(16, 24, 40, 0.04);
}

.ww-seo-snapshot-num {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.ww-seo-snapshot-grade {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    margin-top: 4px;
    letter-spacing: 0.06em;
}

.ww-seo-snapshot-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ww-seo-snapshot-label {
    margin: 0;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.ww-seo-snapshot-headline {
    margin: 4px 0 0;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.ww-seo-snapshot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ww-seo-spark-wrap {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.ww-seo-spark-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}

.ww-seo-spark-wrap canvas {
    width: 100% !important;
    height: 64px !important;
}

.ww-seo-snapshot-empty {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 22px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 18px;
}

.ww-seo-snapshot-empty > div {
    flex: 1 1 320px;
    min-width: 0;
}

@media (max-width: 720px) {
    .ww-seo-snapshot-card {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "ring body"
            "spark spark";
        padding: 18px;
        gap: 16px;
    }

    .ww-seo-snapshot-ring {
        grid-area: ring;
        width: 84px;
        height: 84px;
    }

    .ww-seo-snapshot-inner {
        width: 68px;
        height: 68px;
    }

    .ww-seo-snapshot-body {
        grid-area: body;
    }

    .ww-seo-spark-wrap {
        grid-area: spark;
        width: 100%;
        align-items: stretch;
    }
}

@media (prefers-color-scheme: dark) {
    .ww-seo-snapshot-card,
    .ww-seo-snapshot-empty {
        background: var(--surface);
        border-color: var(--glass-border);
    }

    .ww-seo-snapshot-ring {
        background: conic-gradient(
            var(--ring-color, #818cf8) calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-snapshot-ring.ww-seo-green {
        background: conic-gradient(
            #4ade80 calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-snapshot-ring.ww-seo-amber {
        background: conic-gradient(
            #fbbf24 calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-snapshot-ring.ww-seo-red {
        background: conic-gradient(
            #f87171 calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-snapshot-inner {
        background: rgba(255, 255, 255, 0.04);
        box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.30);
    }

    .ww-seo-snapshot-num {
        color: var(--text);
    }
}

/* ── SEO score chip (used on manage cards & home charts) ── */
.ww-seo-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ww-seo-chip:hover {
    transform: translateY(-1px);
    border-color: var(--brand);
}

.ww-seo-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.ww-seo-chip.green { background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.32); color: #166534; }
.ww-seo-chip.green .ww-seo-chip-dot { background: #16a34a; }
.ww-seo-chip.amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.34); color: #92400e; }
.ww-seo-chip.amber .ww-seo-chip-dot { background: #d97706; }
.ww-seo-chip.red { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.32); color: #991b1b; }
.ww-seo-chip.red .ww-seo-chip-dot { background: #dc2626; }
.ww-seo-chip.idle {
    color: var(--muted);
    background: var(--surface-2);
    border-style: dashed;
}

@media (prefers-color-scheme: dark) {
    .ww-seo-chip.green { color: #86efac; }
    .ww-seo-chip.amber { color: #fcd34d; }
    .ww-seo-chip.red { color: #fca5a5; }
}

/* ── Plain pre block (for robots.txt preview) ── */
.ww-seo-pre {
    background: #0d1117;
    color: #c9d1d9;
    padding: 12px 14px;
    border-radius: 10px;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
    max-height: 280px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ww-seo-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 14px;
        gap: 14px;
        border-radius: 14px;
    }

    .ww-seo-score-ring {
        width: 110px;
        height: 110px;
    }

    .ww-seo-score-inner {
        width: 90px;
        height: 90px;
    }

    .ww-seo-score-num {
        font-size: 2rem;
    }

    .ww-seo-hero-title {
        font-size: 1.15rem;
    }

    .ww-seo-hero-url {
        font-size: 0.88rem;
    }

    .ww-seo-rec {
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .ww-seo-outline-h2 {
        margin-left: 12px;
    }

    .ww-seo-outline-row {
        font-size: 0.85rem;
        padding: 7px 10px;
    }

    .ww-seo-tag {
        font-size: 0.78rem;
        padding: 5px 10px;
    }

    .ww-seo-pre {
        font-size: 0.75rem;
        max-height: 200px;
    }
}

/* ── Dark Mode ── */
@media (prefers-color-scheme: dark) {
    .ww-seo-hero {
        background: var(--surface);
        border-color: var(--glass-border);
    }

    .ww-seo-score-ring {
        background: conic-gradient(
            var(--ring-color, #818cf8) calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-score-ring.ww-seo-green {
        background: conic-gradient(
            #4ade80 calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-score-ring.ww-seo-amber {
        background: conic-gradient(
            #fbbf24 calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-score-ring.ww-seo-red {
        background: conic-gradient(
            #f87171 calc(var(--pct, 0) * 1%),
            rgba(255, 255, 255, 0.06) 0
        );
    }

    .ww-seo-score-inner {
        background: rgba(255, 255, 255, 0.04);
        box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.30);
    }

    .ww-seo-score-num {
        color: #e6e8ef;
    }

    .ww-seo-grade {
        border-color: #0b1020;
    }

    .ww-seo-rec {
        background: rgba(99, 102, 241, 0.10);
        border-color: rgba(99, 102, 241, 0.28);
        color: #c7d2fe;
    }

    .ww-seo-rec svg { color: #a5b4fc; }

    .ww-kpi-red .ww-seo-rec {
        background: rgba(239, 68, 68, 0.10);
        border-color: rgba(239, 68, 68, 0.28);
        color: #fca5a5;
    }

    .ww-kpi-red .ww-seo-rec svg { color: #f87171; }

    .ww-kpi-amber .ww-seo-rec {
        background: rgba(245, 158, 11, 0.10);
        border-color: rgba(245, 158, 11, 0.28);
        color: #fcd34d;
    }

    .ww-kpi-amber .ww-seo-rec svg { color: #fbbf24; }

    .ww-seo-outline-row {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--glass-border);
        color: var(--text);
    }

    .ww-seo-outline-tag {
        background: rgba(99, 102, 241, 0.16);
        color: #a5b4fc;
    }

    .ww-seo-outline-h2 .ww-seo-outline-tag {
        background: rgba(6, 182, 212, 0.16);
        color: #67e8f9;
    }

    .ww-seo-tag {
        background: rgba(99, 102, 241, 0.12);
        border-color: rgba(99, 102, 241, 0.30);
        color: #c7d2fe;
    }
}
