/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #1a56db;
  --brand-dark: #1340b8;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --radius: 8px;

  --critical: #dc2626;
  --high: #ea580c;
  --medium: #d97706;
  --low: #2563eb;
  --info: #6b7280;

  --grade-a: #16a34a;
  --grade-b: #65a30d;
  --grade-c: #d97706;
  --grade-d: #ea580c;
  --grade-f: #dc2626;
}

/* ── Dark Mode ───────────────────────────────────────────────────── */
[data-theme="dark"] {
  --brand: #4d8bff;
  --brand-dark: #6ba3ff;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --bg: #0d1117;
  --card-bg: #161b22;

  --critical: #f85149;
  --high: #fb8f44;
  --medium: #d29922;
  --low: #58a6ff;
  --info: #8b949e;

  --grade-a: #3fb950;
  --grade-b: #7cb76b;
  --grade-c: #d29922;
  --grade-d: #fb8f44;
  --grade-f: #f85149;
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] body.landing { background: var(--bg); }
[data-theme="dark"] code { background: #21262d; color: #e6edf3; }
[data-theme="dark"] .hero { background: linear-gradient(135deg, #0d1f3c 0%, #0d1117 100%); }
[data-theme="dark"] .feature-card { background: var(--card-bg); }
[data-theme="dark"] .auth-card { background: var(--card-bg); box-shadow: 0 4px 24px rgba(0,0,0,.4); }
[data-theme="dark"] .auth-card input[type="email"] { background: #0d1117; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-google { background: #21262d; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .btn-google:hover { background: #30363d; }
[data-theme="dark"] .btn-outline { background: #21262d; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .btn-outline:hover { background: #30363d; }
[data-theme="dark"] .app-header { background: #161b22; border-color: var(--border); }
[data-theme="dark"] .scan-form-section { background: var(--card-bg); }
[data-theme="dark"] .scan-form input { background: #0d1117; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .progress-card { background: var(--card-bg); }
[data-theme="dark"] .scans-table-wrap { background: var(--card-bg); }
[data-theme="dark"] .scans-table th { background: #0d1117; }
[data-theme="dark"] .score-section { background: var(--card-bg); }
[data-theme="dark"] .subscore-card { background: #0d1117; }
[data-theme="dark"] .benchmark-row { background: #0d1f3c; }
[data-theme="dark"] .finding-card { background: var(--card-bg); }
[data-theme="dark"] .finding-header { background: #0d1117; }
[data-theme="dark"] .evidence-link { background: #0d1117; }
[data-theme="dark"] .evidence-link:hover { background: #21262d; }
[data-theme="dark"] .evidence-link-primary:hover { background: color-mix(in srgb, var(--critical) 10%, #0d1117); }
[data-theme="dark"] .checklist-table { background: var(--card-bg); }
[data-theme="dark"] .checklist-head, [data-theme="dark"] .checklist-cat { background: #0d1117; }
[data-theme="dark"] .checklist-row:hover { background: #0d1117; }
[data-theme="dark"] .sev-tab { background: #21262d; border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .sev-tab:hover { border-color: var(--brand); color: var(--brand); }
[data-theme="dark"] .stat-card { background: var(--card-bg); }
[data-theme="dark"] .cta-section { background: #0d1f3c; }
[data-theme="dark"] .site-footer { border-color: var(--border); }
[data-theme="dark"] .theme-btn { min-width: 2rem; }

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Menlo', 'Consolas', monospace; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* ── Layout ─────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--border); background: #fff; color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: .3rem .75rem; font-size: .82rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-google { background: #fff; border-color: var(--border); color: var(--text); }
.btn-google:hover { background: var(--bg); }
.btn-danger { border-color: var(--critical); color: var(--critical); }
.btn-danger:hover { background: var(--critical); color: #fff; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; color: var(--critical); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Landing Page ────────────────────────────────────────────────── */
body.landing { background: #fff; }

.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.4rem; flex-shrink: 0; }
.logo-text-group { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text { font-size: 1.05rem; }
.logo-sub { font-size: .7rem; color: var(--text-muted); font-weight: 400; }

.hero { padding: 5rem 0 4rem; text-align: center; background: linear-gradient(135deg, #eff6ff 0%, #fff 100%); }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; margin-bottom: 1rem; }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 2rem; }
.hero-note { margin-top: 1rem; color: var(--text-muted); font-size: .85rem; }

.features { padding: 4rem 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { margin-bottom: .5rem; font-size: 1.05rem; }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

.cta-section { padding: 4rem 0; text-align: center; background: var(--brand); color: #fff; }
.cta-section h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.cta-section .btn-primary { background: #fff; color: var(--brand); }
.cta-section .btn-primary:hover { background: #eff6ff; }

.site-footer { padding: 2rem 0; text-align: center; color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 2rem; }

/* ── Auth Page ───────────────────────────────────────────────────── */
body.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem 2rem; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,.07); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-icon { font-size: 2.5rem; }
.auth-logo h1 { font-size: 1.5rem; margin-top: .5rem; }
.auth-logo p { color: var(--text-muted); font-size: .9rem; }
.auth-card label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .4rem; margin-top: 1rem; }
.auth-card input[type="email"] { width: 100%; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; outline: none; transition: border-color .15s; }
.auth-card input[type="email"]:focus { border-color: var(--brand); }
.auth-card form .btn { margin-top: .75rem; }
.divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; color: var(--text-muted); font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .85rem; color: var(--text-muted); }

/* ── App Shell ───────────────────────────────────────────────────── */
body.app-page { background: var(--bg); }

.app-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.app-header .container { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.5rem; }
.app-nav { display: flex; gap: 1.25rem; flex: 1; }
.app-nav a { color: var(--text-muted); font-size: .9rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
.app-nav a:hover, .app-nav a.active { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.header-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.user-email { font-size: .85rem; color: var(--text-muted); }

.app-page main.container { padding-top: 2rem; padding-bottom: 4rem; }
.loading-text { color: var(--text-muted); padding: 2rem 0; }
.empty-text { color: var(--text-muted); padding: 2rem 0; text-align: center; }
.page-sub { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Scan Form ───────────────────────────────────────────────────── */
.scan-form-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem; }
.scan-form-section h2 { margin-bottom: 1rem; }
.scan-form { display: flex; gap: .75rem; }
.scan-form input { flex: 1; padding: .6rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; outline: none; }
.scan-form input:focus { border-color: var(--brand); }
.form-hint { margin-top: .5rem; font-size: .82rem; color: var(--text-muted); }

/* ── Progress ────────────────────────────────────────────────────── */
.scan-progress { margin-bottom: 2rem; }
.progress-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; display: flex; align-items: center; gap: 1rem; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scans Table ─────────────────────────────────────────────────── */
.recent-scans-section h3 { margin-bottom: 1rem; }
.scans-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.scans-table { width: 100%; border-collapse: collapse; }
.scans-table th, .scans-table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.scans-table th { background: var(--bg); font-weight: 600; font-size: .82rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.scans-table tr:last-child td { border-bottom: none; }
.pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; justify-content: center; }

/* ── Grade Badges ────────────────────────────────────────────────── */
.grade { display: inline-block; padding: .15rem .6rem; border-radius: 4px; font-weight: 700; font-size: .85rem; color: #fff; }
.grade-a { background: var(--grade-a); }
.grade-b { background: var(--grade-b); }
.grade-c { background: var(--grade-c); }
.grade-d { background: var(--grade-d); }
.grade-f { background: var(--grade-f); }
.grade-pending { background: var(--text-muted); }

/* ── Scan Results ────────────────────────────────────────────────── */
.scan-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; }
.scan-domain { font-size: 1.6rem; font-weight: 700; }
.scan-meta { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }

.score-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.grade-card { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; border-radius: var(--radius); color: #fff; }
.grade-card.grade-a { background: var(--grade-a); }
.grade-card.grade-b { background: var(--grade-b); }
.grade-card.grade-c { background: var(--grade-c); }
.grade-card.grade-d { background: var(--grade-d); }
.grade-card.grade-f { background: var(--grade-f); }
.grade-letter { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.grade-score { font-size: 2rem; font-weight: 700; }
.grade-score span { font-size: 1rem; opacity: .8; }
.grade-top-finding { margin-top: .75rem; font-size: .8rem; opacity: .92; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.grade-top-finding .sev-badge { flex-shrink: 0; background: rgba(0,0,0,.25); }

.subscore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; }
.subscore-card { background: var(--bg); border-radius: var(--radius); padding: 1rem; text-align: center; }
.subscore-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.subscore-val { font-size: 1.5rem; font-weight: 700; margin-top: .25rem; }
.subscore-src { font-size: .72rem; color: var(--text-muted); margin-top: .35rem; }
.ssl-grade-badge { display: inline-block; padding: .05rem .4rem; border-radius: 4px; font-size: .8rem; font-weight: 700; color: #fff; }
.ssl-grade-a-plus, .ssl-grade-a, .ssl-grade-a- { background: var(--grade-a); }
.ssl-grade-b { background: var(--grade-b); }
.ssl-grade-c { background: var(--grade-c); }
.ssl-grade-d { background: var(--grade-d); }
.ssl-grade-f, .ssl-grade-t, .ssl-grade-m { background: var(--grade-f); }

/* Mozilla Observatory grade — shown as large letter in subscore card */
.obs-grade { font-size: 1.8rem; font-weight: 800; }
.obs-grade-a_plus, .obs-grade-a, .obs-grade-a- { color: var(--grade-a); }
.obs-grade-b_plus, .obs-grade-b, .obs-grade-b- { color: var(--grade-b); }
.obs-grade-c_plus, .obs-grade-c, .obs-grade-c- { color: var(--grade-c); }
.obs-grade-d_plus, .obs-grade-d, .obs-grade-d- { color: var(--grade-d); }
.obs-grade-f { color: var(--grade-f); }

.benchmark-row { display: flex; align-items: center; gap: 2rem; padding: 1rem; background: #eff6ff; border-radius: var(--radius); }
.benchmark-item { text-align: center; }
.bench-label { display: block; font-size: .8rem; color: var(--text-muted); }
.bench-val { font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.benchmark-sep { font-size: 1.2rem; color: var(--text-muted); }
.bench-stats-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.bench-stat { font-size: .9rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.bench-stat-icon { font-size: 1rem; }

/* ── Domain Info Bar ─────────────────────────────────────────────── */
.domain-info-bar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: .82rem; color: var(--text-muted); margin-bottom: .75rem; flex-wrap: wrap; }
.domain-info-label { font-weight: 600; color: var(--text); white-space: nowrap; }

/* ── Third-Party Verdicts Row ────────────────────────────────────── */
.verdicts-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.verdict-chip { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-bg); font-size: .82rem; flex: 1; min-width: 160px; }
.verdict-icon { font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
.verdict-source { font-weight: 600; font-size: .75rem; color: var(--text-muted); }
.verdict-label { font-size: .8rem; color: var(--text); }
.verdict-clean .verdict-icon  { color: var(--grade-a); }
.verdict-bad   .verdict-icon  { color: var(--grade-f); }
.verdict-warn  .verdict-icon  { color: var(--grade-c); }
.verdict-pending .verdict-icon { color: var(--text-muted); }

/* ── Findings ────────────────────────────────────────────────────── */
.findings-section h3 { margin-bottom: 1rem; }
.severity-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sev-tab { padding: .4rem .9rem; border-radius: 20px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: .85rem; transition: all .15s; display: flex; align-items: center; gap: .4rem; }
.sev-tab:hover { border-color: var(--brand); color: var(--brand); }
.sev-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.sev-count { background: rgba(0,0,0,.15); border-radius: 10px; padding: 0 .4rem; font-size: .75rem; }
.sev-tab.active .sev-count { background: rgba(255,255,255,.25); }

.finding-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.finding-card.severity-critical { border-left: 4px solid var(--critical); }
.finding-card.severity-high { border-left: 4px solid var(--high); }
.finding-card.severity-medium { border-left: 4px solid var(--medium); }
.finding-card.severity-low { border-left: 4px solid var(--low); }
.finding-card.severity-info { border-left: 4px solid var(--info); }

.finding-header { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
.finding-src-badge { margin-left: auto; font-size: .7rem; color: var(--text-muted); background: var(--border); padding: .1rem .45rem; border-radius: 4px; white-space: nowrap; }
.finding-body { padding: 1rem 1.1rem; }
.finding-desc { margin-bottom: .6rem; }
.finding-value { display: block; margin-bottom: .75rem; font-size: .85rem; word-break: break-all; }
.finding-rec { font-size: .9rem; }

/* ── Evidence Links (exposed file proof) ─────────────────────── */
.finding-evidence { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0 .75rem; }
.evidence-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0; }
.evidence-link { display: inline-flex; align-items: center; padding: .3rem .55rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; font-size: .78rem; font-family: monospace; color: var(--brand); text-decoration: none; word-break: break-all; transition: border-color .15s, background .15s; }
.evidence-link:hover { border-color: var(--brand); text-decoration: underline; }
.evidence-link-primary { border-color: color-mix(in srgb, var(--critical) 50%, var(--border)); color: var(--critical); font-weight: 500; }
.evidence-link-primary:hover { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 6%, var(--bg)); }

/* ── Summary / Detail Tabs ───────────────────────────────────── */
.main-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.main-tab { background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: .6rem 1.25rem; font-size: .95rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: color .15s; display: flex; align-items: center; gap: .4rem; }
.main-tab:hover { color: var(--text); }
.main-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── Security Checklist ──────────────────────────────────────── */
.checklist-section { margin-bottom: 2rem; width: 100%; }
.checklist-table { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .875rem; width: 100%; table-layout: fixed; }
.checklist-head { display: grid; grid-template-columns: 1fr 72px 170px; gap: .5rem; padding: .5rem 1rem; background: var(--bg); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.checklist-cat { padding: .35rem 1rem; background: var(--bg); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-top: 1px solid var(--border); }
.checklist-cat:first-of-type { border-top: none; }
.checklist-row { display: grid; grid-template-columns: 1fr 72px 170px; gap: .5rem; padding: .45rem 1rem; border-top: 1px solid var(--border); align-items: center; min-height: 2.5rem; cursor: pointer; }
.checklist-row:hover { background: var(--bg); }
.checklist-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cl-label { color: var(--text); }
.cl-result { display: flex; align-items: center; gap: .35rem; }
.cl-result-text { font-size: .75rem; font-weight: 600; }
.cl-source { color: var(--text-muted); font-size: .75rem; }
.cl-source-head { }
.cl-icon { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; font-size: .65rem; font-weight: 800; flex-shrink: 0; }
.cl-pass { background: var(--grade-a); color: #fff; }
.cl-fail { background: var(--critical); color: #fff; }
.cl-warn { background: var(--medium); color: #fff; }
.cl-na, .cl-pending { background: var(--border); color: var(--text-muted); }
.cl-result-text.cl-pass { color: var(--grade-a); }
.cl-result-text.cl-fail { color: var(--critical); }
.cl-result-text.cl-warn { color: var(--medium); }
.cl-result-text.cl-na, .cl-result-text.cl-pending { color: var(--text-muted); }
@media (max-width: 600px) {
  .checklist-head { grid-template-columns: 1fr 72px; }
  .checklist-row { grid-template-columns: 1fr 72px; }
  .cl-source, .cl-source-head { display: none; }
}
.no-findings { text-align: center; color: var(--text-muted); padding: 3rem 0; }

/* ── Check Explanation & Share Modals ────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; width: 100%; max-width: 500px; position: relative; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: .9rem; right: .9rem; background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted); padding: .25rem .45rem; border-radius: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-section { margin-bottom: 1rem; font-size: .9rem; line-height: 1.65; color: var(--text); }
.modal-section-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: .3rem; }
.modal-jump-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .75rem; cursor: pointer; font-size: .85rem; margin-top: .5rem; transition: border-color .15s; color: var(--text); }
.modal-jump-btn:hover { border-color: var(--brand); }

/* ── Shared Report ────────────────────────────────────────────── */
.shared-banner { background: #eff6ff; border-bottom: 1px solid #bfdbfe; padding: .6rem 1.5rem; font-size: .85rem; color: #1e40af; text-align: center; }
.claim-cta { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-top: 2.5rem; text-align: center; }
.claim-cta h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.claim-cta p { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.25rem; }
.claim-cta-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

[data-theme="dark"] .modal-box { box-shadow: 0 20px 60px rgba(0,0,0,.6); }
[data-theme="dark"] .modal-jump-btn { background: #0d1117; border-color: var(--border); }
[data-theme="dark"] .modal-jump-btn:hover { border-color: var(--brand); }
[data-theme="dark"] .shared-banner { background: #0d1f3c; border-color: #1e40af; color: #93c5fd; }

.sev-badge { display: inline-block; padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; color: #fff; text-transform: uppercase; }
.sev-critical { background: var(--critical); }
.sev-high { background: var(--high); }
.sev-medium { background: var(--medium); }
.sev-low { background: var(--low); }
.sev-info { background: var(--info); }

/* ── Benchmarks ──────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; }
.stat-icon { font-size: 2rem; margin-bottom: .75rem; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--brand); }
.stat-meta { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; }
.bench-section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.bench-section-sub { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── Batch Scanner ───────────────────────────────────────────────── */
.batch-layout { display: grid; grid-template-columns: 380px 1fr; gap: 2rem; align-items: start; margin-top: 1.5rem; }
@media (max-width: 900px) { .batch-layout { grid-template-columns: 1fr; } }
.batch-form-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.batch-form-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.batch-list-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.batch-list-panel h3 { font-size: 1rem; font-weight: 700; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.form-input { width: 100%; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; background: var(--bg); color: var(--text); outline: none; transition: border-color .15s; }
.form-input:focus { border-color: var(--brand); }
.form-textarea { width: 100%; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .85rem; font-family: monospace; background: var(--bg); color: var(--text); outline: none; resize: vertical; transition: border-color .15s; }
.form-textarea:focus { border-color: var(--brand); }
.domain-count-hint { font-size: .8rem; color: var(--text-muted); margin-top: .4rem; min-height: 1.2em; }
.batch-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .75rem; cursor: pointer; transition: border-color .15s; }
.batch-item:hover { border-color: var(--brand); }
.batch-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; gap: .75rem; }
.batch-item-name { font-weight: 600; font-size: .95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-status { font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 4px; flex-shrink: 0; }
.batch-status-running { background: #dbeafe; color: #1e40af; }
.batch-status-done { background: #dcfce7; color: #15803d; }
.batch-status-warn { background: #fef9c3; color: #854d0e; }
.batch-progress-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.batch-progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.batch-progress-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s; }
.batch-progress-label { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.batch-item-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: .6rem; }
.batch-item-actions { display: flex; justify-content: flex-end; }
.cl-pass-text { color: var(--grade-a); font-weight: 600; }
.cl-fail-text { color: var(--critical); font-weight: 600; }
.batch-detail-list { display: flex; flex-direction: column; gap: .5rem; }
.batch-detail-row { display: grid; grid-template-columns: 24px 1fr auto auto; gap: .75rem; align-items: center; padding: .5rem .75rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: .88rem; }
.batch-detail-domain { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-detail-score { color: var(--text-muted); font-size: .85rem; white-space: nowrap; }
.grade-badge { display: inline-block; padding: .1rem .4rem; border-radius: 4px; font-size: .75rem; font-weight: 700; color: #fff; }
.grade-a { background: var(--grade-a); }
.grade-b { background: var(--grade-b, #22c55e); }
.grade-c { background: var(--grade-c, #f59e0b); }
.grade-d { background: var(--grade-d, #f97316); }
.grade-f { background: var(--critical); }

[data-theme="dark"] .batch-status-running { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .batch-status-done { background: #14532d; color: #86efac; }
[data-theme="dark"] .batch-status-warn { background: #422006; color: #fde68a; }

/* ── Scan disclaimer ─────────────────────────────────────────────── */
.scan-disclaimer { font-size: .78rem; color: var(--text-muted); margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); text-align: center; line-height: 1.6; }
.disclaimer-link { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.disclaimer-link:hover { color: var(--brand); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .scan-form { flex-direction: column; }
  .subscore-grid { grid-template-columns: 1fr; }
  .benchmark-row { flex-direction: column; gap: .75rem; }
  .app-nav { gap: .75rem; }
  .grade-card { flex-direction: column; text-align: center; }
}
