/*
 * Auth pages (login / register / forgot / reset) + Account → API Keys page.
 *
 * Visual posture: minimal, single-purpose card, indigo primary accent
 * matching the rest of the app. Fixed-height card so error messages
 * pushing in don't visibly shift other layout.
 */

/* ----- Auth page (login/register/forgot/reset) ----------------------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;     /* card, then the legal links under it */
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: linear-gradient(135deg, #f4f5f9 0%, #e7eaf3 100%);
}
.auth-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.04);
}
.auth-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: #1e1b4b;
    letter-spacing: -0.01em;
}
.auth-title--logo { line-height: 0; margin-bottom: 14px; }
/* A white-label domain without a logo: its name, set like a wordmark (2026-11-25). */
.auth-title--wlname { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 14px; color: var(--text, #111827); }
.auth-logo { height: 36px; width: auto; display: block; }
.auth-subtitle {
    margin: 0 0 28px;
    font-size: 13px;
    color: #6b7280;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: 0.2px;
}
.auth-input {
    appearance: none;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
    outline: none;
    border-color: #5B53E8;
    box-shadow: var(--focus-ring);
}
.auth-error {
    color: #b91c1c;
    font-size: 13px;
    min-height: 18px;          /* reserve space so adding an error doesn't jump */
}

/* Inline helper text — shown UNDER an input to communicate constraints
 * (password rules) or set expectations (no email verification). Different
 * from .auth-error because these are stable, neutral, always-visible
 * hints, not transient validation errors. */
.auth-helper-text {
    margin: -6px 0 0;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
}
.auth-helper-text.auth-helper-muted {
    color: #6b7280;
    font-style: italic;
}
.auth-submit {
    margin-top: 4px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}
.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 13px;
}
.auth-link {
    color: #5B53E8;
    text-decoration: none;
    font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

/* Legal links under every auth card. */
.auth-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-top: 18px;
    font-size: 12px;
}
.auth-legal-link { color: #5B6270; text-decoration: none; }
.auth-legal-link:hover { color: #5B53E8; text-decoration: underline; }

/* Terms acceptance checkbox (sign-up form + the blocking re-acceptance prompt). */
.terms-check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    font-size: 12.5px;
    line-height: 1.5;
    color: #4b5563;
    cursor: pointer;
}
.terms-check__box {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #5B53E8;
    cursor: pointer;
}
.terms-check .auth-legal-link { color: #5B53E8; font-weight: 500; }
.terms-check .auth-legal-link:hover { color: #4A43D6; }

.terms-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 23, 31, 0.55);
}
.terms-gate__card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(20, 23, 31, 0.25);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.terms-gate__title { margin: 0; font-size: 18px; font-weight: 700; color: #14171F; }
.terms-gate__body { margin: 0; font-size: 14px; line-height: 1.55; color: #4b5563; }
.terms-gate__body .auth-legal-link { color: #5B53E8; font-weight: 500; }
.terms-gate__actions { display: flex; justify-content: flex-end; gap: 10px; }
.terms-gate__actions .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Success / confirmation card (shown after forgot-password / reset-password). */
.auth-success { gap: 10px; }
.auth-success-title {
    margin: 0;
    font-size: 18px;
    color: #047857;
    font-weight: 700;
}
.auth-success-body {
    margin: 0;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.55;
}

/* ----- Sidebar account chrome (shown when signed in) ----------------------
 *
 * Both buttons share the .nav-item base style (defined in app.css) so they
 * pick up the 48×48 box, hover bg, active state, etc. We only override the
 * sign-out hover here so the destructive action reads as red instead of
 * the default neutral .nav-item:hover. */
.account-chrome-signout:hover {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.08);
}

/* ----- Account → API Keys page -------------------------------------------- */

.account-page {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 24px;
}
.account-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}
.account-subtitle {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.55;
}
.account-scope-banner {
    margin: 0 0 24px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #3730a3;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}
.account-scope-banner strong { color: #312e81; }
.account-scope-banner.is-readonly {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}
.account-scope-banner.is-readonly strong { color: #78350f; }
.account-loading {
    color: #6b7280;
    font-size: 13px;
    padding: 24px;
    text-align: center;
}
.account-key-block {
    background: #fff;
    border: 1px solid #e1e3e5;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.account-key-head {
    display: flex;
    align-items: flex-start;            /* pin the badge to the top-right corner */
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.account-key-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    min-width: 0;                        /* let a long title wrap instead of shoving the badge */
}
.account-key-status {
    flex-shrink: 0;                      /* never compress the badge */
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 10px;
    border-radius: 999px;
}
.account-key-status.is-set {
    background: #dcfce7;
    color: #15803d;
}
.account-key-status.is-missing {
    background: #f3f4f6;
    color: #6b7280;
}
.account-key-notes {
    margin: 0 0 8px;
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.55;
}
.account-key-help {
    margin: 0 0 14px;
    font-size: 12px;
    color: #6b7280;
}
.account-key-help a {
    color: #5B53E8;
    text-decoration: none;
}
.account-key-help a:hover { text-decoration: underline; }
.account-key-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.account-key-input {
    appearance: none;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    color: #111827;
    background: #fff;
}
.account-key-input:focus {
    outline: none;
    border-color: #5B53E8;
    box-shadow: var(--focus-ring);
}
.account-key-error {
    color: #b91c1c;
    font-size: 12.5px;
    min-height: 16px;
}
.account-key-actions {
    display: flex;
    gap: 8px;
}

/* Account tab — stacked labelled fields (change email/password). */
.account-field { margin: 0 0 12px; }
.account-field .auth-label { display: block; margin-bottom: 6px; }
.account-field .account-key-input { margin: 0; display: block; width: 100%; max-width: 420px; box-sizing: border-box; font-family: inherit; }   /* email / password: the API-key monospace + 20-char width cut the email off */

/* ---- Text-provider selector (Claude vs OpenAI) ----------------------- */
.account-provider-block .account-provider-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 10px;
    margin-top: 8px;
}
.account-provider-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border, #e0e0e6);
    border-radius: 8px;
    background: var(--bg-secondary, #ffffff);
    cursor: pointer;
    transition: all 0.12s;
}
.account-provider-option:hover {
    border-color: var(--accent, #5B53E8);
    background: var(--accent-subtle, rgba(99, 102, 241, 0.06));
}
.account-provider-option.is-active {
    border-color: var(--accent, #5B53E8);
    background: var(--accent-subtle, rgba(99, 102, 241, 0.06));
    box-shadow: 0 0 0 1px var(--accent, #5B53E8) inset;
}
.account-provider-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.account-provider-option > input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.account-provider-option-text {
    flex: 1;
    min-width: 0;
}
.account-provider-option-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 2px;
}
.account-provider-option-note {
    font-size: 12px;
    color: var(--text-muted, #9aa0a6);
    line-height: 1.4;
}

/* Dual-model toggle row — single on/off switch for Meta ad-copy
   parallel mode. Visually distinct from the 2-radio provider
   selector above so the user reads it as a "feature flag" not as
   "pick one of two". */
.account-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border, #e0e0e6);
    border-radius: 8px;
    background: var(--bg-secondary, #ffffff);
    cursor: pointer;
    transition: all 0.12s;
    margin-top: 8px;
}
.account-toggle-row:hover:not(.is-disabled) {
    border-color: var(--accent, #5B53E8);
    background: var(--accent-subtle, rgba(99, 102, 241, 0.06));
}
.account-toggle-row.is-on {
    border-color: var(--accent, #5B53E8);
    background: var(--accent-subtle, rgba(99, 102, 241, 0.06));
    box-shadow: 0 0 0 1px var(--accent, #5B53E8) inset;
}
.account-toggle-row.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.account-toggle-input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #5B53E8);
    cursor: pointer;
}
.account-toggle-row.is-disabled .account-toggle-input {
    cursor: not-allowed;
}
.account-toggle-text {
    flex: 1;
    min-width: 0;
}
.account-toggle-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 2px;
}
.account-toggle-note {
    font-size: 12px;
    color: var(--text-muted, #9aa0a6);
    line-height: 1.4;
}

/* =============================================================================
 * Meta accounts section (under #account/keys)
 *
 * One outer .account-key-block, one inner .meta-conn-card per linked
 * connection. Status pill colors: green=ok, amber=expiring/expired,
 * red=missing token. Selection rows highlight unset slots in muted gray
 * so the user notices when something needs picking.
 * ============================================================================= */
.account-meta-section .account-key-head {
    align-items: center;
}
.account-meta-section .account-key-head .btn { white-space: nowrap; }
.meta-conn-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}
.meta-conn-card {
    background: #fafbfc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
}
.meta-conn-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.meta-conn-name-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.meta-conn-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.meta-conn-email {
    font-size: 11px;
    color: #6b7280;
}
.meta-conn-status {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 999px;
}
.meta-conn-status.is-ok    { background: #dcfce7; color: #15803d; }
.meta-conn-status.is-warn  { background: #fef3c7; color: #b45309; }
.meta-conn-status.is-bad   { background: #fee2e2; color: #b91c1c; }
.meta-conn-actions {
    display: flex;
    gap: 6px;
}
.meta-conn-actions .btn-danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: transparent;
}
.meta-conn-actions .btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}
.meta-conn-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.meta-conn-sel-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 12.5px;
}
.meta-conn-sel-label {
    width: 86px;
    flex-shrink: 0;
    color: #6b7280;
    font-weight: 500;
}
/* The right-hand side of each selection row holds BOTH the human name
 * and the raw Meta id when both are known. Layout:
 *
 *   Ad account   gave.ro · Production    [act_1234567890]
 *   ────────────────────────────────────────────────────
 *   label        name (bold, primary)    id (mono pill, muted)
 *
 * Name wraps with ellipsis if too long; id has its own min-width so it
 * doesn't collapse on narrow cards. */
.meta-conn-sel-value-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    overflow: hidden;
}
.meta-conn-sel-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.meta-conn-sel-value.is-set   { color: #111827; font-weight: 500; }
.meta-conn-sel-value.is-empty { color: #646B78; font-style: italic; font-weight: 400; }

/* Per-row "Edit" button — sits at the end of each value-wrap so the
 * user can jump straight to that wizard step. Compact xs size (.btn .btn-xs,
 * canonical in app.css) so it doesn't dominate the row; only colors up on hover.
 */
.meta-conn-row-edit-btn {
    margin-left: auto;
    flex-shrink: 0;
    background: transparent;
    color: var(--text-muted, #6b7280);
    border: 1px solid transparent;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.meta-conn-row-edit-btn:hover {
    color: var(--accent, #5B53E8);
    border-color: var(--accent, #5B53E8);
    background: rgba(99, 102, 241, 0.06);
}

/* Defaults summary row — looks like a selection row but its value can
 * wrap onto multiple lines (the · · · separator format makes long
 * defaults summaries common). Distinct background so it visually
 * groups separately from the ad-account/pixel/page rows above it.
 */
.meta-conn-defaults-row {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-faint, #e5e7eb);
}
.meta-conn-defaults-row .meta-conn-sel-value.is-set {
    white-space: normal;
    line-height: 1.4;
}
.meta-conn-needs-page-cta {
    margin-top: 8px;
}
.meta-conn-sel-value.is-id-only {
    /* When we only have the raw id (no human name on file), render it
     * as the primary text but in monospace so the user knows it's an id,
     * not a label. */
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11.5px;
    font-weight: 500;
}
.meta-conn-sel-id {
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10.5px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 7px;
    border-radius: 4px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.meta-conn-body .btn {
    align-self: flex-start;
    margin-top: 4px;
}
.account-meta-empty {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    background: #fafbfc;
    border: 1px dashed rgba(15, 23, 42, 0.10);
    border-radius: 8px;
}
.account-meta-warning {
    padding: 12px 14px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 12.5px;
}
.meta-picker .modal-body label.auth-label { font-size: 12px; }

/* =============================================================================
 * Platforms page (#platforms)
 *
 * Top-level surface for ad-platform integrations. One section per platform
 * (Meta, Google soon, TikTok soon). Active platforms render their own
 * multi-account UI inside .platform-body; coming-soon platforms get a muted
 * placeholder card.
 *
 * Visual posture: wider container than the API-keys page (840px vs 720px)
 * because each block carries logo + meta + actions on the header row plus
 * a stack of connection cards in the body. Platform logos sit in their own
 * 56px square so the blocks visually line up regardless of icon shape.
 * ============================================================================= */

.platforms-page {
    max-width: 840px;
    margin: 32px auto;
    padding: 0 24px;
}
.platforms-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}
.platforms-subtitle {
    margin: 0 0 28px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.55;
    max-width: 680px;
}

.platform-block {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.platform-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.platform-logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    overflow: hidden;
    padding: 7px;
}
/* Let the brand SVG fill the padded box (was a fixed 32px in a 56px box, so it
   looked tiny / off-centre). width/height:100% override the SVG's own
   attributes; viewBox keeps the aspect ratio so nothing is cut. */
.platform-logo svg {
    display: block;
    width: 100%;
    height: 100%;
}
.platform-title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.platform-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.005em;
}
.platform-blurb {
    margin: 0;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.5;
}
.platform-badge {
    flex-shrink: 0;
    align-self: flex-start;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
}
.platform-badge.is-active { background: #dcfce7; color: #15803d; }
.platform-badge.is-soon   { background: #f3f4f6; color: #6b7280; }

.platform-body {
    /* The body either holds the multi-connection list (active platforms)
     * or a single .platform-coming-soon placeholder. Padding-top spaces
     * the body off the head divider when the body has content. */
    padding-top: 4px;
}

/* Active-platform header row inside .platform-body — a small flex bar with
 * helper text on the left and the primary "Link" CTA on the right. */
.platform-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.platform-helper-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    flex: 1;
    min-width: 220px;
}
/* Shown in place of the Link button when no specific project is selected. */
.platform-needs-project {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    max-width: 380px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: #92400e;
    background: #fffaeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

/* Coming-soon placeholder. Muted dashed card that visually telegraphs
 * "this is the same shape as Meta will be when it ships" without inviting
 * the user to click anything. */
.platform-coming-soon {
    padding: 18px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
    background: #fafbfc;
    border: 1px dashed rgba(15, 23, 42, 0.10);
    border-radius: 10px;
}

/* Pointer card on the API-keys page that links over to Platforms.
 * Same shape as a regular .account-key-block but with the inline button
 * sitting on its own line so it doesn't crowd the explanatory text. */
.account-platforms-pointer .btn {
    display: inline-flex;
    margin-top: 4px;
    text-decoration: none;
}

/* Danger zone block — bulk "Remove all API keys" card at the bottom
 * of the API-keys page. Soft red border + tint so it visually signals
 * "destructive action lives here" without screaming. */
.account-danger-zone {
    border: 1px solid #fecaca;
    background: linear-gradient(to bottom, #fffafa, #fff);
    margin-top: 24px;
}
.account-danger-title {
    color: var(--danger, #dc2626);
}
.account-danger-zone .btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================================================
 * Meta Link Wizard (#platforms → "Link Meta account" + post-OAuth resume)
 *
 * One modal shell that hosts both the pre-redirect form (just the name +
 * permissions blurb) AND the four-step picker that auto-opens after the
 * OAuth redirect. Visual posture matches the rest of the app's modal
 * conventions but adds a branded header + a 4-step indicator + radio-card
 * pickers for ad account / pixel / catalog.
 * ============================================================================= */

.meta-wizard {
    /* Slightly more breathing room than a regular modal — the stepper +
     * pick-card list want vertical space to avoid feeling cramped. */
    border-radius: 16px;
}

.meta-wizard-header {
    padding: 18px 22px;
    gap: 12px;
    border-bottom: 1px solid #ECEDF1;
}
.meta-wizard-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.meta-wizard-logo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(8, 102, 255, 0.08);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.meta-wizard-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.meta-wizard-title-wrap h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #14171F;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.meta-wizard-subtitle {
    font-size: 12px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-wizard-body {
    padding: 20px 24px 22px;
    /* No height cap: the body grows to fit its content and the .modal-overlay
     * scrolls the whole popup when it's taller than the viewport (matching the
     * generic .modal-body). A prior max-height:70vh had NO overflow-y, so on
     * short viewports the content overflowed the box and collided with the
     * footer — the "broken height" bug. */
}
.meta-wizard-blurb {
    margin: 12px 0 14px;
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.55;
}
.meta-wizard-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}
.meta-wizard-perms {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 10px;
}
.meta-wizard-perms-title {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    display: block;
    margin-bottom: 8px;
}
.meta-wizard-perms-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.6;
}
.meta-wizard-perms-list strong {
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 12px;
    background: rgba(99, 102, 241, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}
.meta-wizard-perms-note {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: #6b7280;
    font-style: italic;
}

/* Stepper across the top of the body. The wider modal (760px) fits all six
 * steps; overflow-x:auto is a safety so a narrow viewport scrolls the stepper
 * itself instead of clipping/scrolling the whole body. */
.meta-wizard-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 4px 2px 8px;
    max-width: 100%;
    overflow-x: auto;
}
.meta-wizard-step {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}
.meta-wizard-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.meta-wizard-step-label {
    font-size: 11.5px;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.2s;
    white-space: nowrap;
}
/* Clickable steps (navigable) get a pointer + hover affordance. */
.meta-wizard-step.is-clickable { cursor: pointer; }
.meta-wizard-step.is-clickable:hover .meta-wizard-step-label { color: #5B53E8; }
.meta-wizard-step.is-clickable:hover .meta-wizard-step-num { background: #EEEDFC; color: #4A43D6; }
.meta-wizard-step.is-active .meta-wizard-step-num {
    background: #5B53E8;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(91, 83, 232, 0.14);
}
.meta-wizard-step.is-active .meta-wizard-step-label {
    color: #14171F;
    font-weight: 600;
}
.meta-wizard-step.is-done .meta-wizard-step-num {
    background: #15803D;
    color: #fff;
}
.meta-wizard-step.is-done .meta-wizard-step-label {
    color: #15803D;
}
.meta-wizard-step-line {
    flex: 1;
    height: 1.5px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.12) 50%, rgba(15, 23, 42, 0.08) 100%);
    border-radius: 1px;
    min-width: 12px;
}

/* Step content area — title / blurb / pick list */
.meta-wizard-step-host {
    min-height: 220px;
}
.meta-wizard-step-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.meta-wizard-step-blurb {
    margin: 0 0 14px;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.55;
}

/* Search box above the pick list. Mounts conditionally (only when there
 * are 6+ items) so we don't add UI noise to short lists. The "None"
 * pseudo-card on pixel/catalog steps is intentionally OUTSIDE the
 * filtering loop so it stays visible regardless of search query. */
.meta-pick-search-host {
    margin: 4px 0 8px;
}
.meta-pick-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 40px;
    background: #fff;
    border: 1px solid #E2E4EA;
    border-radius: 10px;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.meta-pick-search:focus-within {
    border-color: #5B53E8;
    box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12);
}
.meta-pick-search-icon {
    display: inline-flex;
    align-items: center;
    color: #646B78;
    flex-shrink: 0;
}
.meta-pick-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #111827;
    font-family: inherit;
    font-size: 13px;
    padding: 0;
    outline: none;
}
.meta-pick-search-input::placeholder { color: #9ca3af; }
/* Hide the native clear button on type="search" (we render our own) */
.meta-pick-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.meta-pick-search-clear {
    appearance: none;
    border: 0;
    background: transparent;
    color: #6b7280;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}
.meta-pick-search-clear:hover { background: #f3f4f6; color: #111827; }
.meta-pick-search-count {
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7280;
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.meta-pick-no-match {
    margin-top: 4px;
}

/* Pick cards — one per ad account / pixel / catalog */
.meta-pick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Cap height so a long account list doesn't push the footer off-
     * screen — internal scroll instead. */
    max-height: 360px;
    overflow-y: auto;
    padding: 2px;
    margin: 0 -2px;
}
/* Currency confirmation row — shown beneath the ad-account list once
   an account is selected. The wizard's nextBtn is gated on a non-empty
   currency value, so this row is effectively mandatory. The picker is
   auto-populated with Meta's detected value; the dropdown is for
   override only. */
.meta-currency-row {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.meta-currency-label {
    font-size: 12px;
    color: #1e3a8a;
    font-weight: 500;
}
.meta-currency-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 9px 12px;
    border: 1px solid #c7d2fe;
    border-radius: 9px;
    background: #fff;
    font-size: 13.5px;
    color: #14171F;
    width: 100%;
    max-width: 260px;
    cursor: pointer;
}
.meta-currency-select:focus {
    outline: none;
    border-color: #5B53E8;
    box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12);
}
.meta-pick-card {
    appearance: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 15px;
    background: #fff;
    border: 1px solid #E9EAEE;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.14s, background 0.14s, box-shadow 0.14s, transform 0.05s;
}
.meta-pick-card:hover {
    border-color: #D9D5F7;
    box-shadow: 0 4px 14px rgba(91, 83, 232, 0.08);
}
.meta-pick-card:active { transform: translateY(1px); }
.meta-pick-card.is-selected {
    border-color: #D6D2F7;
    background: #F7F6FE;
    box-shadow: 0 0 0 2px rgba(91, 83, 232, 0.16);
}
.meta-pick-card.is-selected:hover {
    border-color: #C9C3F3;
    box-shadow: 0 0 0 2px rgba(91, 83, 232, 0.16), 0 4px 14px rgba(91, 83, 232, 0.10);
}
.meta-pick-card.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.meta-pick-card.is-disabled:hover { border-color: rgba(15, 23, 42, 0.10); background: #fff; }

.meta-pick-radio {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #CBD0D8;
    background: #fff;
    transition: border-color 0.12s, background 0.12s;
    position: relative;
}
.meta-pick-card.is-selected .meta-pick-radio {
    border-color: #5B53E8;
    background: #5B53E8;
}
.meta-pick-card.is-selected .meta-pick-radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #fff;
}
.meta-pick-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.meta-pick-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #14171F;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meta-pick-subtitle {
    font-size: 11.5px;
    color: #6B7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meta-pick-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 999px;
}
.meta-pick-badge.is-ok      { background: #dcfce7; color: #15803d; }
.meta-pick-badge.is-warn    { background: #fef3c7; color: #b45309; }
.meta-pick-badge.is-bad     { background: #fee2e2; color: #b91c1c; }
.meta-pick-badge.is-neutral { background: #f3f4f6; color: #4b5563; }

.meta-pick-loading,
.meta-pick-empty,
.meta-pick-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 20px;
    border-radius: 10px;
    font-size: 12.5px;
    color: #6b7280;
    text-align: center;
}
.meta-pick-empty {
    background: #fafbfc;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    line-height: 1.55;
}
.meta-pick-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* Pages-filter banner — sky-tinted, surfaces ABOVE the page-pick list
 * when the wizard narrowed the Pages list to those used in creatives on
 * the chosen ad account. The "Show all N" button is the escape hatch
 * for users who want to start using a Page not yet active on this
 * account. Same shape as .meta-wizard-relink-reason but with the
 * actionable button right-aligned. */
.meta-pages-filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 9px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 12px;
    color: #1e3a8a;
    line-height: 1.45;
}
.meta-pages-filter-banner__text {
    flex: 1;
    min-width: 0;
}
.meta-pages-filter-banner__btn {
    flex-shrink: 0;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.meta-pages-filter-banner__btn:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
}

/* Page CONTENT-access warning — amber, shown in the Page step when the save-time
 * probe (save-selection.php page_content_access) reports the linking user can't READ
 * this Page's posts (no full-admin role). Ad creation still works, so it's a warning
 * with a guide + re-check + continue, not a hard stop. */
.meta-page-access-warn {
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
}
.meta-page-access-warn__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.meta-page-access-warn__icon { font-size: 15px; line-height: 1; }
.meta-page-access-warn__title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
}
.meta-page-access-warn__body {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #78561a;
}
.meta-page-access-warn__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-page-access-warn__btn {
    padding: 6px 13px;
    background: #fff;
    border: 1px solid #e5cf8a;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.meta-page-access-warn__btn:hover { background: #fef3c7; border-color: #d4b45f; }
.meta-page-access-warn__btn--primary {
    background: var(--accent, #5B53E8);
    border-color: var(--accent, #5B53E8);
    color: #fff;
}
.meta-page-access-warn__btn--primary:hover { background: #4b45c9; border-color: #4b45c9; color: #fff; }
.meta-page-access-warn__btn--ghost { background: transparent; border-color: transparent; color: #92400e; }
.meta-page-access-warn__btn--ghost:hover { background: #fef3c7; border-color: transparent; }

/* "How to give access" guide — a small modal layered ABOVE the wizard overlay. */
.meta-access-guide-overlay { z-index: 100000; }
.meta-access-guide {
    width: min(460px, calc(100vw - 40px));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.meta-access-guide__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.meta-access-guide__title { margin: 0; font-size: 16px; font-weight: 700; color: #111827; }
.meta-access-guide__intro {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #4b5563;
}
.meta-access-guide__steps {
    margin: 0 0 14px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #374151;
}
.meta-access-guide__steps li { padding-left: 2px; }
.meta-access-guide__open {
    display: inline-block;
    padding: 8px 15px;
    background: var(--accent, #5B53E8);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}
.meta-access-guide__open:hover { background: #4b45c9; }
.meta-access-guide__note {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid #f0f1f3;
    font-size: 11.5px;
    line-height: 1.55;
    color: #6b7280;
}

/* Relink-reason banner — amber, surfaces ABOVE the permissions list when
 * the smart-relink probe found we actually need fresh OAuth. Examples:
 *   - "Your access token expired — re-grant to refresh."
 *   - "Your app needs additional permissions: ads_management"
 * For first-time links and "skip OAuth" relinks this banner doesn't render. */
.meta-wizard-relink-reason {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 12.5px;
    color: #92400e;
    line-height: 1.5;
}
.meta-wizard-relink-reason svg { flex-shrink: 0; margin-top: 1px; }

/* Step 4 — review / summary. Per-step auto-save means everything is
 * already on disk by the time the user reaches this view; the green
 * banner reassures them the data they see is the persisted state, not
 * a draft. */
.meta-wizard-saved-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 12.5px;
    color: #14532d;
    line-height: 1.5;
    margin-bottom: 12px;
}
.meta-wizard-saved-banner svg { flex-shrink: 0; margin-top: 1px; }

/* IG sub-row inside the Page step.
 * Sits below the Pages list. Lets the user opt-in/out of IG for the
 * currently-selected Page without picking another Page. Hidden when the
 * chosen Page has no linked IG. */
.meta-wizard-ig-row {
    margin-top: 10px;
}
.meta-wizard-ig-toggle {
    background: linear-gradient(135deg, #fdf4ff 0%, #fff 60%);
    border: 1px solid #f5d0fe;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.meta-wizard-ig-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}
.meta-wizard-ig-label strong {
    color: #111827;
    font-weight: 600;
}
.meta-wizard-ig-handle {
    color: #a21caf;
    font-size: 12px;
    font-weight: 500;
}
.meta-wizard-ig-choices {
    display: flex;
    gap: 6px;
}
.meta-wizard-ig-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}
.meta-wizard-ig-btn:hover {
    border-color: #d946ef;
    color: #a21caf;
}
.meta-wizard-ig-btn.is-active {
    background: linear-gradient(135deg, #d946ef, #a21caf);
    color: #fff;
    border-color: #a21caf;
}
/* "No IG linked → using FB Page" explanatory note. Shown inside the
   IG toggle wrapper when the selected Page has no linked Instagram —
   replaces the action buttons with an explanation of what'll happen
   (PBIA mint at save-selection time). Wider than the toggle row
   because the copy is descriptive, not action-y. */
.meta-wizard-ig-note {
    flex: 1 1 100%;
    font-size: 12px;
    line-height: 1.5;
    color: #4b5563;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 4px;
}
.meta-wizard-ig-note strong {
    color: #111827;
    font-weight: 600;
}
.meta-wizard-ig-note a {
    color: #a21caf;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.meta-wizard-ig-note a:hover {
    color: #86198f;
}
/* Disabled-state variant when no Page is picked yet — keeps the
   section visible so the user understands it's coming, but dims it. */
.meta-wizard-ig-toggle.is-disabled {
    opacity: 0.55;
    border-style: dashed;
}

.meta-wizard-summary {
    background: #fafbfc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.meta-summary-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 12.5px;
}
.meta-summary-label {
    width: 110px;
    flex-shrink: 0;
    color: #6b7280;
    font-weight: 500;
}
.meta-summary-value {
    flex: 1;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.meta-summary-row.is-dim .meta-summary-value {
    color: #646B78;
    font-style: italic;
    font-weight: 400;
}

/* Footer — Back / Skip / Next layout. Spacer between Back and Next pushes
 * the action buttons to the right side, with Skip just left of Next. */
.meta-wizard-footer {
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #ECEDF1;
}
.meta-wizard-back { /* already positioned by parent flex */ }
.meta-wizard-skip { /* hidden via JS on steps 0 and 3 */ }
.meta-wizard-cta { /* primary "Continue with Facebook" CTA on step 0 */
    background: #0866FF;
    border-color: #0866FF;
    color: #fff;
}
.meta-wizard-cta:hover:not(:disabled) {
    background: #0555d4;
    border-color: #0555d4;
}
.meta-wizard-cta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ---- Polish: footer buttons + wizard form controls (bx-* design language) ----
 * Scoped to the Meta wizard so shared .auth-input / .btn on the login page and
 * elsewhere are untouched. The FB-blue "Continue with Facebook" CTA keeps its
 * brand color via the :not(.meta-wizard-cta) guard. */
.meta-wizard-footer .btn {
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
}
.meta-wizard-back,
.meta-wizard-skip {
    color: #5B6473;
    background: #fff;
    border-color: #E2E4EA;
}
.meta-wizard-back:hover:not(:disabled),
.meta-wizard-skip:hover:not(:disabled) { background: #F7F8FA; border-color: #E2E4EA; }
.meta-wizard-next:not(.meta-wizard-cta) {
    background: #5B53E8;
    border-color: #5B53E8;
    color: #fff;
    padding: 9px 20px;
}
.meta-wizard-next:not(.meta-wizard-cta):hover:not(:disabled) { background: #4A43D6; border-color: #4A43D6; }
.meta-wizard-next:disabled { opacity: 0.55; cursor: not-allowed; }

/* Text inputs + selects inside the wizard (Defaults step, etc.) → the modern
 * 9px-radius / #E2E4EA-border / indigo-focus control. */
.meta-wizard .auth-input,
.meta-wizard .meta-wizard-select {
    box-sizing: border-box;
    width: 100%;
    border-radius: 9px;
    border: 1px solid #E2E4EA;
    background: #fff;
    font-family: inherit;
    font-size: 13.5px;
    color: #14171F;
    padding: 9px 12px;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.meta-wizard .meta-wizard-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%239099A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    cursor: pointer;
}
.meta-wizard .auth-input:focus,
.meta-wizard .meta-wizard-select:focus {
    outline: none;
    border-color: #5B53E8;
    box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12);
}
/* Uppercase field labels + helper text (design-system form-label spec). */
.meta-wizard .auth-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #646B78;
    margin-bottom: 6px;
}
.meta-wizard-field-hint {
    margin-top: 6px;
    font-size: 11.5px;
    color: #6B7280;
    line-height: 1.5;
}

/* Delete-connection modal — same wizard shell, danger-tinted icon
 * but with a reassuring green "local-only" banner up top. The bullet list
 * uses inline ✓ / ✕ icons (rendered via SVG in the JS) to make the "what
 * this does / doesn't do" split scannable at a glance. */
.meta-wizard-logo.is-danger {
    background: rgba(220, 38, 38, 0.08);
}
.meta-disconnect-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 12.5px;
    color: #14532d;
    line-height: 1.5;
}
.meta-disconnect-banner svg { flex-shrink: 0; margin-top: 1px; }
.meta-disconnect-list {
    list-style: none;
    margin: 6px 0 14px;
    padding: 0;
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.meta-disconnect-list li {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-left: 0;
}
.meta-disconnect-confirm {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}
.meta-disconnect-confirm:hover:not(:disabled) {
    background: #991b1b;
    border-color: #991b1b;
}

/* ------------------------------------------------------------------
 * Facebook brand icon
 *
 * Used wherever the FB brand appears in UI copy. Source PNG is at
 * /assets/icons/facebook.png (downloaded locally, no CDN). Sizing
 * helpers are utility-only — wrap with object-fit:contain so the
 * sprite never distorts when used inside flex children.
 * ------------------------------------------------------------------ */
.fb-icon {
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}
/* All FB-icon variants are ≥20px per the design system rule — the
   brand mark stops being legible below that. Updated 2026-05-14 (was
   14/16/24/14). Vertical-align values adjusted to keep baselines clean
   at the new sizes. */
.fb-icon-sm     { width: 20px; height: 20px; vertical-align: -5px; }
.fb-icon-md     { width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; }
.fb-icon-lg     { width: 24px; height: 24px; vertical-align: -5px; }
.fb-icon-inline { width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; }

/* ============================================================================
 * Connection defaults — collapsible sections inside the platforms wizard's
 * Defaults step. Each section groups related fields so the form scans as a
 * config panel, not a wall of inputs.
 * ==========================================================================*/
.meta-wizard-defaults-section {
    margin: 12px 0;
    border: 1px solid #ECEDF1;
    border-radius: 11px;
    background: #fff;
}
.meta-wizard-defaults-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    border-bottom: 1px solid transparent;
    border-radius: 11px;
}
.meta-wizard-defaults-summary:hover { background: #FAFAFB; }
.meta-wizard-defaults-summary:focus-visible { outline: 2px solid #5B53E8; outline-offset: -2px; }
.meta-wizard-defaults-summary::-webkit-details-marker { display: none; }
.meta-wizard-defaults-summary::marker { content: ''; }
.meta-wizard-defaults-summary-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meta-wizard-defaults-summary-title { font-size: 13.5px; font-weight: 600; color: #14171F; }
.meta-wizard-defaults-summary-sub { font-size: 12px; color: #646B78; font-weight: 500; }
.meta-wizard-defaults-chev { flex: 0 0 auto; color: #6B7280; transition: transform .18s ease; }
details[open] > .meta-wizard-defaults-summary {
    border-bottom-color: #ECEDF1;
    border-radius: 11px 11px 0 0;
}
details[open] > .meta-wizard-defaults-summary .meta-wizard-defaults-chev { transform: rotate(180deg); }
.meta-wizard-defaults-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.meta-wizard-defaults-body > .meta-wizard-field { margin: 0; }

/* On/off setting row — text left, .bx-switch right (DESIGN_SYSTEM.md §5). */
.meta-wizard-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.meta-wizard-setting + .meta-wizard-setting {
    padding-top: 14px;
    border-top: 1px solid #F1F2F5;
}
.meta-wizard-setting-text { flex: 1; min-width: 0; }
.meta-wizard-setting-title { font-size: 13.5px; font-weight: 600; color: #14171F; }
.meta-wizard-setting-sub { margin-top: 3px; font-size: 12px; color: #646B78; line-height: 1.5; }
.meta-wizard-setting .bx-switch:focus-visible { outline: 2px solid #5B53E8; outline-offset: 2px; }
.meta-wizard-field > .meta-wizard-setting { margin-bottom: 10px; }

/* Segmented choices (.bx-seg) — side by side, wrapping on narrow screens. */
.meta-wizard-seg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-wizard-seg-sub[hidden] { display: none; }
.meta-wizard .meta-wizard-seg { width: fit-content; max-width: 100%; align-self: flex-start; flex-wrap: wrap; }
.meta-wizard .meta-wizard-seg .bx-seg-btn { padding: 7px 14px; }

/* URL tracking: monospace template + the shortcodes disclosure and reset on one line. */
.meta-wizard .auth-input.meta-wizard-mono { font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.meta-wizard .auth-input:disabled { background: #F7F8FA; color: #6B7280; cursor: not-allowed; }
.meta-wizard-track-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.meta-wizard-track-actions > .meta-wizard-shortcodes { flex: 1; min-width: 0; margin: 0; }
.meta-wizard-shortcodes > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #5B53E8;
    cursor: pointer;
    list-style: none;
    padding: 6px 0;
}
.meta-wizard-shortcodes > summary::-webkit-details-marker { display: none; }
.meta-wizard-shortcodes > summary::marker { content: ''; }
.meta-wizard-shortcodes > summary::after { content: '▾'; font-size: 10px; transition: transform .18s ease; }
.meta-wizard-shortcodes[open] > summary::after { transform: rotate(180deg); }
.meta-wizard-shortcodes-body {
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid #ECEDF1;
    border-radius: 9px;
    background: #FAFAFB;
    font-size: 12.5px;
    color: #5B6473;
    line-height: 1.55;
}
.meta-wizard-shortcodes-body ul { margin: 6px 0 10px; padding-left: 18px; }
.meta-wizard-shortcodes-body code { font-size: 12px; background: #fff; border: 1px solid #ECEDF1; border-radius: 4px; padding: 0 4px; }
.meta-wizard-shortcodes-body a { color: #5B53E8; font-weight: 600; text-decoration: none; }
.meta-wizard .meta-wizard-reset-link { flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; }
.meta-wizard-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
/* A grid ITEM defaults to `min-width: auto` = min-content, and a bare <input>'s min-content is its
   intrinsic size (~180px, from the default `size` attribute). So these two `1fr` tracks could not
   shrink below ~380px and the row spilled out of any narrower column: measured 390px of content in
   a 208px box (a 320px phone behind the 80px rail) — 174px off-screen.
   Both halves are required and neither works alone: `min-width: 0` gives the track a definite,
   shrinkable width, and only THEN can `max-width: 100%` bind the input to it. max-width by itself
   is the circular trap — the track sizes to the input, so 100% resolves back to 180px.
   No media query: max-width leaves the input at its natural size wherever there is room, so
   desktop is untouched and every breakpoint is covered at once. */
.meta-wizard-row-2 > * { min-width: 0; }
.meta-wizard-row-2 input,
.meta-wizard-row-2 select { min-width: 0; max-width: 100%; }
.meta-wizard-checkboxes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.meta-wizard-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text, #1e293b);
    cursor: pointer;
}
.meta-wizard-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}
.meta-wizard-toggle-row > input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.meta-wizard-toggle-text {
    flex: 1;
    font-size: 13px;
    color: var(--text, #1e293b);
}
.meta-wizard-toggle-text strong {
    display: block;
    margin-bottom: 2px;
}
.meta-wizard-toggle-sub {
    color: var(--text-muted, #64748b);
    font-size: 12px;
    line-height: 1.4;
}

/* ============================================================================
   ClickUp list picker modal — opened from Platforms → connection card →
   ClickUp list row. Reuses the generic .modal shell from app.css but
   needs its own body / footer / field / select styling since the
   `.clickup-picker-*` classes I emitted in JS had no CSS at all (the
   previous version inherited zero alignment, padding, or input style).
   ============================================================================ */
.clickup-picker-modal {
    width: 560px;
    max-width: 92vw;
}

.clickup-picker-modal .modal-header {
    padding: 18px 22px;
}
.clickup-picker-modal .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary, #0e0e1f);
    margin: 0;
    letter-spacing: -0.01em;
}

/* Body — the generic .modal-body has no padding; the picker needs
   comfortable interior space + centered vertical flow. */
.clickup-picker-modal .modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.clickup-picker-blurb {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary, #4a4a6a);
    margin: 0;
    max-width: 100%;
}

/* Loading + error states — both centered with breathing room so the
   modal doesn't snap to a tiny height while it loads. */
.clickup-picker-loading {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted, #6e6e8a);
    font-size: 13px;
    background: #fafafd;
    border: 1px dashed #ececf3;
    border-radius: 10px;
}
/* Animated loading hint — three dots cycling so the user knows
   the network is still working (not stalled). */
.clickup-picker-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    text-align: left;
    animation: clickup-picker-dots 1.4s steps(4, end) infinite;
}
@keyframes clickup-picker-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.clickup-picker-error {
    padding: 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #7f1d1d;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}
.clickup-picker-error p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}
.clickup-picker-error .btn {
    align-self: flex-start;
}

/* Field group — label sits above the select with a clear hierarchy. */
.clickup-picker-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.clickup-picker-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted, #6e6e8a);
}

/* Big, properly-styled select — the previous bare <select> looked
   like a 1990s OS native control. This gives it the same chrome as
   the other Creative Builder inputs (8px radius, indigo focus ring,
   custom dropdown caret via background-image). */
.clickup-picker-select {
    width: 100%;
    padding: 11px 38px 11px 14px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-primary, #0e0e1f);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e8a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 12px;
    border: 1px solid #d4d4e0;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}
.clickup-picker-select:hover {
    border-color: #b4b4c2;
}
.clickup-picker-select:focus {
    outline: none;
    border-color: #5B53E8;
    box-shadow: var(--focus-ring);
}
.clickup-picker-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clickup-picker-hint {
    font-size: 11.5px;
    color: var(--text-muted, #9494a8);
    margin: 0;
    line-height: 1.4;
}

/* Footer — generic .modal-footer pushes everything left; for this
   picker we want the action buttons RIGHT-aligned (modal convention)
   so the primary Save button lands where users expect it. */
.clickup-picker-modal .modal-footer {
    padding: 14px 22px 18px;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafd;
    border-top: 1px solid #ececf3;
}
.clickup-picker-modal .modal-footer .btn {
    min-width: 96px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
}

/* Inline status pill on the connection card's "ClickUp list" row.
   Sits to the right of the breadcrumb path so the user knows at a
   glance which column new tasks land in (e.g. "Open" / "Draft" /
   "list default"). */
.meta-conn-clickup-status {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: 1px;
    border: 1px solid #bbf7d0;
}
.meta-conn-clickup-status.is-default {
    background: #f0f0f7;
    color: #6e6e8a;
    border-color: #ececf3;
}

/* ==================== Admin → Accounts tab ==================== */
.adm-acct-toolbar { display: flex; gap: 10px; margin: 4px 0 14px; }
.adm-acct-search { flex: 1; max-width: 340px; }
.adm-acct-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; margin-bottom: 8px; background: #fff;
    border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px;
}
.adm-acct-main { min-width: 0; }
.adm-acct-email { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.adm-acct-meta { margin-top: 3px; font-size: 12px; color: #6b7280; }
.adm-acct-badge {
    font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
    padding: 2px 7px; border-radius: 999px; background: #eef0ff; color: #4f46e5;
}
.adm-acct-badge.you { background: #e7f6ec; color: #15803d; }

/* Copyable Meta-id pills (platforms page, PL2) — click copies, inline flash. */
.meta-conn-sel-id.is-copyable,
.meta-conn-sel-value.is-id-only.is-copyable { cursor: pointer; }
.meta-conn-sel-id.is-copyable:hover,
.meta-conn-sel-value.is-id-only.is-copyable:hover { color: var(--accent, #5B53E8); text-decoration: underline dotted; }

/* Actionable status pill (platforms page, PL3) — warn/expired pills click straight into smart-relink. */
.meta-conn-status.is-actionable { cursor: pointer; }
.meta-conn-status.is-actionable:hover { filter: brightness(0.94); text-decoration: underline dotted; }

/* ── Google Analytics (GA4) platform section ────────────────────────────────
   Uses the design-system palette (indigo #5B53E8 accent) and the platform card
   chrome already defined above. Four states: notice (info/warn/err), the linked
   row, the property picker field, and a loading line. */
.platform-loading { font-size: 13px; color: #646B78; padding: 4px 0 10px; }
.platform-note { font-size: 13px; line-height: 1.55; border-radius: 9px; padding: 10px 13px; margin-bottom: 12px; }
.platform-note.is-info { color: #3B414C; background: #F4F5F7; border: 1px solid #E7E8EC; }
.platform-note.is-warn { color: #9A6B0E; background: #FBF1DC; border: 1px solid #F2E3C2; }
.platform-note.is-err  { color: #B04A4A; background: #FCEDED; border: 1px solid #F3D6D6; }

.platform-conn { display: flex; align-items: center; gap: 14px; border: 1px solid #E7E8EC; border-radius: 11px; padding: 13px 15px; }
.platform-conn.is-ok { border-color: #CDEBD8; background: #F4FBF6; }
.platform-conn__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.platform-conn__txt strong { font-size: 13.5px; font-weight: 600; color: #14171F; }
.platform-conn__sub { font-size: 12px; color: #646B78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-conn .btn { margin-left: auto; flex: 0 0 auto; }

.platform-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; max-width: 480px; }
.platform-field__label { font-size: 12px; font-weight: 600; color: #5B6473; }

/* ── Platform GROUPS (one provider, several services) ──────────────────────
   Google Analytics / Ads / Merchant Center are three APIs behind ONE Google
   sign-in. As three sibling cards they read as three separate logins, which is
   the opposite of what the OAuth connection actually does. The group supplies
   the brand mark + the "one sign-in" line; members keep their own titles and
   status badges so a live service and a coming-soon one can coexist honestly. */
.platform-group {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.platform-group__head { margin-bottom: 4px; }
.platform-group__body { display: flex; flex-direction: column; gap: 12px; }

/* Members lose the outer card chrome — the GROUP is the card now. The left rail
   is what ties them visually to the group header above. */
.platform-block.is-grouped {
    margin-bottom: 0;
    padding: 16px 0 16px 16px;
    border: none;
    border-left: 2px solid #E7E8EC;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.platform-block.is-grouped:hover { border-left-color: #C9C4F4; }
/* A nested service is a sub-heading, not a second page title. */
.platform-block.is-grouped .platform-head { margin-bottom: 12px; gap: 11px; }
.platform-block.is-grouped .platform-logo { width: 36px; height: 36px; border-radius: 9px; padding: 5px; }
.platform-block.is-grouped .platform-title { font-size: 15px; }
.platform-block.is-grouped .platform-blurb { font-size: 12.5px; }

@media (max-width: 640px) {
    .platform-group { padding: 16px 14px; }
    .platform-block.is-grouped { padding-left: 12px; }
}

/* ── Google link wizard ────────────────────────────────────────────────────
   Only the bits Meta's wizard has no equivalent for: a TAB rail (Google's three
   services are independent, so tabs — not Meta's dependent stepper) and the
   per-project "what's selected" summary on the card. Everything else reuses
   .meta-wizard-* / .meta-pick-* so the two wizards are one design, not two. */
.gw-account { font-size: 12.5px; color: #6b7280; margin: 0 0 14px; }
.gw-tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid #E7E8EC;
    margin-bottom: 16px;
    overflow-x: auto;                 /* narrow screens scroll the rail, not the page */
}
.gw-tab {
    appearance: none; background: none; border: none;
    padding: 9px 14px; font-size: 13.5px; font-weight: 500; color: #6b7280;
    cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.gw-tab:hover { color: #14171F; }
.gw-tab.is-active { color: #5B53E8; border-bottom-color: #5B53E8; }
.gw-blurb { font-size: 12.5px; color: #6b7280; margin: 0 0 12px; }
.gw-panel { min-height: 220px; }
.gw-list { display: flex; flex-direction: column; gap: 8px; }
.gw-note {
    font-size: 12.5px; line-height: 1.5; color: #3B414C;
    background: #F7F8F9; border: 1px solid #E7E8EC; border-radius: 9px;
    padding: 11px 13px; margin-bottom: 10px;
}
.gw-note.is-warn { background: #FFF8E6; border-color: #F3E0A8; color: #6B5310; }
.gw-note.is-err  { background: #FEF1F1; border-color: #F5C9C9; color: #8A2020; }
.gw-saved { margin-left: auto; font-size: 11.5px; font-weight: 600; color: #15803d; }

/* Card summary — one cell per service, so "not selected" is visible at a glance
   rather than something you discover when a publish fails. */
.gw-picks {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 9px; margin-top: 13px;
}
.gw-pick {
    display: flex; flex-direction: column; gap: 3px;
    border: 1px solid #EDEFF2; border-radius: 9px;
    padding: 9px 11px; background: #FAFAFB; min-width: 0;
}
.gw-pick.is-set { border-color: #C9C4F4; background: #F7F6FE; }
.gw-pick-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #646B78; }
.gw-pick-value { font-size: 12.5px; color: #14171F; overflow-wrap: anywhere; }
.gw-pick:not(.is-set) .gw-pick-value { color: #6B7280; }
.meta-pick-card.is-disabled { opacity: .55; cursor: not-allowed; }

/* Google wizard — stepper states + footer. The rail is now ORDERED (Ads → Merchant →
   GA4) because the later steps depend on the Ads pick, so a completed step reads
   differently from an inactive one. */
.gw-tab.is-done { color: #15803d; }
.gw-tab.is-done::before { content: '✓ '; }
.gw-foot-spacer { flex: 1 1 auto; }
.meta-wizard-footer .btn { min-width: 88px; }

/* ── Google wizard: loading state ──────────────────────────────────────────
   Merchant makes two round trips PER account and GA4 two per property, so these
   waits are seconds, not milliseconds. A static line of text reads as a dead
   panel; a spinner plus skeleton rows shows work in progress AND pre-suggests
   the shape of the list that is coming. */
.gw-loading { padding: 4px 0; }
.gw-loading-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.gw-loading-text { font-size: 13px; color: #6b7280; }
.gw-spinner {
    width: 16px; height: 16px; flex: 0 0 auto;
    border: 2px solid #E7E8EC; border-top-color: #5B53E8; border-radius: 50%;
    animation: gw-spin .7s linear infinite;
}
@keyframes gw-spin { to { transform: rotate(360deg); } }

/* Skeleton rows echo .meta-pick-card's height so the list does not jump when it
   swaps in. */
.gw-skel {
    height: 54px; border-radius: 10px; margin-bottom: 8px;
    background: linear-gradient(90deg, #F4F5F7 25%, #ECEEF1 37%, #F4F5F7 63%);
    background-size: 400% 100%;
    animation: gw-shimmer 1.4s ease-in-out infinite;
}
@keyframes gw-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* The "already linked in Google" callout earns colour — it is the answer the user
   came for, not a neutral hint. */
.gw-note.is-linked {
    background: #F0FAF3; border-color: #BFE3CB; color: #14622F;
}

/* Motion-sensitive users: keep the state legible, drop the movement. */
@media (prefers-reduced-motion: reduce) {
    .gw-spinner { animation-duration: 2.4s; }
    .gw-skel    { animation: none; background: #F4F5F7; }
}

/* The row this project is ALREADY using. Green, because it is a confirmed state
   rather than a suggestion — "Linked in Google" is grey-green by contrast, and
   the two must not be mistaken for each other at a glance. */
.meta-pick-card.is-current {
    border-color: #86C99B;
    background: #F5FBF7;
}
.meta-pick-card.is-current .meta-pick-badge.is-ok {
    background: #15803d;
    color: #fff;
}
.meta-pick-card.is-current:hover { border-color: #5FB37C; }

/* ── Affiliate program page (js/account/affiliate-page.js) ───────────────────────────────────
   Its section/form/stat classes had no styles at all: full-width inputs stacked flush against
   each other, no cards. Cards in the settings palette, a compact form, stat tiles, a table. */
.affiliate-page .account-section { background: #fff; border: 1px solid #E9EAEE; border-radius: 14px; padding: 20px 22px; margin-top: 16px; max-width: 760px; }
.affiliate-page .account-section-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #14171F; }
.affiliate-page .account-section > .account-key-notes { margin: 0; font-size: 13px; line-height: 1.55; color: #5B6473; }
.aff-apply { display: grid; gap: 10px; max-width: 440px; margin-top: 14px; }
.aff-apply .btn { justify-self: start; margin-top: 4px; }
.aff-terms-link { font-size: 12.5px; color: #5B53E8; text-decoration: none; }
.aff-terms-link:hover { text-decoration: underline; }
.aff-link-row { display: flex; gap: 8px; max-width: 620px; margin: 10px 0 8px; }
.aff-link-input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12.5px; }
.aff-stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.aff-stat { background: #F7F8FA; border: 1px solid #EEF0F3; border-radius: 10px; padding: 12px 14px; }
.aff-stat-val { font-size: 20px; font-weight: 700; color: #14171F; letter-spacing: -0.01em; }
.aff-stat-label { margin-top: 2px; font-size: 12px; color: #6B7280; }
.affiliate-page .cpn-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.affiliate-page .cpn-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6B7280; padding: 8px 10px; border-bottom: 1px solid #EEF0F3; }
.affiliate-page .cpn-table td { padding: 10px; border-bottom: 1px solid #F2F3F5; color: #2A3343; }
@media (max-width: 640px) {
    .affiliate-page .account-section { padding: 16px; }
    .aff-link-row { flex-direction: column; }
    .affiliate-page .cpn-table { display: block; overflow-x: auto; }
}

/* ==================== Admin → Coupons + Affiliates tabs ====================
   coupons-admin.js / affiliates-admin.js emitted cpn-* / aff-* classes that had no
   rules at all, so both tabs rendered as a bare stacked form on the grey page. */
.cpn-form, .aff-panel {
    background: #fff; border: 1px solid #E9EAEE; border-radius: 14px;
    padding: 20px 22px; margin-top: 16px;
}
.cpn-form-title { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: #14171F; }
.cpn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 18px; }
.cpn-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cpn-label { font-size: 12px; font-weight: 600; color: #4B5563; }
.cpn-hint { font-size: 11.5px; color: #646B78; line-height: 1.4; }
.cpn-form .input, .aff-terms .input {
    background: #fff; border: 1px solid #DADDE3; border-radius: 9px;
    height: 38px; padding: 0 12px; font-size: 13px;
}
.cpn-form .input:focus, .aff-terms .input:focus { border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12); }
.cpn-warn {
    margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
    background: #FFF8EB; border: 1px solid #F3DDB0; color: #8A5A00;
}
.cpn-list { margin-top: 16px; }
.cpn-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.cpn-list .cpn-table, .aff-panel .cpn-table { border: 1px solid #E9EAEE; border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; margin-top: 12px; }
.cpn-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6B7280; padding: 10px 12px; border-bottom: 1px solid #EEF0F3; }
.cpn-table td { padding: 10px 12px; border-bottom: 1px solid #F2F3F5; color: #2A3343; vertical-align: middle; }
.cpn-table tr:last-child td { border-bottom: 0; }
.cpn-list .cpn-table td:last-child, .aff-panel .cpn-table td:last-child { text-align: right; }
.cpn-badge {
    display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px; background: #F1F2F5; color: #6B7280;
}
.cpn-badge--on { background: #E7F6EC; color: #15803D; }
.aff-panel > .btn { margin-bottom: 4px; }
.aff-card { border: 1px solid #EEF0F3; border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.aff-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aff-card-meta { font-size: 12.5px; color: #6B7280; }
.aff-card-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 12px; font-size: 12.5px; color: #4B5563; }
.aff-card-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.aff-terms { flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #F0F1F4; }
.aff-terms-field { display: flex; flex-direction: column; gap: 6px; width: 150px; }
@media (max-width: 720px) {
    .cpn-grid { grid-template-columns: 1fr; }
    .cpn-form, .aff-panel { padding: 16px; }
    .cpn-list, .aff-panel { overflow-x: auto; }
}

/* ── Admin → People (js/account/people-admin.js, 2026-11-09) ───────────────── */
.ppl { max-width: 1320px; }
.ppl-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 18px; }
.ppl-stat { display: flex; align-items: baseline; gap: 7px; padding: 10px 14px; background: #fff; border: 1px solid #E2E4EA; border-radius: 10px; font: inherit; color: #4B5263; cursor: pointer; }
.ppl-stat strong { font-size: 18px; color: #14171F; }
.ppl-stat:disabled { cursor: default; }
.ppl-stat:not(:disabled):hover { border-color: #C9C6F7; }
.ppl-stat.is-on { border-color: var(--accent, #5B53E8); box-shadow: 0 0 0 3px rgba(91, 83, 232, .12); }
.ppl-card { background: #fff; border: 1px solid #E2E4EA; border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.ppl-card[hidden] { display: none; }
.ppl-card-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #14171F; }
.ppl-card-sub { margin: 0 0 12px; font-size: 13px; color: #6B7280; line-height: 1.45; }
.ppl-emails { width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px; font: inherit; font-size: 13.5px; }
.ppl-seg { display: inline-flex; gap: 2px; margin-top: 12px; padding: 3px; background: #F1F2F6; border-radius: 10px; }
.ppl-seg-btn { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: #4B5263; cursor: pointer; }
.ppl-seg-btn.is-on { background: #fff; color: var(--accent, #5B53E8); box-shadow: 0 1px 2px rgba(17, 24, 39, .08); }
.ppl-seg-btn:focus-visible { outline: 2px solid var(--accent, #5B53E8); outline-offset: 1px; }
.ppl-hint { margin: 8px 0 0; font-size: 12.5px; color: #6B7280; }
.ppl-projbox { margin-top: 12px; border: 1px solid #E2E4EA; border-radius: 10px; padding: 10px; }
.ppl-projbox[hidden] { display: none; }
.ppl-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ppl-pchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; background: #EEF0FF; color: #3F37C9; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.ppl-pchip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 5px; border-radius: 999px; }
.ppl-pchip-x:hover { background: rgba(63, 55, 201, .12); }
.ppl-projsearch { width: 100%; box-sizing: border-box; }
.ppl-projresults { max-height: 220px; overflow: auto; margin-top: 6px; }
.ppl-projrow { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.ppl-projrow:hover { background: #F7F8FA; }
.ppl-projname { font-weight: 600; color: #14171F; }
.ppl-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.ppl-results { margin-top: 12px; }
.ppl-results-h, .ppl-sub-h { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #646B78; margin: 14px 0 6px; }
.ppl-resrow { display: grid; grid-template-columns: minmax(160px, 260px) auto 1fr; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid #F1F2F6; font-size: 13px; }
.ppl-resmail { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-resmsg { color: #4B5263; }
.ppl-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ppl-pill.is-ok { background: #E7F6EC; color: #15803D; }
.ppl-pill.is-wait { background: #FFF6E5; color: #A15C00; }
.ppl-pill.is-warn { background: #FFF1E0; color: #B45309; }
.ppl-pill.is-err { background: #FDECEC; color: #B91C1C; }
.ppl-pill.is-muted { background: #F1F2F6; color: #5B6170; }
.ppl-toolbar { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.ppl-search { flex: 1; min-width: 200px; max-width: 360px; }
.ppl-rolefilter { width: auto; }
.ppl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #ECEEF2; border-radius: 10px; margin-bottom: 7px; }
.ppl-row.is-done { opacity: .75; }
.ppl-row-main { min-width: 0; }
.ppl-row-email { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-weight: 600; font-size: 14px; color: #14171F; word-break: break-all; }
.ppl-row-meta { margin-top: 3px; font-size: 12px; color: #6B7280; }
.ppl-row-note { margin-top: 3px; font-size: 12px; color: #4B5263; }
.ppl-row-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ppl-rolesel { width: auto; min-width: 110px; }
.ppl-badge { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.ppl-badge.is-admin { background: #EEF0FF; color: #4F46E5; }
.ppl-badge.is-manager { background: #E8F4FD; color: #1D6FB8; }
.ppl-badge.is-me { background: #E7F6EC; color: #15803D; }
.ppl-badge.is-off { background: #FDECEC; color: #B91C1C; }
.ppl-danger { color: #B91C1C; }
.ppl-muted { font-size: 12.5px; color: #646B78; }
.ppl-err { font-size: 13px; color: #B91C1C; }
.ppl-more { margin-top: 6px; }
@media (max-width: 720px) {
    .ppl-row { flex-direction: column; align-items: stretch; }
    .ppl-row-acts { justify-content: flex-end; }
    .ppl-resrow { grid-template-columns: 1fr; gap: 4px; }
}


/* Sign-up confirmation step (js/auth/auth-page.js _renderConfirmStep) */
.auth-input--code { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.auth-link--button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.auth-link--button:disabled { opacity: .5; cursor: default; }
.auth-link--button:focus-visible { outline: 2px solid var(--accent, #5B53E8); outline-offset: 2px; border-radius: 4px; }
