:root{
  --bg1:#f5f8ff;
  --bg2:#eef3ff;
  --card:#ffffffcc;
  --ink:#0f172a;
  --muted:#64748b;
  --line:rgba(15,23,42,.10);
  --soft:rgba(15,23,42,.04);
  --blue:#2563eb;
  --green:#16a34a;
  --red:#dc2626;
  --shadow: 0 18px 60px rgba(15,23,42,.08);
  --radius:20px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% 0%, var(--bg2), transparent),
              radial-gradient(1200px 700px at 90% 10%, #e9fff7, transparent),
              linear-gradient(180deg, var(--bg1), #ffffff);
  color:var(--ink);
}

.page{max-width:1200px; margin:0 auto; padding:22px 18px 28px}

/* HERO */
.hero{
  position:relative;
  border-radius:28px;
  overflow:hidden;
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(255,255,255,.55);
}

.hero__bg{
  position:absolute; inset:0;
  background:
    radial-gradient(900px 420px at 10% 20%, rgba(37,99,235,.22), transparent 60%),
    radial-gradient(900px 420px at 90% 10%, rgba(16,185,129,.18), transparent 60%),
    linear-gradient(135deg, rgba(37,99,235,.10), rgba(16,185,129,.08));
  filter: blur(0px);
}

.hero__content{
  position:relative;
  padding: 20px 18px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.brand{display:flex; align-items:flex-start; gap:14px; min-width:0}
.brand__mark{
  width:54px; height:54px;
  display:grid; place-items:center;
  border-radius:16px;
  background: rgba(255,255,255,.70);
  border:1px solid rgba(15,23,42,.10);
  font-weight:900;
  font-size:22px;
  color: var(--ink);
}

.brand__text{min-width:0}
.brand__text h1{
  margin:0 0 8px;
  font-size:22px;
  letter-spacing:.2px;
}
.brand__text p{
  margin:0;
  line-height:1.85;
  color: rgba(15,23,42,.86);
  max-width: 780px;
}

.hero__pill{
  display:flex; align-items:center; gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.72);
  white-space:nowrap;
  height: fit-content;
}

.dot{
  width:10px; height:10px;
  border-radius:999px;
  background: rgba(148,163,184,.9);
  box-shadow: 0 0 0 0 rgba(37,99,235,.0);
}
.dot.good{ background: rgba(22,163,74,1); }
.dot.bad{ background: rgba(220,38,38,1); }
.dot.pulse{ animation: pulse 1.2s infinite; }
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(37,99,235,.35); }
  70%{ box-shadow: 0 0 0 10px rgba(37,99,235,0); }
  100%{ box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}

/* GRID */
.grid{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:16px;
  margin-top:16px;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

/* CARD */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(15,23,42,.06);
  padding: 16px;
  backdrop-filter: blur(6px);
}
.card__head{ margin-bottom: 12px; }
.card__head h2{
  margin:0 0 6px;
  font-size:18px;
}
.muted{ color: var(--muted); }
.small{ font-size: 12.5px; }

.card__head--row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.card--neutral{ border-color: rgba(15,23,42,.10); }
.card--ok{
  border-color: rgba(22,163,74,.28);
  background: linear-gradient(180deg, rgba(22,163,74,.08), rgba(255,255,255,.70));
}
.card--bad{
  border-color: rgba(220,38,38,.28);
  background: linear-gradient(180deg, rgba(220,38,38,.08), rgba(255,255,255,.70));
}

/* INPUT */
.field{ display:block; }
.field__label{
  display:block;
  margin: 8px 0 6px;
  font-weight:700;
  color: rgba(15,23,42,.82);
}
textarea{
  width:100%;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.78);
  padding: 14px 14px;
  font-size: 18px;
  line-height: 1.9;
  outline:none;
  resize: vertical;
  min-height: 160px;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
textarea:focus{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 10px 30px rgba(37,99,235,.10);
}

/* BUTTONS */
.actions{ display:flex; gap:10px; margin-top: 12px; }
.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border-radius: 14px;
  padding: 10px 14px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.75);
  cursor:pointer;
  font-weight:800;
  transition: transform .12s, box-shadow .16s, background .16s, opacity .16s;
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn--primary{
  background: rgba(37,99,235,.96);
  border-color: rgba(37,99,235,.30);
  color: #fff;
  box-shadow: 0 14px 30px rgba(37,99,235,.18);
}
.btn--primary:hover{ box-shadow: 0 18px 42px rgba(37,99,235,.22); }

.btn--soft{
  background: rgba(15,23,42,.04);
}
.btn__spinner{
  width:16px; height:16px;
  border-radius:999px;
  border: 2px solid rgba(255,255,255,.55);
  border-top-color: rgba(255,255,255,1);
  display:none;
  animation: spin 0.9s linear infinite;
}
.btn.loading .btn__spinner{ display:inline-block; }
.btn.loading .btn__label{ opacity:.85; }
@keyframes spin{ to{ transform: rotate(360deg); } }

/* BADGE */
.badge{
  padding: 8px 12px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.70);
  font-weight: 900;
  letter-spacing:.2px;
}
.badge.ok{
  border-color: rgba(22,163,74,.25);
  background: rgba(22,163,74,.10);
  color: rgba(13,125,55,1);
}
.badge.bad{
  border-color: rgba(220,38,38,.25);
  background: rgba(220,38,38,.10);
  color: rgba(185,28,28,1);
}

/* KV */
.kv{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 520px){
  .kv{ grid-template-columns: 1fr; }
}
.kv__item{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.65);
  border-radius: 16px;
  padding: 10px 12px;
}
.kv__k{ font-size:12px; color: var(--muted); font-weight:800; margin-bottom: 6px; }
.kv__v{ font-size:18px; font-weight:900; }

/* PANELS */
.panel{
  margin-top: 12px;
  border:1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  background: rgba(255,255,255,.70);
  overflow:hidden;
}
.panel__title{
  padding: 10px 12px;
  font-weight: 900;
  color: rgba(15,23,42,.82);
  background: rgba(15,23,42,.03);
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.panel__body{
  padding: 12px 12px;
  line-height: 1.95;
  font-size: 16px;
}
.panel__actions{
  padding: 10px 12px 12px;
  display:flex;
  justify-content:flex-start;
}
.mini{
  padding: 8px 12px;
  border-radius: 12px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.04);
  cursor:pointer;
  font-weight: 900;
}
.mini:disabled{ opacity:.55; cursor:not-allowed; }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

/* CHART */
.chart{
  width:100%;
  height:auto;
  display:block;
  border-radius: 14px;
  background: rgba(15,23,42,.02);
  border: 1px solid rgba(15,23,42,.08);
}

/* CANDIDATES LIST */
.candList{ display: grid; gap: 12px; }

.cand{
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.05);
  transform: translateY(0);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.cand:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(15,23,42,0.07);
}
.cand--best{
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 14px 34px rgba(37,99,235,0.08);
}

.cand__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cand__id{ font-weight: 1000; letter-spacing: 0.2px; }

.cand__meta{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  border: 1px solid rgba(15,23,42,0.08);
  font-weight: 800;
}

.cand__text{
  font-size: 16px;
  line-height: 1.9;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15,23,42,0.03);
  border: 1px solid rgba(15,23,42,0.06);
}

/* FOOTER */
.footer{
  margin-top: 14px;
  text-align:center;
  padding: 10px 0 2px;
}





