:root {
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --card: #161b26;
  --border: #262d3d;
  --text: #e6e9f0;
  --text-dim: #9aa3b5;
  --brand: #6d5bff;
  --brand-2: #22d3ee;
  --pass: #34d399;
  --warn: #fbbf24;
  --fail: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.25);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #1b1440 0%, transparent 60%),
              radial-gradient(1000px 500px at 100% 0%, #06222c 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); background: rgba(11,14,20,.75); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--brand-2); }
.main-nav { display: flex; gap: 4px; }
.main-nav a { color: var(--text-dim); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .92rem; font-weight: 500; transition: .15s; white-space: nowrap; }
.main-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.main-nav a.active { color: var(--text); background: rgba(109,91,255,.18); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }

main { flex: 1; }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; }
.hero .accent { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-dim); font-size: 1.15rem; max-width: 640px; margin: 0 auto 32px; }

/* Tool grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; padding: 20px 0 80px; }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text); transition: .18s; display: flex; flex-direction: column; gap: 8px; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.tool-card .icon { font-size: 1.8rem; }
.tool-card h3 { margin: 4px 0 0; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--text-dim); font-size: .92rem; }

/* Tool page */
.tool-page-head { padding: 56px 0 8px; text-align: center; }
.tool-page-head h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 10px; letter-spacing: -.02em; }
.tool-page-head p { color: var(--text-dim); max-width: 620px; margin: 0 auto; }

.checker-form { max-width: 720px; margin: 32px auto 8px; display: flex; gap: 10px; padding: 0 20px; flex-wrap: wrap; }
.checker-form input[type=text] {
  flex: 1; min-width: 220px; background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 14px 16px; border-radius: 10px; font-size: 1rem; outline: none; transition: .15s;
}
.checker-form input[type=text]:focus { border-color: var(--brand); }
.checker-form button {
  background: linear-gradient(90deg, var(--brand), #8b7bff); color: #fff; border: none; padding: 14px 24px;
  border-radius: 10px; font-weight: 600; font-size: 1rem; cursor: pointer; transition: .15s; white-space: nowrap;
}
.checker-form button:hover { filter: brightness(1.08); }
.checker-form button:disabled { opacity: .6; cursor: not-allowed; }

.results { max-width: 900px; margin: 0 auto; padding: 24px 20px 100px; }
.state-msg { text-align: center; color: var(--text-dim); padding: 40px 0; }
.state-msg.error { color: var(--fail); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Score display */
.score-hero { display: flex; align-items: center; gap: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; flex-wrap: wrap; }
.score-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.score-ring .bg { fill: none; stroke: var(--border); stroke-width: 10; }
.score-ring .fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-ring .label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .num { font-size: 1.8rem; font-weight: 800; }
.score-ring .grade { font-size: .8rem; color: var(--text-dim); }
.score-meta h2 { margin: 0 0 6px; font-size: 1.3rem; word-break: break-all; }
.score-meta .counts { display: flex; gap: 14px; flex-wrap: wrap; }
.count-pill { font-size: .85rem; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.count-pill.pass { background: rgba(52,211,153,.15); color: var(--pass); }
.count-pill.warn { background: rgba(251,191,36,.15); color: var(--warn); }
.count-pill.fail { background: rgba(248,113,113,.15); color: var(--fail); }

/* Check list */
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; display: flex; gap: 14px; }
.check-item .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.check-item.pass .dot { background: var(--pass); }
.check-item.warn .dot { background: var(--warn); }
.check-item.fail .dot { background: var(--fail); }
.check-item.info .dot { background: var(--info); }
.check-item .body { flex: 1; min-width: 0; }
.check-item .label { font-weight: 600; margin-bottom: 3px; }
.check-item .detail { color: var(--text-dim); font-size: .92rem; word-break: break-word; }
.check-item .fix { color: var(--brand-2); font-size: .88rem; margin-top: 6px; }

.section-title { font-size: 1.05rem; font-weight: 700; margin: 32px 0 12px; }

/* Tables & misc */
.kw-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.kw-table th, .kw-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: .92rem; }
.kw-table th { color: var(--text-dim); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.kw-table tr:last-child td { border-bottom: none; }
.kw-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 18px; margin-bottom: 24px; }

.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 10px; }
.agent-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.agent-item .name { font-weight: 600; font-size: .88rem; }
.agent-item .desc { color: var(--text-dim); font-size: .78rem; }
.badge { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.allowed { background: rgba(52,211,153,.15); color: var(--pass); }
.badge.blocked, .badge.blocked-wildcard { background: rgba(248,113,113,.15); color: var(--fail); }

.notice { background: rgba(96,165,250,.1); border: 1px solid rgba(96,165,250,.3); color: #cfe0fb; border-radius: 10px; padding: 14px 16px; font-size: .9rem; margin-bottom: 20px; }
.notice.estimate { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.3); color: #f3dfae; }

.big-metric { text-align: center; padding: 20px 0; }
.big-metric .value { font-size: 4rem; font-weight: 800; letter-spacing: -.03em; background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-metric .caption { color: var(--text-dim); margin-top: 6px; }

.signal-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.signal-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: .9rem; }
.signal-row .mark { font-weight: 700; width: 18px; }
.signal-row .mark.yes { color: var(--pass); }
.signal-row .mark.no { color: var(--fail); }

.placement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 10px; margin: 16px 0 24px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; }
.footer-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer-inner p { color: var(--text-dim); font-size: .85rem; margin: 0; }
.footer-nav { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--text-dim); text-decoration: none; font-size: .85rem; }
.footer-nav a:hover { color: var(--text); }

@media (max-width: 820px) {
  .main-nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-soft); border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px; display: none; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
}
