:root {
  --bg: #14151a;
  --panel: #1c1e24;
  --panel-raised: #21232a;
  --border: #2a2d35;
  --text: #ededea;
  --text-muted: #8b8e98;
  --accent-live: #e3402a;
  --accent-done: #3f9c8b;
  --accent-review: #e3a23d;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.app {
  display: flex;
  min-height: 100vh;
}

.rail {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-mark {
  font-weight: 700;
  font-size: 17px;
  padding: 0 12px 20px;
  color: var(--text);
}

.rail-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}

.rail-item:hover { color: var(--text); background: var(--panel-raised); }
.rail-item.is-active { color: var(--text); background: var(--panel-raised); }

.main {
  flex: 1;
  padding: 40px 48px;
  max-width: 860px;
}

.view.is-hidden { display: none; }

.view-head { margin-bottom: 28px; }
.view-head h1 { margin: 0 0 6px; font-size: 24px; }
.view-sub { margin: 0; color: var(--text-muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.generate-form {
  display: grid;
  grid-template-columns: 2fr 2fr 80px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 28px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; color: var(--text-muted); }
.field-narrow { max-width: 80px; }

input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
}
input:focus { outline: 2px solid var(--accent-review); outline-offset: -1px; }

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--accent-live); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-connect { margin-bottom: 24px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel-raised); }

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card.status-new { border-left-color: var(--accent-review); }
.card.status-approved { border-left-color: var(--accent-done); }
.card.status-rejected { opacity: 0.5; }
.card.status-posted { border-left-color: var(--accent-done); }
.card.status-failed { border-left-color: var(--accent-live); }
.card.status-queued { border-left-color: var(--accent-review); }

.card-body { min-width: 0; }
.card-hook { font-weight: 600; margin: 0 0 4px; }
.card-desc { margin: 0; color: var(--text-muted); font-size: 14px; white-space: pre-line; }
.card-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}

.empty-state {
  color: var(--text-muted);
  padding: 32px 0;
  text-align: center;
}

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .rail { width: 100%; flex-direction: row; overflow-x: auto; }
  .main { padding: 24px; }
  .generate-form { grid-template-columns: 1fr; }
}
