/* SOTW standalone — visual-brain house style (ADMT-1795).
   Tokens and chrome copied from employee-brain-visualization
   frontend/src/legacy/shared.css + Layout.jsx (ADTV Indigo default).
   This is a FastAPI/Jinja app that *looks* like the portal; it is not a
   portal port. */

:root {
  --brand-primary:        #6366f1;
  --brand-light:          #818cf8;
  --brand-violet:         #a78bfa;
  --brand-pale:           #a5b4fc;
  --brand-rgb:            99, 102, 241;
  --brand-light-rgb:      129, 140, 248;

  --bg-base:              #0a0a0f;
  --bg-app:               #0f0f1e;
  --bg-app-soft:          #1a1a2e;
  --bg-app-tinted:        #1a1a3e;
  --bg-card:              rgba(255, 255, 255, 0.04);
  --bg-topbar:            rgba(15, 15, 25, 0.9);
  --bg-input:             rgba(255, 255, 255, 0.04);
  --bg-input-hover:       rgba(255, 255, 255, 0.07);
  --bg-app-radial:        radial-gradient(circle at top, #1a1a3e 0%, #0f0f1e 60%);

  --border-faint:         rgba(255, 255, 255, 0.06);
  --border-muted:         rgba(255, 255, 255, 0.08);
  --border-strong:        rgba(255, 255, 255, 0.1);
  --border-brand-faint:   rgba(99, 102, 241, 0.1);
  --border-brand:         rgba(99, 102, 241, 0.15);
  --border-brand-medium:  rgba(99, 102, 241, 0.25);
  --border-brand-strong:  rgba(99, 102, 241, 0.4);

  --text-primary:         #fff;
  --text-base:            #e5e5e5;
  --text-muted:           #ccc;
  --text-muted2:          #aaa;
  --text-quiet:           #888;
  --text-fainter:         #555;

  --status-success:       #4ade80;
  --status-warning:       #fbbf24;
  --status-danger:        #f87171;
  --status-info:          #818cf8;

  --gradient-brand:       linear-gradient(135deg, #6366f1, #818cf8);
  --gradient-avatar:      linear-gradient(135deg, #6366f1, #a78bfa);
  --shadow-brand-soft:    0 2px 12px rgba(99, 102, 241, 0.25);
  --shadow-brand:         0 4px 14px rgba(99, 102, 241, 0.35);

  --radius-xs:            4px;
  --radius-sm:            6px;
  --radius:               8px;
  --radius-md:            10px;
  --radius-lg:            12px;
  --radius-pill:          24px;

  --font-base:            "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:            "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-base);
  background: var(--bg-app-radial);
  min-height: 100vh;
}
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--text-primary); letter-spacing: -0.01em; }

/* ── Top bar (Layout.jsx / shared.css) ─────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-brand-faint);
  backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-logo {
  width: 36px; height: 36px;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-brand-soft);
}
.topbar-logo svg { width: 18px; height: 18px; color: var(--text-primary); }
.topbar-title    { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.topbar-subtitle { font-size: 11px; color: var(--text-fainter); letter-spacing: 0.05em; line-height: 1; margin-top: 2px; }
.topbar-home {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border-muted);
  color: var(--text-muted); font-size: 12px;
  text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.topbar-home:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--border-brand-medium);
  color: var(--brand-light);
  text-decoration: none;
}

/* ── Page ──────────────────────────────────────────────────────────── */
.content { max-width: 980px; margin: 28px auto 60px; padding: 0 20px; }

.page-head { margin-bottom: 22px; }
.eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted2); margin: 0 0 6px;
}
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.page-head .meta { margin-top: 8px; font-size: 13px; color: var(--text-muted2); }
.lede { margin: 14px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; max-width: 72ch; }
.lede strong { color: var(--text-primary); font-weight: 600; }

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

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-faint);
}
.panel-head h2 { font-size: 16px; font-weight: 600; }
.panel-head .meta { font-size: 12.5px; color: var(--text-muted2); }
.panel-body { padding: 14px 20px 18px; }

/* ── Table (rsn-dash) ──────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; }
table.data {
  border-collapse: collapse; width: 100%;
}
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted2); padding: 9px 12px;
  border-bottom: 1px solid var(--border-muted);
  background: rgba(255, 255, 255, 0.03); white-space: nowrap; font-weight: 600;
}
table.data td {
  padding: 11px 12px; border-bottom: 1px solid var(--border-muted);
  vertical-align: middle; font-size: 14px;
}
table.data tr:last-child td { border-bottom: none; }
table.data .sub { display: block; font-size: 12px; color: var(--text-muted2); font-weight: 400; }
.empty { font-size: 13px; color: var(--text-muted2); margin: 4px 0 12px; }

/* ── Pills ─────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-md); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.pill-active  { background: rgba(74, 222, 128, 0.12); color: var(--status-success); }
.pill-pending { background: rgba(245, 158, 11, 0.14); color: var(--status-warning); }
.pill-danger  { background: rgba(239, 68, 68, 0.14); color: var(--status-danger); }
.pill-info    { background: rgba(99, 102, 241, 0.15); color: var(--brand-light); }
.pill-inactive { background: rgba(255, 255, 255, 0.06); color: var(--text-quiet); }

/* ── Buttons + inputs ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s ease; font-family: inherit;
}
.btn-primary {
  background: var(--gradient-brand);
  color: var(--text-primary); border-color: var(--border-brand-strong);
}
.btn-primary:hover { box-shadow: var(--shadow-brand); text-decoration: none; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border-muted);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-danger { color: var(--status-danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--status-danger); }
.btn-icon {
  padding: 4px;
  line-height: 0;
  border-radius: var(--radius-sm);
}
.btn-icon svg { display: block; }
table.data th.col-remove,
table.data td.col-remove {
  width: 40px;
  text-align: center;
  padding-right: 8px;
}
.btn-link {
  background: none; border: none; color: var(--brand-light);
  cursor: pointer; font: inherit; font-size: 12px; padding: 0;
  text-decoration: underline;
}

input[type="text"], input[inputmode="numeric"], select {
  background: var(--bg-input);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text-base);
  font-size: 13px; outline: none; font-family: inherit;
}
select { min-width: 88px; }
input::placeholder { color: var(--text-quiet); }
input:focus, select:focus { border-color: var(--border-brand-strong); }
.poll-error { color: var(--status-danger); font-size: 13px; margin: 0 0 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.rcv-grid th.rcv-rank-h { text-align: center; width: 52px; }
.rcv-grid td.rcv-cell { text-align: center; padding: 8px 6px; }
.rcv-mark {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; width: 28px; height: 28px; cursor: pointer; margin: 0;
}
.rcv-mark input {
  position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0;
  cursor: pointer;
}
.rcv-box {
  width: 22px; height: 22px; border-radius: 4px;
  border: 2px solid var(--border-brand-strong);
  background: var(--bg-input);
  display: inline-flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.rcv-mark:hover .rcv-box { border-color: var(--brand-light); background: rgba(99, 102, 241, 0.12); }
.rcv-mark input:focus-visible + .rcv-box { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.55); }
.rcv-mark input:checked + .rcv-box {
  background: var(--gradient-brand);
  border-color: var(--brand-light);
}
.rcv-mark input:checked + .rcv-box::after {
  content: "";
  width: 11px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.rcv-receipt-list {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.rcv-receipt-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.18);
  border-radius: var(--radius);
}
.rcv-place {
  flex: 0 0 42px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--status-success); text-transform: uppercase;
}
.rcv-receipt-name { font-size: 15px; color: var(--text-primary); }
.rcv-receipt-name a, .rcv-receipt-name .rcv-title { color: var(--text-primary); font-weight: 600; }

.rcv-title {
  display: inline; padding: 0; margin: 0; border: 0;
  background: none; font: inherit; font-weight: 700;
  color: var(--text-primary); cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--border-brand-strong);
  text-underline-offset: 3px;
}
.rcv-title:hover { color: var(--brand-light); text-decoration-color: var(--brand-light); }

.video-modal {
  width: min(960px, calc(100vw - 32px));
  max-width: 960px;
  padding: 0;
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-lg);
  background: var(--bg-app-soft);
  color: var(--text-base);
}
.video-modal::backdrop { background: rgba(0, 0, 0, 0.65); }
.video-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-faint);
}
.video-modal-head h2 { font-size: 16px; font-weight: 600; }
.video-frame { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.rcv-winner-name {
  margin: 0; font-size: 28px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em;
}
.announce-preview {
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--border-faint); border-radius: var(--radius-lg);
  background: var(--bg-app-soft);
}
.announce-preview p { color: var(--text-base); font-size: 15px; }
.rcv-round { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rcv-round li { position: relative; }
.rcv-round-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.rcv-round-name { font-weight: 600; color: var(--text-primary); }
.rcv-round-count { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 13px; }
.rcv-bar-track {
  position: relative; height: 10px; border-radius: 99px;
  background: rgba(255,255,255,0.06); overflow: hidden; margin-bottom: 8px;
}
.rcv-bar-fill {
  display: block; height: 100%; border-radius: 99px;
  background: var(--gradient-brand);
}
.rcv-bar-majority {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: rgba(255,255,255,0.35);
}
.rcv-round li.is-winner .rcv-bar-fill { background: linear-gradient(135deg, #22c55e, #4ade80); }
.rcv-round li.is-out { opacity: 0.55; }
.rcv-round li.is-out .rcv-bar-fill { background: rgba(255,255,255,0.2); }
.rcv-round .pill { margin-top: 0; }
.rcv-score-win td { color: var(--status-success); font-weight: 600; }

.demo-steps {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; margin: 0 0 22px; padding: 0;
}
.demo-steps li {
  font-size: 12px; color: var(--text-quiet);
  padding: 6px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-faint);
}
.demo-steps li.is-on {
  color: var(--text-primary);
  border-color: var(--border-brand-strong);
  background: rgba(99, 102, 241, 0.12);
}
.demo-steps li.is-done { color: var(--status-success); border-color: rgba(74, 222, 128, 0.35); }

.slack-mock {
  background: #1a1d21;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 14px 16px 16px;
  max-width: 520px;
}
.slack-mock-meta { font-size: 12px; color: #ababad; margin-bottom: 8px; }
.slack-mock-header { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.slack-mock-body { font-size: 14px; color: #d1d2d3; line-height: 1.5; }
.slack-mock-body p { margin: 0 0 10px; }
.slack-mock-body ul { margin: 0 0 12px; padding-left: 18px; }
.slack-mock-btn {
  display: inline-block; padding: 8px 14px;
  background: #007a5a; color: #fff !important; border-radius: 4px;
  font-weight: 600; text-decoration: none !important; font-size: 13px;
}
.slack-mock-ctx { font-size: 12px; color: #ababad; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; }
.add-row { margin-top: 14px; }
.doc-status { margin-top: 14px; font-size: 13px; }
