:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#111b27;
  --text:#e9eef6;
  --muted:#9aa7b6;
  --line:#1e2a3a;
  --accent:#7dd3fc;
  --accent2:#a78bfa;
  --danger:#fb7185;
  --ok:#34d399;
  --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;
  font-family:var(--sans);
  background: radial-gradient(1200px 600px at 20% 0%, #122034 0%, var(--bg) 55%);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(17,27,39,.92), rgba(11,15,20,.92));
  position:sticky;
  top:0;
  backdrop-filter: blur(10px);
  z-index:10;
}

.brand{display:flex; align-items:center; gap:10px}
.logo{
  width:44px;height:44px;border-radius:12px;
  background:linear-gradient(135deg, rgba(125,211,252,.20), rgba(167,139,250,.18));
  border:1px solid rgba(125,211,252,.25);
  display:flex;align-items:center;justify-content:center;
  font-weight:800; letter-spacing:1px;
}
.title{font-size:18px; font-weight:700; opacity:.95}
.pill{
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
  background:rgba(17,27,39,.35);
}

.actions{display:flex; gap:10px; align-items:center}

.grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:14px;
  padding:14px;
  max-width:1200px;
  margin:0 auto;
}

.panel{
  background:linear-gradient(180deg, rgba(17,27,39,.75), rgba(15,22,32,.75));
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.panel.wide{min-height: 70vh}

.panelTitle{
  font-weight:800;
  letter-spacing:.2px;
  margin-bottom:12px;
}
.panelTitle.small{margin-top:10px; font-size:12px; color:var(--muted); font-weight:700}

.row{display:flex; flex-direction:column; gap:6px; margin-bottom:10px}
label{font-size:12px; color:var(--muted); font-weight:700}
input,select,textarea{
  width:100%;
  background: rgba(11,15,20,.55);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
textarea{resize:vertical}

.split{display:flex; gap:10px; align-items:center}
.miniInput{width:90px}

.btn{
  border:1px solid var(--line);
  background: rgba(17,27,39,.45);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{border-color: rgba(125,211,252,.35)}
.btn.primary{
  background: linear-gradient(135deg, rgba(125,211,252,.20), rgba(167,139,250,.18));
  border-color: rgba(125,211,252,.30);
}
.btn.ghost{background: transparent}
.btn.small{padding:8px 10px; font-size:12px}

.status{
  margin-top:10px;
  padding:10px;
  border-radius:12px;
  border:1px dashed rgba(154,167,182,.25);
  color:var(--muted);
  font-size:12px;
}

.pillRow{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  background: rgba(11,15,20,.50);
  border:1px solid var(--line);
  color:var(--text);
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.chip:hover{border-color: rgba(167,139,250,.35)}

.tabs{display:flex; gap:8px; margin-bottom:12px}
.tab{
  border:1px solid var(--line);
  background: rgba(11,15,20,.45);
  color:var(--muted);
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
}
.tab.active{
  color:var(--text);
  border-color: rgba(125,211,252,.35);
  background: rgba(17,27,39,.55);
}

.tabBody{display:none}
.tabBody.active{display:block}

.chatLog{
  height:52vh;
  overflow:auto;
  padding:12px;
  border:1px solid var(--line);
  background: rgba(11,15,20,.45);
  border-radius:14px;
}

.msg{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(30,42,58,.55);
  margin-bottom:10px;
  white-space: pre-wrap;
}
.msg.user{
  background: rgba(125,211,252,.10);
  border-color: rgba(125,211,252,.18);
}
.msg.assistant{
  background: rgba(167,139,250,.08);
  border-color: rgba(167,139,250,.16);
}
.msg.meta{
  background: rgba(52,211,153,.08);
  border-color: rgba(52,211,153,.16);
  color: var(--muted);
}

.chatBar{
  display:flex;
  gap:10px;
  margin-top:10px;
}
.chatBar textarea{flex:1}

.cards{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
  margin-bottom:10px;
}
.card{
  border:1px solid var(--line);
  background: rgba(11,15,20,.45);
  border-radius:14px;
  padding:12px;
}
.cardTitle{font-size:12px; color:var(--muted); font-weight:800; margin-bottom:6px}
.big{font-size:16px; font-weight:900}
.mono{font-family:var(--mono); font-size:12px; color:var(--muted)}

.pre{
  border:1px solid var(--line);
  background: rgba(11,15,20,.45);
  border-radius:14px;
  padding:12px;
  overflow:auto;
  min-height: 220px;
  font-family:var(--mono);
  font-size:12px;
  color: var(--text);
}
