/* web-narrator internal tool — minimal, clean, no brand system.
   Single stylesheet, plain CSS custom properties, no build step. */

:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-raised: #1e222b;
  --border: #2a2f3a;
  --text: #e6e8ec;
  --text-dim: #9aa1ad;
  --text-faint: #666d7a;
  --accent: #5b8cff;
  --accent-dim: #34446e;
  --ok: #3ecf8e;
  --warn: #e8b339;
  --err: #e8555f;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header.topbar {
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
header.topbar .container {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
}
header.topbar .brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
header.topbar .brand span {
  color: var(--text-faint);
  font-weight: 400;
}

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--text); }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.subtitle { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #4a78e0; text-decoration: none; }
.btn:disabled { background: var(--accent-dim); color: var(--text-faint); cursor: not-allowed; }
.btn-secondary {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #262b36; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

table.job-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.job-table th, table.job-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
table.job-table th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.job-table tr:last-child td { border-bottom: none; }
table.job-table tr:hover td { background: var(--surface-raised); }
table.job-table td.url-cell { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-SUBMITTED { background: #33394a; color: #b7bfd4; }
.badge-AGENT_LOOP_RUNNING { background: #3a3416; color: var(--warn); }
.badge-SCRIPT_REVIEW { background: #1f3a55; color: #6fb3ff; }
.badge-GENERATING { background: #3a3416; color: var(--warn); }
.badge-DELIVERED { background: #163a2b; color: var(--ok); }
.badge-FAILED { background: #3a1a1d; color: var(--err); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}

form .field { margin-bottom: 14px; }
form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
form input[type=text], form input[type=url], form textarea, form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
}
form textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
form input:focus, form textarea:focus, form select:focus {
  outline: none;
  border-color: var(--accent);
}
.hint { color: var(--text-faint); font-size: 12px; margin-top: 4px; }

.cred-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.cred-row input { flex: 1; }

.banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.banner-warn { background: #3a3416; color: var(--warn); border: 1px solid #5c5220; }
.banner-err { background: #3a1a1d; color: var(--err); border: 1px solid #5c2229; }
.banner-ok { background: #163a2b; color: var(--ok); border: 1px solid #1f5c3e; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; }

.rehearsal-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rehearsal-list { list-style: none; margin: 0; padding: 0; }
.rehearsal-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 12px;
}
.rehearsal-list li:last-child { border-bottom: none; }
.rehearsal-list .action-name { font-family: var(--mono); font-size: 12.5px; }
.rehearsal-list .settle-time { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--ok); }
.dot-err { background: var(--err); }
.dot-warn { background: var(--warn); }

.error-list { margin: 8px 0 0; padding-left: 18px; color: var(--err); font-size: 12.5px; }

video { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: #000; }

.section-gap { margin-top: 24px; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.muted { color: var(--text-faint); }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); }
