/* Website SEO module — builds on app.css tokens and components. */

/* sub-navigation + tabs */
.seo-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin: -6px 0 18px; border-bottom: 1px solid var(--border); }
.seo-tabs a { padding: 8px 12px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seo-tabs a:hover { color: var(--text); text-decoration: none; }
.seo-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.seo-subtabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 4px 0 14px; }
.seo-subtabs button { border: 0; border-radius: 0; background: none; padding: 8px 12px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seo-subtabs button:hover { background: none; color: var(--text); }
.seo-subtabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.seo-site-sel { font-weight: 600; max-width: 240px; }

/* notes */
.seo-note { padding: 10px 14px; border-radius: 10px; font-size: 13px; background: var(--info-soft); color: var(--text-2); }
.seo-note.warn { background: var(--warn-soft); color: var(--warn); }
.seo-note.bad { background: var(--bad-soft); color: var(--bad); }
.seo-note.good { background: var(--good-soft); color: var(--good); }
.seo-note + .seo-note { margin-top: 8px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }

/* tags for data provenance */
.tag.real { background: var(--good-soft); color: var(--good); border-color: transparent; font-weight: 600; }
.tag.est { background: var(--surface-2); color: var(--muted); border-style: dashed; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* severity + HTTP status */
.sev-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sev-dot.critical { background: var(--bad); } .sev-dot.warning { background: var(--warn); } .sev-dot.info { background: var(--s1); }
.http { font: 600 11px/1.6 ui-monospace, Consolas, monospace; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }
.http.s2 { background: var(--good-soft); color: var(--good); }
.http.s3 { background: var(--info-soft); color: var(--accent); }
.http.s4, .http.s5, .http.se { background: var(--bad-soft); color: var(--bad); }
.http.sx { background: var(--warn-soft); color: var(--warn); }

/* gauge + donut */
.gauge { display: flex; flex-direction: column; align-items: center; }
.gauge-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-top: -8px; text-transform: uppercase; letter-spacing: .05em; }
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.legend.col { flex-direction: column; gap: 6px; margin: 0; }
.legend.col b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.hero-score { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }

/* labelled bars + stacked category bars */
.lbars { display: flex; flex-direction: column; gap: 7px; }
.lbar { display: grid; grid-template-columns: minmax(80px, 150px) 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.lbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.lbar .bar { height: 8px; }
.lbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.stacked { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--grid); }
.stacked i { display: block; height: 100%; }

/* KPI strip inside a card */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.kpis .kpi .value { font-size: 24px; }
.card.kpi .value { font-size: 26px; }

/* fix list (clickable insights) */
.insight.click { cursor: pointer; border-radius: 8px; padding-left: 6px; padding-right: 6px; margin: 0 -6px; }
.insight.click:hover { background: var(--surface-2); }
.gain { font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* checks */
.checks { display: flex; flex-direction: column; }
.chk { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.chk:last-child { border-bottom: 0; }
.chk .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; margin-top: 1px; }
.chk .ic.pass { background: var(--good-soft); color: var(--good); }
.chk .ic.warn { background: var(--warn-soft); color: var(--warn); }
.chk .ic.fail { background: var(--bad-soft); color: var(--bad); }
.chk .d { font-size: 12px; color: var(--muted); word-break: break-word; }

/* tables */
.url { word-break: break-all; }
.trunc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
td.urlc { max-width: 420px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 0 0; font-size: 12px; color: var(--muted); }
tr.issue-detail > td { background: var(--surface-2); padding: 14px 16px; }
.explain { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.explain b { display: block; color: var(--text); margin-bottom: 2px; }
.url-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.url-list .d { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { .explain { grid-template-columns: 1fr; } .lbar { grid-template-columns: 90px 1fr 44px; } }

/* filters row */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1 1 200px; }

/* job card with cancel */
.seo-job { position: relative; margin-bottom: 16px; }
.seo-job [data-cancel] { position: absolute; right: 10px; bottom: 8px; }
.seo-job:has([data-p]:empty) { display: none; }

/* Google snippet + social previews */
.serp { font-family: arial, sans-serif; max-width: 600px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.serp .su { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp .st { font-size: 19px; color: #1a0dab; line-height: 1.3; margin: 3px 0; }
.serp .sd { font-size: 13px; color: var(--text-2); line-height: 1.5; }
:root[data-theme="dark"] .serp .st { color: #8ab4f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp .st { color: #8ab4f8; } }
.og { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-width: 520px; }
.og img { width: 160px; object-fit: cover; flex: none; background: var(--surface-2); }
.og .b { padding: 10px 12px; min-width: 0; }
.og .s { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.og .t { font-weight: 600; margin: 2px 0; }
.og .d { font-size: 12px; color: var(--text-2); }

/* heading outline */
.outline { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.outline .hx { display: inline-block; min-width: 26px; font: 600 10px/1.6 ui-monospace, Consolas, monospace; color: var(--accent); background: var(--accent-soft); border-radius: 4px; text-align: center; margin-right: 8px; }
pre.code { font: 12px/1.5 ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; max-height: 280px; overflow: auto; margin: 0; }

/* Core Web Vitals tiles */
.cwv { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.cwv > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; border-top: 3px solid var(--border-strong); }
.cwv > div.good { border-top-color: var(--good); } .cwv > div.ni { border-top-color: var(--warn); } .cwv > div.poor { border-top-color: var(--bad); }
.cwv .n { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.cwv .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cwv .dist { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.cwv .dist i:nth-child(1) { background: var(--good); } .cwv .dist i:nth-child(2) { background: var(--warn); } .cwv .dist i:nth-child(3) { background: var(--bad); }
.scores { display: flex; gap: 14px; flex-wrap: wrap; }
.scores > div { text-align: center; font-size: 11px; color: var(--muted); }

/* keyword clusters + recommendations */
.cluster { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.cluster h4 { margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.rec { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: flex-start; }
.rec:last-child { border-bottom: 0; }
.rec > .tag, .rec > .pill { flex: none; margin-top: 1px; }
.topic-chips .chip { font-size: 12px; }

/* AI output */
.ai-out h4 { margin: 14px 0 4px; font-size: 13px; }
.ai-out ul { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.ai-out .action { padding: 12px 0; border-bottom: 1px solid var(--border); }
.ai-out .action:last-child { border-bottom: 0; }
