:root{
  --bg:#0b0d10;
  --card:#10151b;
  --border:#222a33;
  --text:#e9eef5;
  --muted:#b7c3d6;
  --accent:#2b6cff;
  --danger:#ff4d4d;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  background:rgba(11,13,16,.9);
  backdrop-filter: blur(10px);
  z-index:10;
}

.brand{ display:flex; gap:12px; align-items:baseline; }
.logo{ font-weight:800; letter-spacing:.8px; }
.sub{ opacity:.7; font-size:14px; }

.container{ max-width:1100px; margin:0 auto; padding:18px; }
.grid{ display:grid; grid-template-columns: 420px 1fr; gap:16px; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

h1{ margin:0 0 8px; font-size:22px; }
h2{ margin:14px 0 8px; font-size:16px; }

.muted{ color:var(--muted); }
.small{ font-size:12px; margin-top:10px; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

code{
  background:#0c1117;
  border:1px solid var(--border);
  padding:2px 6px;
  border-radius:8px;
  color:var(--text);
}

.row{ display:flex; gap:10px; align-items:center; margin-top:10px; }
.prefix{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0c1117;
  color:var(--muted);
  font-weight:700;
}

.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0c1117;
  color:var(--text);
  outline:none;
}
.input:focus{ border-color:#36537a; }

.file{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0c1117;
  color:var(--muted);
}

.btn{
  background:var(--accent);
  color:white;
  border:0;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
  white-space:nowrap;
}
.btn:hover{ opacity:.92; }
.btn.secondary{ background:#223249; border:1px solid #2d405c; }

.link{
  color:var(--muted);
  text-decoration:none;
  border:1px solid var(--border);
  padding:8px 10px;
  border-radius:12px;
  background:#0c1117;
}
.link:hover{ border-color:#36537a; }

.sep{
  border:0;
  border-top:1px solid var(--border);
  margin:16px 0;
}

.out{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0c1117;
  white-space:pre-wrap;
  word-break:break-word;
}

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

.workspaceHeader{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#0c1117;
  color:var(--muted);
}
.badge.ok{ border-color:#2f6; color:#cfc; }
.badge.bad{ border-color:var(--danger); color:#ffd0d0; }

.chat{ display:flex; flex-direction:column; min-height:70vh; }
.messages{
  flex:1;
  border-radius:14px;
  border:1px solid var(--border);
  background:#0c1117;
  padding:12px;
  overflow:auto;
}
.msg{
  padding:10px 12px;
  border-radius:14px;
  margin:8px 0;
  max-width:88%;
  white-space:pre-wrap;
  line-height:1.4;
}
.msg.user{ background:#20304a; margin-left:auto; }
.msg.assistant{ background:#16202c; }

.composer{ display:flex; gap:10px; margin-top:12px; }

.footer{
  padding:16px 18px;
  border-top:1px solid var(--border);
  opacity:.7;
  font-size:13px;
  text-align:center;
}

@media (max-width: 980px){
  .grid{ grid-template-columns:1fr; }
  .chat{ min-height:55vh; }
}
