:root{
  --bg:#070b16;
  --ink:#eef2ff;
  --muted:#a8b3d6;
  --line:rgba(255,255,255,.10);
  --good:#21c07a;
  --bad:#ff5a6a;
  --warn:#ffcc66;
  --accent:#3b6cff;
  --card: rgba(255,255,255,.02);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 900px at 15% -10%, #14224a 0%, rgba(20,34,74,0) 50%),
              radial-gradient(1200px 900px at 95% 0%, #1a2a58 0%, rgba(26,42,88,0) 45%),
              var(--bg);
  color:var(--ink);
  background-attachment: fixed;
}
a{color:inherit}
.topbar{
  background: rgba(7,11,22,.86);

  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(10px);

  display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
  padding:16px 18px;
  max-width:1200px; margin:0 auto;
}
.brandTitle{font-weight:1000; font-size:18px; letter-spacing:.2px}
.brandSub{color:var(--muted); font-size:12px; margin-top:2px}
.wrap{max-width:1200px; margin:0 auto; padding:0 18px 26px; display:grid; gap:14px}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
}
.panelTop{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:12px}
.panelTitle{font-weight:1000; font-size:15px}
.panelMeta{display:flex; gap:8px; flex-wrap:wrap}

.pill{
  display:inline-flex; align-items:center;
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  background: rgba(255,255,255,.02);
}

.btn{
  appearance:none;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--ink);
  background-attachment: fixed;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
}
.btn:hover{border-color:rgba(255,255,255,.22)}
.btn.primary{
  background: linear-gradient(180deg, rgba(59,108,255,.20), rgba(59,108,255,.12));
  border-color: rgba(59,108,255,.55);
}
.btn:disabled{opacity:.45; cursor:not-allowed}

.controls{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 980px){
  .controls{grid-template-columns:1fr}
}
.control label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.control input, .control select{
  width:100%;
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  color:var(--ink);
  background-attachment: fixed;
  padding:10px 10px;
  border-radius:12px;
  outline:none;
}
.control.wide{grid-column: 1 / -1}
.control.actions{display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap}

.topicGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:8px;
}
@media (max-width: 980px){ .topicGrid{grid-template-columns:1fr} }
.topic{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  background: var(--card);
  font-size:13px;
  color: var(--ink);
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.topic input{margin-top:2px}

.hint{color:var(--muted); font-size:12px; margin-top:6px}

.kpis{display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; margin-top:6px}
.kpi{border:1px solid var(--line); border-radius:14px; padding:10px; background: var(--card)}
.kpiN{font-weight:1000; font-size:18px}
.kpiL{color:var(--muted); font-size:12px; margin-top:3px}
.scoreLine{margin-top:10px; font-weight:1000}

.qcard{
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}
.qhead{display:flex; justify-content:space-between; gap:12px; align-items:flex-start}
.qnum{font-size:12px; color:var(--muted); margin-bottom:8px}
.qtext{font-size:15px; font-weight:900}
.tags{display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end}
.tag{
  font-size:11px;
  border:1px solid var(--line);
  padding:4px 8px;
  border-radius:999px;
  color:var(--muted);
  background: rgba(255,255,255,.02);
}

.choice{
  display:flex; gap:10px; align-items:flex-start;
  padding:10px 10px; border-radius:12px;
  border:1px solid var(--line);
  margin-top:8px; background: var(--card);
  cursor:pointer;
}
.choice:hover{border-color: rgba(255,255,255,.22)}
.choice input{margin-top:2px}
.choiceViz{margin-top:8px;border:1px solid rgba(255,255,255,.10);border-radius:12px;padding:8px;background:rgba(255,255,255,.015);display:inline-block}
.choiceViz svg{display:block}

.answerbox{display:flex; gap:10px; margin-top:10px}
.answerbox input, .answerbox textarea{flex:1}
.answerbox textarea{min-height: 92px; resize: vertical;}

.feedback{
  margin-top:12px;
  border:1px dashed rgba(255,255,255,.20);
  border-radius:14px;
  padding:12px;
  background: rgba(255,255,255,.02);
}
.feedback.good{border-color: rgba(33,192,122,.55); background: rgba(33,192,122,.07)}
.feedback.bad{border-color: rgba(255,90,106,.55); background: rgba(255,90,106,.06)}
.feedback .title{font-weight:1000; margin-bottom:8px}
.explain{margin:0 0 10px; font-size:13px}
details summary{cursor:pointer; color:var(--muted); font-weight:1000; margin-top:6px}
details .model{
  margin:10px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:12.5px;
  color:#dbe2ff;
  white-space:pre-wrap;
  line-height:1.4;
}
.autoWarn{
  border:2px solid rgba(255,204,102,.65);
  background: rgba(255,204,102,.14);
  padding:12px;
  border-radius:14px;
  margin-top:10px;
}
.autoWarn .h{font-weight:1000; color:#ffe6b3; margin-bottom:6px}
.autoWarn .b{color:#ffecc7; font-size:12.5px; line-height:1.35}

.adjustRow{
  display:flex; gap:10px; align-items:center; margin-top:10px; flex-wrap:wrap;
  padding-top:8px; border-top:1px solid rgba(255,255,255,.10);
}
.adjustRow input{
  width:120px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.18);
  color:var(--ink);
  background-attachment: fixed;
  padding:8px 10px;
  border-radius:12px;
  outline:none;
}
.adjustRow .note{color:var(--muted); font-size:12px}
.small{font-size:12px; color:var(--muted)}
/* Mini buttons (e.g., report) */
.btn.mini{
  padding:6px 10px;
  border-radius:10px;
  font-weight:800;
  font-size:12px;
}
.reportBanner{
  position: sticky;
  top: 8px;
  z-index: 20;
  margin: 10px 0 0;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(59,108,255,.10);
  color: #eaf0ff;
  display:none;
}
.reportBanner .small{color:#cfe0ff}
/* Sticky score bar (always visible) */
.scoreBar{
  position: sticky;
  top: 10px;
  z-index: 30;
  max-width:1200px;
  margin: 0 auto;
  padding: 0 18px;
}
.scoreBar > div.scoreBarRow{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  border-radius:16px;
  padding:10px 12px;
}
.scoreBar .small{color:var(--muted); font-size:12px; margin-top:6px}
.scoreBar code{background:rgba(255,255,255,.08); padding:2px 6px; border-radius:8px}
/* Compact always-visible stats row inside header */
.topStats{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:10px;
}
.statPill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  font-size:12px;
  color: rgba(235,242,255,.92);
}
.statPill b{font-weight:1000}
.topicDetails{
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background: rgba(255,255,255,.015);
  padding:10px 10px;
}
.topicDetails > summary{
  cursor:pointer;
  list-style:none;
  font-weight:900;
  color:#dbe2ff;
}
.topicDetails > summary::-webkit-details-marker{display:none;}
.topicDetails > summary::before{
  content:"▸";
  display:inline-block;
  margin-right:8px;
  color: rgba(255,255,255,.7);
}
.topicDetails[open] > summary::before{content:"▾";}
.controls{gap:12px}
.control label{margin-bottom:6px}
.topicGrid{gap:10px}
.topic{padding:10px 10px; font-size:13px}
/* Fixed header so stats are always visible */
.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(5,8,18,.78);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
/* Push the main content down under the fixed header */
.wrap{
  padding-top: calc(var(--headerOffset, 0px) + 18px);
}
/* Report banner: in-flow, non-overlapping */
.reportBanner{
  position: relative !important;
  top: auto !important;
  z-index: auto !important;
}
.reportRow{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.reportBox{
  width:100%;
  margin-top:8px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
  color: rgba(235,242,255,.95);
  padding:10px;
  min-height:84px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 12.5px;
}
.reportActions{
  margin-top:8px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
