:root {
    --blue: #1877f2;
    --blue-dark: #1464cc;
    --blue-soft: #e7f3ff;
    --canvas: #f0f2f5;
    --surface: #fff;
    --surface-soft: #f7f8fa;
    --ink: #1c1e21;
    --muted: #65676b;
    --line: #dfe3e8;
    --line-strong: #ccd0d5;
    --green: #31a24c;
    --green-soft: #e6f4ea;
    --amber: #b26a00;
    --amber-soft: #fff4d6;
    --red: #d93025;
    --red-soft: #fdecea;
    --sidebar: 248px;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }
html { min-height: 100%; color: var(--ink); background: var(--canvas); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(24, 119, 242, .25); outline-offset: 2px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: var(--sidebar); padding: 22px 14px 16px; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; margin: 0 8px 26px; align-items: center; gap: 11px; color: var(--ink); font-size: 1.06rem; font-weight: 750; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 1rem; font-weight: 800; box-shadow: 0 5px 14px rgba(24,119,242,.22); }
.brand-mark--light { color: var(--blue); background: #fff; box-shadow: none; }
.brand--light { color: #fff; }
.main-navigation { display: grid; gap: 4px; }
.navigation-label { margin: 17px 12px 6px; color: #8a8d91; font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.navigation-link { display: flex; min-height: 44px; padding: 9px 11px; align-items: center; gap: 12px; border-radius: 9px; color: #4b4f56; font-size: .92rem; font-weight: 650; }
.navigation-link:hover { color: var(--ink); background: var(--surface-soft); text-decoration: none; }
.navigation-link--active { color: var(--blue); background: var(--blue-soft); }
.navigation-link svg { width: 21px; height: 21px; fill: currentColor; }
.sidebar-account { display: grid; margin-top: auto; padding: 13px 8px 0; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.account-details { min-width: 0; }
.account-details strong, .account-details span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details strong { font-size: .84rem; }
.account-details span { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.account-avatar { display: inline-grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #2d88ff, #1769d1); font-weight: 750; }
.account-avatar--large { width: 48px; height: 48px; font-size: 1.05rem; }
.icon-button { display: inline-grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--canvas); }
.icon-button svg { width: 20px; height: 20px; fill: currentColor; }
.app-content { min-height: 100vh; margin-left: var(--sidebar); }
.page-content { width: min(100%, 1500px); min-height: 100vh; padding: 40px clamp(24px, 3.2vw, 54px) 70px; }
.mobile-header { display: none; }
.sidebar-backdrop[hidden] { display: none; }

/* Typography and actions */
.page-heading { margin-bottom: 28px; }
.page-heading--actions, .section-heading--actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-heading h1, .campaign-workspace-title h1 { margin: 0; font-size: clamp(1.75rem, 2.6vw, 2.35rem); line-height: 1.15; letter-spacing: -.035em; }
.page-description, .section-heading p, .campaign-section-intro p { max-width: 720px; margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted-copy { color: var(--muted); }
.primary-button, .secondary-button, .danger-button, .button-link { display: inline-flex; min-height: 40px; padding: 0 16px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; font-size: .86rem; font-weight: 700; line-height: 1; cursor: pointer; }
.button-link:hover { text-decoration: none; }
.primary-button { color: #fff; background: var(--blue); }
.primary-button:hover { color: #fff; background: var(--blue-dark); }
.secondary-button { color: #34373c; border-color: var(--line-strong); background: #fff; }
.secondary-button:hover { color: var(--ink); background: var(--surface-soft); }
.danger-button { color: #fff; background: var(--red); }
.text-button, .icon-link { display: inline-flex; padding: 7px 4px; border: 0; color: var(--blue); background: transparent; font-size: .83rem; font-weight: 700; cursor: pointer; }
.text-button--danger { color: var(--red); }
.compact-button { min-height: 32px; padding: 0 11px; font-size: .77rem; }

/* Feedback and states */
.message-stack { position: fixed; z-index: 50; top: 22px; right: 24px; display: grid; width: min(390px, calc(100vw - 32px)); gap: 8px; }
.message { padding: 13px 15px; border: 1px solid #bad5fb; border-radius: 9px; color: #174a85; background: var(--blue-soft); box-shadow: var(--shadow); font-size: .86rem; }
.message--success { color: #1d6731; border-color: #b8dfc2; background: var(--green-soft); }
.message--error { color: #98251e; border-color: #f4c0bc; background: var(--red-soft); }
.message--warning { color: #825100; border-color: #efd796; background: var(--amber-soft); }
.status-badge { display: inline-flex; width: fit-content; min-height: 25px; padding: 3px 9px; align-items: center; border-radius: 999px; color: #51545a; background: #eceff2; font-size: .7rem; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.status-badge--running, .status-badge--queued, .status-badge--searching, .status-badge--monitoring { color: #15569b; background: var(--blue-soft); }
.status-badge--active, .status-badge--success, .status-badge--succeeded, .status-badge--selected, .status-badge--completed { color: #22743a; background: var(--green-soft); }
.status-badge--warning, .status-badge--pending, .status-badge--pending_approval, .status-badge--discovered { color: #8a5500; background: var(--amber-soft); }
.status-badge--failed, .status-badge--cancelled, .status-badge--excluded, .status-badge--rejected, .status-badge--removed { color: #a32d25; background: var(--red-soft); }
.status-badge--paused, .status-badge--draft, .status-badge--neutral { color: #5f6368; background: #eceff2; }
.inline-alert { display: flex; margin: 0 0 18px; padding: 12px 14px; align-items: flex-start; gap: 10px; border-radius: 9px; color: #205a91; background: var(--blue-soft); font-size: .84rem; line-height: 1.45; }
.inline-alert--warning { color: #825100; background: var(--amber-soft); }
.inline-alert svg { width: 18px; height: 18px; flex: 0 0 auto; fill: currentColor; }
.error-copy { color: var(--red) !important; }
.success-copy { color: var(--green) !important; font-weight: 650; }

/* Cards and empty states */
.panel, .campaign-card, .account-card, .form-section, .campaign-section, .coming-soon-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.empty-state, .inline-empty-state { display: flex; padding: 54px 24px; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,.62); }
.empty-state--compact { padding: 42px 24px; }
.empty-state h2, .inline-empty-state strong { margin: 14px 0 0; }
.empty-state p, .inline-empty-state span { max-width: 520px; margin: 8px 0 20px; color: var(--muted); line-height: 1.5; }
.empty-state-icon, .coming-soon-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }
.empty-state-icon svg, .coming-soon-icon svg { width: 26px; height: 26px; fill: currentColor; }
.coming-soon-card { min-height: 440px; padding: clamp(32px, 6vw, 74px); align-items: flex-start; background: radial-gradient(circle at 90% 10%, #e7f3ff 0, transparent 38%), #fff; }
.coming-soon-card h2 { max-width: 670px; margin: 16px 0 0; font-size: clamp(1.7rem, 3vw, 2.65rem); letter-spacing: -.04em; }
.coming-soon-card > p { max-width: 650px; margin: 14px 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.soft-label { margin-top: 30px; padding: 5px 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.coming-soon-actions { display: flex; gap: 9px; }

/* Lists */
.campaign-list { display: grid; gap: 16px; }
.campaign-card { overflow: hidden; }
.campaign-card__top { display: grid; padding: 22px 24px; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 16px; }
.campaign-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); }
.campaign-icon svg { width: 22px; height: 22px; fill: currentColor; }
.campaign-card__identity > div { display: flex; align-items: center; gap: 10px; }
.campaign-card h2 { margin: 0; font-size: 1.08rem; }
.campaign-card h2 a { color: var(--ink); }
.campaign-card__identity p { margin: 7px 0 0; color: var(--muted); font-size: .86rem; }
.campaign-stats { display: grid; margin: 0; padding: 15px 24px; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); background: var(--surface-soft); }
.campaign-stats div { padding: 0 18px; border-right: 1px solid var(--line); }
.campaign-stats div:first-child { padding-left: 0; }
.campaign-stats div:last-child { border: 0; }
.campaign-stats dt { color: var(--muted); font-size: .72rem; }
.campaign-stats dd { margin: 4px 0 0; font-size: .9rem; font-weight: 750; }
.campaign-card__footer { display: flex; padding: 13px 24px; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .79rem; }
.campaign-card__footer a { display: inline-flex; align-items: center; gap: 5px; font-weight: 750; white-space: nowrap; }
.campaign-card__footer svg { width: 16px; height: 16px; fill: currentColor; }
.account-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.account-card { padding: 22px; }
.account-card__header { display: flex; align-items: center; gap: 13px; }
.account-card h2, .campaign-account-card h3 { margin: 0; font-size: 1rem; }
.account-card__header p, .campaign-account-card__identity p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.account-statuses { display: flex; margin-top: 18px; flex-wrap: wrap; gap: 6px; }
.account-policy, .account-mini-details { display: grid; margin: 18px 0; gap: 10px; }
.account-policy div, .account-mini-details div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.account-policy dt, .account-mini-details dt { color: var(--muted); font-size: .75rem; }
.account-policy dd, .account-mini-details dd { margin: 0; text-align: right; font-size: .79rem; font-weight: 650; }
.account-card-actions { display: flex; padding-top: 15px; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.account-card-actions .text-button { margin-left: auto; }

/* Campaign workspace */
.campaign-workspace-header { margin: -40px calc(clamp(24px, 3.2vw, 54px) * -1) 28px; padding: 25px clamp(24px, 3.2vw, 54px) 0; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumbs { display: flex; margin-bottom: 15px; gap: 7px; color: var(--muted); font-size: .76rem; }
.breadcrumbs a { color: var(--muted); }
.campaign-workspace-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.campaign-workspace-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.campaign-workspace-heading > div > p { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
.campaign-workspace-actions { display: flex; align-items: center; gap: 8px; }
.campaign-tabs { display: flex; margin-top: 25px; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.campaign-tab { display: inline-flex; min-height: 44px; padding: 0 13px; align-items: center; gap: 6px; border-bottom: 3px solid transparent; color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.campaign-tab:hover { color: var(--ink); text-decoration: none; }
.campaign-tab--active { color: var(--blue); border-bottom-color: var(--blue); }
.campaign-tab span { display: inline-grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 999px; background: var(--canvas); font-size: .67rem; }
.campaign-overview-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr); gap: 16px; }
.campaign-readiness, .next-step-card { padding: 23px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2, .next-step-card h2 { margin: 0; font-size: 1.18rem; }
.readiness-score { color: var(--muted); font-size: .75rem; }
.readiness-list { display: grid; margin-top: 17px; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.readiness-item { display: flex; padding: 13px; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.readiness-item:hover { border-color: #b5cff2; background: #fafcff; text-decoration: none; }
.readiness-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }
.readiness-item--ready .readiness-icon { color: var(--green); background: var(--green-soft); }
.readiness-icon svg { width: 16px; height: 16px; fill: currentColor; }
.readiness-item strong, .readiness-item small { display: block; }
.readiness-item strong { font-size: .82rem; }
.readiness-item small { margin-top: 3px; color: var(--muted); font-size: .71rem; line-height: 1.3; }
.campaign-readiness .inline-alert { margin: 14px 0 0; }
.next-step-card { background: linear-gradient(145deg, #fff, #f4f8fe); }
.next-step-card p:not(.eyebrow) { margin: 10px 0 20px; color: var(--muted); font-size: .87rem; line-height: 1.55; }
.metric-grid { display: grid; margin-top: 16px; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card { display: flex; min-height: 128px; padding: 18px; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.metric-card:hover { border-color: #b5cff2; text-decoration: none; }
.metric-card span { color: var(--muted); font-size: .75rem; }
.metric-card strong { margin-top: auto; font-size: 1.8rem; letter-spacing: -.04em; }
.metric-card small { margin-top: 3px; color: var(--muted); }
.campaign-section { padding: 24px; }
.section-heading, .campaign-section-intro { margin-bottom: 21px; }
.section-heading h2, .campaign-section-intro h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.campaign-account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px,1fr)); gap: 12px; }
.campaign-account-card { display: grid; padding: 18px; grid-template-columns: auto minmax(0,1fr); gap: 11px; border: 1px solid var(--line); border-radius: 10px; }
.campaign-account-card .account-statuses, .campaign-account-card .account-mini-details, .campaign-account-card > a { grid-column: 1 / -1; }

/* Forms */
.settings-form { display: grid; max-width: 1000px; gap: 16px; }
.form-section { display: grid; padding: 24px; grid-template-columns: 220px minmax(0,1fr); gap: 28px; }
.form-section-heading h2 { margin: 0; font-size: 1rem; }
.form-section-heading p { margin: 7px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.form-grid--three { grid-template-columns: repeat(3,1fr); }
.form-grid--four { grid-template-columns: repeat(4,1fr); }
.form-grid-full { grid-column: 1 / -1; }
.form-field { display: grid; gap: 7px; }
.form-field label, .choice-field-label, .filter-bar label { color: #3d4147; font-size: .78rem; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea, .filter-bar input, .filter-bar select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; }
.form-field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.form-field input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--blue); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(24,119,242,.12); }
.field-help { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.field-error { margin: 0; color: var(--red); font-size: .74rem; }
.form-alert { padding: 12px 14px; border: 1px solid #efbbb7; border-radius: 8px; color: #9c2d25; background: var(--red-soft); }
.choice-field ul { display: grid; margin: 4px 0 0; padding: 0; gap: 8px; list-style: none; }
.choice-field li label { display: flex; padding: 11px 12px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.choice-field input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--blue); }
.form-actions { display: flex; padding: 12px 0; align-items: center; justify-content: flex-end; gap: 8px; }
.post-template-form { display: grid; max-width: 760px; gap: 17px; }

/* Discovery */
.keyword-form { display: grid; max-width: 820px; margin-bottom: 28px; padding: 18px; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.keyword-form textarea { min-height: 230px; background: #fff; }
.keyword-form .primary-button { width: fit-content; height: 38px; min-height: 38px; }
.discovery-examples { display: flex; flex-wrap: wrap; gap: 7px; }
.discovery-examples span { padding: 6px 9px; border-radius: 7px; color: var(--muted); background: #fff; font-size: .72rem; }
.discovery-examples strong { margin-right: 4px; color: var(--blue); }
.split-list-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.list-heading { display: flex; margin-bottom: 9px; align-items: center; justify-content: space-between; }
.list-heading h3 { margin: 0; font-size: .9rem; }
.list-heading > span { color: var(--muted); font-size: .78rem; }
.simple-list { display: grid; gap: 7px; }
.simple-list-row { display: flex; min-height: 64px; padding: 11px 12px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.simple-list-row > div { min-width: 0; margin-right: auto; }
.simple-list-row strong, .simple-list-row div > span { display: block; }
.simple-list-row strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; }
.simple-list-row div > span { margin-top: 3px; color: var(--muted); font-size: .7rem; }

/* Filters and tables */
.filter-bar { display: flex; margin-bottom: 16px; padding: 12px; align-items: flex-end; flex-wrap: wrap; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.filter-bar > div { display: grid; min-width: 170px; gap: 5px; }
.filter-bar .filter-search { min-width: min(360px,100%); flex: 1; }
.filter-bar input, .filter-bar select { min-height: 38px; padding: 7px 10px; font-size: .8rem; }
.filter-bar .secondary-button { min-height: 38px; }
.group-summary { display: grid; margin-bottom: 15px; grid-template-columns: repeat(4,1fr); gap: 8px; }
.group-summary__item { display: flex; min-height: 72px; padding: 13px 15px; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.group-summary__item span { color: var(--muted); font-size: .7rem; }
.group-summary__item strong { margin-top: 3px; font-size: 1.2rem; }
.compact-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.compact-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.compact-table th { padding: 11px 13px; color: var(--muted); background: var(--surface-soft); font-size: .67rem; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.compact-table td { padding: 12px 13px; border-top: 1px solid var(--line); vertical-align: middle; }
.compact-table tbody tr:hover { background: #fafcff; }
.compact-table td > strong, .compact-table td > span:not(.status-badge), .scheduled-action-table td > span:not(.status-badge) { display: block; }
.compact-table td > span:not(.status-badge), .scheduled-action-table td > span:not(.status-badge) { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.group-table__identity { min-width: 230px; }
.group-table__identity a, .group-table__identity > span { display: block; }
.group-table__identity > span { margin-top: 4px; color: var(--muted); font-size: .69rem; }
.compact-description { max-width: 280px; }
.compact-stack { display: grid; gap: 5px; }
.compact-stack span { font-size: .69rem; }
.group-status-stack { display: grid; min-width: 150px; gap: 6px; }
.group-status-stack > span:not(.status-badge), .group-status-stack > strong { color: var(--muted); font-size: .7rem; line-height: 1.35; }
.membership-state { display: inline-flex; margin-left: 3px; padding: 2px 6px; border-radius: 999px; color: var(--muted); background: #edf0f2; }
.membership-state--joined { color: #22743a; background: var(--green-soft); }
.membership-state--pending, .membership-state--join_requested { color: #8a5500; background: var(--amber-soft); }
.status-badge--approved { color: #22743a; background: var(--green-soft); }
.status-badge--unassessed { color: #5f6368; background: #eceff2; }
.status-badge--error { color: #a32d25; background: var(--red-soft); }
.compact-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.action-menu { position: relative; min-width: 110px; }
.action-menu summary { display: inline-flex; min-height: 34px; padding: 0 11px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 8px; color: #34373c; background: #fff; font-size: .77rem; font-weight: 700; cursor: pointer; list-style: none; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu summary::after { margin-left: 7px; color: var(--muted); content: "⌄"; font-size: .9rem; }
.action-menu[open] summary { border-color: #a9caf4; color: var(--blue-dark); background: var(--blue-soft); }
.action-menu__content { position: absolute; z-index: 10; top: calc(100% + 5px); right: 0; display: grid; min-width: 175px; padding: 6px; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 8px 24px rgba(28,30,33,.14); }
.action-menu__content form, .action-menu__content button, .action-menu__content .muted-copy { width: 100%; }
.action-menu__content button { justify-content: flex-start; }
.action-menu__content .muted-copy { padding: 6px 8px; line-height: 1.35; }
.pagination { display: flex; margin-top: 15px; align-items: center; justify-content: center; gap: 13px; color: var(--muted); font-size: .76rem; }

/* Dashboard */
.dashboard-metrics { display: grid; margin-bottom: 18px; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dashboard-metric { display: flex; min-height: 124px; padding: 17px; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.dashboard-metric:hover { border-color: #a9caf4; text-decoration: none; }
.dashboard-metric span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.dashboard-metric strong { margin-top: auto; font-size: 1.9rem; letter-spacing: -.04em; }
.dashboard-metric small { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.dashboard-metric--attention strong { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.8fr); gap: 16px; }
.dashboard-panel { padding: 21px; }
.dashboard-panel h2 { margin: 0; font-size: 1.12rem; }
.dashboard-campaign-list, .dashboard-links { display: grid; margin-top: 16px; gap: 7px; }
.dashboard-campaign { display: grid; padding: 11px; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.dashboard-campaign:hover { border-color: #a9caf4; background: #fafcff; text-decoration: none; }
.dashboard-campaign__icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: var(--blue); background: var(--blue-soft); }
.dashboard-campaign__icon svg { width: 15px; height: 15px; fill: currentColor; }
.dashboard-campaign strong, .dashboard-campaign small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-campaign small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.dashboard-panel--next { background: linear-gradient(145deg, #fff, #f4f8fe); }
.dashboard-panel--next > p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.dashboard-links a { display: grid; padding: 10px 0; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); color: var(--ink); }
.dashboard-links a:last-child { border-bottom: 0; }
.dashboard-links a:hover { text-decoration: none; }
.dashboard-link__number { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 800; }
.dashboard-links strong, .dashboard-links small { display: block; }
.dashboard-links small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.dashboard-empty { display: grid; margin-top: 16px; padding: 25px 12px; gap: 8px; color: var(--muted); font-size: .8rem; }
.dashboard-empty strong { color: var(--ink); font-size: .9rem; }

/* Scenario */
.scenario-list { max-width: 900px; }
.scenario-variation { min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; }
.scenario-variation legend { padding: 0 6px; font-weight: 700; }
.scenario-step { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: start; gap: 12px; }
.scenario-step__rail { position: relative; display: flex; height: 100%; justify-content: center; }
.scenario-step__number { display: grid; width: 34px; height: 34px; z-index: 1; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--blue); box-shadow: 0 0 0 1px #aacbf6; font-size: .75rem; font-weight: 800; }
.scenario-step__body { min-height: 105px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.scenario-step__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scenario-step__heading strong, .scenario-kind { display: block; }
.scenario-kind { margin-bottom: 4px; color: var(--blue); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.scenario-step__heading strong { font-size: .85rem; }
.scenario-target { margin-top: 11px; padding: 7px 9px; border-left: 3px solid #a9caf4; color: var(--muted); background: #f6f9fd; font-size: .73rem; }
.scenario-content { max-width: 620px; margin-top: 12px; color: #303338; font-size: .85rem; line-height: 1.55; }
.scenario-step__media { width: min(100%, 320px); margin-top: 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #000; }
.scenario-step__media img, .scenario-step__media video { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.scenario-step__media--edit { width: min(100%, 360px); }
.scenario-delay { display: grid; height: 58px; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px; color: var(--muted); font-size: .68rem; }
.scenario-delay > span:first-child { width: 100%; height: 1px; grid-column: 2; grid-row: 1; background: var(--line); }
.scenario-delay > span:last-child { display: none; }
.scenario-delay strong { z-index: 1; display: inline-flex; width: fit-content; min-height: 26px; padding: 0 11px; align-items: center; justify-self: center; grid-column: 2; grid-row: 1; border: 1px solid #d8e3f2; border-radius: 999px; color: #526275; background: #fff; font-weight: 700; white-space: nowrap; }
.scenario-delay strong::before { width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #7ba9e6; content: ""; }
.scenario-step__actions { display: flex; margin-top: 15px; padding-top: 12px; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.execution-timeline { position: relative; max-width: 960px; margin: 0; padding: 0 0 0 28px; list-style: none; }
.execution-timeline::before { position: absolute; inset: 0 auto 0 8px; width: 2px; background: #cadcf3; content: ""; }
.execution-item { position: relative; margin-bottom: 13px; }
.execution-marker { position: absolute; top: 22px; left: -25px; width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #a9caf4; }
.execution-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.execution-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.execution-card__header span:first-child { color: var(--muted); font-size: .69rem; }
.execution-card h3 { margin: 3px 0 0; font-size: .94rem; }
.execution-details { display: grid; margin: 14px 0 0; gap: 8px; }
.execution-details div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; }
.execution-details dt { color: var(--muted); font-size: .71rem; }
.execution-details dd { margin: 0; font-size: .76rem; line-height: 1.45; }
.execution-error dd { color: var(--red); }
.back-link { display: inline-block; margin-bottom: 17px; font-size: .76rem; font-weight: 700; }
.confirmation-wrap { max-width: 620px; margin: 30px auto; }
.confirmation-card { padding: clamp(25px,5vw,44px); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; background: #fff; box-shadow: var(--shadow); }
.confirmation-card h1 { margin: 10px 0 0; font-size: 1.55rem; letter-spacing: -.03em; }
.confirmation-card > p:not(.eyebrow) { margin: 12px auto 22px; color: var(--muted); line-height: 1.55; }
.danger-mark { display: grid; width: 48px; height: 48px; margin: 0 auto 18px; place-items: center; border-radius: 50%; color: var(--red); background: var(--red-soft); font-size: 1.2rem; font-weight: 850; }
.form-actions--center { justify-content: center; }

/* Authentication */
.auth-page { background: #fff; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px,1.05fr) minmax(430px,.95fr); }
.auth-intro { display: flex; min-height: 100vh; padding: clamp(38px,6vw,80px); flex-direction: column; justify-content: space-between; color: rgba(255,255,255,.82); background: radial-gradient(circle at 12% 82%, rgba(255,255,255,.13), transparent 30%), linear-gradient(145deg, #0f5fc4, #1877f2 62%, #4599ff); }
.auth-intro-copy { max-width: 610px; }
.auth-pill { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 700; }
.auth-intro h1 { margin: 20px 0 0; color: #fff; font-size: clamp(2.4rem,5vw,4.7rem); line-height: 1.02; letter-spacing: -.055em; }
.auth-intro-copy p { max-width: 520px; margin: 22px 0 0; font-size: 1rem; line-height: 1.65; }
.auth-footnote { margin: 0; font-size: .78rem; }
.auth-form-panel { display: grid; min-height: 100vh; padding: 42px; place-items: center; }
.auth-form-wrap { width: min(100%,410px); }
.auth-form-heading h2 { margin: 0; font-size: 1.85rem; letter-spacing: -.035em; }
.auth-form-heading > p:last-child { margin: 9px 0 0; color: var(--muted); }
.auth-form { display: grid; margin-top: 29px; gap: 18px; }
.auth-submit { width: 100%; min-height: 46px; }

@media (max-width: 1100px) {
    .campaign-overview-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: repeat(2,1fr); }
    .form-section { grid-template-columns: 1fr; gap: 18px; }
    .form-grid--four { grid-template-columns: repeat(2,1fr); }
    .split-list-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    :root { --sidebar: 260px; }
    .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: 12px 0 30px rgba(0,0,0,.12); }
    .sidebar--open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.38); }
    .app-content { margin-left: 0; }
    .mobile-header { position: sticky; top: 0; z-index: 20; display: flex; height: 58px; padding: 0 15px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
    .mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: .9rem; font-weight: 750; }
    .mobile-brand:hover { text-decoration: none; }
    .mobile-brand .brand-mark { width: 28px; height: 28px; font-size: .77rem; }
    .page-content { min-height: calc(100vh - 58px); padding: 26px 17px 52px; }
    .campaign-workspace-header { margin: -26px -17px 22px; padding: 20px 17px 0; }
    .campaign-workspace-heading { flex-direction: column; }
    .campaign-workspace-actions { width: 100%; flex-wrap: wrap; }
    .campaign-workspace-actions > a, .campaign-workspace-actions form { flex: 1; }
    .campaign-workspace-actions button { width: 100%; }
    .account-list { grid-template-columns: 1fr; }
    .compact-table-wrap { overflow-x: auto; }
    .group-table { min-width: 850px; }
    .action-menu__content { position: static; margin-top: 6px; box-shadow: none; }
    .scheduled-action-table { min-width: 850px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-intro { min-height: 380px; }
    .auth-form-panel { min-height: auto; padding: 48px 24px; }
}

@media (max-width: 620px) {
    .page-heading--actions, .section-heading--actions { flex-direction: column; }
    .page-heading--actions > a, .section-heading--actions > a { width: 100%; }
    .campaign-stats { grid-template-columns: repeat(2,1fr); gap: 14px 0; }
    .campaign-stats div:nth-child(2) { border-right: 0; }
    .campaign-card__top { grid-template-columns: auto minmax(0,1fr); padding: 18px; }
    .campaign-card__top > .icon-link { grid-column: 2; justify-self: start; }
    .campaign-card__identity > div { align-items: flex-start; flex-direction: column; }
    .campaign-card__footer { align-items: flex-start; flex-direction: column; }
    .readiness-list, .metric-grid, .group-summary, .dashboard-metrics { grid-template-columns: 1fr 1fr; }
    .campaign-readiness, .next-step-card, .campaign-section { padding: 18px; }
    .form-grid, .form-grid--three, .form-grid--four { grid-template-columns: 1fr; }
    .form-grid-full { grid-column: auto; }
    .form-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -17px -12px; padding: 12px 17px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
    .scenario-step { grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
    .scenario-step__number { width: 30px; height: 30px; }
    .scenario-delay { grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
    .filter-bar > div { min-width: 100%; }
    .compact-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .group-table, .scheduled-action-table { display: block; min-width: 0; }
    .group-table thead, .scheduled-action-table thead { display: none; }
    .group-table tbody, .scheduled-action-table tbody { display: grid; gap: 11px; }
    .group-table tr, .scheduled-action-table tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
    .group-table td, .scheduled-action-table td { display: grid; padding: 10px 13px; grid-template-columns: 96px minmax(0,1fr); gap: 10px; border-top: 1px solid var(--line); }
    .group-table td:first-child, .scheduled-action-table td:first-child { border-top: 0; }
    .group-table td::before, .scheduled-action-table td::before { color: var(--muted); content: attr(data-label); font-size: .67rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
    .group-table .group-table__group { display: block; }
    .group-table .group-table__group::before { display: block; margin-bottom: 8px; }
    .group-table__identity { min-width: 0; }
    .action-menu { width: 100%; }
    .action-menu summary { width: 100%; }
    .coming-soon-actions { width: 100%; flex-direction: column; }
    .auth-intro { min-height: 330px; padding: 34px 24px; }
    .auth-intro h1 { font-size: 2.25rem; }
    .auth-footnote { display: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Campaign group overview */
.group-overview { min-width: 0; }
.group-overview h2, .group-overview h3, .group-overview h4 { overflow-wrap: anywhere; }
.overview-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.overview-summary > div, .overview-section { border: 1px solid var(--border-color, #dde3ea); border-radius: 12px; padding: 1.25rem; background: var(--surface, #fff); }
.overview-summary span, .overview-summary strong, .group-overview td small { display: block; }
.overview-summary strong { margin: .4rem 0; }
.overview-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }
.overview-section { margin-bottom: 1.5rem; min-width: 0; }
.overview-section > h3 { margin-top: 0; }
.overview-section summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.overview-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .8rem 0; }
.overview-attempt { border-top: 1px solid #dde3ea; padding-top: 1rem; margin-top: 1rem; }
.overview-media img, .overview-media video { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; }
.group-overview .execution-card { min-width: 0; }
.group-overview .compact-table td { overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .overview-summary { grid-template-columns: 1fr; }
    .group-overview .section-heading, .group-overview .execution-card__header { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .overview-section { padding: .9rem; }
}
.group-overview .compact-table-wrap { overflow-x: auto; }
.group-overview .compact-button { white-space: nowrap; }
@media (max-width: 620px) {
    .group-overview .compact-table { min-width: 560px; }
    .group-overview .execution-details div { grid-template-columns: 1fr; gap: .25rem; }
}
