:root{
  --bg:#0b0f17;
  --panel:#111827;
  --panel2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:#1f2937;
  --accent:#38bdf8;
  --good:#34d399;
  --bad:#fb7185;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 600px at 20% 0%, #0b1a2a 0%, var(--bg) 55%), var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
a{color:inherit}
.app{min-height:100%; padding:28px; max-width: 1280px; margin: 0 auto;}
.container{width: min(1060px, 100%);}
.header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px;
  border:1px solid var(--border);
  border-radius:18px;
  background: linear-gradient(180deg, rgba(17,24,39,.9), rgba(15,23,42,.9));
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:38px; height:38px; border-radius:12px;
  background: linear-gradient(135deg, rgba(56,189,248,.25), rgba(56,189,248,.05));
  border:1px solid rgba(56,189,248,.25);
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
}
.brand h1{font-size:16px; margin:0}
.brand p{margin:0; color:var(--muted); font-size:12px}
.actions{display:flex; gap:10px; align-items:center}
.badge{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.7);
  color: var(--muted);
  font-size:12px;
}
.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.8);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{border-color: rgba(56,189,248,.35)}
.btn.primary{background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.35)}
.btn.danger{background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.35)}
.grid{display:grid; grid-template-columns: 360px 1fr; gap:18px; margin-top:18px}
.panel{
  border:1px solid var(--border);
  border-radius:18px;
  background: rgba(17,24,39,.75);
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.panel .panel-h{padding:14px 16px; border-bottom:1px solid var(--border)}
.panel .panel-h h2{margin:0; font-size:14px}
.panel .panel-h p{margin:6px 0 0; color:var(--muted); font-size:12px}
.panel .panel-b{padding:14px 16px}
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
label{font-size:12px; color:var(--muted)}
select, input[type="text"], input[type="password"], textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.65);
  color:var(--text);
}
textarea{min-height:110px; resize:vertical}
.small{font-size:12px; color:var(--muted)}
.hr{height:1px; background:var(--border); margin:12px 0}
.list{display:flex; flex-direction:column; gap:8px; max-height: 430px; overflow:auto; padding-right:6px}
.item{
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(15,23,42,.55);
  padding:10px 12px;
  cursor:pointer;
}
.item:hover{border-color: rgba(56,189,248,.35)}
.item.active{border-color: rgba(56,189,248,.6); background: rgba(56,189,248,.08)}
.item .t{font-size:13px; margin:0}
.item .m{font-size:12px; color:var(--muted); margin:4px 0 0}
.practice{
  padding:16px;
}
.context{
  border:1px dashed rgba(56,189,248,.35);
  background: rgba(56,189,248,.06);
  border-radius:16px;
  padding:12px 12px;
  color: var(--text);
  font-size:13px;
}
.turn{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  background: rgba(15,23,42,.55);
}
.turn .who{color:var(--muted); font-size:12px; margin-bottom:6px}
.turn .txt{font-size:14px; line-height:1.4}
.options{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.opt{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background: rgba(15,23,42,.55);
  display:flex; gap:10px; align-items:flex-start;
}
.opt input{margin-top:4px}
.result{
  margin-top:14px;
  border:1px solid var(--border);
  border-radius:18px;
  background: rgba(17,24,39,.75);
  padding:14px;
}
.score{display:flex; align-items:center; gap:10px}
.pill{padding:5px 10px; border-radius:999px; border:1px solid var(--border); font-size:12px}
.pill.good{border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.12)}
.pill.bad{border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.12)}
.kv{margin-top:10px; display:grid; grid-template-columns: 1fr 1fr; gap:10px}
.kv .box{border:1px solid var(--border); border-radius:14px; padding:10px; background: rgba(15,23,42,.55)}
.kv h3{margin:0 0 6px; font-size:12px; color:var(--muted)}
.kv ul{margin:0; padding-left:16px; font-size:13px}
.toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  background: rgba(15,23,42,.9);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  font-size:13px;
  color:var(--text);
  box-shadow:0 12px 30px rgba(0,0,0,.35);
  opacity:0; pointer-events:none;
  transition: opacity .18s ease;
}
.toast.show{opacity:1}
.loading{color:var(--muted); padding:18px;}
.login{
  max-width: 420px;
  margin: 10vh auto;
  border:1px solid var(--border);
  border-radius:18px;
  background: rgba(17,24,39,.75);
  padding:18px;
}
.login h2{margin:0 0 8px}
.login p{margin:0 0 14px; color:var(--muted)}
@media (max-width: 980px){
  .grid{grid-template-columns: 1fr}
  .list{max-height: 260px}
}

/* --- v0.1.4 UI fixes: align CSS with markup --- */
.top{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
  padding:16px 18px;
  border:1px solid var(--border);
  border-radius:18px;
  background: linear-gradient(180deg, rgba(17,24,39,.9), rgba(15,23,42,.9));
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.top .title{font-size:16px; font-weight:700}
.top .sub{margin-top:2px; color:var(--muted); font-size:12px}
.stats{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.section{padding:14px 16px}
.section-title{font-size:13px; font-weight:700; margin-bottom:10px}
.row{display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-bottom:12px}
@media (max-width: 900px){
  .grid{grid-template-columns: 1fr}
  .row{grid-template-columns: 1fr}
}

.list-item{
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(15,23,42,.55);
  padding:10px 12px;
  cursor:pointer;
}
.list-item:hover{border-color: rgba(56,189,248,.35)}
.list-item.active{border-color: rgba(56,189,248,.6); background: rgba(56,189,248,.08)}
.list-title{font-size:13px; font-weight:700}
.list-meta{font-size:12px; color:var(--muted); margin-top:4px}

.card{
  border:1px solid var(--border);
  border-radius:16px;
  background: rgba(15,23,42,.55);
  padding:12px;
  margin-bottom:12px;
}
.card .h{font-size:14px; font-weight:700; line-height:1.35}
.note{
  margin-top:10px;
  border:1px dashed rgba(56,189,248,.35);
  background: rgba(56,189,248,.06);
  border-radius:14px;
  padding:10px 10px;
  color:var(--text);
  font-size:13px;
}
.muted{color:var(--muted)}
.score{
  font-size:22px;
  font-weight:800;
  margin:8px 0;
}
.score.good{color: var(--good)}
.score.mid{color: var(--accent)}
.score.bad{color: var(--bad)}
.models{display:grid; gap:10px; margin-top:10px}
.mono{
  margin-top:6px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background: rgba(17,24,39,.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  line-height:1.35;
  color:var(--text);
}
