/* ==========================================================================
   theme-plus.css — Site Analiz Sistemi için zenginleştirilmiş görünüm katmanı
   app.css'in ÜSTÜNE biner (index.php'de app.css'den SONRA yüklenir).
   Belirteçler: tokens.css (--brand-*, --sev-*, --score-*, --shadow-*, --radius-*, --space-*).
   Açık/koyu tema: html[data-theme="light|dark"] (belirteçler temayı kendisi değiştirir).
   Yeni genel sınıflar: .sx-badge .sx-card .sx-table .sx-meter .sx-chip .sx-code (+ .sx-tabs .sx-ring .sx-grid)
   ========================================================================== */

/* ---------- 0. Temel cila ---------- */
::selection { background: var(--brand-300); color: #0a0a0a; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.card, .glass { overflow-wrap: break-word; }
.metric-value, .audit-row, .content-audit-card, .deep-report-card { overflow-wrap: anywhere; }
.stat-val, .percentage, .viz-meter-val, .kw-stats, .psi-quick-metric__v { font-variant-numeric: tabular-nums; }
img, svg, video { max-width: 100%; }
.footer { color: var(--text-subtle); }


/* ---------- 0b. Sarı metin kontrast düzeltmeleri (sarı zemin dışında marka rengi metin olarak okunmaz) ---------- */
.psi-inline-link, .psi-lab-nested summary, .psi-img-url, .hreflang-url-cell a,
.link-samples-meta-bar__item strong, .content-stat-card .stat-icon, .history-tag:hover { color: var(--brand-text); }
.psi-inline-link { text-decoration: underline; text-underline-offset: 2px; }
.intel-hint-pill { color: var(--sev-low); background: var(--sev-low-bg); border-color: var(--sev-low-border); }
/* app.js satır içi stilleri (color:var(--primary) / #f59e0b) için */
[style*="color:var(--primary)"]:not([style*="background"]),
[style*="color: var(--primary)"]:not([style*="background"]) { color: var(--brand-text) !important; }
[style*="color:#f59e0b"], [style*="color: #f59e0b"], [style*="color:#d97706"], [style*="color: #d97706"] { color: var(--sev-medium) !important; }
[style*="color:#10b981"], [style*="color: #10b981"] { color: var(--sev-pass) !important; }
[style*="color:#ef4444"], [style*="color: #ef4444"] { color: var(--sev-critical) !important; }
[style*="color:#3b82f6"], [style*="color: #3b82f6"], #testLocationBadge { color: var(--sev-low) !important; }
[style*="color:#86868b"] { color: #5f5f66 !important; }
[data-theme="dark"] [style*="linear-gradient(135deg, #f1f5f9"] { color: #475569 !important; }
[style*="color:#8b5cf6"], [style*="color: #8b5cf6"] { color: #6d28d9 !important; }
[data-theme="dark"] [style*="color:#8b5cf6"], [data-theme="dark"] [style*="color: #8b5cf6"] { color: #c4b5fd !important; }
[data-theme="dark"] [style*="background:#fff5f5"] { background: var(--sev-critical-bg) !important; border-color: var(--sev-critical-border) !important; }
[data-theme="dark"] [style*="background:#dcfce7"] { background: var(--sev-pass-bg) !important; }

/* ---------- 1. Hero / arama alanı ---------- */
.header { position: relative; }
.logo { letter-spacing: -0.045em; }
.logo-brand { color: var(--text-subtle); }
.gradient-text {
    background-image: linear-gradient(120deg, var(--brand-600) 0%, var(--brand-500) 38%, var(--brand-300) 62%, var(--brand-500) 100%);
}
[data-theme="dark"] .gradient-text {
    background-image: linear-gradient(120deg, var(--brand-400) 0%, var(--brand-300) 45%, var(--brand-200) 100%);
}
.search-form {
    border-radius: var(--radius-xl);
    background:
        linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
        linear-gradient(135deg, var(--brand-line), transparent 45%, var(--brand-line)) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow-3), 0 18px 48px rgba(255, 188, 0, 0.1);
}
.search-form:focus-within {
    border-color: transparent;
    box-shadow: var(--shadow-4), var(--brand-glow);
}
.search-form .input-wrapper { border-radius: var(--radius-md); }
input[type="text"]:focus-visible { outline: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-500) 60%, var(--brand-600));
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.history-tag {
    border-radius: var(--radius-pill);
    transition: background var(--dur-base) ease, border-color var(--dur-base) ease, transform var(--dur-fast) ease;
}
.history-tag:hover { transform: translateY(-1px); }
.dark-mode-toggle { box-shadow: var(--shadow-1); transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease; }
.dark-mode-toggle:hover { box-shadow: var(--shadow-2); }
.error-message { border-radius: var(--radius-md); }

/* ---------- 2. Rapor bölümleri ve başlıklar ---------- */
.report-section { margin-bottom: var(--space-8); }
.report-section > .section-lead,
.section-lead { color: var(--text-subtle); line-height: 1.65; max-width: 78ch; }
.category-title {
    margin: var(--space-12) 0 var(--space-4);
    padding: 0 0 var(--space-3) 0;
    gap: var(--space-3);
    letter-spacing: -0.025em;
}
.category-title::before {
    content: '';
    flex: 0 0 auto;
    width: 6px;
    align-self: stretch;
    min-height: 1.4em;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
    box-shadow: 0 0 14px rgba(255, 188, 0, 0.45);
}
.category-title::after {
    height: 2px;
    max-width: 100%;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-line) 35%, transparent);
}
.intel-subh, .content-depth-h, .audit-suite-h, .link-samples-h {
    letter-spacing: -0.01em;
}

/* ---------- 3. Kart hiyerarşisi ---------- */
.glass {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 42%),
        var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
[data-theme="dark"] .glass {
    background:
        linear-gradient(160deg, rgba(255, 188, 0, 0.06), transparent 42%),
        var(--bg-card);
    box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.card {
    position: relative;
    padding: var(--space-6);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
}
.card::after {
    content: '';
    position: absolute;
    left: var(--space-6);
    right: var(--space-6);
    top: 0;
    height: 2px;
    border-radius: 0 0 var(--radius-pill) var(--radius-pill);
    background: linear-gradient(90deg, var(--brand-500), transparent 70%);
    opacity: 0.55;
    pointer-events: none;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-line);
    box-shadow: var(--shadow-3);
}
.card:hover::after { opacity: 1; }
.card-header { padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px dashed var(--border); }
.card-header h3 { font-size: var(--fs-lg); letter-spacing: -0.015em; }
.card-lead { color: var(--text-subtle); }
.icon-box { border-radius: var(--radius-md); box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.icon-box.purple { background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); }
.icon-box.purple svg { color: #1a1300; }
.ai-card { border-left-width: 4px; }
.page-intel-card, .content-audit-card, .deep-report-card, .img-detail-card, .psi-lab-card, .dom-load-card, .semantic-heading-card {
    border-radius: var(--radius-md);
}
.grid-layout { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-6); }
.report-card-grid { gap: var(--space-6); }

/* ---------- 4. Skor halkası ve hero kartı ---------- */
.score-header {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 188, 0, 0.16), transparent 55%),
        var(--bg-card);
}
.score-circle { filter: drop-shadow(0 6px 14px rgba(10, 10, 10, 0.12)); }
[data-theme="dark"] .score-circle { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55)); }
.circle-bg { stroke: var(--surface-3); stroke-width: 3.6; }
.circle { stroke-width: 3; }
.score-high { stroke: var(--score-100); }
.score-medium { stroke: var(--score-50); }
.score-low { stroke: var(--score-0); }
.percentage { font-weight: 800; letter-spacing: -0.02em; }
.score-info h2 { letter-spacing: -0.025em; }

/* ---------- 5. Durum rozetleri (AA kontrastlı) ---------- */
.status-badge, .badge-modern, .audit-badge, .deep-report-badge, .seo-check-status, .semantic-badge, .img-badge, .psi-tag {
    letter-spacing: 0.02em;
}
.status-badge { border: 1px solid var(--border); color: var(--text-main); background: var(--surface-2); }
.status-badge.success, .badge-success, .audit-badge--ok, .deep-report-badge--ok, .status-pass {
    background: var(--sev-pass-bg); color: var(--sev-pass); border-color: var(--sev-pass-border);
}
.status-badge.error, .badge-error, .status-fail {
    background: var(--sev-critical-bg); color: var(--sev-critical); border-color: var(--sev-critical-border);
}
.status-badge.warning, .badge-warning, .audit-badge--warn, .deep-report-badge--warn, .status-warn {
    background: var(--sev-medium-bg); color: var(--sev-medium); border-color: var(--sev-medium-border);
}
.deep-report-badge--info {
    background: var(--sev-info-bg); color: var(--sev-info); border-color: var(--sev-info-border);
}
.status-badge.success, .status-badge.error, .status-badge.warning,
.status-pass, .status-warn, .status-fail, .deep-report-badge, .audit-badge, .badge-modern { border-width: 1px; border-style: solid; }
.text-success { color: var(--sev-pass); }
.text-warning { color: var(--sev-medium); }
.text-danger { color: var(--sev-critical); }
.stat-box.success-box .stat-val { color: var(--sev-pass); }
.stat-box.warning-box .stat-val { color: var(--sev-medium); }
.stat-box.danger-box .stat-val { color: var(--sev-critical); }
.stat-box.info-box .stat-val { color: var(--sev-low); }
.stat-box.success-box { background: var(--sev-pass-bg); border-color: var(--sev-pass-border); }
.stat-box.warning-box { background: var(--sev-medium-bg); border-color: var(--sev-medium-border); }
.stat-box.danger-box { background: var(--sev-critical-bg); border-color: var(--sev-critical-border); }
.stat-box.info-box { background: var(--sev-low-bg); border-color: var(--sev-low-border); }
[data-theme="dark"] .stat-box.success-box { background: var(--sev-pass-bg); border-color: var(--sev-pass-border); }
[data-theme="dark"] .stat-box.warning-box { background: var(--sev-medium-bg); border-color: var(--sev-medium-border); }
[data-theme="dark"] .stat-box.danger-box { background: var(--sev-critical-bg); border-color: var(--sev-critical-border); }
[data-theme="dark"] .stat-box.info-box { background: var(--sev-low-bg); border-color: var(--sev-low-border); }

/* Bulgu kartları: şiddete göre sol şerit */
.content-audit-card { border-left: 4px solid var(--border-strong); box-shadow: var(--shadow-1); }
.content-audit-card--crit { border-color: var(--sev-critical-border); border-left-color: var(--sev-critical-solid); background: var(--sev-critical-bg); }
.content-audit-card--warn { border-color: var(--sev-medium-border); border-left-color: var(--sev-medium-solid); background: var(--sev-medium-bg); }
.content-audit-card--info { border-color: var(--sev-info-border); border-left-color: var(--sev-info-solid); background: var(--sev-info-bg); }
.content-audit-card--crit .content-audit-sev { color: var(--sev-critical); }
.content-audit-card--warn .content-audit-sev { color: var(--sev-medium); }
.content-audit-card--info .content-audit-sev { color: var(--sev-info); }
.dom-load-severity--high, .dom-load-hint--high { color: var(--sev-critical); }
.dom-load-severity--warn, .dom-load-hint--warn { color: var(--sev-medium); }
.dom-load-severity--ok { color: var(--sev-pass); }

/* ---------- 6. Sekme / içindekiler çubuğu ---------- */
.report-toc-details {
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 188, 0, 0.07), transparent),
        var(--bg-card);
    box-shadow: var(--shadow-2);
}
.report-toc { gap: var(--space-2); padding: var(--space-3) var(--space-4); }
.report-toc__link {
    color: var(--text-main);
    background: var(--surface-2);
    border-color: var(--border);
    transition: background var(--dur-base) ease, border-color var(--dur-base) ease, box-shadow var(--dur-base) ease, transform var(--dur-fast) ease;
}
.report-toc__link:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.report-toc__link.is-active {
    background: linear-gradient(135deg, var(--brand-300), var(--brand-500));
    border-color: var(--brand-600);
    color: #0a0a0a;
    box-shadow: var(--shadow-brand);
}
.report-toc__link.is-active .report-toc__ic { background: rgba(10, 10, 10, 0.12); color: #0a0a0a; }
.report-toc-details__summary { color: var(--text-subtle); }

/* Genel sekme bileşeni (.sx-tabs > .sx-tab) */
.sx-tabs {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-1);
    margin: 0 0 var(--space-4);
    list-style: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.sx-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: 0 var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-subtle);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--dur-base) ease, color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}
.sx-tab:hover { color: var(--text-main); background: var(--brand-soft); }
.sx-tab[aria-selected="true"], .sx-tab.is-active {
    color: #0a0a0a;
    background: linear-gradient(135deg, var(--brand-300), var(--brand-500));
    box-shadow: var(--shadow-1);
}
.sx-tab__count {
    min-width: 1.5em;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: rgba(10, 10, 10, 0.1);
    font-size: var(--fs-xs);
    text-align: center;
}

/* ---------- 7. Tablolar: zebra, hover, sabit başlık ---------- */
.kw-table-wrap, .psi-table-scroll, .dup-anchor-wrap, .sx-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: auto;
    max-height: min(34rem, 75vh);
    -webkit-overflow-scrolling: touch;
    background: var(--surface-1);
    scrollbar-width: thin;
}
.kw-table, .psi-lab-table, .dup-anchor-table, .intel-mini-table, .ai-verdict-table, .sx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}
.kw-table th, .kw-table td, .psi-lab-table th, .psi-lab-table td,
.dup-anchor-table th, .dup-anchor-table td, .intel-mini-table th, .intel-mini-table td,
.ai-verdict-table th, .ai-verdict-table td, .sx-table th, .sx-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}
.kw-table thead th, .psi-lab-table thead th, .dup-anchor-table thead th,
.intel-mini-table thead th, .ai-verdict-table thead th, .sx-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--table-head);
    color: var(--text-subtle);
    font-size: var(--fs-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-strong);
}
[data-theme="dark"] .kw-table th, [data-theme="dark"] .kw-table thead th { background: var(--table-head); }
.kw-table tbody tr:nth-child(even), .psi-lab-table tbody tr:nth-child(even),
.dup-anchor-table tbody tr:nth-child(even), .intel-mini-table tbody tr:nth-child(even),
.ai-verdict-table tbody tr:nth-child(even), .sx-table tbody tr:nth-child(even) { background: var(--table-stripe); }
.kw-table tbody tr, .psi-lab-table tbody tr, .dup-anchor-table tbody tr,
.intel-mini-table tbody tr, .ai-verdict-table tbody tr, .sx-table tbody tr { transition: background var(--dur-fast) ease; }
.kw-table tbody tr:hover, .psi-lab-table tbody tr:hover, .dup-anchor-table tbody tr:hover,
.intel-mini-table tbody tr:hover, .ai-verdict-table tbody tr:hover, .sx-table tbody tr:hover { background: var(--table-hover); }
.kw-table tbody tr:last-child td, .psi-lab-table tbody tr:last-child td,
.sx-table tbody tr:last-child td { border-bottom: none; }
.sx-table .is-num, .sx-table td[data-num] { text-align: right; font-weight: 600; }
.sx-table td:first-child { font-weight: 600; }
/* Satır şiddet vurgusu: <tr class="is-critical"> vb. */
.sx-table tr.is-critical td:first-child { box-shadow: inset 4px 0 0 var(--sev-critical-solid); }
.sx-table tr.is-high td:first-child { box-shadow: inset 4px 0 0 var(--sev-high-solid); }
.sx-table tr.is-medium td:first-child { box-shadow: inset 4px 0 0 var(--sev-medium-solid); }
.sx-table tr.is-low td:first-child { box-shadow: inset 4px 0 0 var(--sev-low-solid); }
.sx-table tr.is-pass td:first-child { box-shadow: inset 4px 0 0 var(--sev-pass-solid); }

/* ---------- 8. Listeler: sabit başlıklı uzun listeler ---------- */
.audit-list {
    background: var(--surface-1);
    border-radius: var(--radius-md);
    max-height: min(34rem, 75vh);
    overflow: auto;
    scrollbar-width: thin;
}
.audit-list-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--table-head);
    color: var(--text-subtle);
    border-bottom: 2px solid var(--border-strong);
}
[data-theme="dark"] .audit-list { background: var(--surface-1); }
[data-theme="dark"] .audit-list-header { background: var(--table-head); }
.audit-list-item:nth-child(even) { background: var(--table-stripe); }
.audit-list-item:hover { background: var(--table-hover); }
.link-samples-list, .reverse-ip-host-list, .psi-sample-list, .keywords-list { scrollbar-width: thin; }
.seo-check-item {
    background: var(--surface-1);
    border-radius: var(--radius-md);
    gap: var(--space-3);
    transition: border-color var(--dur-base) ease, background var(--dur-base) ease;
}
.seo-check-item:hover { border-color: var(--brand-line); background: var(--surface-2); }
[data-theme="dark"] .seo-check-item { background: var(--surface-1); }
.link-sample-item, .resource-item { border-radius: var(--radius-sm); }
.audit-row { border-radius: var(--radius-md); background: var(--surface-1); transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease; }
.audit-row:hover { border-color: var(--brand-line); box-shadow: var(--shadow-1); }

/* ---------- 9. Metrik ızgaraları ---------- */
.metric-item { padding-bottom: var(--space-3); margin-bottom: var(--space-3); border-bottom-style: dashed; }
.metric-label { color: var(--text-subtle); font-size: var(--fs-sm); text-transform: none; letter-spacing: 0; }
.metric-value { font-size: var(--fs-md); }
.flex-metrics { flex-wrap: wrap; gap: var(--space-3); }
.flex-metrics > .stat-box { flex: 1 1 110px; min-width: 0; }
.stat-box {
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-3);
    background: var(--surface-1);
    box-shadow: var(--shadow-1);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease;
}
.stat-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
[data-theme="dark"] .stat-box { background: var(--surface-2); }
.stat-val { font-size: clamp(1.25rem, 3.4vw, 1.65rem); letter-spacing: -0.02em; line-height: 1.15; }
.stat-lbl { color: var(--text-subtle); }
.heading-grid { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.heading-box { background: var(--surface-2); border-radius: var(--radius-md); }
.report-quick-pill {
    background: var(--brand-soft);
    border-color: var(--brand-line);
    border-radius: var(--radius-md);
}
.report-quick-pill__lbl { color: var(--text-subtle); }
.psi-quick-metric, .intel-stat-chip, .intel-mini-chip, .dom-load-chip, .content-stat-card {
    border-radius: var(--radius-md);
}
.deep-report-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--space-3); }
.deep-report-card { background: var(--surface-1); box-shadow: var(--shadow-1); transition: border-color var(--dur-base) ease, transform var(--dur-base) var(--ease-out); }
.deep-report-card:hover { border-color: var(--brand-line); transform: translateY(-1px); }
[data-theme="dark"] .deep-report-card { background: var(--surface-2); }
.deep-report-detail, .deep-report-label + * { color: var(--text-subtle); }

/* ---------- 10. Kod / pre blokları ---------- */
.audit-pre, .psi-code, .content-depth-code, .reverse-ip-host-code, .sx-code, pre.sx-code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--code-fg);
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-sm);
    tab-size: 4;
}
[data-theme="dark"] .psi-code { background: var(--code-bg); }
.audit-pre, pre.sx-code {
    padding: var(--space-3) var(--space-4);
    overflow: auto;
    scrollbar-width: thin;
}
.sx-code { display: block; padding: var(--space-3) var(--space-4); white-space: pre-wrap; overflow-wrap: anywhere; }
pre.sx-code { white-space: pre; max-height: 26rem; }
code.sx-code { display: inline; padding: 1px 6px; font-size: 0.86em; white-space: normal; }
.sx-code--before { border-left: 4px solid var(--sev-critical-solid); }
.sx-code--after { border-left: 4px solid var(--sev-pass-solid); }
.sx-code[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: var(--space-2);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
code:not([class]) { font-family: var(--font-mono); font-size: 0.88em; }

/* ---------- 11. İlerleme çubukları ---------- */
.progress-bg, .viz-meter-track, .dom-load-bar-track, .chart-track { background: var(--surface-3); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .progress-bg, [data-theme="dark"] .viz-meter-track { background: var(--surface-3); }
.progress-bar, .viz-meter-fill { background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); }
.viz-meter-label { color: var(--text-main); }
.viz-meter-val { color: var(--text-subtle); }
.viz-meter-row { grid-template-columns: minmax(96px, 150px) 1fr 44px; }

/* ---------- 12. Genel yardımcı bileşenler ---------- */

/* .sx-badge — şiddet rozeti. <span class="sx-badge sx-badge--critical">Kritik</span> */
.sx-badge {
    --_c: var(--text-subtle); --_bg: var(--surface-2); --_bd: var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--_bd);
    background: var(--_bg);
    color: var(--_c);
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.5;
    text-transform: uppercase;
    white-space: nowrap;
}
.sx-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.sx-badge--critical { --_c: var(--sev-critical); --_bg: var(--sev-critical-bg); --_bd: var(--sev-critical-border); }
.sx-badge--high { --_c: var(--sev-high); --_bg: var(--sev-high-bg); --_bd: var(--sev-high-border); }
.sx-badge--medium { --_c: var(--sev-medium); --_bg: var(--sev-medium-bg); --_bd: var(--sev-medium-border); }
.sx-badge--low { --_c: var(--sev-low); --_bg: var(--sev-low-bg); --_bd: var(--sev-low-border); }
.sx-badge--info { --_c: var(--sev-info); --_bg: var(--sev-info-bg); --_bd: var(--sev-info-border); }
.sx-badge--pass { --_c: var(--sev-pass); --_bg: var(--sev-pass-bg); --_bd: var(--sev-pass-border); }
.sx-badge--sm { padding: 1px 8px; font-size: 0.66rem; }
.sx-badge--solid { background: var(--_c); color: var(--surface-1); border-color: transparent; }

/* .sx-card — şiddet vurgulu bulgu kartı. <article class="sx-card sx-card--high"> */
.sx-card {
    --_accent: var(--brand-500);
    position: relative;
    padding: var(--space-5) var(--space-6);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.5), transparent 40%),
        var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--_accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    overflow-wrap: anywhere;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
}
[data-theme="dark"] .sx-card { background: linear-gradient(160deg, rgba(255, 188, 0, 0.05), transparent 40%), var(--bg-card); }
.sx-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.sx-card--critical { --_accent: var(--sev-critical-solid); }
.sx-card--high { --_accent: var(--sev-high-solid); }
.sx-card--medium { --_accent: var(--sev-medium-solid); }
.sx-card--low { --_accent: var(--sev-low-solid); }
.sx-card--info { --_accent: var(--sev-info-solid); }
.sx-card--pass { --_accent: var(--sev-pass-solid); }
.sx-card--tint.sx-card--critical { background: var(--sev-critical-bg); border-color: var(--sev-critical-border); }
.sx-card--tint.sx-card--high { background: var(--sev-high-bg); border-color: var(--sev-high-border); }
.sx-card--tint.sx-card--medium { background: var(--sev-medium-bg); border-color: var(--sev-medium-border); }
.sx-card--tint.sx-card--low { background: var(--sev-low-bg); border-color: var(--sev-low-border); }
.sx-card--tint.sx-card--info { background: var(--sev-info-bg); border-color: var(--sev-info-border); }
.sx-card--tint.sx-card--pass { background: var(--sev-pass-bg); border-color: var(--sev-pass-border); }
.sx-card--tint { border-left-color: var(--_accent); }
.sx-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.sx-card__title { margin: 0; flex: 1 1 14rem; min-width: 0; font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.01em; color: var(--text-main); }
.sx-card__meta { font-size: var(--fs-xs); color: var(--text-subtle); font-weight: 600; }
.sx-card__body { color: var(--text-main); font-size: var(--fs-sm); line-height: 1.65; }
.sx-card__body > * + * { margin-top: var(--space-3); }
.sx-card__foot { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* .sx-grid — kart/metrik ızgarası */
.sx-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.sx-grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }

/* .sx-meter — ilerleme/skor çubuğu.
   <div class="sx-meter sx-meter--high" style="--sx-v:72" role="meter" aria-valuenow="72" aria-valuemin="0" aria-valuemax="100"><span class="sx-meter__fill"></span></div>
   Renk: sx-meter--critical|high|medium|low|info|pass veya otomatik skor tonu .sx-meter--score (data-band="0..100", 10'luk adım) */
.sx-meter {
    --sx-v: 0;
    --_c: var(--brand-500);
    position: relative;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.sx-meter__fill {
    display: block;
    height: 100%;
    width: calc(var(--sx-v) * 1%);
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--_c) 70%, #fff), var(--_c));
    transition: width 0.8s var(--ease-out);
}
.sx-meter--lg { height: 14px; }
.sx-meter--sm { height: 6px; }
.sx-meter--critical { --_c: var(--sev-critical-solid); }
.sx-meter--high { --_c: var(--sev-high-solid); }
.sx-meter--medium { --_c: var(--sev-medium-solid); }
.sx-meter--low { --_c: var(--sev-low-solid); }
.sx-meter--info { --_c: var(--sev-info-solid); }
.sx-meter--pass { --_c: var(--sev-pass-solid); }
.sx-meter[data-band="0"] { --_c: var(--score-0); }
.sx-meter[data-band="10"] { --_c: var(--score-10); }
.sx-meter[data-band="20"] { --_c: var(--score-20); }
.sx-meter[data-band="30"] { --_c: var(--score-30); }
.sx-meter[data-band="40"] { --_c: var(--score-40); }
.sx-meter[data-band="50"] { --_c: var(--score-50); }
.sx-meter[data-band="60"] { --_c: var(--score-60); }
.sx-meter[data-band="70"] { --_c: var(--score-70); }
.sx-meter[data-band="80"] { --_c: var(--score-80); }
.sx-meter[data-band="90"] { --_c: var(--score-90); }
.sx-meter[data-band="100"] { --_c: var(--score-100); }
.sx-meter-row { display: grid; grid-template-columns: minmax(80px, 160px) minmax(0, 1fr) 3.2em; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); }
.sx-meter-row__label { font-weight: 700; color: var(--text-main); overflow-wrap: anywhere; }
.sx-meter-row__val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-subtle); }

/* .sx-ring — dairesel skor. <div class="sx-ring" data-band="70" style="--sx-v:73"><span>73</span></div> */
.sx-ring {
    --sx-v: 0;
    --_c: var(--brand-500);
    --_s: 84px;
    position: relative;
    display: inline-grid;
    place-items: center;
    width: var(--_s);
    height: var(--_s);
    border-radius: 50%;
    background: conic-gradient(var(--_c) calc(var(--sx-v) * 1%), var(--surface-3) 0);
    font-weight: 800;
    font-size: calc(var(--_s) * 0.27);
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}
.sx-ring::before { content: ''; position: absolute; inset: calc(var(--_s) * 0.11); border-radius: 50%; background: var(--surface-1); }
.sx-ring > * { position: relative; z-index: 1; }
.sx-ring--lg { --_s: 120px; }
.sx-ring--sm { --_s: 56px; }
.sx-ring[data-band="0"] { --_c: var(--score-0); } .sx-ring[data-band="10"] { --_c: var(--score-10); }
.sx-ring[data-band="20"] { --_c: var(--score-20); } .sx-ring[data-band="30"] { --_c: var(--score-30); }
.sx-ring[data-band="40"] { --_c: var(--score-40); } .sx-ring[data-band="50"] { --_c: var(--score-50); }
.sx-ring[data-band="60"] { --_c: var(--score-60); } .sx-ring[data-band="70"] { --_c: var(--score-70); }
.sx-ring[data-band="80"] { --_c: var(--score-80); } .sx-ring[data-band="90"] { --_c: var(--score-90); }
.sx-ring[data-band="100"] { --_c: var(--score-100); }

/* .sx-chip — etiket / filtre çipi. <button class="sx-chip is-active">Kritik <b>3</b></button> */
.sx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--text-main);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: default;
    transition: background var(--dur-base) ease, border-color var(--dur-base) ease, transform var(--dur-fast) ease;
}
button.sx-chip, a.sx-chip { cursor: pointer; text-decoration: none; }
button.sx-chip:hover, a.sx-chip:hover { background: var(--brand-soft); border-color: var(--brand-line); transform: translateY(-1px); }
.sx-chip.is-active, .sx-chip[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand-300), var(--brand-500)); border-color: var(--brand-600); color: #0a0a0a; }
.sx-chip b { font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: var(--radius-pill); background: rgba(10, 10, 10, 0.1); font-size: var(--fs-xs); }
.sx-chip--critical { color: var(--sev-critical); background: var(--sev-critical-bg); border-color: var(--sev-critical-border); }
.sx-chip--high { color: var(--sev-high); background: var(--sev-high-bg); border-color: var(--sev-high-border); }
.sx-chip--medium { color: var(--sev-medium); background: var(--sev-medium-bg); border-color: var(--sev-medium-border); }
.sx-chip--low { color: var(--sev-low); background: var(--sev-low-bg); border-color: var(--sev-low-border); }
.sx-chip--info { color: var(--sev-info); background: var(--sev-info-bg); border-color: var(--sev-info-border); }
.sx-chip--pass { color: var(--sev-pass); background: var(--sev-pass-bg); border-color: var(--sev-pass-border); }
.sx-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- 13. Duyarlı düzen (375px dahil taşma yok) ---------- */
@media (max-width: 640px) {
    .container { padding: var(--space-8) var(--space-4); }
    .card { padding: var(--space-4); }
    .card::after { left: var(--space-4); right: var(--space-4); }
    .score-header { padding: var(--space-5); gap: var(--space-4); }
    .report-hero__row { gap: var(--space-4); justify-content: center; }
    .report-hero__row > .score-info { flex: 1 1 15rem !important; } /* app.js satır içi flex:1 */
    .search-form { flex-direction: column; gap: var(--space-3); padding: var(--space-3); }
    .search-form .input-wrapper { padding: 0 var(--space-3); }
    .search-form .btn-primary { width: 100%; min-height: 50px; }
    .category-title { margin-top: var(--space-10); }
    .viz-meter-row { grid-template-columns: minmax(0, 1fr) 40px; }
    .viz-meter-row .viz-meter-label { grid-column: 1 / -1; }
    .sx-meter-row { grid-template-columns: minmax(0, 1fr) 3.2em; }
    .sx-meter-row__label { grid-column: 1 / -1; }
    .sx-card { padding: var(--space-4); }
    .kw-table th, .kw-table td, .sx-table th, .sx-table td, .psi-lab-table th, .psi-lab-table td { padding: 8px 10px; }
    .kw-table-wrap, .sx-table-wrap, .psi-table-scroll { max-height: min(28rem, 70vh); }
    .content-audit-dl { grid-template-columns: 1fr; }
    .intel-main-grid, .report-server-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .flex-metrics > .stat-box { flex-basis: calc(50% - 6px); }
    .sx-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 14. Hareket tercihi ve yazdırma ---------- */
@media (prefers-reduced-motion: reduce) {
    .card, .card:hover, .stat-box, .stat-box:hover, .deep-report-card, .deep-report-card:hover,
    .sx-card, .sx-card:hover, .sx-chip, .sx-tab, .sx-meter__fill, .history-tag, .history-tag:hover,
    .btn-primary, .btn-primary:active, .search-form, .search-form:focus-within, .dark-mode-toggle,
    .report-toc__link, .seo-check-item, .audit-row, tr {
        transition: none !important;
        transform: none !important;
        animation: none !important;
    }
}
@media print {
    .kw-table-wrap, .psi-table-scroll, .dup-anchor-wrap, .sx-table-wrap, .audit-list, .audit-pre, pre.sx-code { max-height: none !important; overflow: visible !important; }
    .kw-table thead th, .sx-table thead th, .psi-lab-table thead th, .audit-list-header { position: static; }
    .card::after, .category-title::before { display: none; }
    .card, .sx-card, .stat-box { box-shadow: none !important; transform: none !important; }
}
