/* ==========================================================================
 * Festival Studio - drafts, publishing, duplicating, host accounts, payouts
 *
 *  1. Draft strip        st-draft-strip (Overview)
 *  2. Event status       st-details-publish (Details)
 *  3. Publish dialog     st-publish  st-publish__list / __item  st-publish-done
 *  4. Duplicate dialog   st-duplicate__lists / __head / __list
 *  5. Host accounts      st-hosts-grant  st-hosts-who (#/admin/hosts)
 *  6. Narrow screens, reduced motion
 *  7. Payouts            st-payouts-* (#/admin/payouts)
 * ========================================================================== */

/* ---------- 1. Draft strip ---------- */
.st-draft-strip {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  margin-bottom: 16px; padding: 14px 18px; border-radius: var(--st-r-12);
  background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.32);
}
.st-draft-strip[hidden] { display: none; }
.st-draft-strip__icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  color: var(--st-amber); background: rgba(251, 191, 36, 0.12);
}
.st-draft-strip__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-draft-strip__title { font-size: 14px; font-weight: 600; }
.st-draft-strip__body { font-size: 13px; line-height: 1.45; color: var(--st-text-dim); }
.st-draft-strip__actions { display: flex; gap: 8px; }

/* ---------- 2. Event status (Details) ---------- */
.st-details-publish { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 3. Publish dialog ---------- */
.st-publish__loading { display: flex; align-items: center; gap: 10px; min-height: 64px; font-size: 13.5px; color: var(--st-text-dim); }
.st-publish__list { display: flex; flex-direction: column; border: 1px solid var(--st-border); border-radius: var(--st-r-10); }
.st-publish__item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-top: 1px solid var(--st-border); }
.st-publish__item:first-child { border-top: 0; }
.st-publish__icon { display: grid; place-items: center; }
.st-publish__list--blocker .st-publish__icon { color: var(--st-red); }
.st-publish__list--warning .st-publish__icon { color: var(--st-amber); }
.st-publish__msg { font-size: 13.5px; line-height: 1.45; }
.st-publish__subhead { margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--st-text-muted); }
.st-publish__facts { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; list-style: disc; font-size: 13.5px; line-height: 1.5; color: var(--st-text-dim); }

/* The success moment: the check draws itself, six sparks fly out once. */
.st-publish-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 6px; text-align: center; }
.st-publish-done__mark { position: relative; width: 56px; height: 56px; margin-bottom: 8px; }
.st-publish-done__svg { display: block; animation: st-publish-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.st-publish-done__disc { fill: rgba(52, 211, 153, 0.14); stroke: var(--st-green); stroke-width: 2; }
.st-publish-done__tick {
  fill: none; stroke: var(--st-green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 36; animation: st-publish-draw 0.4s ease-out 0.25s both;
}
.st-publish-done__spark {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%;
  background: var(--st-lavender); opacity: 0; pointer-events: none;
  animation: st-publish-spark 0.75s ease-out calc(0.3s + var(--i) * 0.02s) both;
}
.st-publish-done__spark:nth-child(even) { width: 4px; height: 4px; margin: -2px; background: var(--st-amber); }
.st-publish-done__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.st-publish-done__text { max-width: 380px; font-size: 13.5px; line-height: 1.5; color: var(--st-text-dim); }

@keyframes st-publish-pop { from { opacity: 0; transform: scale(0.55); } }
@keyframes st-publish-draw { from { stroke-dashoffset: 36; } to { stroke-dashoffset: 0; } }
@keyframes st-publish-spark {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(-10px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-42px); }
}

/* ---------- 4. Duplicate dialog ---------- */
.st-duplicate__lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 14px; border: 1px solid var(--st-border); border-radius: var(--st-r-10); background: var(--st-bg-elev); }
/* "Not copied - set up again": the whole width, its short items in two columns. */
.st-duplicate__lists > div:nth-child(3) { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--st-border); }
.st-duplicate__lists > div:nth-child(3) .st-duplicate__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.st-duplicate__weekday { font-weight: 500; color: var(--st-text-dim); }
.st-duplicate__head { margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--st-text-muted); }
.st-duplicate__list { display: flex; flex-direction: column; gap: 4px; padding-left: 16px; list-style: disc; font-size: 13px; line-height: 1.45; color: var(--st-text-dim); }

/* ---------- 5. Host accounts ---------- */
.st-hosts-grant { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(220px, 1fr) minmax(180px, 1fr) auto; align-items: start; gap: 12px 14px; }
.st-hosts-grant__action { padding-top: 26px; }
.st-hosts-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-hosts-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 6. Narrow screens, reduced motion ---------- */
@media (max-width: 1100px) {
  .st-hosts-grant { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-hosts-grant__action { padding-top: 0; }
}
@media (max-width: 720px) {
  .st-draft-strip { grid-template-columns: auto minmax(0, 1fr); }
  .st-draft-strip__actions { grid-column: 1 / -1; }
  .st-duplicate__lists, .st-hosts-grant { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .st-publish-done__svg, .st-publish-done__tick { animation: none; }
  .st-publish-done__spark { display: none; }
}

/* ---------- 7. Payouts (#/admin/payouts, Milestone D) ---------- */
.st-payouts-event { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-payouts-event > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-payouts-terms { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.st-payouts-terms > span { white-space: nowrap; }
.st-payouts-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.st-payouts-num { display: inline-flex; flex-direction: column; align-items: flex-end; }
.st-payouts-num > span { white-space: nowrap; }
.st-payouts-neg { color: var(--st-amber); }
.st-payouts-actions { justify-content: flex-end; }
.st-payouts-percent { display: flex; align-items: center; gap: 8px; color: var(--st-text-dim); }
.st-payouts-percent .st-input { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.st-payouts-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.st-payouts-review { color: var(--st-amber); white-space: normal !important; }
/* The event's name opens its tickets drawer; it reads as the name, with a link's hover. */
.st-payouts-open { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.st-payouts-reqbadge { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 999px; }
.st-payouts-reqbadge:hover .st-badge { filter: brightness(1.2); }
/* The Refund requests tile goes to the desk. */
.st-stat--link { cursor: pointer; transition: border-color 0.15s ease; }
.st-stat--link:hover, .st-stat--link:focus-visible { border-color: var(--st-border-strong, rgba(185, 174, 255, 0.45)); }
.st-refund-req--desk .st-refund-req__ask > span:last-child { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
/* An event's drawer: its money in one line, then its paid tickets. */
.st-payouts-drawer__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13.5px; }
.st-payouts-tickets { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.st-payouts-ticket {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 14px;
  padding: 9px 12px; border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-elev);
}
.st-payouts-ticket__who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-payouts-ticket__who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-payouts-ticket__money { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.st-payouts-drawer .st-refund-req { grid-template-columns: minmax(0, 1fr); }
.st-payouts-drawer .st-refund-req__actions { justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) {
  .st-stat--link { transition: none; }
}

/* Payouts: "Set terms for an event" - pick any event, then its Payment terms. */
.st-payouts-pick { margin-top: 10px; max-height: min(56vh, 520px); overflow-y: auto; }
.st-payouts-pick__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.st-payouts-pick__list > li + li { border-top: 1px solid var(--st-border); }
.st-payouts-pick__row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 6px; border: 0; border-radius: var(--st-r-8); background: none; color: inherit; text-align: left; cursor: pointer; }
.st-payouts-pick__row:hover, .st-payouts-pick__row:focus-visible { background: rgba(255, 255, 255, 0.04); }
.st-payouts-pick__row > .st-icon { flex: 0 0 auto; color: var(--st-text-muted); }
.st-payouts-pick__text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.st-payouts-pick__title { overflow: hidden; font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
