:root {
  --bg: #111827;
  --panel: #1f2937;
  --panel-2: #374151;
  --text: #f9fafb;
  --muted: #cbd5e1;
  --border: #4b5563;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100vh;
}

.sidebar {
  padding: 20px;
  border-right: 1px solid var(--border);
  background: #0f172a;
  overflow-y: auto;
}

.sidebar h1 {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.sidebar h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.subtle {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.hidden {
  display: none;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

select,
button,
input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.95rem;
}

input::placeholder {
  color: #94a3b8;
}

button {
  cursor: pointer;
}

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button:hover,
select:hover,
input:hover,
input:focus,
select:focus {
  filter: brightness(1.08);
  outline: none;
}

.field-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.graph-area {
  position: relative;
}

#cy {
  width: 100%;
  height: 100%;
  background: #f8fafc;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  flex: 0 0 16px;
}

.selection-info {
  color: var(--muted);
  line-height: 1.45;
}

.small-text,
.small-text p {
  font-size: 0.9rem;
  color: var(--muted);
}

code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 42vh;
  }
}
