:root {
  --bg: #0f1419;
  --fg: #e6e1cf;
  --muted: #8a9199;
  --card: #14191f;
  --border: #1e252e;
  --primary: #5ccfe6;
  --error: #ff6666;
  --critical: #ff3b3b;
  --high: #ff9933;
  --medium: #ffcc66;
  --low: #99cc99;
  --queued: #8a9199;
  --running: #ffcc66;
  --done: #99cc99;
  --err: #ff6666;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
}
a { color: var(--primary); }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: 0.01em;
  padding: 0.4rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: 6px;
  transition: color 120ms ease;
}
header .brand:hover { color: var(--primary); }
header .brand-logo {
  height: 28px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
header .brand-name {
  line-height: 1;
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--border);
}
header .brand:hover .brand-name { color: var(--fg); }

header .nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}
header .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
}
header .nav-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}
header .nav-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
}
form.inline { display: inline; }
main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.2rem;
}
.card.narrow { max-width: 420px; margin-inline: auto; margin-top: 3rem; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
h1, h2 { margin-top: 0; }
h4 { margin: 1.1rem 0 0.4rem; color: var(--muted); font-weight: 500; }
label { display: block; margin-bottom: 0.8rem; }
input, button, .button {
  font: inherit;
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
input[type=text], input[type=password] { width: 100%; margin-top: 0.2rem; }
button, .button {
  background: var(--primary);
  color: #0f1419;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.link { background: none; color: var(--muted); font-weight: normal; padding: 0; border: 0; cursor: pointer; }
button.link:hover { color: var(--fg); text-decoration: underline; }
input[type=file] { padding: 0.3rem; }
table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 0.9em; }
code {
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--primary);
}
.muted { color: var(--muted); }
.error { color: var(--error); }
pre.error { background: #1a1010; padding: 0.8rem; border-radius: 4px; white-space: pre-wrap; overflow-x: auto; }
.status {
  padding: 0.15em 0.55em;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
}
.status-queued { background: var(--queued); color: #0f1419; }
.status-running { background: var(--running); color: #0f1419; }
.status-done    { background: var(--done); color: #0f1419; }
.status-error   { background: var(--err); color: #0f1419; }
.pill {
  padding: 0.1em 0.55em;
  border-radius: 10px;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
}
.pill-critical { background: var(--critical); color: white; }
.pill-high     { background: var(--high); color: #0f1419; }
.pill-medium   { background: var(--medium); color: #0f1419; }
.pill-low      { background: var(--low); color: #0f1419; }
.themes { padding-left: 1.3rem; }
.themes li { margin-bottom: 0.5rem; }
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 {
  margin: 0;
  font-size: 0.98em;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.chart-card .chart-sub {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.82em;
  color: var(--muted);
  min-height: 1.1em;
}
.chart-wrap {
  position: relative;
  height: 260px;
  flex: 1;
  min-height: 0;
}
.chart-card canvas {
  width: 100% !important;
  height: 100% !important;
}
.chart-card.wide .chart-wrap { height: 300px; }
details { margin-bottom: 1.2rem; border: 1px solid var(--border); border-radius: 5px; padding: 0.75rem 1rem; }
details summary { cursor: pointer; font-size: 1.05em; margin: -0.25rem -0.5rem 0; padding: 0.25rem 0.5rem; }
details summary strong { color: var(--primary); }
details[open] > summary { margin-bottom: 0.5rem; }
.proposal ul { margin: 0.3rem 0 0.8rem 1.2rem; padding: 0; }
.proposal ul li { margin-bottom: 0.35rem; }

header .nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 0.85rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 6px;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
}
header .nav-link:hover { color: var(--fg); background: rgba(255, 255, 255, 0.04); }
header .nav-link.is-active { color: var(--fg); }
header .nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

header .account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem;
  text-decoration: none;
  color: var(--fg);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
}
header .account-chip:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--border); }
header .account-chip.is-active { background: rgba(92, 207, 230, 0.08); border-color: rgba(92, 207, 230, 0.35); }
header .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3340 0%, #3a4555 100%);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
header .account-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}
header .account-name { font-size: 0.92rem; font-weight: 500; }

button.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
button.btn-ghost:hover {
  color: var(--fg);
  border-color: #3a3030;
  background: rgba(255, 102, 102, 0.06);
}

.login-card { text-align: center; padding-top: 2rem; }
.login-card form { text-align: left; margin-top: 1rem; }
.login-logo {
  display: block;
  width: 88px;
  height: auto;
  margin: 0 auto 0.8rem;
}
.login-subtitle {
  margin: 0 0 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}
.login-card h1 { margin-top: 0.2rem; }

.section-heading {
  margin: 2rem 0 0.8rem;
  font-size: 1.3em;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Agent accents — used by both help tiles and the per-proposal sections */
.accent-blue   { --accent: #5ccfe6; }
.accent-purple { --accent: #c792ea; }
.accent-green  { --accent: #7fd962; }
.accent-orange { --accent: #ffae57; }
.accent-red    { --accent: #ff8078; }
.accent-teal   { --accent: #6ad9c4; }

/* Action plan */
.plan-notes { margin: 0.5rem 0 1rem; }
.plan-notes h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.3rem; }
.plan-notes ul { margin: 0 0 0 1.2rem; padding: 0; font-size: 0.92em; color: var(--muted); }

.plan-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr));
  margin-top: 0.8rem;
}
.plan-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem 0.8rem;
}
.plan-item.plan-priority-critical { border-left-color: var(--critical); }
.plan-item.plan-priority-high     { border-left-color: var(--high); }
.plan-item.plan-priority-medium   { border-left-color: var(--medium); }
.plan-item.plan-priority-low      { border-left-color: var(--low); }

.plan-item-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.plan-item-head h3 {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
  font-size: 1.02rem;
  line-height: 1.35;
}
.plan-effort { color: var(--muted); font-size: 0.82rem; }
.plan-problem { margin: 0 0 0.55rem; font-size: 0.95em; }
.plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.plan-item h4 {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.plan-criteria {
  margin: 0 0 0.4rem 1.1rem;
  padding: 0;
  font-size: 0.92em;
}
.plan-criteria li { margin-bottom: 0.25rem; }
.plan-deps { margin: 0.3rem 0; font-size: 0.88em; color: var(--muted); }
.plan-labels { margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.plan-labels .label {
  display: inline-block;
  padding: 0.15em 0.55em;
  font-size: 0.72rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Upload dropzone ---------- */
.dropzone {
  display: block;
  cursor: pointer;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
  background: rgba(255, 255, 255, 0.015);
}
.dropzone:hover { border-color: var(--primary); background: rgba(92, 207, 230, 0.04); }
.dropzone.dz-dragover {
  border-color: var(--primary);
  border-style: solid;
  background: rgba(92, 207, 230, 0.08);
}
.dropzone.dz-has-file { border-style: solid; border-color: #3d5840; background: rgba(127, 217, 98, 0.05); }
.dropzone.dz-error { border-color: #8a3030; background: rgba(255, 102, 102, 0.06); }
.dz-icon { color: var(--muted); margin-bottom: 0.6rem; }
.dropzone:hover .dz-icon { color: var(--primary); }
.dz-title { font-size: 1rem; color: var(--fg); margin-bottom: 0.35rem; }
.dz-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.dz-hint { font-size: 0.85rem; }

.dz-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: rgba(127, 217, 98, 0.12);
  border: 1px solid rgba(127, 217, 98, 0.4);
  color: #b8e8a4;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}
.file-pill svg { color: #7fd962; flex: 0 0 auto; }
.file-pill-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.file-pill-size { font-size: 0.82em; margin-left: 0.2rem; }

.upload-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}
button.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none !important;
}

/* ---------- Jobs table ---------- */
.jobs-table th.numeric, .jobs-table td.numeric { text-align: right; }
.jobs-table tr.job-row { cursor: pointer; transition: background 120ms ease; }
.jobs-table tr.job-row:hover { background: rgba(255, 255, 255, 0.03); }
.jobs-table tr.job-row:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.jobs-table a.file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}
.jobs-table a.file-link:hover { color: var(--primary); }
.jobs-table a.file-link svg { color: var(--muted); flex: 0 0 auto; }
.jobs-table a.file-link:hover svg { color: var(--primary); }
.jobs-table .file-name {
  max-width: 26rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jobs-table .id-code { font-size: 0.8em; color: var(--muted); background: transparent; }

.me-pill {
  display: inline-block;
  padding: 0.15em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(92, 207, 230, 0.12);
  color: var(--primary);
  border: 1px solid rgba(92, 207, 230, 0.35);
  border-radius: 999px;
}

.status-pulsing { display: inline-flex; align-items: center; gap: 0.4rem; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--running);
  box-shadow: 0 0 0 0 var(--running);
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(255, 204, 102, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 204, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 204, 102, 0); }
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  color: var(--muted);
}
.empty-state svg { color: var(--border); margin-bottom: 0.6rem; }
.empty-state p { margin: 0.3rem 0; }
.empty-state strong { color: var(--fg); font-size: 1rem; }

/* Agents-in-this-run and help grids */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.8rem;
}
.agent-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--primary));
  border-radius: 6px;
  padding: 0.9rem 1rem;
}
.agent-tile h3 {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 1.05em;
}
.agent-tile .agent-role {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85em;
}
.agent-tile .agent-domain {
  margin: 0 0 0.4rem;
  font-size: 0.9em;
}
.agent-tile .agent-lens {
  margin: 0.3rem 0 0.5rem;
  font-size: 0.92em;
}
.agent-tile details { margin: 0.5rem 0 0; padding: 0.3rem 0; border: 0; }
.agent-tile details summary {
  cursor: pointer;
  font-size: 0.88em;
  color: var(--muted);
  padding: 0;
  margin: 0;
}
.agent-tile details ul { margin: 0.4rem 0 0 1.1rem; padding: 0; font-size: 0.88em; }
.agent-tile details ul li { margin-bottom: 0.2rem; }

/* Per-agent proposal sections */
.agent-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent, var(--primary));
  border-radius: 8px;
  padding: 0;
  margin-bottom: 1.8rem;
  overflow: hidden;
}
.agent-section .agent-header {
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--border);
}
.agent-section .agent-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.agent-section .agent-header h2 {
  margin: 0;
  color: var(--accent);
}
.agent-section .agent-tag {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8em;
  color: var(--muted);
  background: var(--bg);
  padding: 0.15em 0.55em;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.agent-section .agent-role {
  margin: 0.4rem 0 0.2rem;
  color: var(--fg);
  font-weight: 500;
  font-size: 0.95em;
}
.agent-section .agent-lens {
  margin: 0.2rem 0 0.3rem;
  color: var(--muted);
  font-style: italic;
}
.agent-section .agent-body { padding: 0.8rem 1.3rem 1.3rem; }
.agent-section .agent-body h3 {
  margin: 1.1rem 0 0.35rem;
  font-size: 1em;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.agent-section .agent-body h3:first-child { margin-top: 0.2rem; }
.agent-section .agent-body ul {
  margin: 0.3rem 0 0.6rem 1.2rem;
  padding: 0;
}
.agent-section .agent-body ul li { margin-bottom: 0.4rem; }
.agent-section .rec-table {
  margin-top: 0.4rem;
  font-size: 0.93em;
}
.agent-section .rec-table td { vertical-align: top; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; }
.small { font-size: 0.86em; }

/* Progress / stage */
.stage-line { margin: 0 0 0.8rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.stage-badge {
  padding: 0.15em 0.6em;
  border-radius: 14px;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--border);
}
.stage-badge.stage-ingest     { color: var(--muted); }
.stage-badge.stage-proposals  { color: #5ccfe6; border-color: #5ccfe6; }
.stage-badge.stage-roundtable { color: #ffae57; border-color: #ffae57; }
.stage-badge.stage-consensus  { color: #c792ea; border-color: #c792ea; }
.stage-badge.stage-themes     { color: #7fd962; border-color: #7fd962; }
.stage-badge.stage-executive  { color: #ffcc66; border-color: #ffcc66; }
.stage-badge.stage-rendering  { color: var(--muted); }
.stage-badge.stage-done       { color: #7fd962; border-color: #7fd962; background: rgba(127,217,98,0.1); }

/* Executive summary card — top-of-page, amber accent */
.exec-card {
  border-left: 5px solid #ffcc66;
  background: linear-gradient(180deg, rgba(255,204,102,0.04) 0%, var(--card) 40%);
}
.exec-card.exec-critical { border-left-color: #ff3b3b; background: linear-gradient(180deg, rgba(255,59,59,0.06) 0%, var(--card) 40%); }
.exec-card.exec-elevated { border-left-color: #ff9933; }
.exec-card.exec-managed  { border-left-color: #ffcc66; }
.exec-card.exec-healthy  { border-left-color: #7fd962; background: linear-gradient(180deg, rgba(127,217,98,0.04) 0%, var(--card) 40%); }

.exec-head { margin-bottom: 1.1rem; }
.exec-headline {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.exec-label {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}
.exec-lead {
  margin: 0;
  font-size: 1.15em;
  line-height: 1.5;
  font-weight: 500;
  color: var(--fg);
}

.posture-badge {
  padding: 0.22em 0.7em;
  border-radius: 14px;
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.posture-badge.posture-critical { background: #ff3b3b; color: white; }
.posture-badge.posture-elevated { background: #ff9933; color: #0f1419; }
.posture-badge.posture-managed  { background: #ffcc66; color: #0f1419; }
.posture-badge.posture-healthy  { background: #7fd962; color: #0f1419; }

.exec-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.2rem;
}
.exec-metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}
.exec-metric-value {
  font-size: 1.55em;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
}
.exec-metric-label {
  margin-top: 0.2rem;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.exec-metric-context { margin-top: 0.3rem; }

.exec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.2rem;
  margin-top: 0.6rem;
}
.exec-col h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.exec-col.exec-risks h3 { color: #ff9e9e; }
.exec-col.exec-investments h3 { color: #7fd962; }
.exec-list { list-style: none; padding: 0; margin: 0; }
.exec-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.exec-list li:last-child { border-bottom: 0; }
.exec-item-title {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.likelihood {
  padding: 0.1em 0.55em;
  border-radius: 10px;
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.likelihood-low    { background: rgba(127,217,98,0.2); color: #7fd962; }
.likelihood-medium { background: rgba(255,204,102,0.25); color: #ffcc66; }
.likelihood-high   { background: rgba(255,59,59,0.22); color: #ff6666; }
.inv-badge {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78em;
  padding: 0.08em 0.5em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--primary);
  font-weight: 600;
}

.exec-asks {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  background: rgba(92, 207, 230, 0.06);
  border-left: 3px solid var(--primary);
}
.exec-asks h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 600;
}
.exec-asks ul { margin: 0; padding-left: 1.2rem; }
.exec-asks li { margin-bottom: 0.3rem; }

.progress-table { margin-top: 0.4rem; }
.progress-table td, .progress-table th { padding: 0.4rem 0.6rem; }
.progress-table td:nth-child(1) { width: 22%; }
.progress-table td:nth-child(2), .progress-table td:nth-child(3) { width: 18%; }

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.45em;
  vertical-align: middle;
  background: var(--muted);
}
.dot-pending { background: #3a4048; }
.dot-running {
  background: #ffae57;
  box-shadow: 0 0 0 0 rgba(255,174,87,0.7);
  animation: dot-pulse 1.3s ease-out infinite;
}
.dot-done   { background: #7fd962; }
.dot-error  { background: #ff6666; }
@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,174,87,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(255,174,87,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,174,87,0); }
}

/* Roundtable / consensus */
.rec-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.rec-col { padding: 0.8rem 1rem; border-radius: 6px; border: 1px solid var(--border); }
.rec-col h3 { margin-top: 0; font-size: 0.95em; text-transform: uppercase; letter-spacing: 0.03em; }
.rec-col.strengthened { background: rgba(127,217,98,0.06); border-left: 3px solid #7fd962; }
.rec-col.strengthened h3 { color: #7fd962; }
.rec-col.weakened { background: rgba(255,102,102,0.06); border-left: 3px solid #ff6666; }
.rec-col.weakened h3 { color: #ff9e9e; }
.list-dis li { margin-bottom: 0.6rem; }
.list-net li { margin-bottom: 0.5rem; font-weight: 500; }

.peer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
}
.peer-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--primary));
  border-radius: 6px;
  padding: 0.9rem 1rem;
}
.peer-card-head { display: flex; align-items: baseline; gap: 0.6rem; }
.peer-card-head h3 { margin: 0; color: var(--accent); font-size: 1.05em; }
.peer-review { margin-top: 0.6rem; padding: 0.5rem 0.7rem; }
.peer-review summary { font-size: 0.95em; }
.peer-review h4 {
  margin: 0.6rem 0 0.25rem;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.peer-review ul { margin: 0.2rem 0 0.4rem 1.1rem; padding: 0; font-size: 0.92em; }
.peer-review ul li { margin-bottom: 0.3rem; }
.peer-review p { margin: 0.4rem 0; font-size: 0.92em; }
.label-strong { color: #7fd962; }
.label-weak   { color: #ff9e9e; }

/* User control panel */
.notice {
  color: #7fd962;
  background: #102015;
  border: 1px solid #2a4a30;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
}
.role-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22em 0.7em;
  border-radius: 999px;
  vertical-align: middle;
  line-height: 1;
}
.role-tag.role-admin { background: #4a2a55; color: #f5cdfa; border: 1px solid #7a4a8a; }
.role-tag.role-user  { background: #1f3450; color: #b4d6ff; border: 1px solid #3f6390; }
/* user management table */
.hidden { display: none !important; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.card-header h2 { margin: 0; }

.users-table { margin-top: 0.4rem; }
.users-table td { vertical-align: middle; padding: 0.6rem 0.6rem; }
.users-table th.actions-col { text-align: right; }
.users-table .inline-form { display: inline-flex; gap: 0; margin: 0; }

.user-row.is-self { opacity: 0.72; }
.user-row.is-self:hover { opacity: 1; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.avatar.small {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3340 0%, #3a4555 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg);
  flex: 0 0 auto;
}
.user-name code { background: transparent; padding: 0; font-size: 0.95em; }

.role-cell .mode-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.actions-cell { text-align: right; }
.actions-cell .row-actions,
.actions-cell .mode-pw {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
}
.role-cell select,
.actions-cell input[type="password"] {
  padding: 0.3rem 0.5rem;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.actions-cell input[type="password"] { min-width: 14rem; }

button.btn-compact {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
button.btn-compact:hover { background: rgba(255,255,255,0.04); border-color: #3a4250; }
button.btn-compact.ghost { background: transparent; color: var(--muted); }
button.btn-compact.ghost:hover { color: var(--fg); }
button.btn-compact.danger {
  color: #ffb8b8;
  border-color: #6a2828;
}
button.btn-compact.danger:hover {
  background: rgba(255, 102, 102, 0.08);
  border-color: #8a3030;
  color: #ffd0d0;
}

/* quiet text-link style used for row actions — stays neutral until hover */
button.btn-link {
  background: transparent;
  color: var(--fg);
  border: 1px solid transparent;
  padding: 0.3rem 0.6rem;
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
button.btn-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.btn-link.danger { color: #e99; }
button.btn-link.danger:hover {
  background: rgba(255, 102, 102, 0.1);
  border-color: #7a2828;
  color: #ffd0d0;
}
.user-row:not(:hover) .row-actions .btn-link { color: var(--muted); }
.user-row:hover .row-actions .btn-link { color: var(--fg); }
.user-row:hover .row-actions .btn-link.danger { color: #ffb8b8; }

.panel-heading {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

button.btn-primary {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--primary);
  color: #0f1419;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  transition: filter 120ms ease;
}
button.btn-primary:hover { filter: brightness(1.1); }

.add-user-panel {
  background: rgba(92, 207, 230, 0.04);
  border: 1px solid rgba(92, 207, 230, 0.18);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.add-user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
}
.add-user-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1 1 12rem;
}
.add-user-form input,
.add-user-form select {
  height: 36px;
  padding: 0 0.6rem;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.2;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
}
.add-user-form select { appearance: none; padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.add-user-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* legacy — keep old .danger style for pre-existing usage */
button.danger:not(.btn-compact) {
  background: #5a1f1f;
  color: #ffb8b8;
  border: 1px solid #8a3030;
}
button.danger:not(.btn-compact):hover { background: #7a2828; }
.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 28rem;
}
.stacked-form label { display: flex; flex-direction: column; gap: 0.3rem; }
.stacked-form button { align-self: flex-start; }

