:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #111c2e;
  --panel2: #17243a;
  --border: #263750;
  --text: #edf3fb;
  --muted: #91a1b8;
  --accent: #7c9cff;
  --accent2: #a9bcff;
  --green: #58d6a0;
  --red: #ff8585;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(85,119,210,.17), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(100%, 420px);
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: #fff; font-weight: 800; font-size: 21px;
  background: linear-gradient(140deg,#779aff,#5269d8);
}
.brand-name { font-size: 19px; font-weight: 750; letter-spacing: -.5px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.login-card h1 { font-size: 25px; margin: 34px 0 8px; }
.muted { color: var(--muted); }
.login-card p { font-size: 14px; line-height: 1.6; }
.field-label { display: block; font-size: 13px; margin: 24px 0 9px; }
input, textarea {
  width: 100%;
  color: var(--text);
  background: #0b1525;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
input { padding: 14px; }
input:focus, textarea:focus { border-color: var(--accent); }
.primary {
  color: #fff; font-weight: 700;
  background: linear-gradient(135deg,#718ff4,#536ed2);
  border: 0; border-radius: 10px;
  padding: 13px 19px;
}
.primary:hover { filter: brightness(1.1); }
.login-card .primary { width: 100%; margin-top: 17px; }
.error { color: var(--red); font-size: 13px; margin-top: 12px; }

.app { min-height: 100vh; }
.topbar {
  height: 72px; padding: 0 5vw;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(17,28,46,.9);
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.connection { color: var(--green); font-size: 12px; }
.ghost {
  color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 13px; font-size: 13px;
}
main { width: min(1100px, 92%); margin: 54px auto 80px; }
.welcome { margin-bottom: 30px; }
.welcome h1 { font-size: clamp(25px,4vw,34px); letter-spacing: -1px; margin: 0 0 9px; }
.welcome p { margin: 0; font-size: 14px; line-height: 1.6; }
.workspace {
  display: grid; grid-template-columns: minmax(0,1fr) 300px;
  gap: 20px; align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 15px; overflow: hidden;
}
.panel-head {
  padding: 19px 21px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-body { padding: 21px; }
textarea {
  min-height: 190px; resize: vertical;
  padding: 16px; line-height: 1.65; font-size: 14px;
}
textarea::placeholder { color: #71839e; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 11px 0 18px; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.run-btn { min-width: 150px; }
.run-btn:disabled { opacity: .55; cursor: wait; }
.status-pill {
  color: var(--muted); font-size: 11px;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 10px;
}
.status-pill.active { color: var(--green); border-color: #28674f; }
.activity { margin-top: 20px; }
.activity-content {
  padding: 18px 21px; min-height: 150px;
  max-height: 540px; overflow: auto;
}
.empty { color: var(--muted); font-size: 13px; line-height: 1.7; }
.event { padding: 12px 0; border-bottom: 1px solid rgba(38,55,80,.7); }
.event:last-child { border: 0; }
.event-label { color: var(--accent2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px; }
.event-text { font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.sidebar .panel { margin-bottom: 15px; }
.side-body { padding: 18px; }
.side-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.side-copy { color: var(--muted); font-size: 12px; line-height: 1.7; }
.project-path {
  margin-top: 10px; padding: 10px;
  border-radius: 8px; background: #0b1525;
  font-family: ui-monospace, monospace; font-size: 11px;
  overflow-wrap: anywhere; color: #b5c7e4;
}
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; }
.footer { text-align: center; color: #718198; font-size: 11px; margin-top: 42px; }

@media(max-width:800px) {
  .workspace { grid-template-columns: 1fr; }
  main { margin-top: 35px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .sidebar .panel { margin: 0; }
}
@media(max-width:520px) {
  .topbar { height: 64px; padding: 0 4%; }
  .brand-name { font-size: 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .connection { display: none; }
  main { width: 92%; margin-top: 30px; }
  .panel-body { padding: 15px; }
  .panel-head { padding: 16px; }
  .sidebar { grid-template-columns: 1fr; }
  .login-card { padding: 27px; }
  .actions { align-items: stretch; flex-direction: column; }
  .run-btn { width: 100%; }
}
