:root {
  --bg: #0b0e14;
  --panel: #131822;
  --panel-2: #19202e;
  --border: #273144;
  --text: #eef2f7;
  --muted: #98a4b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #131b2b 0%, var(--bg) 52%);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.container {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(8px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--ok));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}
.badge-pill {
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  border-radius: 999px;
  padding: 4px 12px;
}

main { flex: 1; padding: 36px 20px 56px; }

.hero { text-align: center; max-width: 740px; margin: 0 auto 30px; }
.hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.subtitle { color: var(--muted); margin: 0 0 24px; }

.scan-form {
  display: flex;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
.scan-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  font: 16px var(--sans);
  padding: 10px 12px;
  outline: none;
}
.scan-form button {
  background: var(--accent-strong);
  color: #041018;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
}
.scan-form button:hover { background: var(--accent); }
.scan-form button:disabled { opacity: 0.6; cursor: wait; }

.samples {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.sample-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font: inherit;
}
.sample-chip:hover { border-color: var(--accent); color: var(--accent); }

.status-banner {
  margin: 16px auto 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
}
.status-banner.info {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.unlock-banner {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.unlock-banner p { margin: 6px 0 0; color: #bbf7d0; }
#session-badge { font-size: 12px; color: var(--muted); margin-left: 8px; font-family: var(--mono); }

.results { display: flex; flex-direction: column; gap: 20px; }
.grid-top { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
@media (max-width: 820px) {
  .grid-top { grid-template-columns: 1fr; }
  .scan-form { flex-direction: column; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }

.score-card { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; gap: 14px; }
.score-ring {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 8px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-ring.good { border-color: var(--ok); }
.score-ring.mid { border-color: var(--warn); }
.score-ring.low { border-color: var(--bad); }
.score-num { font-size: 36px; font-weight: 800; line-height: 1; }
.score-sub { font-size: 12px; color: var(--muted); }
.grade-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.grade-pill {
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.scanned-url { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
.score-summary { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.checks-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.check-title { font-weight: 600; font-size: 14px; }
.check-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.check-badge {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  align-self: center;
  padding: 3px 9px;
  border-radius: 999px;
}
.check-badge.pass { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.check-badge.warn { background: rgba(245, 158, 11, 0.15); color: #fde68a; }
.check-badge.fail { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.card-head, .fixpack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.crawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.crawler-cell {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.crawler-name { font-weight: 600; font-size: 13.5px; }
.crawler-owner { font-size: 11.5px; color: var(--muted); }
.pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.pill.allowed { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.pill.partial { background: rgba(245, 158, 11, 0.16); color: #fde68a; }
.pill.blocked { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }

.cta-wrap { display: flex; gap: 10px; flex-wrap: wrap; }
.buy-btn {
  display: inline-block;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #03150a;
  font-weight: 800;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
}
.buy-btn:hover { filter: brightness(1.08); }
.secondary-btn, .mini-btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.mini-btn { padding: 4px 10px; font-size: 12px; }
.secondary-btn:hover, .mini-btn:hover { border-color: var(--accent); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  font: 13px var(--mono);
}
.tab.active { border-color: var(--accent); color: var(--text); background: rgba(56, 189, 248, 0.14); }

.code-box-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #090c11;
  overflow: hidden;
}
.code-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.toolbar-actions { display: flex; gap: 8px; }
.code-preview {
  margin: 0;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #dbeafe;
  overflow-x: auto;
  min-height: 180px;
  max-height: 420px;
  white-space: pre-wrap;
  word-break: break-word;
}
.paywall-overlay {
  position: absolute;
  inset: 42px 0 0 0;
  background: linear-gradient(180deg, rgba(9, 12, 17, 0.2) 0%, rgba(9, 12, 17, 0.94) 52%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
  text-align: center;
  gap: 12px;
}
.paywall-overlay[hidden] { display: none; }
.paywall-overlay p { margin: 0; color: var(--text); font-weight: 600; max-width: 440px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer a { color: var(--accent); text-decoration: none; }

@media print {
  .topbar, .hero, .cta-wrap, .paywall-overlay, .footer, .toolbar-actions { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .check-item, .crawler-cell { background: #fff; border-color: #ccc; color: #111; }
  .code-preview { color: #111; max-height: none; }
}
