:root{
  --bg:#f6f8fc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e6eaf2;
  --brand:#0f62fe;
  --good:#16a34a;
  --warn:#f59e0b;
  --bad:#ef4444;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: linear-gradient(180deg, #f8fbff, var(--bg));
}

.topbar{
  position:sticky; top:0; z-index:10;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:40px; height:40px; border-radius:12px;
  display:grid; place-items:center;
  color:white; font-weight:900;
  background: linear-gradient(135deg, #0f62fe, #22c55e);
}
.brand-title{font-weight:900}
.brand-sub{font-size:12px; color:var(--muted); margin-top:2px}

.top-actions{display:flex; align-items:center; gap:10px}
.link{color:var(--muted); text-decoration:none; font-weight:700}
.link:hover{color:var(--text)}

.wrap{max-width:1200px; margin:0 auto; padding:18px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:18px;
}

.hero{display:grid; grid-template-columns: 1.6fr .9fr; gap:16px}
@media (max-width: 980px){ .hero{grid-template-columns:1fr} }

h1{margin:0 0 8px; font-size:32px}
.lead{margin:0 0 14px; color:var(--muted); line-height:1.6}

.input-row{display:flex; gap:10px; flex-wrap:wrap}
input{
  flex:1;
  min-width:240px;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  font-size:16px;
  outline:none;
}
input:focus{border-color: rgba(15,98,254,.35); box-shadow: 0 0 0 4px rgba(15,98,254,.10)}

.btn{
  border:none;
  background: var(--brand);
  color:white;
  font-weight:900;
  padding:12px 14px;
  border-radius:12px;
  cursor:pointer;
}
.btn:hover{filter:brightness(.96)}
.btn.small{padding:10px 12px; font-size:13px}
.btn.outline{
  background:transparent;
  border:1px solid var(--line);
  color:var(--text);
}

.status{margin-top:10px; color:var(--muted); font-size:13px; min-height:18px}
.status.ok{color:var(--good)}
.status.error{color:var(--bad)}

.chips{margin-top:10px; display:flex; gap:8px; flex-wrap:wrap}
.chip{
  border:1px solid var(--line);
  background:#f2f6ff;
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
  color:#1e40af;
}

.score-box{
  border:1px dashed var(--line);
  border-radius:14px;
  padding:14px;
  background:#fbfdff;
}
.score-title{font-weight:900; margin-bottom:8px}
.score-ring{position:relative; width:160px; height:160px; margin:4px auto 8px}
.score-ring svg{width:160px; height:160px; transform: rotate(-90deg)}
.ring-bg{fill:none; stroke:#e9eef8; stroke-width:12}
.ring-fill{
  fill:none;
  stroke: var(--good);
  stroke-width:12;
  stroke-linecap:round;
  stroke-dasharray:302;
  stroke-dashoffset:302;
  transition: stroke-dashoffset .7s ease, stroke .3s ease;
}
.ring-text{
  position:absolute; inset:0;
  display:grid; place-items:center;
  text-align:center;
}
.score{font-size:40px; font-weight:1000; line-height:1}
.score-sub{color:var(--muted); font-size:12px}

.badge{
  text-align:center;
  font-weight:900;
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 10px;
  background:#fff;
}

.mini-kv{margin-top:10px; display:grid; gap:6px}
.mini-kv span{color:var(--muted); font-size:12px}
.mini-kv b{display:block; margin-top:2px}

.hero-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}

.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
@media (max-width: 980px){ .grid{grid-template-columns:1fr} }
.hidden{display:none}

.card-head{display:flex; justify-content:space-between; align-items:center; gap:10px}
h2{margin:0; font-size:18px}

.checks{margin-top:10px; display:grid; gap:10px}
.check{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfdff;
}
.label{font-weight:900}

.pill{
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-size:12px;
}
.pill.ok{border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.08); color: var(--good)}
.pill.warn{border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.10); color: var(--warn)}
.pill.bad{border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.10); color: var(--bad)}

.kv{margin-top:10px; display:grid; gap:10px}
.kv-row{display:flex; justify-content:space-between; gap:10px}
.kv-row span{color:var(--muted)}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace}

.divider{height:1px; background:var(--line); margin:12px 0}
.mini-title{margin:0 0 8px; font-size:13px; color:var(--muted); font-weight:900}
.list{margin:0; padding-left:18px}
.list li{margin:8px 0; line-height:1.5}

.note{
  margin-top:10px;
  font-size:13px;
  color:var(--muted);
  background:#f8fafc;
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:12px;
}

.tabs{display:flex; gap:8px; margin-top:10px}
.tab{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  font-weight:900;
  color:var(--muted);
}
.tab.active{color:var(--text); border-color: rgba(15,98,254,.25); background: rgba(15,98,254,.08)}

.bars{margin-top:12px; display:grid; gap:10px}
.bar-row{display:grid; grid-template-columns: 120px 1fr 40px; gap:10px; align-items:center}
.bar-row span{color:var(--muted); font-weight:800}
.bar{
  height:10px; border-radius:999px;
  background:#eef2ff;
  border:1px solid var(--line);
  overflow:hidden;
}
.fill{height:100%; width:0%; background: var(--brand); transition: width .5s ease}

.cta{grid-column: 1 / -1}
.cta p{color:var(--muted); margin:6px 0 12px}
.cta-actions{display:flex; gap:10px; flex-wrap:wrap}
.fine{margin-top:10px; color:var(--muted); font-size:12px}

.footer{
  margin:16px 0 6px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

/* Modal */
.modal.hidden{display:none}
.modal{position:fixed; inset:0; z-index:50}
.modal-backdrop{position:absolute; inset:0; background:rgba(15,23,42,.55)}
.modal-card{
  position:relative;
  max-width:520px;
  margin:8vh auto 0;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:18px;
}
.modal-card h3{margin:0 0 6px}
.muted{color:var(--muted)}
.form{display:grid; gap:10px; margin-top:12px}