/* #41xxx — 2-step single-channel message composer.
   Scoped under .msgc so it can't leak into the legacy _NewMessage composer. */

/* Constrain the shared ultra-wide modal only while it hosts this composer.
   `.msgc-dialog` is added by messageComposer.js; (0,2,0) beats `.ultra-wide-modal` (0,1,0). */
.modal-dialog.msgc-dialog { max-width: 1140px; width: auto; }
@media (max-width: 1180px) {
    .modal-dialog.msgc-dialog { max-width: calc(100% - 1rem); }
}

.msgc {
    --msgc-brand: #6366f1; /* overridden inline from the club colour */
    --msgc-brand-soft: color-mix(in srgb, var(--msgc-brand) 9%, #fff);
    --msgc-ink: #0f172a;
    --msgc-muted: #64748b;
    --msgc-line: #e7e9ee;
    max-width: 1100px;
    margin: 0 auto;
    font-size: 14px;
    color: var(--msgc-ink);
}

.msgc .msgc-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 8px;
}

/* ---- step indicator ---- */
.msgc-stepper { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.msgc-stepper__step { display: flex; align-items: center; gap: 9px; color: var(--msgc-muted); font-size: 13px; font-weight: 550; }
.msgc-stepper__dot {
    width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--msgc-line); background: #fff; color: #94a3b8;
    font-size: 12px; font-weight: 700; transition: .2s;
}
.msgc-stepper__step.is-active { color: var(--msgc-ink); }
.msgc-stepper__step.is-active .msgc-stepper__dot { border-color: var(--msgc-brand); background: var(--msgc-brand); color: #fff; box-shadow: 0 0 0 4px var(--msgc-brand-soft); }
.msgc-stepper__step.is-done .msgc-stepper__dot { border-color: var(--msgc-brand); background: #fff; color: var(--msgc-brand); }
.msgc-stepper__line { flex: 1; height: 2px; background: var(--msgc-line); border-radius: 2px; position: relative; overflow: hidden; }
.msgc-stepper__line > i { position: absolute; inset: 0; width: 0; background: var(--msgc-brand); transition: width .35s ease; }
.msgc-stepper__line.is-filled > i { width: 100%; }

/* ---- segmented channel control ---- */
.msgc-seg {
    display: inline-flex;
    flex-wrap: wrap;
    background: #f1f5f9;
    border: 1px solid var(--msgc-line);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.msgc-seg__btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: .15s;
}
.msgc-seg__btn:hover { color: var(--msgc-ink); }
.msgc-seg__btn.is-on {
    background: #fff;
    color: var(--msgc-brand);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* ---- channel explainers ---- */
.msgc-note {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin: 14px 0 2px;
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.5;
}
.msgc-note > i { margin-top: 1px; flex: 0 0 auto; }
.msgc-note--smart {
    background: var(--msgc-brand-soft);
    border: 1px solid color-mix(in srgb, var(--msgc-brand) 30%, #fff);
    color: #334155;
}
.msgc-note--smart > i { color: var(--msgc-brand); }
.msgc-note--welcome {
    background: linear-gradient(100deg, #fff7ed, #fefce8);
    border: 1px solid #fde68a;
    color: #92400e;
}
.msgc-note--welcome > i { color: #d97706; }

/* ---- compose grid ---- */
.msgc-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 22px;
    margin-top: 18px;
}
@media (max-width: 800px) {
    .msgc-grid { grid-template-columns: 1fr; }
}
.msgc-editor { position: relative; }

/* preview recedes onto a grey panel so the eye stays on the editor (left) */
.msgc-preview {
    background: #f6f8fa;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    padding: 16px 16px 18px;
    align-self: start;
}
.msgc-preview .msgc-preview__title { color: #64748b; }
.msgc-preview .msgc-preview__title > i { color: #94a3b8; }
.msgc-field { margin-bottom: 14px; }
.msgc-field > label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.msgc-counter {
    font-size: 12px;
    color: var(--msgc-muted);
    margin-top: 6px;
    text-align: right;
}
.msgc-counter.is-over { color: #d97706; }

.msgc-preview__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.msgc-preview__title > i { color: var(--msgc-brand); font-size: 15px; }

/* ---- saved-reply button + popover (floated top-right) ---- */
.msgc-reply-access {
    float: right;
    position: relative;
    margin: 0 0 8px 14px;
}
.msgc-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--msgc-line);
    background: #fff;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    padding: 9px 13px;
    border-radius: 10px;
    cursor: pointer;
    transition: .15s;
}
.msgc-reply-btn:hover { border-color: var(--msgc-brand); color: var(--msgc-brand); background: var(--msgc-brand-soft); }
.msgc-reply-btn__caret { font-size: 11px; opacity: .55; }
.msgc-rpop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    width: 360px;
    max-width: 92vw;
    background: #fff;
    border: 1px solid var(--msgc-line);
    border-radius: 13px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .20);
    overflow: hidden;
}
.msgc-rpop__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--msgc-line);
}
.msgc-rpop__search > i { color: #94a3b8; }
.msgc-rpop__search input { border: 0; outline: 0; font-size: 13.5px; width: 100%; background: transparent; }
.msgc-rpop__list { max-height: 300px; overflow: auto; padding: 6px; }
.msgc-rrow {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 9px;
    padding: 9px 11px;
}
.msgc-rrow:hover { background: var(--msgc-brand-soft); }
.msgc-rrow__t { font-size: 13.5px; font-weight: 650; color: var(--msgc-ink); line-height: 1.35; }
.msgc-rpop__empty { padding: 18px; text-align: center; color: var(--msgc-muted); font-size: 13px; }

/* ---- preview cards (built by JS) ---- */
.msgc-pv-card {
    border: 1px solid var(--msgc-line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}
.msgc-pv-email__bar { background: var(--msgc-brand-soft); padding: 10px 14px; font-size: 12px; color: var(--msgc-brand); font-weight: 600; }
.msgc-pv-email__from { padding: 14px 16px 4px; font-weight: 700; font-size: 13px; }
.msgc-pv-email__subj { padding: 0 16px; font-weight: 700; font-size: 14.5px; }
.msgc-pv-email__body { padding: 8px 16px 18px; font-size: 13.5px; color: #475569; line-height: 1.55; min-height: 60px; }
.msgc-pv-email__body img { max-width: 100%; }
.msgc-pv-email hr { border: 0; border-top: 1px solid var(--msgc-line); margin: 10px 16px; }
.msgc-pv-smartfoot { margin: 2px 16px 14px; padding-top: 10px; border-top: 1px dashed var(--msgc-line); font-size: 11px; color: var(--msgc-brand); font-weight: 600; }

.msgc-pv-phone { background: #0b1220; border-radius: 14px; padding: 18px 14px 22px; }
.msgc-pv-phone__time { color: #cbd5e1; text-align: center; font-size: 11px; margin-bottom: 12px; }
.msgc-pv-sender { color: #94a3b8; font-size: 11px; margin: 0 0 6px 4px; }
.msgc-pv-bubble { background: #e9edf3; border-radius: 16px 16px 16px 4px; padding: 10px 13px; font-size: 13.5px; color: #0f172a; max-width: 80%; white-space: pre-wrap; line-height: 1.45; }

.msgc-pv-push { background: linear-gradient(160deg, #1e293b, #0b1220); border-radius: 14px; padding: 34px 16px; }
.msgc-pv-noti { background: rgba(255, 255, 255, .92); border-radius: 14px; padding: 11px 13px; display: flex; gap: 11px; align-items: flex-start; }
.msgc-pv-noti__ic { width: 32px; height: 32px; border-radius: 8px; background: var(--msgc-brand); flex: 0 0 auto; }
.msgc-pv-noti__app { font-size: 10.5px; color: #64748b; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.msgc-pv-noti__t { font-weight: 700; font-size: 13.5px; }
.msgc-pv-noti__b { font-size: 12.5px; color: #475569; margin-top: 2px; white-space: pre-wrap; line-height: 1.4; }

.msgc-pv-screen { background: #0b1220; border-radius: 14px; padding: 14px; }
.msgc-pv-screen__inner { background: linear-gradient(150deg, var(--msgc-brand), #4338ca); border-radius: 10px; padding: 26px 20px; text-align: center; color: #fff; min-height: 120px; }
.msgc-pv-screen__club { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; margin-bottom: 12px; }
.msgc-pv-screen__h { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.msgc-pv-screen__m { font-size: 13px; opacity: .92; white-space: pre-wrap; line-height: 1.5; }
.msgc-pv-screen__foot { font-size: 10px; color: #94a3b8; text-align: center; margin-top: 10px; }

/* ---- review step ---- */
.msgc-review-lead { font-size: 14.5px; font-weight: 650; margin: 4px 0 14px; }
.msgc-when { margin: 22px 0 6px; }
.msgc-opt {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    border: 1px solid var(--msgc-line);
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: .15s;
}
.msgc-opt:hover { border-color: #cbd5e1; }
.msgc-opt.is-sel { border-color: var(--msgc-brand); background: var(--msgc-brand-soft); }
.msgc-opt input { accent-color: var(--msgc-brand); width: 17px; height: 17px; }
.msgc-opt__t { font-weight: 600; font-size: 14px; display: block; }
.msgc-opt__d { font-size: 12.5px; color: var(--msgc-muted); display: block; }
.msgc-sched { display: flex; gap: 10px; margin: -2px 0 10px 42px; }
.msgc-sched select, .msgc-sched input { max-width: 240px; }

.msgc-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 18px;
    font-size: 12.5px;
    color: var(--msgc-muted);
    background: #f8fafc;
    border: 1px solid var(--msgc-line);
    border-radius: 11px;
    padding: 11px 13px;
    line-height: 1.5;
}
.msgc-consent > i { color: #94a3b8; flex: 0 0 auto; margin-top: 2px; }

.msgc-welcome-review {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin-top: 22px;
    font-size: 13.5px;
    color: #92400e;
    background: linear-gradient(100deg, #fff7ed, #fefce8);
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 15px;
    line-height: 1.55;
}
.msgc-welcome-review > i { color: #d97706; flex: 0 0 auto; margin-top: 1px; }

/* ---- consent basis chooser (bulk marketing sends) ---- */
.msgc-consent-choose { margin-top: 14px; }
/* (.msgc-consent-badge styles removed — the radio-list consent was replaced by the
   shared _ConsentCards picker, so the inline badges are no longer rendered.) */
.msgc-consent--blocked {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}
.msgc-consent--blocked > i { color: #ea580c; }

/* ---- comms drawer / dashboard compose bar hosting the shared reply bar ---- */
.comms-compose-bar { display: flex; flex-direction: column; gap: 6px; }
.comms-reply-bar-slot { min-height: 1px; }
/* "Add a note" — a small, clearly separate action, not a message channel */
.comms-compose-note {
    align-self: flex-start;
    border: none;
    background: transparent;
    color: #d97706;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.comms-compose-note:hover { background: rgba(217, 119, 6, 0.08); }

/* ---- in-composer footer ---- */
.msgc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 16px;
    margin-top: 18px;
    border-top: 1px solid var(--msgc-line);
}

/* =====================================================================
   Inline reply bar (_ReplyBar.cshtml) — compact staff reply for the
   conversation thread. Reuses the .msgc-rpop saved-replies popover and
   the .cr-personalise mounts; only the bar chrome is styled here.
   ===================================================================== */
.replybar { display: flex; flex-direction: column; gap: 8px; }
.replybar__replyto {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--rb-brand);
    font-size: 12px;
    color: #6b7280;
}
.replybar__replyto-text { flex: 1; }
.replybar__replyto-cancel { color: #9ca3af; cursor: pointer; }
.replybar__channels {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.replybar__channels-label { font-size: 11px; color: #9ca3af; margin-right: 2px; }
.replybar-channel-btn {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
}
.replybar-channel-btn.is-on {
    background: var(--rb-brand);
    color: #fff;
    border-color: var(--rb-brand);
}
.replybar__tools { margin-left: auto; }
.replybar__row { display: flex; flex-direction: column; gap: 6px; }
.replybar__textarea {
    resize: none;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    font-size: 13px;
}
.replybar__subject { font-size: 13px; border-radius: 6px; }
/* leave room on the right so Send clears the fixed support launcher (bottom-right) */
.replybar__actions { display: flex; justify-content: flex-end; padding-right: 64px; }
.replybar__send {
    background: linear-gradient(135deg, var(--rb-brand-bg) 0%, var(--rb-brand) 100%);
    color: var(--rb-on-brand);
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}
.replybar__send:disabled { opacity: .6; cursor: default; }

/* =====================================================================
   Broadcast wizard (_NewBroadcastPanel) tweaks
   ===================================================================== */
/* Recipient plan filter — collapse to a few rows until expanded/searched,
   so a club with many plans doesn't render an enormous wall of pills. */
.broadcast-plan-pills.is-collapsible { max-height: 132px; overflow: hidden; }
.broadcast-plan-pills.is-collapsible.is-expanded { max-height: none; overflow: visible; }

/* Keep the wizard's Back / Next / Review buttons visible while scrolling a
   long step. The card / card-body carry overflow:hidden|auto which would scope
   position:sticky to themselves instead of the page, so clear it on the
   broadcast card for the sticky footer to actually pin (incl. small screens). */
#broadcastPanelRoot .card,
#broadcastPanelRoot .card-body { overflow: visible; }
.mpw-navigation {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: #fff;
    border-top: 1px solid var(--msgc-line, #e7e9ee);
    padding: 12px 0 6px;
    margin-top: 16px;
}

/* Schedule & Review step — recap of the earlier choices */
.compose-review-recap { border: 1px solid var(--msgc-line, #e7e9ee); border-radius: 10px; padding: 2px 14px; }
.compose-review-recap__row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.compose-review-recap__row:last-child { border-bottom: none; }
.compose-review-recap__label { color: #64748b; font-size: 13px; }
