
:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.09);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.52);
  --line: rgba(255,255,255,0.12);
  --brand: #7c5cff;
  --brand2: #2ee59d;
  --warn: #ffcc66;
  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 16px;
  --radius2: 12px;
  --maxw: 1280px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(800px 500px at 15% 10%, rgba(124,92,255,0.35), transparent 55%),
    radial-gradient(900px 600px at 85% 20%, rgba(46,229,157,0.22), transparent 55%),
    radial-gradient(1000px 700px at 60% 90%, rgba(255,204,102,0.14), transparent 60%),
    var(--bg);
  color:var(--text);
  font-family:var(--sans);
  line-height:1.35;
}

a{color:inherit}
small{color:var(--muted)}
.muted{color:var(--muted)}
.muted2{color:var(--muted2)}
.mono{font-family:var(--mono)}
.hidden{display:none !important}

.container{
  max-width:var(--maxw);
  margin:0 auto;
  padding:18px 18px 28px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(14px);
  background: rgba(9,12,20,0.62);
  border-bottom:1px solid var(--line);
}
.topbar .inner{
  max-width:var(--maxw);
  margin:0 auto;
  padding:12px 18px;
  display:flex;
  align-items:center;
  gap:12px;
  justify-content:space-between;
}
.brand{
  display:flex;
  gap:10px;
  align-items:center;
  font-weight:700;
  letter-spacing:0.2px;
}
.badge{
  padding:2px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
}
.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color:var(--text);
  cursor:pointer;
  transition: transform 0.06s ease, background 0.18s ease, border 0.18s ease;
  user-select:none;
  text-decoration:none;
  font-weight:600;
}
.btn:hover{background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.18)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,0.95), rgba(46,229,157,0.82));
  border:none;
  box-shadow: 0 12px 32px rgba(124,92,255,0.18);
}
.btn.danger{background: rgba(255,107,107,0.12); border-color: rgba(255,107,107,0.35)}
.btn.ghost{background: transparent}
.btn.small{padding:8px 10px; border-radius:10px; font-size:13px}
.btn.block{width:100%; justify-content:center}

.card{
  background: var(--panel);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .hd{
  padding:14px 14px 10px;
  border-bottom: 1px solid var(--line);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.card .hd h3, .card .hd h4{margin:0; font-size:15px}
.card .bd{padding:14px}
.card .ft{
  padding:12px 14px 14px;
  border-top: 1px solid var(--line);
}

.grid3{
  display:grid;
  grid-template-columns: 280px 1fr 320px;
  gap:14px;
  align-items:start;
}
@media (max-width: 1080px){
  .grid3{grid-template-columns: 1fr}
  .topbar .inner{flex-wrap:wrap}
}

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav a{
  text-decoration:none;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid transparent;
  color:var(--muted);
  background: transparent;
}
.nav a.active, .nav a:hover{
  background: rgba(255,255,255,0.07);
  border-color: var(--line);
  color: var(--text);
}

.list{display:flex; flex-direction:column; gap:10px}
.row{display:flex; justify-content:space-between; align-items:center; gap:10px}
.kv{display:flex; flex-direction:column; gap:4px}
.kv .k{color:var(--muted2); font-size:12px}
.kv .v{font-weight:700}

.pills{display:flex; flex-wrap:wrap; gap:8px}
.pill{
  font-size:12px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  background: rgba(255,255,255,0.04);
}
.pill.good{border-color: rgba(46,229,157,0.35); color: rgba(46,229,157,0.92); background: rgba(46,229,157,0.08)}
.pill.warn{border-color: rgba(255,204,102,0.35); color: rgba(255,204,102,0.92); background: rgba(255,204,102,0.08)}
.pill.bad{border-color: rgba(255,107,107,0.35); color: rgba(255,107,107,0.92); background: rgba(255,107,107,0.08)}

.input, select, textarea{
  width:100%;
  padding:11px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline:none;
}
textarea{min-height: 110px; resize: vertical}
label{display:block; margin: 12px 0 6px; color: var(--muted); font-size: 13px}
.formRow{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
@media (max-width: 760px){ .formRow{grid-template-columns: 1fr} }

.hr{height:1px; background: var(--line); margin: 12px 0}

.toast{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12,14,24,0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  z-index: 999;
  display:flex;
  gap:10px;
  align-items:center;
}
.toast .dot{
  width:10px;height:10px;border-radius:999px;background: var(--brand2);
  box-shadow: 0 0 0 4px rgba(46,229,157,0.16);
}

.hero{
  padding: 22px 0 10px;
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap:16px;
  align-items:stretch;
}
@media (max-width: 980px){ .hero{grid-template-columns: 1fr} }

.h1{
  font-size: 34px;
  line-height: 1.05;
  margin: 0 0 10px;
}
.sub{
  color: var(--muted);
  margin: 0 0 16px;
}
.featureGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
@media (max-width: 620px){ .featureGrid{grid-template-columns: 1fr} }
.feature{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
}
.feature h4{margin:0 0 6px; font-size: 14px}
.feature p{margin:0; color: var(--muted); font-size: 13px}

.chat{
  display:flex;
  flex-direction:column;
  gap:10px;
  height: 430px;
}
.chatLog{
  flex:1;
  overflow:auto;
  padding: 10px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.msg{
  display:flex;
  gap:10px;
  margin: 10px 0;
  align-items:flex-start;
}
.avatar{
  width:34px;height:34px;border-radius:12px;
  background: rgba(255,255,255,0.08);
  border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  font-size: 16px;
}
.bubble{
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.05);
}
.msg.me{flex-direction:row-reverse}
.msg.me .bubble{
  background: rgba(124,92,255,0.14);
  border-color: rgba(124,92,255,0.35);
}
.msg .meta{margin-top:4px; font-size: 12px; color: var(--muted2)}
.chatInput{
  display:flex;
  gap:10px;
}
.chatInput input{flex:1}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.15);
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align:left;
  font-size: 13px;
  color: var(--muted);
}
.table th{color: rgba(255,255,255,0.8); font-weight: 700}
.table tr:last-child td{border-bottom:none}
.table td strong{color: var(--text)}

.tag{
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

.kbd{
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.85);
}

.footerNote{
  margin-top: 18px;
  color: var(--muted2);
  font-size: 12px;
}



/* v3 additions: small list item + status tags */
.item{
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.item:hover{ background: rgba(255,255,255,0.06); }

.tag.ok{
  color: rgba(46,229,157,0.92);
  border-color: rgba(46,229,157,0.28);
  background: rgba(46,229,157,0.08);
}
.tag.warn{
  color: rgba(255,204,102,0.92);
  border-color: rgba(255,204,102,0.30);
  background: rgba(255,204,102,0.10);
}
.tag.danger{
  color: rgba(255,107,107,0.92);
  border-color: rgba(255,107,107,0.30);
  background: rgba(255,107,107,0.10);
}


/* v4 additions: chips, meters, mini tables (for data loop & analytics) */

.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  font-size:12.5px;
  color: var(--text);
}
.chip.warn{
  border-color: rgba(255,204,102,0.35);
  background: rgba(255,204,102,0.12);
}
.chip.ok{
  border-color: rgba(46,229,157,0.30);
  background: rgba(46,229,157,0.10);
}

.metricGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
.metric{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,0.14);
}
.metric .k{
  font-size:12px;
  color: var(--muted2);
}
.metric .v{
  font-size:16px;
  font-weight:650;
  margin-top:4px;
}

.meter{
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,0.08);
  border:1px solid var(--line);
  overflow:hidden;
}
.meter > i{
  display:block;
  height:100%;
  background: linear-gradient(90deg, rgba(124,92,255,0.95), rgba(46,229,157,0.90));
  width:50%;
}

.miniTable{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.miniTable th,
.miniTable td{
  padding:8px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
}
.miniTable th{
  color: var(--muted2);
  font-weight:650;
}

@media (max-width: 1080px){
  .metricGrid{ grid-template-columns: 1fr; }
}


/* v5 additions: review (SRS) UI */
.reviewPrompt{
  margin-top: 6px;
  font-weight: 700;
  color: rgba(255,255,255,0.86);
}

.choiceGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top: 12px;
}
@media (min-width: 760px){
  .choiceGrid{ grid-template-columns: 1fr 1fr; }
}

.choiceBtn{
  text-align:left;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
  font-weight: 650;
  transition: transform 0.06s ease, background 0.18s ease, border 0.18s ease;
}
.choiceBtn:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.choiceBtn:active{ transform: translateY(1px); }
.choiceBtn:disabled{ opacity:0.88; cursor:not-allowed; }
.choiceBtn.good{
  border-color: rgba(46,229,157,0.35);
  background: rgba(46,229,157,0.10);
}
.choiceBtn.bad{
  border-color: rgba(255,107,107,0.35);
  background: rgba(255,107,107,0.10);
}

.ratingRow .btn{
  min-width: 120px;
  justify-content:center;
}
