.admin-bar .section-heading {
  align-items: center;
}

.admin-bar .section-heading p:last-child {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.event-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #343241;
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62);
}

.event-dialog::backdrop,
.slot-dialog::backdrop,
.action-dialog::backdrop {
  background: rgba(3, 3, 7, .82);
  backdrop-filter: blur(4px);
}

.action-dialog {
  width: min(480px, calc(100% - 28px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #343241;
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62);
}

.action-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.action-dialog-heading h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.action-dialog-message {
  margin: 0;
  padding: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.text-dialog-body {
  display: grid;
  gap: 17px;
  padding: 22px;
}

.text-dialog-body > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.text-dialog-body label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.text-dialog-body input,
.text-dialog-body textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  color: var(--text);
  background: #0d0d13;
  border: 1px solid #393746;
  border-radius: 7px;
  outline: none;
}

.email-dialog {
  width: min(650px, calc(100% - 28px));
}

.message-history-dialog {
  width: min(760px, calc(100% - 28px));
}

.message-history-list {
  display: grid;
  gap: 12px;
  max-height: min(600px, 60vh);
  overflow-y: auto;
  padding: 22px;
}

.message-history-item {
  padding: 14px;
  background: #101017;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.message-history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.message-history-subject {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 15px;
}

.message-history-body {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-history-error {
  margin: 10px 0 0;
  color: #ff9dad;
  font-size: 12px;
}

.message-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.text-dialog-body textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.5;
}

.text-dialog-body input:focus,
.text-dialog-body textarea:focus {
  border-color: var(--purple2);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .13);
}

.action-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  background: #0f0f16;
  border-top: 1px solid var(--line);
}

.danger-button {
  color: #fff;
  background: #be3650;
}

.danger-button:hover {
  background: #a92d45;
}

.event-dialog form {
  display: flex;
  max-height: min(860px, calc(100vh - 28px));
  flex-direction: column;
}

.admin-dialog-heading {
  align-items: flex-start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.admin-dialog-heading h2 {
  margin: 5px 0 4px;
  font-size: 25px;
}

.admin-dialog-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 24px;
  background: #0f0f16;
  border-bottom: 1px solid var(--line);
}

.wizard-progress button {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  color: #888493;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.wizard-progress button span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: #23222c;
  border-radius: 50%;
  font-size: 11px;
}

.wizard-progress button.active {
  color: var(--text);
  border-bottom-color: var(--purple);
}

.wizard-progress button.active span {
  color: #fff;
  background: var(--purple);
}

.wizard-body {
  min-height: 370px;
  padding: 24px;
  overflow-y: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.event-dialog label,
.event-dialog legend {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.event-dialog label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.event-dialog input,
.event-dialog select,
.event-dialog textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  color: var(--text);
  background: #0d0d13;
  border: 1px solid #393746;
  border-radius: 7px;
  outline: none;
}

.event-dialog textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.5;
}

.event-dialog input:hover,
.event-dialog select:hover,
.event-dialog textarea:hover {
  border-color: #4b485a;
}

.event-dialog input:focus,
.event-dialog select:focus,
.event-dialog textarea:focus {
  border-color: var(--purple2);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .13);
}

.form-help {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.choice-group {
  display: grid;
  gap: 9px;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid #393746;
  border-radius: 8px;
}

.segmented-control label {
  display: block;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented-control span {
  min-height: 43px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #15151d;
  font-size: 13px;
  font-weight: 800;
}

.segmented-control label + label span {
  border-left: 1px solid #393746;
}

.segmented-control input:checked + span {
  color: #fff;
  background: var(--purple);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid #c4b5fd;
  outline-offset: -3px;
}

#invite-code-field,
#max-slots-field {
  margin-top: 14px;
}

.wizard-footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #0f0f16;
  border-top: 1px solid var(--line);
}

.wizard-footer > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.wizard-footer > div {
  display: flex;
  gap: 8px;
}

.event-heading-copy {
  min-width: 0;
}

.event-kicker,
.event-labels,
.event-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.event-status,
.event-label {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  color: #b8b4c2;
  background: #20202a;
  border: 1px solid #343342;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.event-status.status-open,
.event-status.status-live {
  color: var(--success);
  border-color: rgba(126, 226, 168, .28);
}

.event-status.status-draft {
  color: var(--warning);
  border-color: rgba(244, 200, 106, .3);
}

.event-summary {
  margin: 7px 0 0;
  color: #ddd9e5;
  line-height: 1.45;
}

.event-labels {
  margin-top: 11px;
}

.host-label {
  color: var(--purple2);
}

.event-header-actions {
  flex-direction: column;
  align-items: flex-end;
}

.event-description {
  padding: 14px 18px;
  color: var(--muted);
  background: #101017;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.live-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
  padding: 18px;
  background: #0d0d13;
  border-bottom: 1px solid var(--line);
}

.live-player-wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #07070a;
  border: 1px solid #343342;
  border-radius: 9px;
}

.live-player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.live-player-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.live-lineup {
  display: grid;
  align-content: start;
  gap: 10px;
}

.live-lineup-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.live-lineup-card span {
  color: var(--purple2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.live-lineup-card strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.live-lineup-card small {
  color: var(--muted);
  font-size: 11px;
}

.now-card {
  background: #191326;
  border-color: #4b3670;
  box-shadow: inset 3px 0 0 var(--purple);
}

.slot:has(.slot-actions) .slot-actions {
  grid-column: 2 / -1;
}

@media (max-width: 760px) {
  .admin-bar .section-heading,
  .event-header {
    align-items: stretch;
  }

  .event-header-actions {
    flex-direction: row;
    align-items: center;
  }

  .wizard-progress {
    padding: 0 10px;
  }

  .wizard-progress button {
    font-size: 0;
  }

  .wizard-progress button span {
    font-size: 11px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .live-stage {
    grid-template-columns: 1fr;
  }

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

  .form-grid .full {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .admin-dialog-heading,
  .wizard-body,
  .wizard-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .wizard-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-footer > div,
  .wizard-footer .button {
    width: 100%;
  }

  .slot:has(.slot-actions) .slot-actions {
    grid-column: 2;
  }

  .live-lineup {
    grid-template-columns: 1fr;
  }

  .action-dialog-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .action-dialog-footer .button {
    width: 100%;
  }
}
