:root{
  --bg:#0b1220;
  --card:#0f1a2e;
  --muted:#9fb0cc;
  --text:#eaf1ff;
  --border:rgba(255,255,255,0.10);
  --shadow: 0 12px 30px rgba(0,0,0,0.35);
  --accent:#69a7ff;
  --good:#6ee7b7;
  --warn:#fbbf24;
  --wrap: 980px;
}

*{ box-sizing:border-box; }
html, body { height: 100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1200px 600px at 20% -10%, #1d3a7a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #214c63 0%, transparent 50%),
    var(--bg);
  color:var(--text);
  overflow-x:hidden;
}

a{ color: inherit; }

.wrap{
  max-width: var(--wrap);
  margin: 18px auto 0;
  padding: 0 14px calc(92px + env(safe-area-inset-bottom));
}

.hero{
  padding: 18px 16px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-radius: 18px;
  box-shadow: var(--shadow);
}

h1{ margin:0 0 6px; font-size: 24px; }
.sub{ margin:0; color: var(--muted); line-height:1.55; font-size: 14px; }

.meta{
  margin-top: 12px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items:center;
}
.chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 8px 10px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 13px;
  text-decoration:none;
  white-space: nowrap;
}
.chip b{ color: var(--text); }

.card{
  margin-top: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.section{
  padding: 16px;
  border-top: 1px solid var(--border);
}
.section:first-child{ border-top:none; }
.section h2{ margin:0 0 6px; font-size: 17px; }
.section p{ margin:0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.q{
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.q:first-of-type{ border-top:none; }

.q .title{
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.scaleRow{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.opt{
  cursor:pointer;
  user-select:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.03);
  padding: 10px 12px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  gap:10px;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  font-size: 13px;
  color: var(--muted);
  min-height: 44px;
}
.opt input{ margin:0; }
.opt:hover{ border-color: rgba(255,255,255,0.18); }
.opt.active{
  background: rgba(105,167,255,0.16);
  border-color: rgba(105,167,255,0.55);
  color: var(--text);
}

.actions{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  border-top: 1px solid var(--border);
  background: rgba(8,14,26,0.92);
  backdrop-filter: blur(10px);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}

.actionsInner{
  max-width: var(--wrap);
  margin: 0 auto;
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items:center;
  justify-content: space-between;
}

button{
  appearance:none;
  border:none;
  background: linear-gradient(180deg, rgba(105,167,255,1), rgba(68,129,255,1));
  color: #061022;
  font-weight: 900;
  padding: 12px 16px;
  border-radius: 14px;
  cursor:pointer;
  font-size: 15px;
  box-shadow: 0 10px 22px rgba(55,130,255,0.28);
  min-height: 46px;
}
button:active{ transform: translateY(1px); }
button[disabled]{ opacity: 0.7; cursor: not-allowed; }

.note{
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  max-width: 560px;
}

.result{
  margin-top: 14px;
  border:1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
  padding: 16px;
  display:none;
}

.resultHead{
  display:flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items:flex-start;
  justify-content: space-between;
}

.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 13px;
}
.badge b{ color: var(--text); }

.grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

.panel{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  padding: 14px;
}

.kv{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items:center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.kv:first-child{ border-top:none; }
.k{ color: var(--muted); }
.v{ font-weight: 900; }

.bar{
  height: 9px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow:hidden;
  margin-top: 6px;
}
.bar > div{
  height: 100%;
  background: rgba(105,167,255,0.9);
  width: 0%;
}

.report{
  margin-top: 10px;
  line-height: 1.6;
  font-size: 14px;
}
.report b{ color: var(--good); }
.report .warn{ color: var(--warn); font-weight: 900; }

.canvasWrap{ padding: 6px; }
canvas{ width:100%; height: clamp(240px, 55vw, 360px); display:block; }

.foot{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.resultTitle{ margin:0 0 6px; }
.spacer8{ height:8px; }
.divider{ border:none;border-top:1px solid var(--border); margin:14px 0; }