/* Defines the application's visual system and responsive layout. */
:root {
  --bg: #160923;
  --surface: #1e1030;
  --border: #2a1545;
  --accent: #bfffa2;
  --lilac: #d28eff;
  --purple: #6d2d93;
  --text: #f0eaff;
  --text-secondary: #9b7ec8;
  /* 3.17:1 on --bg; decorative only, never normal-sized body text. */
  --text-muted: #6d5a8a;
  --success: #bfffa2;
  --warning: #ffd98a;
  --error: #ff8a8a;
  --info: #7ec8ff;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --container-width: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--lilac);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-3);
  line-height: 1.18;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

p,
dl {
  margin: 0 0 1rem;
}

code {
  color: var(--warning);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - (2 * var(--space-4))), var(--container-width));
  min-height: 64px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
}

.brand-mark {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page {
  width: min(calc(100% - (2 * var(--space-4))), var(--container-width));
  min-height: calc(100vh - 65px);
  margin: 0 auto;
  padding: var(--space-6) 0 4rem;
  text-align: left;
}

.page--centered {
  display: grid;
  place-items: center;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.page-header h1,
.page-header p:last-child,
.panel-header h2 {
  margin-bottom: 0;
}

.secondary {
  color: var(--text-secondary);
}

.surface,
.panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.panel {
  padding: var(--space-4);
}

.panel {
  margin-bottom: var(--space-5);
}

.data-section {
  padding: 0;
  overflow: hidden;
}

.data-section > .section-header {
  margin: 0;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.panel-header,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-header h2,
.section-header p,
.section-actions .status {
  margin-bottom: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.section-link {
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.decision-team {
  display: grid;
}

.decision-team__slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.decision-team__slot:first-child {
  padding-top: 0;
  border-top: 0;
}

.decision-team__slot:last-child {
  padding-bottom: 0;
}

.decision-team__count {
  width: min(100%, 24rem);
}

.composer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.seed-readout {
  margin-right: auto;
  color: var(--text-secondary);
}

.stage-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.scenario-header {
  position: sticky;
  top: 65px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.scenario-header h1,
.scenario-header p {
  margin-bottom: 0;
}

.scenario-header h1 {
  font-size: 1.35rem;
}

.scenario-header__status {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.4rem;
  text-align: right;
}

.view-as-banner {
  position: sticky;
  top: 65px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--warning);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.view-as-banner div {
  display: grid;
  gap: var(--space-1);
}

.view-as-banner strong {
  color: var(--warning);
}

.view-as-banner form {
  flex: 0 0 auto;
}

.history-banner {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--warning);
  border-radius: 6px;
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
  color: var(--warning);
  font-weight: 700;
}

.stage-navigation {
  display: grid;
  gap: 0.75rem;
}

.stage-navigation__arrows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stage-navigation__control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-reason {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
}

.stage-step {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.stage-step:hover {
  border-color: var(--lilac);
  background: transparent;
  color: var(--text);
}

.stage-step--current,
.stage-step--current:disabled {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.stage-step--locked {
  cursor: not-allowed;
  opacity: 0.62;
}

.section-stack {
  display: grid;
  gap: var(--space-3);
}

.admin-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.admin-nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a[aria-current="page"] {
  border-color: var(--lilac);
  background: color-mix(in srgb, var(--lilac) 8%, transparent);
  color: var(--text);
}

form {
  margin: 0;
}

form.inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-row,
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.form-row {
  align-items: flex-end;
}

.form-row + .form-row {
  margin-top: 0.65rem;
}

.form-row > label,
.form-row > input,
.form-row > select {
  flex: 1 1 12rem;
}

.form-row--compact > input,
.form-row--compact > select {
  min-width: 10rem;
}

.form-stack {
  display: grid;
  gap: 0.75rem;
}

.form-actions {
  justify-content: flex-end;
}

.form-actions--with-helper {
  width: 100%;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: var(--space-3);
}

.form-actions--with-helper .form-helper {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.form-actions--with-helper button {
  flex: 0 0 auto;
}

.form-row--actions {
  justify-content: flex-end;
}

.user-row-actions {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: var(--space-2);
}

.user-row-actions > form {
  display: contents;
}

.user-row-actions > details {
  align-self: flex-start;
  margin-block: 0;
}

.user-action-button {
  box-sizing: border-box;
  margin: 0;
  width: 96px;
  min-width: 96px;
  height: 40px;
  min-height: 40px;
  padding-inline: var(--space-2);
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
}

.user-reset {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  margin-top: 0;
}

.user-reset > summary {
  list-style: none;
}

.user-reset > summary::-webkit-details-marker {
  display: none;
}

.user-reset[open] {
  min-height: 17rem;
}

.user-reset__form {
  position: absolute;
  top: calc(40px + var(--space-2));
  right: 0;
  z-index: 2;
  width: 22rem;
  margin-top: 0;
  margin-left: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.filter-bar {
  padding: var(--space-3) var(--space-4);
}

.filter-bar label {
  max-width: 34rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(12rem, 1fr)) auto;
  align-items: end;
  gap: var(--space-3);
}

.filter-grid--single {
  grid-template-columns: minmax(18rem, 1fr) auto;
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.panel-create {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.data-section > .panel-create {
  margin: 0;
  padding: var(--space-4);
}

.disclosure-action {
  display: inline-block;
  width: auto;
  text-align: left;
}

.disclosure-action > summary {
  list-style: none;
}

.disclosure-action > summary::-webkit-details-marker {
  display: none;
}

.disclosure-action[open] > form {
  width: min(100%, 24rem);
  margin-top: var(--space-3);
}

.form-actions--center {
  justify-content: center;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

legend {
  padding: 0 0.4rem;
  color: var(--text);
  font-weight: 700;
}

label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-hint {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  padding: 0.55rem 0.7rem;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

select[multiple] {
  min-height: 10rem;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--lilac);
  outline: 2px solid color-mix(in srgb, var(--lilac) 28%, transparent);
  outline-offset: 1px;
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

option:disabled {
  color: var(--text-secondary);
}

button,
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
}

button:hover,
.button:hover {
  background: var(--text);
  color: var(--bg);
}

button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--secondary {
  border-color: var(--lilac);
  background: transparent;
  color: var(--lilac);
}

.button--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text-secondary);
}

.button--danger {
  border-color: var(--error);
  background: transparent;
  color: var(--error);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cell--center {
  text-align: center;
}

.cell--numeric,
.cell--actions {
  text-align: right;
}

.cell--actions .form-row {
  justify-content: flex-end;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--lilac) 5%, transparent);
}

.table-wrap {
  overflow-x: auto;
}

.bootcamp-table {
  table-layout: fixed;
}

.bootcamp-table th:nth-child(1) {
  width: 50%;
}

.bootcamp-table th:nth-child(2) {
  width: 20%;
}

.bootcamp-table th:nth-child(3) {
  width: 30%;
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.status::before {
  content: "•";
  font-size: 1rem;
}

.status--pending {
  border-color: var(--warning);
  color: var(--warning);
}

.status--pending::before {
  content: "!";
}

.status--approved,
.status--active,
.status--se-complete {
  border-color: var(--success);
  color: var(--success);
}

.status--approved::before,
.status--active::before,
.status--se-complete::before {
  content: "✓";
}

.status--rejected,
.status--archived,
.status--disabled {
  border-color: var(--error);
  color: var(--error);
}

.status--rejected::before,
.status--archived::before,
.status--disabled::before {
  content: "×";
}

.status--closed {
  border-color: var(--lilac);
  color: var(--lilac);
}

.status--closed::before {
  content: "■";
}

.status--assigned,
.status--in-progress,
.status--info {
  border-color: var(--info);
  color: var(--info);
}

.status--assigned::before,
.status--in-progress::before,
.status--info::before {
  content: "→";
}

.approval-queue {
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
}

.approval-queue__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.approval-queue__header h2,
.approval-queue__header .secondary {
  margin-bottom: 0;
}

.record-table {
  table-layout: fixed;
}

.record-table th {
  line-height: 1.5;
  vertical-align: bottom;
  white-space: nowrap;
}

.record-table th,
.record-table td {
  padding-right: var(--space-4);
  padding-left: var(--space-4);
}

.record-table .column-user .table-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.approval-table {
  font-size: 0.82rem;
  line-height: 1.35;
}

.approval-table th:nth-child(1) {
  width: 11%;
}

.approval-table th:nth-child(2) {
  width: 17%;
}

.approval-table th:nth-child(3) {
  width: 9%;
}

.approval-table th:nth-child(4) {
  width: 9%;
}

.approval-table th:nth-child(5) {
  width: 7%;
}

.approval-table th:nth-child(6) {
  width: 23%;
}

.approval-table th:nth-child(7) {
  width: 9%;
}

.approval-table th:nth-child(8) {
  width: 15%;
}

.approval-table td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
}

.approval-table td:nth-child(2) strong {
  overflow-wrap: anywhere;
}

.approval-table__stage {
  color: var(--text-secondary);
  white-space: nowrap;
}

.column-duration {
  width: 9%;
  white-space: nowrap;
}

.id-short {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.table-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: color-mix(in srgb, var(--lilac) 4%, transparent);
  color: var(--lilac);
  text-decoration: none;
}

.table-link:hover,
.table-link:focus-visible {
  border-color: var(--lilac);
  background: color-mix(in srgb, var(--lilac) 10%, transparent);
  color: var(--text);
}

.submission-reason {
  max-width: 14rem;
}

.submission-reason summary {
  overflow: hidden;
  cursor: pointer;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-reason[open] summary {
  white-space: normal;
}

.submission-reason div {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.timestamp {
  white-space: nowrap;
}

.history-primary,
.history-secondary {
  display: block;
}

.history-secondary {
  margin-top: var(--space-1);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.history-disclosure {
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-disclosure::before {
  content: "▸";
  margin-right: var(--space-1);
  color: var(--lilac);
}

.history-disclosure[aria-expanded="true"]::before {
  content: "▾";
}

.history-meta-control {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.history-meta-control::after {
  content: "▸";
  margin-left: var(--space-2);
  color: var(--lilac);
}

.history-meta-control[aria-expanded="true"]::after {
  content: "▾";
}

.history-meta-control:hover {
  border-color: var(--lilac);
  background: color-mix(in srgb, var(--lilac) 6%, transparent);
  color: var(--text);
}

.history-meta-control--decision {
  padding: var(--space-1);
}

.history-disclosure:hover {
  background: transparent;
  color: var(--lilac);
}

.history-detail-row td {
  background: color-mix(in srgb, var(--lilac) 4%, var(--surface));
}

.history-detail-row p {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.stage-history-table--pending th:nth-child(1) {
  width: 18rem;
}

.stage-history-table--pending th:nth-child(2) {
  width: 11rem;
}

.stage-history-table--pending th:nth-child(3) {
  width: auto;
}

.stage-history-table--pending th:nth-child(4) {
  width: 10rem;
}

.stage-history-table--decided th:nth-child(1) {
  width: 16rem;
}

.stage-history-table--decided th:nth-child(2) {
  width: 10rem;
}

.stage-history-table--decided th:nth-child(3) {
  width: 18rem;
}

.stage-history-table--decided th:nth-child(4) {
  width: 16rem;
}

.stage-history-table--decided th:nth-child(5) {
  width: auto;
}

.assignment-table {
  table-layout: fixed;
}

.assignment-table--summary th:nth-child(1) {
  width: 25%;
}

.assignment-table--summary th:nth-child(2) {
  width: 16%;
}

.assignment-table--summary th:nth-child(3) {
  width: 8%;
}

.assignment-table--summary th:nth-child(4) {
  width: 9%;
}

.assignment-table--summary th:nth-child(5),
.assignment-table--summary th:nth-child(6) {
  width: 21%;
}

.assignment-table--full th:nth-child(1) {
  width: 18%;
}

.assignment-table--full th:nth-child(2) {
  width: 11%;
}

.assignment-table--full th:nth-child(3) {
  width: 7%;
}

.assignment-table--full th:nth-child(4) {
  width: 9%;
}

.assignment-table--full th:nth-child(5) {
  width: 11%;
}

.assignment-table--full th:nth-child(6) {
  width: 11%;
}

.assignment-table--full th:nth-child(7) {
  width: 33%;
}

.assignment-history-table th:nth-child(1) {
  width: 24%;
}

.assignment-history-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.assignment-history-table th:nth-child(2) {
  width: 17%;
}

.assignment-history-table th:nth-child(3) {
  width: 17%;
}

.assignment-history-table th:nth-child(4) {
  width: 15%;
}

.assignment-history-table th:nth-child(5) {
  width: 8%;
}

.assignment-history-table th:nth-child(6) {
  width: 19%;
}

.approval-table__empty {
  height: 4.5rem;
  color: var(--text-secondary);
  text-align: center;
}

.approval-row-actions,
.approval-decision-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: var(--space-2);
}

.approval-row-actions button,
.approval-decision-actions button {
  min-height: 32px;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.approval-decision-row td {
  background: color-mix(in srgb, var(--lilac) 5%, var(--surface));
}

.approval-decision-form {
  display: flex;
  width: 100%;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.approval-decision-form label {
  flex: 1 1 28rem;
  min-width: 0;
}

.approval-decision-form input[name="note"] {
  width: 100%;
}

.approval-decision-label {
  display: block;
  margin-bottom: var(--space-1);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.pagination [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.alert {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--info);
  border-radius: 6px;
  background: color-mix(in srgb, var(--info) 7%, var(--surface));
  color: var(--text);
}

.alert--error {
  border-color: var(--error);
  background: color-mix(in srgb, var(--error) 7%, var(--surface));
}

.alert--warning {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
}

.constraint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
}

.constraint {
  border-left: 3px solid var(--lilac);
  background: color-mix(in srgb, var(--lilac) 8%, var(--surface));
  padding: 0.4rem 0.55rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.content-section {
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}

.stage {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 1rem;
}

.content-section:first-child {
  border-top: 0;
}

.content-section dt {
  color: var(--lilac);
  font-weight: 700;
}

.content-section dd {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}

.empty-state {
  margin: 0;
  padding: var(--space-6);
  text-align: center;
  color: var(--text-secondary);
}

.auth-card {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  width: min(100%, 620px);
  max-width: 620px;
  margin: auto;
  padding: var(--space-6);
  text-align: center;
}

.auth-card > p,
.auth-card > .alert,
.auth-card form {
  width: min(100%, 440px);
}

.auth-card label {
  text-align: left;
}

details {
  margin-top: 0.75rem;
}

summary {
  color: var(--lilac);
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 900px) {
  .grid--2,
  .grid--3,
  .decision-team__slot,
  .filter-grid,
  .filter-grid--single {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: flex-start;
  }

  .page-header,
  .section-header,
  .approval-queue__header,
  .site-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .site-nav {
    padding: 0.8rem 0;
  }

  .scenario-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .scenario-header__status {
    align-items: flex-start;
    text-align: left;
  }

  .stage-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
