/* Staged event co-hosts */
.event-cohosts-editor {
  scroll-margin-top: 6rem;
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-top: 2px solid rgba(16, 16, 16, 0.16);
  border-bottom: 2px solid rgba(16, 16, 16, 0.16);
}

.event-cohosts-editor--empty {
  gap: 0;
  padding: 0;
  border: 0;
}

.wf-event-page .event-cohosts-editor { gap: 10px; padding-block: 0; border: 0; }
.wf-event-page .event-cohosts-editor [data-proposal-finances]:empty { display: none; }
.wf-event-page .event-cohosts-editor [data-own-finances] { margin-top: 0; }
.wf-event-page .event-cohosts-editor [data-finances-total] { margin-block: 0; }

.event-cohosts-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.event-cohosts-editor--empty .event-cohosts-header {
  justify-content: flex-start;
}

.event-cohosts-editor--empty .event-cohosts-header > div,
.event-cohosts-editor--empty .event-cohosts-empty,
.event-cohosts-editor--empty .event-cohosts-list {
  display: none;
}

.wf-pill-btn.event-section-add,
.event-cohost-form-actions .wf-secondary-btn,
.event-cohost-row-body .wf-secondary-btn {
  width: auto;
  min-height: 40px;
  margin: 0;
  white-space: nowrap;
}

.event-cohosts-empty {
  color: color-mix(in srgb, var(--ink) 66%, white);
  font-size: 0.9rem;
  font-weight: 700;
}

.event-cohosts-list {
  display: grid;
  gap: 0.5rem;
}

.event-cohost-card {
  scroll-margin-top: 6rem;
  border: 2px solid rgba(16, 16, 16, 0.18);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 88%, var(--lav));
}

.event-cohost-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.event-cohost-row > summary::-webkit-details-marker {
  display: none;
}

.event-cohost-summary-main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.event-cohost-summary-main strong,
.event-cohost-summary-main span {
  overflow-wrap: anywhere;
}

.event-cohost-summary-main span,
.event-cohost-summary-detail {
  color: color-mix(in srgb, var(--ink) 66%, white);
  font-size: 0.82rem;
  font-weight: 800;
}

.event-cohost-toggle {
  align-self: center;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 900;
  justify-self: end;
  line-height: 1;
  text-align: center;
  width: 1.5rem;
}

.event-cohost-toggle::before {
  content: "+";
}

.event-cohost-row[open] > summary .event-cohost-toggle::before {
  content: "-";
}

.event-cohost-row-body,
.event-cohost-form-grid {
  display: grid;
  gap: 0.65rem;
  padding: 0 0.75rem 0.75rem;
}

.event-cohost-form-grid [hidden] {
  display: none !important;
}

.event-cohost-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.event-cohost-contact-header > .label {
  margin: 0;
}

.event-cohost-form-grid input[type="tel"] {
  margin-block: 0;
}

.event-cohost-form-grid .contactListSingleImport {
  justify-self: start;
  min-height: 24px;
  margin: 0;
}

.event-cohost-contact-header > .event-cohost-contact-switch {
  width: auto;
  min-height: 28px;
  margin: 0;
  padding: 3px 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.event-cohost-contact-switch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.event-cohost-permissions {
  display: grid;
  gap: .65rem;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
  padding: .65rem .75rem;
  border-top: 1px solid #d8d5ce;
}

.event-cohost-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-cohost-delete-action { padding: 0 .75rem .75rem; }
.event-cohost-delete-action .wf-danger-btn { box-sizing: border-box; width: 100%; min-height: 40px; margin: 0; }
.event-cohost-row:not([open]) ~ .event-cohost-delete-action { display: none; }

@media (max-width: 600px) {
  .event-cohosts-header,
  .event-cohost-form-actions {
    display: grid;
  }

  .wf-pill-btn.event-section-add,
  .event-cohost-form-actions .wf-secondary-btn,
  .event-cohost-row-body .wf-secondary-btn {
    width: 100%;
  }

  .event-cohost-row > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.event-cohost-finances {
  border-top: 1px solid #d4d0df;
  padding: 12px 0;
}
.event-cohost-finances > summary {
  cursor: pointer;
  font-weight: 600;
}
.event-cohost-finance-body { display: grid; gap: 12px; margin-top: 14px; }
.event-cohost-finance-body .field { margin: 0; }
.event-cohost-minimum-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.event-cohost-minimum-row > .field { min-width: 0; flex: 0 1 130px; }
.event-cohost-finance-field { display: flex; align-items: center; gap: 12px; margin: 0; min-width: 0; }
.event-cohost-minimum-field { flex: 1 1 230px; }
.event-cohost-finance-input { display: block; position: relative; flex: 0 1 148px; min-width: 0; }
.event-cohost-percent-field .event-cohost-finance-input { flex-basis: 120px; }
.event-cohost-finance-symbol { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.event-cohost-finance-input--prefix .event-cohost-finance-symbol { left: 0.75rem; }
.event-cohost-finance-input--suffix .event-cohost-finance-symbol { right: 0.75rem; }
#event-cohosts .event-cohost-finance-input--prefix input[type="number"] { padding-left: 1.75rem; }
#event-cohosts .event-cohost-finance-input--suffix input[type="number"] { padding-right: 2rem; }
.event-builder .event-cohost-finance-input input[type="number"] { appearance: textfield; margin: 0; }
.event-cohost-finance-input input::-webkit-inner-spin-button,
.event-cohost-finance-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.event-builder .event-cohost-finance-body input { min-width: 0; }
.event-cohost-finance-body select { min-width: 80px; }
.event-cohosts-editor [hidden] { display: none !important; }
.event-finances-error { color: #a12b35; font-weight: 600; }
[data-own-finances] { margin-top: 16px; }


/* The same contact and payout form is mounted in both live editors. */
.wf-event-page .event-cohosts-editor {
  font: 600 .95rem/1.4 var(--org-font, "Manrope", ui-sans-serif, system-ui, sans-serif);
  color: var(--ink);
}
.wf-event-page .event-cohosts-editor .field {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: .3rem;
  margin: 0 0 .1rem;
}
.wf-event-page .event-cohosts-editor .label { margin: 0; font: inherit; color: var(--ink); }
.wf-event-page .event-cohosts-editor :is(input[type="tel"], input[type="text"], input[type="email"], input[type="number"], select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: .5rem .65rem;
  border: var(--border) solid var(--ink);
  border-radius: var(--r);
  background-color: var(--paper);
  color: var(--org-text, #373c44);
  font: inherit;
}
.wf-event-page .event-cohosts-editor :is(input, select):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--org-accent, var(--lav));
}
.wf-event-page .event-cohost-permissions .switch-row {
  display: flex; align-items: center; gap: .5rem; margin: 0 0 .25rem;
  font-weight: 400; cursor: pointer;
}
.wf-event-page .event-cohost-permissions .switch-row:has(:disabled) { opacity: .7; cursor: default; }
.wf-event-page .event-cohost-row > summary .event-cohost-toggle::before {
  content: ""; display: inline-block; width: 16px; height: 16px;
  background: currentColor; mask: var(--wf-event-pencil);
}
