:root {
  --bg: #0e1116;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --primary: #2ea043;
  --primary-hover: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.topnav {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topnav .brand { font-weight: 600; color: var(--text); text-decoration: none; }
.topnav a { color: var(--text); text-decoration: none; }
.topnav a:hover { color: var(--primary-hover); }
.topnav .spacer { flex: 1; }
.tenant-pill { background: var(--line); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.queue-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.queue-header h1 { margin: 0; font-size: 22px; }
.muted { color: var(--muted); }
/* Default for inline copy/breadcrumb anchors inside paragraphs — without
   this they fall back to the browser's purple-on-dark, which is unreadable.
   Anchors that are themselves .muted (e.g. the source URL list items)
   keep their subdued style. */
.container p a:not(.muted),
.muted > a:not(.muted) { color: var(--primary); }
.container p a:not(.muted):hover,
.muted > a:not(.muted):hover { color: var(--primary-hover); }
a.muted:hover { color: var(--text); }
.grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px;
}
.card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.badge { background: var(--line); padding: 2px 8px; border-radius: 4px; }
.badge-bluesky { background: #0a83fb33; }
.badge-x { background: #ffffff15; }
.badge-linkedin { background: #0072b133; }
.badge-instagram { background: #e1306c33; }
.alignment { font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.alignment-good { background: var(--primary); color: #001 }
.alignment-ok { background: var(--warn); color: #221; }
.alignment-bad { background: var(--danger); color: #fff; }
.body-form textarea {
  width: 100%; background: #0d1117; color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; padding: 8px; font: inherit;
  resize: vertical;
}
.char-count { color: var(--muted); font-size: 12px; margin: 4px 0; }
.btn {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--line); color: var(--text); cursor: pointer; font: inherit;
}
.btn:hover { background: #21262d; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.link { background: transparent; border: none; padding: 0; color: var(--text); cursor: pointer; }
.card-actions { display: flex; gap: 8px; margin-top: 8px; }
.inline { display: inline; }
.flags { color: var(--warn); margin: 8px 0; padding-left: 20px; }
.source { font-size: 12px; color: var(--muted); margin: 8px 0; }
.source a { color: var(--muted); }

/* Auth pages */
.login-card {
  max-width: 360px; margin: 60px auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 24px;
}
.login-card h1 { margin: 0 0 16px; font-size: 20px; }
.login-card label { display: block; margin-bottom: 14px; }
.login-card label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.login-card input {
  width: 100%; padding: 8px; background: #0d1117; color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; font: inherit;
}
.login-card .btn { width: 100%; padding: 8px; }
.login-card .small { font-size: 12px; margin-top: 16px; }
.form-error { background: var(--danger); color: white; padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }

/* Tenant picker */
.tenant-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.tenant-list a {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.tenant-list a:hover { border-color: var(--primary); transform: translateY(-1px); }
.tenant-name { font-size: 18px; font-weight: 600; }
.tenant-slug { font-family: ui-monospace, monospace; color: var(--muted); font-size: 13px; }
.tenant-role {
  background: var(--line); padding: 4px 10px; border-radius: 999px;
  font-size: 12px; color: var(--text);
}

/* Dashboard */
.dashboard-header { margin-bottom: 24px; }
.dashboard-header h1 { font-size: 28px; margin: 0 0 4px; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.stat-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: var(--text);
}
a.stat-card:hover { border-color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; margin: 4px 0; }
.stat-foot { font-size: 12px; color: var(--muted); }
.dashboard-actions h2 { font-size: 16px; margin: 0 0 12px; }
.action-list { list-style: none; padding: 0; display: grid; gap: 8px; max-width: 480px; }
.action-list a {
  display: block; padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); text-decoration: none;
}
.action-list a:hover { border-color: var(--primary); }

/* Onboarding wizard */
.wizard-checklist {
  list-style: none; padding: 0; margin: 24px 0;
  display: grid; gap: 12px;
}
.wizard-checklist > li {
  /* The <a> (or the inline finish row) is the actual grid container; the li
     just provides the card chrome. */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s;
  overflow: hidden;
}
.wizard-checklist > li:has(> a:hover) { border-color: var(--primary); }
.wizard-checklist > li.done {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(46, 160, 67, 0.04), transparent), var(--panel);
}
.wizard-checklist > li > a,
.wizard-checklist > li > .step-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  color: var(--text);
  text-decoration: none;
}
.wizard-checklist .step-num {
  background: var(--line); border-radius: 999px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.wizard-checklist .done .step-num {
  background: var(--primary); color: #001;
}
.wizard-checklist .step-body { display: flex; flex-direction: column; gap: 2px; }
.wizard-checklist .step-title { font-weight: 600; font-size: 15px; }
.wizard-checklist .step-sub { color: var(--muted); font-size: 13px; }
.wizard-checklist .step-status { color: var(--muted); font-size: 13px; }
.wizard-checklist .done .step-status { color: var(--primary); font-weight: 600; }

.wizard-form { max-width: 680px; }
.wizard-form .form-row { margin-bottom: 18px; }
.wizard-form .form-row-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
}
.wizard-form label { display: block; }
.wizard-form label span {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; line-height: 1.3;
}
.wizard-form label span small { font-weight: normal; }
.wizard-form input[type="text"],
.wizard-form input[type="url"],
.wizard-form select,
.wizard-form textarea {
  width: 100%; padding: 8px;
  background: #0d1117; color: var(--text);
  border: 1px solid var(--line); border-radius: 4px;
  font: inherit;
}
.wizard-form input[type="color"] {
  width: 100%; height: 40px;
  background: #0d1117; border: 1px solid var(--line);
  border-radius: 4px; padding: 2px;
}
.wizard-form textarea { resize: vertical; font-family: ui-monospace, monospace; font-size: 13px; }
.wizard-form .form-actions {
  display: flex; gap: 8px; margin-top: 24px;
  padding-top: 16px; border-top: 1px solid var(--line);
}

.source-list { margin: 24px 0; }
.source-list h2 { font-size: 16px; margin: 0 0 12px; }
.source-list ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.source-list li {
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.small { font-size: 12px; }
