/* =============================================================
   Guided Tournament Creation - surface styling
   Mounts on the draft event page (?create=1) as a fixed chrome panel
   that hosts the Guided wizard + the Guided⇄Free toggle, plus the
   Free-mode publish bar / inline editors.

   Uses ONLY the Ratz-GG design tokens from style.css (--accent, --bg-*,
   --border, --text-*, --green, --red, radii, shadows). No hard-coded
   colors that a variable already provides. Classes here are presentation
   only - every hook/data-attr/event lives in src/js/admin/creation/* and
   src/js/tournaments/draft-mode.js unchanged.
   ============================================================= */

/* ── 1. Chrome - centered modal ───────────────────────────────
   A dimmed full-screen overlay backdrop wrapping a centered, focused card.
   (Replaces the old far-right rail: one clear thing in the middle of the
   screen, nothing competing - dummy-proof.) */
.creation-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(24px, 5vh) 16px 24px;
    box-sizing: border-box;
    overflow-y: auto;
    background: rgba(8, 8, 11, 0.66);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: creationOverlayIn 0.18s ease;
}
@keyframes creationOverlayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.creation-chrome {
    position: relative;
    width: 540px;
    max-width: 100%;
    margin: auto;
    box-sizing: border-box;
    padding: 18px 18px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    /* Tight, less-round aesthetic: sharper card corners than the site --radius-md. */
    border-radius: 6px;
    box-shadow:
        var(--shadow-elevated),
        0 24px 70px rgba(0, 0, 0, 0.55),
        0 0 60px rgba(157, 135, 200, 0.06);
    color: var(--text);
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    animation: creationCardIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes creationCardIn {
    from {
        transform: translateY(8px) scale(0.985);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

/* Accent shine along the card's leading edge. */
.creation-chrome::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0.5;
    border-radius: 6px 0 0 6px;
    pointer-events: none;
}

/* ✕ close - quiet top-right control. */
.creation-chrome-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s;
}
.creation-chrome-close:hover {
    color: #fff;
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

/* Manual mode: the modal must not cover the page being edited. Make the overlay
   non-blocking and dock the card to the top-right so page fields stay clickable. */
.creation-overlay.is-free {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
    padding: 0;
}
.creation-overlay.is-free .creation-chrome {
    pointer-events: auto;
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: auto;
    left: auto;
    margin: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.creation-chrome-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-right: 34px; /* clear the ✕ close control */
    display: flex;
    align-items: center;
    gap: 8px;
}
.creation-chrome-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.creation-chrome-host {
    display: block;
}

/* ── 2. Orchestrator + Guided/Free toggle ─────────────────────
   A segmented control matching the site's .page-tabs / .game-filter
   pill style: a recessed track with the active mode as an accent pill. */
.creation {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* Stable host slots (index.js): content (toggle + panel) and the persistent
   progress slot. The progress window inside is position:fixed, so the slot
   itself is a zero-footprint anchor. */
.creation-content {
    display: block;
}
.creation-progress-slot {
    display: contents;
}

.mode-toggle {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    /* Sharper segmented track (was --radius-md / 12px). */
    border-radius: 6px;
}
.mode-toggle button {
    flex: 1;
    padding: 7px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.mode-toggle button:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}
.mode-toggle button.active {
    color: #fff;
    background: rgba(157, 135, 200, 0.16);
    box-shadow:
        inset 0 0 0 1px rgba(157, 135, 200, 0.22),
        0 0 12px rgba(157, 135, 200, 0.15);
    text-shadow: 0 0 8px rgba(157, 135, 200, 0.5);
}

/* One-line description of the active mode, under the toggle. */
.mode-desc {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.creation-panel {
    display: block;
    margin-top: 4px;
}

/* Manual-Builder note pointing the organizer at the live editable page. */
.creation-free-note {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--accent-soft);
    border: 1px solid var(--border-hover);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

/* Synthesized editable cells (the event-page fields the page didn't tag) the
   Manual Builder surfaces so the WHOLE page is editable in place. */
.creation-free-extra {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.free-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.free-field-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.free-field {
    display: block;
    min-height: 36px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    cursor: text;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
.free-field:hover {
    border-color: var(--border-hover);
}
.free-field:empty::before {
    content: "Click to edit";
    color: var(--text-muted);
}

/* Real, always-visible config controls in the Manual Builder panel - a dropdown
   for enumerated fields, a box for text/number - instead of a click-to-edit
   placeholder. */
.free-control {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
.free-control:hover {
    border-color: var(--border-hover);
}
.free-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
select.free-control {
    cursor: pointer;
    color-scheme: dark;
    appearance: auto;
}
select.free-control option {
    background: #16161b;
    color: var(--text);
}
textarea.free-control {
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
}

/* Optional link/integration fields (Discord invite, Twitch/stream link) - a
   button that shows the set/unset state and reveals an input on click. */
.free-linkctl {
    display: block;
}
.free-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    min-height: 36px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s,
        background 0.2s;
}
.free-link-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}
.free-link-btn.is-set {
    color: var(--accent, #9d87c8);
    border-color: var(--accent, #9d87c8);
    background: rgba(157, 135, 200, 0.1);
}
.free-link-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.free-link-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.free-link-input[hidden] {
    display: none;
}

/* Real event-page boxes turned click-to-edit in owner-draft Manual mode. The
   [data-edit-field] attribute is applied ONLY in DRAFT + owner mode
   (draft-mode.js applyDraftOwnerMode), and the `creation-editing` class is on
   the edited region ONLY while Manual Builder is the active mode (index.js), so
   public viewers and Assisted mode never get this affordance. Synthesized
   .free-field cells have their own styling above, so exclude them here.

   The persistent dashed outline is what tells the organizer these fields are
   editable: with a pre-seeded draft nothing glows (all required filled), so a
   hover-only cue read as "nothing is editable". */
.creation-editing [data-edit-field]:not(.free-field) {
    cursor: pointer;
    outline: 1px dashed var(--border-hover);
    outline-offset: 2px;
    border-radius: 4px;
    transition:
        outline-color 0.15s,
        background 0.15s,
        box-shadow 0.15s;
}
.creation-editing [data-edit-field]:not(.free-field):hover {
    outline-color: var(--accent);
    background: var(--accent-soft);
}
/* Filled / edited - a calm solid violet-green outline so a set field reads as
   "done", visibly distinct from the dashed "still editable" default and the
   amber "empty required" glow. (refreshGlow toggles .is-set on any filled cell.) */
.creation-editing [data-edit-field].is-set:not(.glow):not(.free-field) {
    outline-style: solid;
    outline-color: rgba(126, 199, 165, 0.6);
    box-shadow: inset 0 0 0 1px rgba(126, 199, 165, 0.12);
}
/* An empty editable cell otherwise collapses to a zero-width inline box, so only
   the floating outline/glow shows - a tiny "yellow square" with no real hit area
   to click. Give empty INLINE cells (the banner pills: name, mode, region, start,
   max players) a clearly-clickable box + a prompt, mirroring the .free-field cells.
   The long-form BLOCK fields (description, rules) stay full-width block - they were
   never the tiny-square problem - and just get a min-height + prompt. */
.creation-editing
    [data-edit-field]:not(.free-field):empty:not(#eventDescription):not(
        #eventRules
    ),
.creation-editing
    [data-edit-field].glow:not(.free-field):not(#eventDescription):not(
        #eventRules
    ) {
    display: inline-block;
    min-width: 130px;
    min-height: 36px;
    padding: 6px 10px;
    box-sizing: border-box;
    vertical-align: middle;
}
.creation-editing #eventDescription:not(.free-field):empty,
.creation-editing #eventRules:not(.free-field):empty {
    min-height: 44px;
    padding: 8px 12px;
}
.creation-editing [data-edit-field]:not(.free-field):empty::before {
    content: "Click to edit";
    color: var(--text-muted);
    font-size: 13px;
    line-height: 22px;
}
/* Editable value inside a prominent banner-stat tile (event.html editTile). */
.ebs-edit {
    display: inline-block;
}

/* Click-to-set action chips (Watch Stream / Join Discord) in owner-draft mode.
   They reuse the page's .btn chip styling; the inline editor swaps the label
   span for an input, then restores the icon + relabels on commit. */
.event-chip-edit {
    cursor: pointer;
}
.event-chip-edit .inline-edit-input {
    min-width: 180px;
}

/* Editable single-line draft fields placed in their natural home (prize-card
   distribution line, Bracket-format chooser). Empty state shows a prompt. */
.draft-edit-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}
.draft-edit-line {
    display: block;
    min-height: 24px;
    font-size: 14px;
    color: var(--text);
}
.creation-editing .draft-edit-line:empty::before,
.creation-editing #eventDescription:empty::before {
    content: attr(data-empty);
    color: var(--text-muted);
    font-style: italic;
}
.creation-editing #eventDescription:empty::before {
    content: "Click to add tournament info";
}

/* ── 3. Wizard ────────────────────────────────────────────────
   Stepper = a progress rail; current = accent pill, done = green ✓,
   upcoming = muted. Mirrors phase-rail.js's .phase-step spirit. */
.wiz {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Stepper rail */
.wiz-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.wiz-step {
    position: relative;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.wiz-step:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.06);
}
.wiz-step.done {
    color: var(--green);
    background: var(--green-soft);
}
.wiz-step.done::before {
    content: "✓";
    margin-right: 5px;
    font-weight: 800;
}
.wiz-step.current {
    color: #fff;
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 2px 10px var(--accent-glow);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.wiz-step.current:hover {
    filter: brightness(1.08);
}
/* Locked future step - the forced-linear gate. Not yet reachable, so it reads
   as inert (no hover lift, no pointer) until its run-up is complete. */
.wiz-step:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}
.wiz-step:disabled:hover {
    color: var(--text-muted);
    border-color: transparent;
    background: rgba(255, 255, 255, 0.02);
}
.wiz-step:disabled::before {
    content: "🔒";
    margin-right: 5px;
    font-size: 9px;
}

/* "Step X of Y" counter under the stepper. */
.wiz-counter {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: -6px 0 2px;
}

/* Step panel - one labeled control per field. */
.wiz-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wiz-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* Checkbox fields read better as a single inline row. */
.wiz-field:has(.wiz-input[type="checkbox"]) {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.wiz-field-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Inputs - the site's labeled-input look (matches .form-input/.form-select). */
.wiz-input {
    width: 100%;
    padding: 9px 13px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}
.wiz-input::placeholder {
    color: var(--text-muted);
}
.wiz-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: rgba(157, 135, 200, 0.03);
}

/* Multi-day schedule editor: a stack of {label, datetime, remove} rows + an add
   button. The label input flexes; the datetime + remove stay their natural size. */
.wiz-schedule { display: flex; flex-direction: column; gap: 8px; }
.wiz-schedule-list { display: flex; flex-direction: column; gap: 8px; }
.wiz-schedule-row { display: flex; gap: 8px; align-items: center; }
.wiz-schedule-row .wiz-schedule-label { flex: 1 1 auto; min-width: 0; }
.wiz-schedule-row .wiz-schedule-when { flex: 0 0 auto; width: auto; }
.wiz-schedule-del {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.wiz-schedule-del:hover { border-color: var(--red, #f87171); color: var(--red, #f87171); }
.wiz-schedule-add {
    align-self: flex-start;
    padding: 7px 13px;
    background: rgba(157, 135, 200, 0.08);
    border: 1px dashed var(--accent, #9D87C8);
    border-radius: 4px;
    color: var(--accent, #9D87C8);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.wiz-schedule-add:hover { background: rgba(157, 135, 200, 0.16); }

/* Select - paint our own caret + dark popup, like .form-select. */
select.wiz-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%239B95A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    accent-color: var(--accent);
    color-scheme: dark;
}
select.wiz-input option {
    background: #16161b;
    color: var(--text);
}

/* ── 3b. Basics game + mode picker ────────────────────────────
   Real-art game tiles, then ONLY the chosen game's modes, then the Naraka
   Solos/Duos/Trios sub-row. Tight + sharp (small radii, trimmed padding -
   no full-pill blobs). */
.wiz-gm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wiz-gm .wiz-field {
    gap: 8px;
}

.wiz-game-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.wiz-game-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
    filter: saturate(0.85) brightness(0.82);
    transition:
        transform 0.15s,
        border-color 0.15s,
        box-shadow 0.15s,
        filter 0.15s;
}
.wiz-game-art {
    width: 100%;
    height: 92px;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.03);
}
.wiz-game-name {
    padding: 9px 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.wiz-game-tile:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    filter: saturate(1) brightness(0.95);
}
.wiz-game-tile.selected {
    border-color: var(--accent);
    filter: none;
    box-shadow:
        inset 0 0 0 1px var(--accent),
        0 8px 24px var(--accent-glow);
}
.wiz-game-tile.selected .wiz-game-name {
    color: #fff;
}
.wiz-game-tile.selected::after {
    content: "✓";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.wiz-mode-toggle,
.wiz-sub-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.wiz-mode-btn,
.wiz-sub-btn {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.wiz-mode-btn:hover,
.wiz-sub-btn:hover {
    color: #fff;
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.07);
}
.wiz-mode-btn.selected,
.wiz-sub-btn.selected {
    color: #fff;
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 3px 12px var(--accent-glow);
}
.wiz-sub-field .wiz-field-label {
    opacity: 0.85;
}

/* Checkbox - compact accent box, not a full-width field. */
.wiz-input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.wiz-field:has(.wiz-input[type="checkbox"]) .wiz-field-label {
    /* Sit beside the box at body size rather than tiny uppercase. */
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
}

/* Next hint - quiet helper line above the nav. */
.wiz-next {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.wiz-next::before {
    content: "▶";
    font-size: 9px;
    color: var(--accent);
}

/* Back / Next nav - primary accent Next, outline Back (matches .mgmt-btn). */
.wiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.wiz-back-btn,
.wiz-next-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.wiz-back-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-color: var(--border);
}
.wiz-back-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--border-hover);
}
.wiz-next-btn {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow:
        0 4px 14px var(--accent-glow),
        var(--shadow-1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.wiz-next-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 8px 24px var(--accent-glow),
        var(--shadow-2);
    filter: brightness(1.08);
}
.wiz-next-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}
.wiz-back-btn:disabled,
.wiz-next-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
    transform: none;
}

/* ── 4. Setup-progress window + inline editors ────────────────
   The single Publish source, shown in BOTH modes: a small floating window
   off to the side (NOT a full-height rail) carrying a thin progress bar,
   an "X of Y required" count, a compact required-field checklist (done ✓ /
   todo !), and a Publish button enabled only at Y of Y. Tight + sharp. */
.publish-bar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 8500;
    width: 230px;
    max-width: calc(100vw - 40px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 13px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    /* Sharper window corners (was 10px). */
    border-radius: 5px;
    box-shadow:
        var(--shadow-2),
        0 12px 30px rgba(0, 0, 0, 0.45);
}
.publish-bar .publish-btn {
    width: 100%;
}

/* Header: "Setup" title + the X-of-Y count. */
.publish-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.publish-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.publish-count {
    font-size: 11px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: 0.3px;
}

/* Thin progress bar (fill width = filled / total required). */
.publish-progress {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.publish-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Compact required-field checklist. */
.publish-checklist {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.publish-check {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 2px 0;
    font-size: 11.5px;
    color: var(--text-secondary);
}
.publish-check.todo {
    color: var(--text-muted);
}
.publish-dot {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}
.publish-dot.ok {
    background: var(--green-soft);
    color: var(--green);
}
.publish-dot.no {
    background: rgba(255, 196, 84, 0.16);
    color: #ffc454;
    border: 1px solid rgba(255, 196, 84, 0.4);
}
.publish-check-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    color: #000;
    background: var(--green);
    box-shadow: 0 4px 12px var(--green-glow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.publish-btn:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--green-glow);
}
.publish-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}
.publish-btn:disabled {
    cursor: not-allowed;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    filter: none;
    transform: none;
}
.publish-missing {
    flex-basis: 100%;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--red);
    line-height: 1.5;
}
.publish-missing:empty {
    display: none;
}
/* Pre-publish "Unlisted" choice, sitting just before the Publish button. */
.publish-unlisted {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #9B95A8);
    cursor: pointer;
    user-select: none;
}
.publish-unlisted .publish-unlisted-input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent, #9D87C8);
    cursor: pointer;
    margin: 0;
}

/* Inline editor input/select (opens in a [data-edit-field] cell). */
.inline-edit-input {
    width: 100%;
    min-width: 120px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 4px;
    color: var(--text);
    font-size: inherit;
    font-family: inherit;
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
select.inline-edit-input {
    cursor: pointer;
    color-scheme: dark;
}
select.inline-edit-input option {
    background: #16161b;
    color: var(--text);
}

/* Empty REQUIRED cell - an AMBER dashed outline + pulsing glow demanding input,
   deliberately distinct from the violet/green "set" state so empty-vs-filled is
   obvious at a glance. `.glow` is toggled by inline-edit.js's refreshGlow(). */
.glow {
    border-radius: 4px;
    outline: 1px dashed rgba(255, 196, 84, 0.9);
    outline-offset: 2px;
    box-shadow:
        0 0 0 3px rgba(255, 196, 84, 0.14),
        0 0 14px rgba(255, 196, 84, 0.28);
    animation: creationGlowPulse 2.2s ease-in-out infinite;
}
@keyframes creationGlowPulse {
    0%,
    100% {
        box-shadow:
            0 0 0 3px rgba(255, 196, 84, 0.12),
            0 0 10px rgba(255, 196, 84, 0.22);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(255, 196, 84, 0.24),
            0 0 18px rgba(255, 196, 84, 0.34);
    }
}

/* ── 5. Draft preview CTA (draft-mode.js) ─────────────────────
   The disabled "Preview - Publish to open registration" button. It carries
   .btn.btn-primary (styled in style.css); give the disabled state an
   intentional muted look instead of a faded primary gradient. */
.btn.btn-primary:disabled,
.btn.btn-primary[aria-disabled="true"] {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px dashed var(--border-hover);
    box-shadow: none;
    text-shadow: none;
    cursor: not-allowed;
}
.btn.btn-primary:disabled:hover,
.btn.btn-primary[aria-disabled="true"]:hover {
    transform: none;
    filter: none;
    box-shadow: none;
}

/* ── 6. Responsive ────────────────────────────────────────────
   On narrow viewports the fixed rail becomes a full-width sheet. */
@media (max-width: 560px) {
    .creation-overlay {
        padding: 0;
    }
    .creation-chrome {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        padding: 18px 16px 24px;
    }
    .creation-chrome::before {
        border-radius: 0;
    }
    .publish-bar {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
}
