:root {
  --bg: #0f172a;
  --card-bg: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --border: #e2e8f0;
  --success: #16a34a;
  --error: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  color: var(--text);
}

.topbar {
  background: var(--bg);
  padding: 16px 24px;
}

.brand {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
}

.container {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 16px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

h1 { font-size: 22px; margin-top: 0; }
h2 { font-size: 17px; margin-top: 0; }

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 16px 0 6px;
}

textarea, input[type="text"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.file-input {
  width: 100%;
  padding: 8px 0;
  font-size: 14px;
  font-family: inherit;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

button:hover { opacity: 0.9; }

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.copy-btn {
  background: #eef2ff;
  color: var(--accent);
  font-weight: 500;
  padding: 6px 12px;
  margin: 0;
}

.button-row { display: flex; gap: 12px; align-items: center; }

.danger-btn {
  background: #fee2e2;
  color: var(--error);
}

.danger-zone { border-color: #fecaca; }

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.drafts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.drafts-table th, .drafts-table td {
  text-align: left;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--muted);
}

.status-klaar_om_te_plakken { background: #fef3c7; color: #92400e; }
.status-gepubliceerd { background: #dcfce7; color: var(--success); }

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.hooks-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hooks-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.flashes { margin-bottom: 16px; }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}

.flash-error { background: #fee2e2; color: var(--error); }
.flash-success { background: #dcfce7; color: var(--success); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin: 0 0 -2px 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn:hover { color: var(--text); opacity: 1; }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Image prompt box ── */
.image-prompt-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-secondary {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 16px;
  background: #eef2ff;
  color: var(--accent);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.btn-secondary:hover { opacity: 0.85; }

.secondary-link {
  display: inline-block;
  padding: 9px 0;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

/* ── Reply variants ── */
.variants-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.variant-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.variant-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 8px;
}

.variant-text {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px 0;
  white-space: pre-wrap;
}
