/*
 * Document Sharing - front-end invite modal (front-end invite pivot; Round-1 redesign + polish pass
 * 2026-06-23). The per-field [Invite] trigger (a quiet text link), the shared modal (accordion rows,
 * checkbox-style document tiles, exclusive assignment), the stacked email-preview overlay, and the
 * required-field handoff. Defensively scoped so host themes (and the plugin's own aggressive
 * `.centrex-app-container button` rule) cannot bleed in.
 *
 * Specificity note: the scoped reset below (`.centrex-invite-overlay button`, 0,1,1) intentionally
 * out-ranks bare component classes, so every styled button/control is itself scoped under its overlay
 * (0,2,x) to win. Mobile overrides for those controls are scoped the same way for the same reason.
 */

/* ---------- Scoped reset: neutralize theme + own-button/input/link bleed inside our layers ------ */
.centrex-invite-overlay,
.centrex-invite-overlay *,
.centrex-invite-overlay *::before,
.centrex-invite-overlay *::after,
.centrex-invite-preview-overlay,
.centrex-invite-preview-overlay *,
.centrex-invite-preview-overlay *::before,
.centrex-invite-preview-overlay *::after {
    box-sizing: border-box;
}

.centrex-invite-overlay button,
.centrex-invite-preview-overlay button {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.3;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.centrex-invite-overlay input,
.centrex-invite-overlay textarea,
.centrex-invite-overlay select,
.centrex-invite-preview-overlay select {
    font: inherit;
    color: #1e293b;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.centrex-invite-overlay :focus-visible,
.centrex-invite-preview-overlay :focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ---------- Per-field [Invite] trigger: a quiet, intentional text link, NOT a button ------------
 * Lives inside .centrex-app-container, so it must beat the plugin's own
 * `.centrex-app-container button{width:100%;background:#0f4988;text-transform:uppercase;color:#fff}`
 * (0,1,1) AND hostile host themes. Higher specificity + targeted !important, mirroring the proven
 * .centrex-ssn-toggle pattern. Sits directly under the file field's label. */
.centrex-app-container .centrex-invite-link,
.rendered-form .centrex-invite-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 6px 0 2px !important;
    padding: 3px 8px 3px 6px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    color: #2563eb !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer;
    float: none !important;
    transition: background-color 120ms ease, color 120ms ease;
    -webkit-appearance: none;
    appearance: none;
}
.centrex-app-container .centrex-invite-link:hover,
.centrex-app-container .centrex-invite-link:focus,
.rendered-form .centrex-invite-link:hover,
.rendered-form .centrex-invite-link:focus {
    color: #1d4ed8 !important;
    background: #eff4ff !important;
    text-decoration: none !important;
}
.centrex-app-container .centrex-invite-link:focus-visible,
.rendered-form .centrex-invite-link:focus-visible {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px;
}
.centrex-app-container .centrex-invite-link .centrex-invite-link__icon,
.rendered-form .centrex-invite-link .centrex-invite-link__icon {
    font-size: 1em !important;
    line-height: 1 !important;
    width: auto !important;
    margin: 0 !important;
    color: inherit !important;
    vertical-align: baseline;
}
/* Assigned: green, reads as "this document is covered". JS prepends a literal check + hides the icon. */
.centrex-app-container .centrex-invite-link.is-assigned,
.rendered-form .centrex-invite-link.is-assigned {
    color: #15803d !important;
    font-weight: 600 !important;
    cursor: pointer;
}
.centrex-app-container .centrex-invite-link.is-assigned:hover,
.centrex-app-container .centrex-invite-link.is-assigned:focus,
.rendered-form .centrex-invite-link.is-assigned:hover,
.rendered-form .centrex-invite-link.is-assigned:focus {
    color: #166534 !important;
    background: #dcfce7 !important;
}
.centrex-invite-link.is-assigned .centrex-invite-link__icon {
    display: none;
}
/* Edit affordance: a pencil shown ONLY once a field is assigned, so it's clear the assignment can
 * be re-opened to edit or remove the person. Hidden in the unassigned state. */
.centrex-app-container .centrex-invite-link .centrex-invite-link__edit,
.rendered-form .centrex-invite-link .centrex-invite-link__edit {
    display: none !important;
    margin-left: 6px !important;
    font-size: 0.9em !important;
    color: inherit !important;
    opacity: 0.9;
}
.centrex-app-container .centrex-invite-link.is-assigned .centrex-invite-link__edit,
.rendered-form .centrex-invite-link.is-assigned .centrex-invite-link__edit {
    display: inline-block !important;
}

/* ---------- Overlay + modal shell --------------------------------------------------------------- */
.centrex-invite-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.45);
    padding: 24px;
    overflow-y: auto;
}
.centrex-invite-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
body.centrex-invite-open {
    overflow: hidden;
}

.centrex-invite-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    margin: 24px auto;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 10px;
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.centrex-invite-modal__head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e8ee;
}
.centrex-invite-modal__title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: #0f172a;
}
.centrex-invite-modal__subhead {
    margin: 3px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}
.centrex-invite-overlay .centrex-invite-modal__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    color: #475569;
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 8px;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.centrex-invite-overlay .centrex-invite-modal__close:hover {
    color: #0f172a;
    background: #eef2f7;
    border-color: #cbd5e1;
}
.centrex-invite-overlay .centrex-invite-modal__close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.centrex-invite-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 22px;
}

.centrex-invite-modal__foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 22px;
    background: #f8fafc;
    border-top: 1px solid #e5e8ee;
}
.centrex-invite-foot__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.centrex-invite-counter {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.centrex-invite-timing {
    font-size: 11.5px;
    color: #64748b;
}
.centrex-invite-foot__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Footer buttons: SECONDARY ghost + PRIMARY solid (scoped to beat the reset). */
.centrex-invite-overlay .centrex-invite-preview-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #2563eb;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.centrex-invite-overlay .centrex-invite-preview-btn:hover {
    color: #1d4ed8;
    background: #eff4ff;
    border-color: #bfdbff;
}
.centrex-invite-overlay .centrex-invite-preview-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.centrex-invite-overlay .centrex-invite-done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.centrex-invite-overlay .centrex-invite-done:hover {
    color: #fff;
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.30);
}
.centrex-invite-overlay .centrex-invite-done:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}
.centrex-invite-overlay .centrex-invite-done:active {
    background: #1e40af;
    border-color: #1e40af;
}

/* ---------- Invitee rows (accordion) ------------------------------------------------------------ */
.centrex-invite-rows {
    border: 1px solid #e5e8ee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2px;
}
.centrex-invite-row + .centrex-invite-row {
    border-top: 1px solid #e5e8ee;
}
.centrex-invite-row.is-expanded {
    background: #fbfcfe;
}

.centrex-invite-row__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 120ms ease;
}
.centrex-invite-row:not(.is-expanded) .centrex-invite-row__summary:hover {
    background: #f8fafc;
}
.centrex-invite-row.is-expanded .centrex-invite-row__summary {
    background: #f4f7fd;
}

.centrex-invite-row__avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eff4ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.centrex-invite-row.is-expanded .centrex-invite-row__avatar {
    background: #dbe7fe;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #bfdbff;
}

.centrex-invite-row__id {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.centrex-invite-row__name-display {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.centrex-invite-row__name-display.is-placeholder {
    color: #94a3b8;
    font-weight: 500;
}
.centrex-invite-row__email-display {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.centrex-invite-row__chips {
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    max-width: 46%;
}
.centrex-invite-chip {
    font-size: 11px;
    color: #1d4ed8;
    background: #eff4ff;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}
.centrex-invite-chip--warn {
    color: #b45309;
    background: #fef3c7;
}

.centrex-invite-overlay .centrex-invite-row__remove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 17px;
    line-height: 1;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.centrex-invite-overlay .centrex-invite-row__remove:hover {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}
.centrex-invite-overlay .centrex-invite-row__remove:focus-visible {
    outline: 2px solid #b91c1c;
    outline-offset: 2px;
}

.centrex-invite-row__chevron {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 12px;
    width: 14px;
    text-align: center;
    transition: color 120ms ease;
}
.centrex-invite-row:not(.is-expanded) .centrex-invite-row__summary:hover .centrex-invite-row__chevron {
    color: #475569;
}

.centrex-invite-row__edit {
    padding: 2px 12px 14px;
}
.centrex-invite-row__inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.centrex-invite-row__name,
.centrex-invite-row__email {
    flex: 1 1 160px;
    min-width: 0;
    padding: 9px 11px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}
.centrex-invite-row__name:focus,
.centrex-invite-row__email:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.centrex-invite-row__fields-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 7px;
}
.centrex-invite-row__fields-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.centrex-invite-row__fields-count {
    font-size: 12px;
    color: #64748b;
}
.centrex-invite-row__fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---------- Document tiles (selectable, exclusive, CHECKBOX-style) ------------------------------- */
.centrex-invite-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #e5e8ee;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
}
.centrex-invite-tile:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.centrex-invite-tile input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

/* Checkbox indicator: rounded SQUARE that fills + shows a checkmark when selected. */
.centrex-invite-tile__check {
    flex: 0 0 auto;
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid #cbd5e1;
    background: #fff;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.centrex-invite-tile:hover .centrex-invite-tile__check {
    border-color: #94a3b8;
}
.centrex-invite-tile__check::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 120ms ease;
}
.centrex-invite-tile__label {
    flex: 1 1 auto;
    min-width: 0;
}
.centrex-invite-tile__owner {
    flex: 0 0 auto;
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 1px 8px;
}

.centrex-invite-tile.is-selected {
    background: #eff4ff;
    border-color: #bfdbff;
    color: #1d4ed8;
}
.centrex-invite-tile.is-selected .centrex-invite-tile__check {
    background: #2563eb;
    border-color: #2563eb;
}
.centrex-invite-tile.is-selected .centrex-invite-tile__check::after {
    transform: rotate(45deg) scale(1);
}

/* Taken by someone else: explicitly styled "covered", not a dimmed bug. */
.centrex-invite-tile.is-taken {
    opacity: 1;
    cursor: not-allowed;
    color: #94a3b8;
    background: #f8fafc;
    border-color: #eef1f5;
}
.centrex-invite-tile.is-taken:hover {
    background: #f8fafc;
    border-color: #eef1f5;
}
.centrex-invite-tile.is-taken .centrex-invite-tile__check {
    border-color: #e2e8f0;
    background: #f1f5f9;
}
.centrex-invite-tile.is-taken .centrex-invite-tile__owner {
    color: #475569;
    background: #e2e8f0;
}

/* ---------- Add person + note ------------------------------------------------------------------- */
.centrex-invite-overlay .centrex-invite-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: #2563eb;
    background: #fff;
    border: 1px dashed #bfdbff;
    border-radius: 8px;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.centrex-invite-overlay .centrex-invite-add:hover {
    color: #1d4ed8;
    background: #eff4ff;
    border-color: #93c5fd;
}
.centrex-invite-overlay .centrex-invite-add:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.centrex-invite-overlay .centrex-invite-add:disabled {
    color: #94a3b8;
    background: #fff;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.centrex-invite-note {
    margin-top: 16px;
}
.centrex-invite-overlay .centrex-invite-note__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    margin-left: -6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #2563eb;
    background: none;
    border: 0;
    border-radius: 6px;
    transition: background-color 120ms ease, color 120ms ease;
}
.centrex-invite-overlay .centrex-invite-note__toggle:hover {
    color: #1d4ed8;
    background: #eff4ff;
}
.centrex-invite-overlay .centrex-invite-note__toggle:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.centrex-invite-note__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
}
.centrex-invite-note__input {
    width: 100%;
    padding: 9px 11px;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    resize: vertical;
    max-height: 120px;
}
.centrex-invite-note__input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.centrex-invite-error {
    margin-top: 12px;
    color: #b91c1c;
    font-size: 13px;
    min-height: 0;
}
.centrex-invite-error:empty {
    margin-top: 0;
}

/* ---------- Email-preview overlay (a second layer above the modal) ------------------------------ */
.centrex-invite-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100010;
    background: rgba(15, 23, 42, 0.55);
    padding: 24px;
}
.centrex-invite-preview-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.centrex-invite-preview-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    height: 760px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: 24px auto;
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 10px;
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.centrex-invite-preview__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e8ee;
}
.centrex-invite-preview-overlay .centrex-invite-preview__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px 5px 7px;
    margin-left: -7px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    color: #2563eb;
    background: none;
    border: 0;
    border-radius: 6px;
    transition: background-color 120ms ease, color 120ms ease;
}
.centrex-invite-preview-overlay .centrex-invite-preview__back:hover {
    color: #1d4ed8;
    background: #eef2f7;
    text-decoration: none;
}
.centrex-invite-preview-overlay .centrex-invite-preview__back:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.centrex-invite-preview__title {
    flex: 1 1 auto;
    margin: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}
.centrex-invite-preview-overlay .centrex-invite-preview__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 1;
    color: #475569;
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 8px;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.centrex-invite-preview-overlay .centrex-invite-preview__close:hover {
    color: #0f172a;
    background: #eef2f7;
    border-color: #cbd5e1;
}
.centrex-invite-preview-overlay .centrex-invite-preview__close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.centrex-invite-preview__meta {
    flex: 0 0 auto;
    padding: 12px 18px;
    border-bottom: 1px solid #eef1f5;
    font-size: 13px;
    color: #334155;
}
.centrex-invite-preview__who {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.centrex-invite-preview__who select {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
}
.centrex-invite-preview__subject {
    color: #0f172a;
}
.centrex-invite-preview__subject strong { color: #475569; font-weight: 600; }
.centrex-invite-preview__sample {
    margin-top: 4px;
    font-size: 11.5px;
    color: #94a3b8;
}

.centrex-invite-preview__frame {
    flex: 1 1 auto;
    min-height: 260px;
    width: 100%;
    border: 0;
    background: #f4f5f7;
    display: block;
}

.centrex-invite-preview__foot {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid #e5e8ee;
}
.centrex-invite-preview-overlay .centrex-invite-preview__done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #2563eb;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.centrex-invite-preview-overlay .centrex-invite-preview__done:hover {
    color: #1d4ed8;
    background: #eff4ff;
    border-color: #bfdbff;
}
.centrex-invite-preview-overlay .centrex-invite-preview__done:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ---------- Mobile: full-screen sheets (overrides re-scoped to win over the desktop scoped rules) - */
@media (max-width: 600px) {
    .centrex-invite-overlay,
    .centrex-invite-preview-overlay {
        padding: 0;
    }
    .centrex-invite-overlay.is-open,
    .centrex-invite-preview-overlay.is-open {
        align-items: stretch;
    }
    .centrex-invite-modal,
    .centrex-invite-preview-dialog {
        max-width: none;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
    .centrex-invite-row__inputs {
        flex-direction: column;
    }
    .centrex-invite-row__name,
    .centrex-invite-row__email {
        flex: 0 0 auto;
        width: 100%;
        font-size: 16px;            /* prevents iOS zoom-on-focus */
    }
    .centrex-invite-note__input {
        font-size: 16px;
    }
    .centrex-invite-row__chips {
        display: none;              /* keep the collapsed row to one tidy line on phones */
    }
    .centrex-invite-overlay .centrex-invite-row__remove,
    .centrex-invite-overlay .centrex-invite-modal__close,
    .centrex-invite-preview-overlay .centrex-invite-preview__close {
        width: 44px;
        height: 44px;
    }
    .centrex-invite-tile {
        min-height: 44px;
    }
    .centrex-invite-modal__foot {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }
    .centrex-invite-foot__actions {
        justify-content: stretch;
    }
    .centrex-invite-foot__actions .centrex-invite-done {
        flex: 1 1 auto;
    }
    .centrex-invite-foot__info {
        align-items: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .centrex-invite-modal,
    .centrex-invite-preview-dialog {
        animation: centrex-invite-in 160ms ease-out;
    }
    @keyframes centrex-invite-in {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}
