:root {
  --bg:        #0a0a0f;
  --surface:   #111118;
  --border:    #1e1e2e;
  --border2:   #2a2a3e;
  --accent:    #5dade2;
  --accent2:   #3498db;
  --text:      #e8e8f0;
  --muted:     #6b6b80;
  --pass:      #27ae60;
  --warn:      #e67e22;
  --fail:      #e74c3c;
  --info:      #5dade2;
  --radius:    10px;
  --mono:      'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
  --sans:      'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-brand {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: .04em;
}
.lang-btn {
  display: inline-block;
  background: var(--border2);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .08em;
  text-decoration: none;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Hero ── */
.hero {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: center;
}
.hero h1 {
  font-family: var(--mono);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 500px;
  margin: 0 auto 36px;
}

/* ── Input ── */
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.input-wrap:focus-within { border-color: var(--accent); }
.input-prefix {
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  border-right: 1px solid var(--border2);
  height: 48px;
  display: flex;
  align-items: center;
}
#domain-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 0 14px;
  height: 48px;
}
#domain-input::placeholder { color: var(--muted); }
#scan-btn {
  background: var(--accent2);
  color: #fff;
  border: none;
  padding: 0 22px;
  height: 48px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
  letter-spacing: .02em;
}
#scan-btn:hover:not(:disabled) { background: var(--accent); }
#scan-btn:active:not(:disabled) { transform: scale(.97); }
#scan-btn:disabled { opacity: .5; cursor: not-allowed; }

.input-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

#error-box {
  margin-top: 12px;
  color: var(--fail);
  font-size: 13px;
  font-family: var(--mono);
  min-height: 18px;
}

/* ── Progress bar ── */
#progress-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  display: none;
}
#progress-wrap.visible { display: block; }
.progress-bar-bg {
  background: var(--border);
  border-radius: 4px;
  height: 3px;
  overflow: hidden;
  margin-top: 20px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 4px;
  width: 0%;
  transition: width .4s ease;
  animation: progress-pulse 1.8s ease-in-out infinite;
}
@keyframes progress-pulse {
  0%,100% { opacity: 1; } 50% { opacity: .6; }
}
.progress-msg {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: .04em;
}

/* ── Results ── */
#results {
  max-width: 760px;
  margin: 40px auto 80px;
  padding: 0 24px;
  display: none;
  animation: fadeUp .4s ease;
}
#results.visible { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Score header ── */
.result-header {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.score-circle {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}
.score-circle svg { transform: rotate(-90deg); }
.score-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.score-num {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.score-lbl {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.result-meta { flex: 1; min-width: 180px; }
.result-domain {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 6px;
  word-break: break-all;
}
.result-info {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 12px;
}
.grade-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: #000;
  padding: 6px 20px;
  border-radius: 8px;
  line-height: 1;
}
.summary-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: .04em;
}
.pill-crit  { background: rgba(231,76,60,.15);  color: var(--fail); border: 1px solid rgba(231,76,60,.3); }
.pill-warn  { background: rgba(230,126,34,.15); color: var(--warn); border: 1px solid rgba(230,126,34,.3); }
.pill-info  { background: rgba(93,173,226,.1);  color: var(--info); border: 1px solid rgba(93,173,226,.25); }
.pill-pass  { background: rgba(39,174,96,.1);   color: var(--pass); border: 1px solid rgba(39,174,96,.25); }

/* ── Sections ── */
.section {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.section-header:hover { background: rgba(255,255,255,.02); }
.section-icon { font-size: 18px; flex-shrink: 0; }
.section-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.section-status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
}
.st-pass { background: rgba(39,174,96,.15);   color: var(--pass); }
.st-fail { background: rgba(231,76,60,.15);   color: var(--fail); }
.st-warn { background: rgba(230,126,34,.15);  color: var(--warn); }
.st-info { background: rgba(93,173,226,.12);  color: var(--info); }
.chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform .25s;
  flex-shrink: 0;
}
.section.open .chevron { transform: rotate(180deg); }

.section-body {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}
.section.open .section-body { display: block; }

/* ── Finding rows ── */
.finding {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.finding:last-child { border-bottom: none; padding-bottom: 0; }
.finding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.dot-crit { background: var(--fail); }
.dot-warn { background: var(--warn); }
.dot-info { background: var(--info); }
.finding-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.finding-reason {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.finding-url {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--border2);
  word-break: break-all;
  line-height: 1.4;
}
.finding-url span {
  display: block;
  color: #3a3a55;
}
.finding-url span:hover { color: var(--muted); }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.check-row:last-child { border-bottom: none; padding-bottom: 0; }
.check-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.check-text { flex: 1; }
.check-label { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.check-detail { font-size: 12px; color: var(--muted); }
.check-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent2);
  text-decoration: none;
  word-break: break-all;
}
.check-link:hover { color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 20px 0 8px;
  color: var(--pass);
  font-size: 13px;
  font-family: var(--mono);
}
.empty-state::before { content: '✓ '; }

/* ── Cookie list ── */
.cookie-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cookie-tag {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(231,76,60,.1);
  border: 1px solid rgba(231,76,60,.25);
  color: var(--fail);
  padding: 3px 10px;
  border-radius: 4px;
}

/* ── Badge section ── */
.badge-section {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 12px;
}
.badge-section h3 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: .04em;
}
.badge-preview { margin-bottom: 14px; }
.badge-code-wrap {
  position: relative;
  background: #080810;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.6;
}
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--border2);
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
}
.copy-btn:hover { background: var(--accent2); color: #fff; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: #333344;
  border-top: 1px solid var(--border);
}
footer a { color: #444458; text-decoration: none; }
footer a:hover { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 500px) {
  .result-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .topbar { padding: 12px 16px; }
  .hero { padding: 40px 16px 28px; }
}

/* ── Finding hostname (was inline style on <small>) ── */
.finding-host {
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

/* ── Score number color (was inline style, color depends on score) ── */
.score-t1 { color: #27ae60; }
.score-t2 { color: #f39c12; }
.score-t3 { color: #e67e22; }
.score-t4 { color: #e74c3c; }

/* ── Grade pill background (was inline style, color depends on grade) ── */
.grade-bg-a-plus { background: #1abc9c; }
.grade-bg-a      { background: #27ae60; }
.grade-bg-b      { background: #2ecc71; }
.grade-bg-c      { background: #f39c12; }
.grade-bg-d      { background: #e67e22; }
.grade-bg-e      { background: #e74c3c; }
.grade-bg-f      { background: #c0392b; }

/* ── Badge section text (was inline style) ── */
.badge-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.badge-preview-img { height: 64px; }

/* ── Progress fill amounts (CSP-safe: no inline style) ── */
.progress-bar-fill.p0 { width: 0%; }
.progress-bar-fill.p1 { width: 1%; }
.progress-bar-fill.p2 { width: 2%; }
.progress-bar-fill.p3 { width: 3%; }
.progress-bar-fill.p4 { width: 4%; }
.progress-bar-fill.p5 { width: 5%; }
.progress-bar-fill.p6 { width: 6%; }
.progress-bar-fill.p7 { width: 7%; }
.progress-bar-fill.p8 { width: 8%; }
.progress-bar-fill.p9 { width: 9%; }
.progress-bar-fill.p10 { width: 10%; }
.progress-bar-fill.p11 { width: 11%; }
.progress-bar-fill.p12 { width: 12%; }
.progress-bar-fill.p13 { width: 13%; }
.progress-bar-fill.p14 { width: 14%; }
.progress-bar-fill.p15 { width: 15%; }
.progress-bar-fill.p16 { width: 16%; }
.progress-bar-fill.p17 { width: 17%; }
.progress-bar-fill.p18 { width: 18%; }
.progress-bar-fill.p19 { width: 19%; }
.progress-bar-fill.p20 { width: 20%; }
.progress-bar-fill.p21 { width: 21%; }
.progress-bar-fill.p22 { width: 22%; }
.progress-bar-fill.p23 { width: 23%; }
.progress-bar-fill.p24 { width: 24%; }
.progress-bar-fill.p25 { width: 25%; }
.progress-bar-fill.p26 { width: 26%; }
.progress-bar-fill.p27 { width: 27%; }
.progress-bar-fill.p28 { width: 28%; }
.progress-bar-fill.p29 { width: 29%; }
.progress-bar-fill.p30 { width: 30%; }
.progress-bar-fill.p31 { width: 31%; }
.progress-bar-fill.p32 { width: 32%; }
.progress-bar-fill.p33 { width: 33%; }
.progress-bar-fill.p34 { width: 34%; }
.progress-bar-fill.p35 { width: 35%; }
.progress-bar-fill.p36 { width: 36%; }
.progress-bar-fill.p37 { width: 37%; }
.progress-bar-fill.p38 { width: 38%; }
.progress-bar-fill.p39 { width: 39%; }
.progress-bar-fill.p40 { width: 40%; }
.progress-bar-fill.p41 { width: 41%; }
.progress-bar-fill.p42 { width: 42%; }
.progress-bar-fill.p43 { width: 43%; }
.progress-bar-fill.p44 { width: 44%; }
.progress-bar-fill.p45 { width: 45%; }
.progress-bar-fill.p46 { width: 46%; }
.progress-bar-fill.p47 { width: 47%; }
.progress-bar-fill.p48 { width: 48%; }
.progress-bar-fill.p49 { width: 49%; }
.progress-bar-fill.p50 { width: 50%; }
.progress-bar-fill.p51 { width: 51%; }
.progress-bar-fill.p52 { width: 52%; }
.progress-bar-fill.p53 { width: 53%; }
.progress-bar-fill.p54 { width: 54%; }
.progress-bar-fill.p55 { width: 55%; }
.progress-bar-fill.p56 { width: 56%; }
.progress-bar-fill.p57 { width: 57%; }
.progress-bar-fill.p58 { width: 58%; }
.progress-bar-fill.p59 { width: 59%; }
.progress-bar-fill.p60 { width: 60%; }
.progress-bar-fill.p61 { width: 61%; }
.progress-bar-fill.p62 { width: 62%; }
.progress-bar-fill.p63 { width: 63%; }
.progress-bar-fill.p64 { width: 64%; }
.progress-bar-fill.p65 { width: 65%; }
.progress-bar-fill.p66 { width: 66%; }
.progress-bar-fill.p67 { width: 67%; }
.progress-bar-fill.p68 { width: 68%; }
.progress-bar-fill.p69 { width: 69%; }
.progress-bar-fill.p70 { width: 70%; }
.progress-bar-fill.p71 { width: 71%; }
.progress-bar-fill.p72 { width: 72%; }
.progress-bar-fill.p73 { width: 73%; }
.progress-bar-fill.p74 { width: 74%; }
.progress-bar-fill.p75 { width: 75%; }
.progress-bar-fill.p76 { width: 76%; }
.progress-bar-fill.p77 { width: 77%; }
.progress-bar-fill.p78 { width: 78%; }
.progress-bar-fill.p79 { width: 79%; }
.progress-bar-fill.p80 { width: 80%; }
.progress-bar-fill.p81 { width: 81%; }
.progress-bar-fill.p82 { width: 82%; }
.progress-bar-fill.p83 { width: 83%; }
.progress-bar-fill.p84 { width: 84%; }
.progress-bar-fill.p85 { width: 85%; }
.progress-bar-fill.p86 { width: 86%; }
.progress-bar-fill.p87 { width: 87%; }
.progress-bar-fill.p88 { width: 88%; }
.progress-bar-fill.p89 { width: 89%; }
.progress-bar-fill.p90 { width: 90%; }
.progress-bar-fill.p91 { width: 91%; }
.progress-bar-fill.p92 { width: 92%; }
.progress-bar-fill.p93 { width: 93%; }
.progress-bar-fill.p94 { width: 94%; }
.progress-bar-fill.p95 { width: 95%; }
.progress-bar-fill.p96 { width: 96%; }
.progress-bar-fill.p97 { width: 97%; }
.progress-bar-fill.p98 { width: 98%; }
.progress-bar-fill.p99 { width: 99%; }
.progress-bar-fill.p100 { width: 100%; }
