:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #844869;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
main {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px 24px;
}
.wide-main {
  max-width: 1420px;
}
.participant-logo-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.participant-logo {
  width: 180px;
  max-width: 38vw;
  height: auto;
}
.title-with-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.title-with-logo h1 {
  margin: 0;
}
.inline-logo {
  width: 180px;
  max-width: 36vw;
  height: auto;
}
section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}
h1, h2 { margin-top: 0; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.mono-input-label input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.2px;
}
input {
  background: #020617;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
}
select {
  background: #020617;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  width: 100%;
}
textarea {
  background: #020617;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  resize: vertical;
}
button, .button-link {
  margin-top: 12px;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.button-link.disabled {
  pointer-events: none;
  opacity: 0.45;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.inline-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.inline-option select {
  width: auto;
  padding: 6px 8px;
  font-size: 12px;
}
.inline-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
}
.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.danger-btn {
  background: #7f1d1d;
}
.signout-btn {
  background: #7f1d1d;
}
.muted, .note {
  color: var(--muted);
  font-size: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 14px;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dense-table {
  min-width: 1320px;
  width: max-content;
  table-layout: fixed;
}
.dense-table th,
.dense-table td {
  font-size: 12px;
  padding: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.dense-table.comfortable-table th,
.dense-table.comfortable-table td {
  font-size: 13px;
  padding: 10px;
}
.dense-table.wrap-table {
  width: 100%;
  min-width: 1320px;
}
.dense-table.wrap-table th,
.dense-table.wrap-table td {
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  max-width: none;
}

.dense-table th.actions-cell,
.dense-table td.actions-cell {
  overflow: visible;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 8px;
  font-size: 13px;
}
pre {
  white-space: pre-wrap;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
}
.small-btn {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
}

.small-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.row-actions {
  position: relative;
  display: inline-flex;
}

.actions-toggle-btn {
  min-width: 28px;
  padding: 4px 8px;
  line-height: 1;
  font-size: 16px;
}

.actions-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 132px;
  padding: 8px;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.dense-table tbody tr:last-child .actions-menu,
.dense-table tbody tr:nth-last-child(2) .actions-menu {
  top: auto;
  bottom: calc(100% + 2px);
}

.actions-menu .small-btn {
  width: 100%;
  text-align: left;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.banner {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 14px;
  border: 1px solid var(--border);
}
.banner.success {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #d1fae5;
}
.banner.error {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  color: #fee2e2;
}
.collapsible-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.25);
}
.collapsible-card summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  list-style: none;
}
.collapsible-card summary::-webkit-details-marker {
  display: none;
}
.collapsible-card summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}
.collapsible-card[open] summary::before {
  transform: rotate(90deg);
}
.collapsible-card > :not(summary) {
  margin-top: 12px;
}
.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(960px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.modal-pre {
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
