:root{
  --bg:#07142d;
  --bg-soft:#11203d;
  --panel:#1b2a44;
  --panel-2:#223455;
  --border:rgba(255,255,255,.08);
  --text:#f8fafc;
  --muted:#9fb0ca;
  --green:#22c55e;
  --red:#f87171;
  --amber:#f59e0b;
  --blue:#60a5fa;
  --violet:#7c83ff;
  --shadow:0 18px 45px rgba(0,0,0,.25);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,Arial,Helvetica,sans-serif;
  background:linear-gradient(180deg,#041129 0%, #07142d 100%);
  color:var(--text);
  min-height:100vh;
}

.page{
  max-width:1280px;
  margin:0 auto;
  padding:40px 22px 70px;
}

.hero{
  text-align:center;
  margin-bottom:28px;
}

.badge{
  display:inline-block;
  padding:8px 12px;
  background:rgba(124,131,255,.14);
  border:1px solid rgba(124,131,255,.35);
  border-radius:999px;
  color:#dbe4ff;
  font-size:13px;
  margin-bottom:18px;
}

.hero h1{
  margin:0 0 14px;
  font-size:48px;
  line-height:1.08;
  letter-spacing:-0.02em;
}

.subtitle{
  max-width:860px;
  margin:0 auto 26px;
  color:var(--muted);
  font-size:18px;
  line-height:1.6;
}

.search-card{
  max-width:920px;
  margin:0 auto;
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
}

.search-row{
  display:flex;
  gap:14px;
  align-items:center;
}

input{
  flex:1;
  min-width:0;
  height:58px;
  border:none;
  border-radius:14px;
  padding:0 18px;
  font-size:17px;
  color:#0f172a;
}

button{
  height:58px;
  min-width:150px;
  border:none;
  border-radius:14px;
  background:linear-gradient(135deg,#6670ff,#847dff);
  color:white;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
  transition:transform .15s ease, opacity .15s ease;
}

button:hover{transform:translateY(-1px)}
button:disabled{opacity:.65;cursor:not-allowed;transform:none}

.hint{
  margin:12px 2px 0;
  color:var(--muted);
  font-size:13px;
  text-align:left;
}

code{
  background:rgba(255,255,255,.08);
  padding:2px 6px;
  border-radius:6px;
}

.panel{
  background:linear-gradient(180deg,var(--panel),var(--bg-soft));
  border:1px solid var(--border);
  border-radius:22px;
  padding:24px;
  box-shadow:var(--shadow);
}

.empty-state{margin-top:24px}
.feature-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.feature-card{
  background:rgba(255,255,255,.035);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  text-align:left;
}

.feature-card h3{
  margin:0 0 8px;
  font-size:18px;
}

.feature-card p{
  margin:0;
  color:var(--muted);
  line-height:1.55;
}

.hidden{display:none}

.loading-wrap{
  display:flex;
  align-items:center;
  gap:18px;
}

.spinner{
  width:48px;
  height:48px;
  border-radius:50%;
  border:4px solid rgba(255,255,255,.16);
  border-top-color:#93c5fd;
  animation:spin 1s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

.error-panel{
  border-color:rgba(248,113,113,.3);
  color:#fecaca;
  background:linear-gradient(180deg,#3a1b2c,#2a1625);
}

.top-grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
  margin-top:26px;
}

.hero-score{
  text-align:center;
}

.top-label{
  color:var(--muted);
  font-size:14px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.overall-score{
  font-size:88px;
  line-height:1;
  margin:12px 0 8px;
  font-weight:800;
  color:#36d47a;
}

.score-band{
  display:inline-block;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(34,197,94,.12);
  color:#bbf7d0;
  border:1px solid rgba(34,197,94,.22);
  font-weight:700;
}

.page-summary{
  max-width:760px;
  margin:16px auto 14px;
  color:var(--muted);
  line-height:1.65;
}

.mini-meta{
  display:flex;
  justify-content:center;
  gap:14px;
  flex-wrap:wrap;
  color:#c3d0e6;
  font-size:13px;
}

.overview-panel h3{
  margin:0 0 16px;
}

.overview-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.overview-grid div{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
}

.overview-grid span{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-bottom:6px;
}

.overview-grid strong{
  display:block;
  font-size:15px;
  line-height:1.5;
}

.main-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-top:18px;
}

.left-col,.right-col{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.section-header h2{
  margin:0 0 6px;
  font-size:24px;
}

.section-header p{
  margin:0 0 18px;
  color:var(--muted);
  line-height:1.6;
}

.metrics-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.metric-card{
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.035);
  padding:16px;
}

.metric-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.metric-title{
  font-size:18px;
  font-weight:800;
}

.metric-score{
  font-size:28px;
  font-weight:800;
}

.progress{
  height:10px;
  background:rgba(255,255,255,.08);
  border-radius:999px;
  overflow:hidden;
  margin-bottom:14px;
}

.progress > div{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#60a5fa,#22c55e);
}

.metric-desc,
.metric-meaning,
.metric-current{
  margin:0 0 10px;
  color:var(--muted);
  line-height:1.6;
}

.metric-meaning strong,
.metric-current strong{
  color:#e5edf8;
}

.signal-list,
.improvement-list{
  margin:0;
  padding-left:20px;
}

.signal-list li,
.improvement-list li{
  margin-bottom:10px;
  line-height:1.6;
}

.entities-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.entity-chip{
  padding:10px 12px;
  border-radius:999px;
  background:rgba(96,165,250,.10);
  color:#dbeafe;
  border:1px solid rgba(96,165,250,.24);
  font-size:14px;
}

.issues-wrap{
  display:grid;
  gap:12px;
}

.issue-card{
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.035);
  padding:16px;
}

.issue-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:10px;
}

.issue-title{
  font-size:18px;
  font-weight:800;
}

.badge-severity{
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.sev-high{background:rgba(248,113,113,.12); color:#fecaca; border:1px solid rgba(248,113,113,.25)}
.sev-medium{background:rgba(245,158,11,.12); color:#fde68a; border:1px solid rgba(245,158,11,.25)}
.sev-low{background:rgba(96,165,250,.12); color:#dbeafe; border:1px solid rgba(96,165,250,.25)}

.issue-meta{
  color:var(--muted);
  font-size:13px;
  margin-bottom:10px;
}

.issue-card p{
  margin:0 0 10px;
  color:var(--muted);
  line-height:1.65;
}

.issue-card p strong{color:#e5edf8}

.rewrite-wrap{
  display:grid;
  gap:16px;
}

.rewrite-block{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
}

.rewrite-block h3{
  margin:0 0 10px;
  font-size:17px;
}

.rewrite-block p,
.rewrite-block li{
  color:var(--muted);
  line-height:1.65;
}

.rewrite-block ul{
  margin:0;
  padding-left:20px;
}

.muted{color:var(--muted)}

@media (max-width: 1024px){
  .top-grid,
  .main-grid,
  .feature-grid{
    grid-template-columns:1fr;
  }

  .hero h1{font-size:38px}
}

@media (max-width: 700px){
  .page{padding:24px 14px 50px}
  .hero h1{font-size:31px}
  .subtitle{font-size:16px}
  .search-row{flex-direction:column}
  button, input{width:100%}
  .overall-score{font-size:68px}
  .overview-grid{grid-template-columns:1fr}
}