:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #101621;
  --panel-2: #151d2b;
  --line: #263448;
  --text: #eef4ff;
  --muted: #9fb0c5;
  --accent: #9bc6ff;
  --danger: #ffb4b4;
  --ok: #adf0c7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #142032, var(--bg) 40%);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #213048, #172236);
  color: var(--text);
  border-radius: 12px;
  padding: 0.72rem 0.95rem;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #080d15;
  color: var(--text);
  border-radius: 12px;
  padding: 0.8rem;
  outline: none;
}
textarea { resize: vertical; }
.app-shell { display: grid; grid-template-columns: 310px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.92);
  padding: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand-block { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.4rem; }
.brand-mark {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #111c2b;
  color: var(--accent);
  font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.45rem; margin-bottom: 0; }
h2 { font-size: 1.55rem; margin-bottom: 0; }
h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; margin-bottom: 0.2rem; }
.nav-list { display: grid; gap: 0.45rem; margin-bottom: 1.25rem; }
.nav-list a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav-list a:hover, .nav-list a.active { color: var(--text); border-color: var(--line); background: #111923; }
.auth-card {
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: var(--panel);
}
.auth-card label { color: var(--muted); font-size: 0.8rem; }
.microcopy { color: var(--muted); font-size: 0.76rem; margin-bottom: 0; line-height: 1.45; }
.workspace { padding: 1.25rem; overflow-x: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.status-strip { display: flex; gap: 0.55rem; flex-wrap: wrap; justify-content: flex-end; }
.status-strip span { border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.7rem; color: var(--muted); background: #0b111b; font-size: 0.8rem; }
.status-strip span[data-status="ok"] { color: var(--ok); border-color: rgba(173,240,199,0.35); }
.status-strip span[data-status="error"] { color: var(--danger); border-color: rgba(255,180,180,0.35); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.dashboard-grid { grid-template-columns: 1.2fr 0.8fr 0.8fr; }
.span-2 { grid-column: span 2; }
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 27, 40, 0.96), rgba(12, 17, 26, 0.96));
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 0 20px 70px rgba(0,0,0,0.2);
}
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.85rem; }
.mode-row { display: flex; gap: 0.55rem; align-items: center; }
.mode-row select { min-width: 170px; }
.command-panel { margin-bottom: 1rem; }
.command-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0; }
.output-block {
  margin: 0.8rem 0 0;
  min-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  background: #05080d;
  color: #dce8fa;
  border-radius: 14px;
  padding: 0.85rem;
  line-height: 1.45;
}
.output-block.compact { min-height: 120px; max-height: 320px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.model-card { border: 1px solid var(--line); border-radius: 16px; padding: 0.85rem; background: var(--panel-2); }
.model-card h4 { margin: 0 0 0.4rem; }
.model-card p { color: var(--muted); margin: 0.2rem 0; font-size: 0.86rem; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .dashboard-grid, .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
}


.operator-card {
  border-left: 3px solid rgba(170, 209, 255, 0.65);
}
.output-block.compact {
  max-height: 420px;
  overflow: auto;
}
.status-strip span[data-status="ok"] {
  box-shadow: 0 0 0 1px rgba(90, 255, 170, 0.18) inset;
}
