/* =====================================================================
   Actions: Roster new user, Log event, Rally promotions (/edit/roster, /edit/event, /edit/rally).
   Every class here starts with .ac-
   ===================================================================== */

/* layout: main column + side column, or two equal columns on wide screens */
.ac-split { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ac-split > .e-card + .e-card, .ac-col > .e-card + .e-card { margin-top: 0; }
.ac-col { display: grid; gap: 14px; min-width: 0; align-content: start; }
@media (min-width: 1100px) {
  .ac-split { grid-template-columns: minmax(0, 1fr) clamp(300px, 28vw, 420px); }
  .ac-split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ac-aside { position: sticky; top: calc(var(--bar-h) + 3px + 16px); }
}
@media (min-width: 1100px) and (max-width: 1299px) { .ac-split-r { grid-template-columns: minmax(0, 1fr) 300px; } }

/* step bar */
.ac-steps { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; counter-reset: none; }
.ac-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--muted); font-size: .875rem; }
.ac-steps li + li::before { content: ""; width: 26px; height: 1px; background: var(--rule-2); margin: 0 10px; }
.ac-steps .n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.ac-steps li.on { color: var(--ink); font-weight: 700; }
.ac-steps li.on .n { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 400; }
.ac-steps li.done { color: var(--sage-ink); }
.ac-steps li.done .n { background: var(--sage-wash); border-color: color-mix(in srgb, var(--sage) 55%, transparent); color: var(--sage-ink); }
/* the tick is drawn, not typed: the mono face has no check mark */
.ac-steps li.done .n { font-size: 0; }
.ac-steps li.done .n::after { content: ""; width: 9px; height: 5px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-1px) rotate(-45deg); }

.ac-count { color: var(--muted); font-weight: 500; font-size: .85rem; font-variant-numeric: tabular-nums; }
.ac-count.full { color: var(--warn); }
.ac-req { color: var(--sage-ink); font-size: .74rem; margin-left: 4px; }
.ac-under { margin-top: 8px; }
.ac-none { padding: 6px 2px; }
.ac-callout { margin-bottom: 14px; }
.ac-ul { margin: 6px 0 0; padding-left: 18px; }
.ac-av-xl { width: 72px; height: 72px; border-radius: var(--r); font-size: 1.3rem; background: var(--sage-wash); color: var(--sage-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sage) 55%, transparent); }
.ac-av-xl img { border-radius: var(--r); }

/* ---------- Roster new user ---------- */
.ac-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; min-width: 0; }
.ac-pv-text { display: grid; gap: 2px; min-width: 0; }
.ac-pv-text b { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-pv-text span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-dnr { margin-top: 14px; }
.e-hint a { color: inherit; text-decoration: underline; font-weight: 600; }
.ac-ranks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.ac-rank { position: relative; cursor: pointer; min-width: 0; }
.ac-rank input { position: absolute; opacity: 0; pointer-events: none; }
.ac-rank > span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--rule-2);
  background: var(--field); transition: border-color .12s, background .12s; }
.ac-rank b { font-family: var(--mono); font-size: 1.05rem; color: var(--ink-2); }
.ac-rank small { color: var(--muted); font-size: .78rem; line-height: 1.3; overflow-wrap: anywhere; }
.ac-rank:hover > span { border-color: color-mix(in srgb, var(--sage) 55%, transparent); }
.ac-rank input:checked + span { border-color: var(--sage); background: var(--sage-wash); box-shadow: inset 0 0 0 1px var(--sage); }
.ac-rank input:checked + span b, .ac-rank input:checked + span small { color: var(--sage-ink); }
.ac-rank input:focus-visible + span { box-shadow: 0 0 0 3px var(--sage-wash), inset 0 0 0 1px var(--sage); }
.ac-toggle { margin-top: 16px; }
.ac-ref { margin-top: 12px; }
.ac-will { margin: 0; padding-left: 18px; list-style: square; display: grid; gap: 8px; color: var(--ink-2); font-size: .9rem; line-height: 1.45; }
.ac-will b { color: var(--ink); }
.ac-will li::marker { color: var(--sage); }

/* done (shared) */
.ac-done[hidden], .ac-col[hidden] { display: none; }
.ac-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px 30px; max-width: 640px; margin: 0 auto 14px; }
.ac-done h2 { font-family: var(--serif); font-weight: 700; font-size: 1.7rem; line-height: 1.1; outline: none; overflow-wrap: anywhere; }
.ac-done-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; color: var(--ink-2); }
.ac-done-warn { text-align: left; }
.ac-done-btns { justify-content: center; margin-top: 8px; }
.ac-tick { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--r); font-size: 1.6rem; font-weight: 700;
  background: var(--sage-wash); color: var(--sage-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sage) 55%, transparent); }
.ac-done:not(.warn) .ac-tick { font-size: 0; }
.ac-done:not(.warn) .ac-tick::after { content: ""; width: 20px; height: 10px; border-left: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateY(-3px) rotate(-45deg); }
.ac-done.warn .ac-tick { background: var(--warn-wash); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }

/* ---------- Log event ---------- */
.ac-chipbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; padding: 6px; border-radius: var(--r); border: 1px solid var(--rule-2);
  background: var(--field); cursor: text; }
.ac-chipbox:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-wash); }
.ac-chipbox .e-pick { flex: 1 1 150px; min-width: 0; }
.ac-chipbox input { width: 100%; height: 34px; padding: 0 6px; border: 0; background: none; color: var(--ink); font: inherit; outline: none; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 3px; border-radius: var(--r-sm); border: 1px solid var(--rule-2);
  background: var(--well); font-size: .88rem; }
.ac-chip .e-av.xs { width: 24px; height: 24px; font-size: .62rem; }
.ac-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-chip.bad { border-color: var(--bad-line); background: var(--bad-wash); color: var(--bad); }
.ac-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--r-sm); border: 0; background: none;
  color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer; }
.ac-chip-x:hover { background: var(--bad-wash); color: var(--bad); }
.ac-note { display: grid; gap: 4px; margin-top: 6px; }
.ac-lead { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.ac-tiles .ac-tile-name b { font-family: var(--body); font-size: 1.15rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ac-tiles .e-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.ac-leadline { color: var(--ink-2); margin: -4px 0 14px; }
.ac-pts { display: grid; }
.ac-pt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); }
.ac-pt:first-child { border-top: 0; }
.ac-delta { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-delta .was { color: var(--muted); }
.ac-delta .arr, .ac-chg .arr { color: var(--muted); }
.ac-delta b { font-size: 1.05rem; }
.ac-delta .plus { color: var(--sage-ink); font-weight: 700; font-size: .82rem; padding: 1px 6px; border-radius: var(--r); background: var(--sage-wash); }

/* ---------- Rally promotions ---------- */
.ac-search { margin-bottom: 4px; }
.ac-search .e-input { width: 100%; padding-left: 36px;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center; }
.ac-rrows { display: grid; }
.ac-rrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(200px, 280px) 34px; gap: 6px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ac-rrow:last-child { border-bottom: 0; }
.ac-to { display: grid; gap: 3px; }
.ac-to span { font-size: .74rem; color: var(--muted); }
.ac-x { width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.ac-x:hover { background: var(--bad-wash); color: var(--bad); }
.ac-rhint { grid-column: 2 / -1; color: var(--warn); font-size: .82rem; font-weight: 600; }
.ac-chg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--rule); }
.ac-chg:first-of-type { border-top: 0; }
.ac-chg-main { min-width: 0; display: grid; gap: 3px; }
.ac-chg .nm { font-weight: 700; color: var(--ink); }
.ac-chg .nm:hover { color: var(--sage-ink); }
.ac-ranks-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.ac-ranks-line .from { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.ac-ranks-line b { color: var(--sage-ink); }
.ac-rtable { max-height: 560px; }
.ac-rtable tr.ac-changed td { background: var(--sage-wash); }
.ac-rtable tr.ac-changed td:first-child { box-shadow: inset 3px 0 0 var(--sage); }
.ac-rtable .e-chip { margin-left: 4px; font-size: .68rem; padding: 0 6px; }

@media (max-width: 640px) {
  .ac-preview .ac-pv-text b { font-size: 1.25rem; }
  .ac-ranks { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .ac-steps li { font-size: .8125rem; }
  .ac-steps li + li::before { width: 12px; margin: 0 6px; }
  .ac-pt { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ac-pt .e-chip { grid-column: 2; grid-row: 2; justify-self: start; }
  .ac-pt .ac-delta { grid-column: 3; grid-row: 1 / 3; }
  .ac-rrow { grid-template-columns: auto minmax(0, 1fr) auto 34px; }
  .ac-rrow .ac-to { grid-column: 1 / -1; grid-row: 2; }
  .ac-rrow .ac-x { grid-column: 4; grid-row: 1; }
  .ac-rhint { grid-column: 1 / -1; }
  .ac-done { padding: 28px 14px 24px; }
}

/* The public site's .sub has a top margin; not inside these lists. */
.ac-pts .sub, .ac-rrow .sub, .ac-search .sub, .ac-rtable .sub, .ac-chipbox .sub, .ac-lead .sub { margin-top: 0; }
.e-card-title + .ac-chg { border-top: 0; }
.ac-clrs { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ac-col > .e-card-title, section.ac-col .e-card-title { flex-wrap: wrap; }
[data-seg] { flex-wrap: nowrap; }
@media (max-width: 640px) {
  .ac-chg { grid-template-columns: auto minmax(0, 1fr); }
  .ac-chg > .e-chip { grid-column: 2; justify-self: start; }
  .ac-rtable .e-table th, .ac-rtable .e-table td { padding: 8px 7px; }
}

/* Event type (Log event) */
.ac-type { margin-bottom: 14px; }
.ac-type-seg { max-width: 100%; }
.ac-type-seg button { padding: 8px 14px; }
.ac-type-seg button:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.ac-type-other { margin-top: 12px; max-width: 420px; }
/* Admin override (more co-hosts and attendees) */
.ac-over { margin-bottom: 14px; padding: 10px 14px; border: 1px dashed var(--rule-2); border-radius: var(--r); }
.ac-over-sw { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.ac-over-sw span { display: grid; gap: 1px; min-width: 0; }
.ac-over-sw small { color: var(--muted); font-size: .8rem; }
.ac-over:has(.adm-switch:checked) { border-style: solid; border-color: var(--warn-line); background: var(--warn-wash); }
.ac-more { margin-top: 12px; }

/* Undo right after saving (kit.offerUndo) */
.e-undo { position: fixed; left: 50%; bottom: 24px; z-index: 130; display: flex; align-items: center; gap: 6px 12px; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 18px; border-radius: var(--r-sm); background: var(--toast-bg); color: var(--toast-ink); font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow); transform: translate(-50%, 16px); opacity: 0; transition: opacity .2s, transform .2s; }
.e-undo.show { opacity: 1; transform: translate(-50%, 0); }
.e-undo.err { background: var(--bad-solid); color: #fff; border-radius: var(--r); }
.e-undo-t { min-width: 0; }
.e-undo-b { border: 0; border-radius: var(--r-sm); padding: 6px 14px; background: var(--toast-ink); color: var(--toast-bg); font: inherit; cursor: pointer; white-space: nowrap; }
.e-undo-b:hover { background: var(--toast-ink); }
.e-undo-b:disabled { opacity: .7; cursor: default; }
.e-undo-x { border: 0; background: none; color: inherit; font-size: 1.2rem; line-height: 1; width: 28px; height: 28px; border-radius: var(--r-sm); cursor: pointer; opacity: .7; }
.e-undo-x:hover { opacity: 1; background: rgba(0, 0, 0, 0.08); }
@media (prefers-reduced-motion: reduce) { .e-undo { transition: none; } }
