:root {
    --bg: #faf6fb;
    --bg-deep: #281333;
    --panel: #fffafe;
    --panel-soft: #f7edf8;
    --ink: #25142f;
    --muted: #7b6a82;
    --line: #ead8ee;
    --line-strong: #d8b8e0;
    --primary: #8b2bd6;
    --primary-dark: #5f1999;
    --pink: #e2368f;
    --rose: #ff5a9f;
    --lavender: #efe1f7;
    --danger: #cf2f68;
    --warning: #a950b5;
    --success: #9a34c8;
    --brand-gradient: linear-gradient(135deg, #7028e4 0%, #b72fce 46%, #ff4f9a 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(112, 40, 228, 0.11), rgba(255, 79, 154, 0.13));
    --surface-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 244, 253, 0.96));
    --shadow: 0 16px 40px rgba(63, 24, 79, 0.09);
    --shadow-soft: 0 8px 22px rgba(63, 24, 79, 0.07);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% -12%, rgba(255, 90, 159, 0.15), transparent 32%),
        radial-gradient(circle at 86% 10%, rgba(112, 40, 228, 0.14), transparent 34%),
        linear-gradient(180deg, #fff9fd 0%, var(--bg) 46%, #f6edf8 100%);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--pink); }
h1, h2, h3, p { margin-top: 0; }
h1 {
    font-size: 28px;
    margin-bottom: 0;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
h2 { font-size: 18px; margin-bottom: 0; color: #32143e; }
h3 { font-size: 15px; color: #3d1b48; }
small { color: var(--muted); display: block; margin-top: 4px; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    background:
        linear-gradient(180deg, rgba(38, 17, 52, 0.97), rgba(72, 24, 84, 0.98)),
        var(--brand-gradient);
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    box-shadow: 18px 0 40px rgba(63, 24, 79, 0.16);
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand { color: #fff; display: flex; align-items: center; gap: 12px; }
.brand:hover { color: #fff; }
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #fff;
    box-shadow: 0 12px 28px rgba(255, 90, 159, 0.24);
    overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand small { color: #f2d9f4; }

.nav { display: grid; gap: 6px; }
.nav a {
    color: #f5e8f7;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-group {
    display: grid;
    gap: 4px;
}
.nav-sub {
    display: none;
    gap: 3px;
    margin-left: 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.nav-group.active .nav-sub { display: grid; }
.nav-sub a {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 750;
}
.nav-sub .material-symbols-rounded { font-size: 18px; }
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'liga';
}
.nav a.active, .nav a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: inset 3px 0 0 #ff78b9;
}
.nav a.active .material-symbols-rounded { color: #ffb0d5; }
.sidebar-note {
    margin-top: auto;
    color: #f4e3f7;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
}
.sidebar-logout { margin: -18px 0 0; }
.logout-button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 11px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .16s ease, transform .16s ease;
}
.logout-button:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff78b9; margin-right: 6px; }

.main { padding: 28px; overflow-x: hidden; }
.mobile-menu-toggle,
.sidebar-close,
.sidebar-backdrop {
    display: none;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.eyebrow { color: var(--pink); font-size: 13px; font-weight: 800; margin-bottom: 4px; text-transform: uppercase; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.account-switcher {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
    box-shadow: var(--shadow-soft);
}
.account-switcher select {
    width: auto;
    min-width: 180px;
    border: 0;
    padding: 0;
    background: transparent;
    font-weight: 800;
}

.notice, .alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.notice {
    background: linear-gradient(135deg, #f2e3f8, #ffe8f3);
    color: #662175;
    border: 1px solid #ddb8e7;
}
.alert {
    background: linear-gradient(135deg, #fff0f7, #f4e4fb);
    color: #8c1f5a;
    border: 1px solid #f2b8d2;
}
.alert.small { margin-top: 16px; font-size: 13px; }
.neco-swal-popup {
    border-radius: 14px;
    border: 1px solid #e7cfe9;
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(63, 24, 79, 0.18);
}
.neco-swal-popup .swal2-title {
    color: var(--ink);
    font-size: 22px;
}
.neco-swal-popup .swal2-html-container {
    color: var(--muted);
    font-size: 15px;
}
.neco-swal-confirm,
.neco-swal-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 900;
    cursor: pointer;
}
.neco-swal-confirm {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 10px 24px rgba(139, 43, 214, 0.23);
}
.neco-swal-cancel {
    background: #fffafd;
    color: var(--ink);
    border-color: #e7cfe9;
}
.neco-swal-confirm:focus,
.neco-swal-cancel:focus {
    outline: 3px solid rgba(181, 54, 211, .18);
    outline-offset: 2px;
}

.button {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button .material-symbols-rounded {
    font-size: 20px;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.button.primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 10px 24px rgba(139, 43, 214, 0.23);
}
.button.primary:hover { box-shadow: 0 13px 30px rgba(226, 54, 143, 0.28); }
.button.subtle {
    background: #fffafd;
    color: var(--ink);
    border: 1px solid #e7cfe9;
    box-shadow: var(--shadow-soft);
}
.button.subtle:hover { border-color: #d59edf; background: #fff4fb; }
.button.danger {
    background: #fff0f6;
    color: var(--danger);
    border: 1px solid #f3bdd3;
}
.button.danger:hover { background: #ffe2ef; }
.button.compact-button {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 13px;
}
.button.full { width: 100%; }
.actions-inline { display: flex; align-items: center; gap: 8px; }
.actions-inline form { margin: 0; }
.actions-menu {
    position: relative;
    display: inline-flex;
}
.actions-menu summary {
    list-style: none;
    user-select: none;
}
.actions-menu summary::-webkit-details-marker { display: none; }
.actions-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: min(320px, calc(100vw - 36px));
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
    box-shadow: 0 18px 42px rgba(63, 24, 79, 0.18);
}
.actions-menu-panel form { margin: 0; }
.actions-menu-panel #list-pagespeed-form {
    display: grid;
    gap: 6px;
}
.menu-action {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}
.menu-action:hover {
    background: #fff1fa;
    color: var(--primary);
}
.menu-action.danger { color: var(--danger); }
.menu-action.danger:hover { background: #fff0f6; color: var(--danger); }
.menu-action-settings {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff7fc;
}
.menu-action-settings label {
    font-size: 12px;
}
.menu-action-settings .compact-select {
    width: 100%;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.inline-expand-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.inline-expand-form input {
    width: 96px;
    min-height: 40px;
    padding: 9px 10px;
    font-weight: 800;
}
#list-pagespeed-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.compact-select {
    width: auto;
    min-width: 128px;
    padding: 8px 32px 8px 10px;
    font-size: 13px;
    font-weight: 750;
}
.compact-check {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.panel, .card, .metric {
    background: var(--surface-gradient);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.panel { padding: 20px; margin-bottom: 18px; }
.panel.compact { padding: 16px 20px; }
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.variable-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
}
.variable-strip.compact { margin-top: 16px; }
.variable-strip strong { color: var(--primary-dark); }
.variable-groups {
    display: grid;
    gap: 12px;
}
.variable-groups.compact { margin-top: 16px; }
.variable-group {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
}
.variable-group .variable-strip {
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.choice-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
}
.choice-card input { margin-top: 4px; }
.choice-card strong,
.choice-card small { overflow-wrap: anywhere; }

.stats-grid, .cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.metric { padding: 18px; }
.metric span { color: var(--muted); font-weight: 700; }
.metric strong { display: block; font-size: 30px; margin-top: 8px; color: var(--primary); }
.campaign-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
.campaign-stats > .metric:not(.email-delivery-summary) {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.25;
}
.campaign-stats > .metric:not(.email-delivery-summary) span,
.campaign-stats > .metric:not(.email-delivery-summary) strong {
    display: inline;
    margin: 0;
    font-size: 12px;
    line-height: inherit;
}
.campaign-stats > .metric:not(.email-delivery-summary) span::after {
    content: ":";
}
.campaign-stats > .metric:not(.email-delivery-summary) strong {
    overflow-wrap: anywhere;
}
.email-delivery-summary { grid-column: 1 / -1; }
.email-delivery-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.email-delivery-heading strong { margin-top: 0; }
.email-delivery-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.email-delivery-breakdown > div {
    min-width: 0;
    padding-left: 12px;
    border-left: 3px solid var(--line);
}
.email-delivery-breakdown strong {
    margin-top: 4px;
    font-size: 20px;
    overflow-wrap: anywhere;
}
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.content-grid.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); }
.content-grid.wide-left.email-sequence-layout {
    grid-template-columns: 1fr;
}

.list-stack { display: grid; gap: 10px; }
.row-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fffafd;
}
.row-link:hover { border-color: #d9a7df; box-shadow: 0 8px 20px rgba(63, 24, 79, 0.07); color: var(--ink); }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.company-link-line {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.text-link-secondary {
    font-size: 12px;
    font-weight: 800;
    color: #9a35b8;
    white-space: nowrap;
}
.text-link-secondary:hover {
    color: var(--accent);
}

.badge, .pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    background: #f3e3f7;
    color: #63306f;
    font-size: 12px;
    font-weight: 800;
}
.badge.neutral {
    background: #f1edf4;
    color: #66536d;
}
.badge.danger {
    background: #ffe3eb;
    color: #b4234f;
    border: 1px solid #f5b2c6;
}
.badge.interested {
    background: #f0dffc;
    color: #7424a8;
    border: 1px solid #d9b7ee;
}
.badge.success {
    background: #dcf7e7;
    color: #176b3a;
    border: 1px solid #9edbb8;
}
.company-outcome-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.recipient-outcome-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.recipient-outcome-form select {
    width: 150px;
    min-width: 150px;
}
.recipient-outcome-form .button {
    width: 38px;
    min-width: 38px;
    padding-inline: 7px;
}
.pill.ok {
    background: linear-gradient(135deg, #f0dcfb, #ffe0ef);
    color: #7a247d;
    border: 1px solid #e4b7e9;
}
.score {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 30px;
    border-radius: 8px;
    background: var(--brand-gradient-soft);
    color: var(--primary-dark);
    font-weight: 900;
}
.contact-stack {
    display: grid;
    gap: 3px;
    min-width: 190px;
}
.contact-stack span,
.contact-stack small,
.contact-stack a {
    overflow-wrap: anywhere;
}
.editable-contact {
    gap: 4px;
    min-width: 210px;
}
.editable-contact label {
    display: grid;
    grid-template-columns: 38px minmax(120px, 1fr);
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.editable-contact input {
    min-height: 24px;
    width: 100%;
    padding: 2px 5px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
.editable-contact input:hover {
    border-color: #efd5f1;
    background: #fffafd;
}
.editable-contact input:focus {
    border-color: #d895e3;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(181, 54, 211, .12);
    outline: none;
}
.editable-contact input::placeholder {
    color: #9c7aa5;
    font-weight: 700;
}
.editable-contact input:disabled {
    opacity: .72;
}
.editable-contact input.field-invalid {
    border-color: var(--danger);
    background: #fff0f6;
}
.editable-contact-compact {
    min-width: 180px;
    max-width: 260px;
}
.editable-contact-compact input {
    min-width: 160px;
}
.inline-save-state {
    min-height: 16px;
    font-size: 12px;
    font-weight: 800;
}
.inline-save-state[data-status="saved"] { color: var(--success); }
.inline-save-state[data-status="saving"] { color: var(--primary); }
.inline-save-state[data-status="error"] { color: var(--danger); }
.progress-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.pagespeed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.pagespeed-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
}
.pagespeed-card.failed { border-color: #f3bdd3; background: #fff6fa; }
.pagespeed-card.passed { border-color: #d1b7eb; }
.pagespeed-card.no_website { border-color: #ded3e4; background: #fbf8fc; }
.pagespeed-card.missing_api_key { border-color: #d6c6f1; background: #faf6ff; }
.pagespeed-card.quota_exceeded { border-color: #f1c98a; background: #fff9ec; }
.pagespeed-card-head,
.pagespeed-score-row,
.pagespeed-category-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pagespeed-card-head .pill { margin-left: auto; }
.pagespeed-score {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: var(--primary-dark);
    background: var(--brand-gradient-soft);
    font-size: 22px;
    font-weight: 900;
}
.pagespeed-card.failed .pagespeed-score {
    color: var(--danger);
    background: #ffe6f0;
}
.pagespeed-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.pagespeed-metrics span,
.pagespeed-category-row span {
    padding: 7px 8px;
    border-radius: 7px;
    background: #f7edf8;
    color: var(--muted);
    font-size: 12px;
}
.pagespeed-metrics strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
}
.cwv-mini {
    display: grid;
    gap: 5px;
    min-width: 78px;
}
.cwv-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: #f3e3f7;
    color: #63306f;
    font-size: 12px;
    font-weight: 900;
}
.cwv-chip.passed { background: #edf7ee; color: #28733a; }
.cwv-chip.failed { background: #fff0f6; color: var(--danger); }
.cwv-chip.unavailable { background: #f3e3f7; color: #7b6a82; }
.cwv-chip.no_website { background: #f1edf4; color: #66536d; }
.cwv-chip.missing_api_key { background: #f1e9ff; color: #5c3c8c; }
.cwv-chip.quota_exceeded { background: #fff1cc; color: #8a5b00; }
.connector-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.connector-strip div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fffafd;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: #f8edf9; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: middle; }
th { color: #7b467f; font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: #fff4fb; }
td span + span { margin-left: 6px; }
.sort-link {
    color: #7b467f;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sort-link .material-symbols-rounded {
    font-size: 16px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.email-test-form {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(170px, 1.25fr) minmax(145px, 1fr) auto;
    align-items: end;
    gap: 12px;
}
.email-test-form .button {
    min-height: 45px;
    white-space: nowrap;
}
.form-stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 750; color: #4e2d58; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d9c1df;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    background: #fffafd;
}
input::placeholder, textarea::placeholder { color: #aa94b0; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(226, 54, 143, 0.16);
    border-color: #c65bd2;
    background: #fff;
}
textarea { resize: vertical; }
.check-row, .source-summary, .form-actions, .full-span { grid-column: 1 / -1; }
.check-row { display: flex; flex-wrap: wrap; gap: 18px; }
.check-row label { display: flex; align-items: center; gap: 8px; color: #4e2d58; }
.check-row input { width: auto; accent-color: var(--pink); }
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-inline input {
    width: auto;
    accent-color: var(--pink);
}
.source-summary, .selected-box, .run-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.source-picker {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff4fb;
}
.source-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
}
.source-option.disabled { opacity: .55; }
.source-option input { width: auto; accent-color: var(--pink); }
.selected-box {
    background: #fff4fb;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}
.csv-import-box {
    display: grid;
    gap: 14px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff4fb;
}
.csv-import-box h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.csv-import-box p {
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.55;
}
.csv-hint {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px dashed #d8b8e0;
    border-radius: 8px;
    background: #fffafd;
}
.csv-hint code {
    padding: 2px 5px;
    border-radius: 6px;
    background: #f3e3f7;
    color: #63306f;
    font-size: 12px;
    font-weight: 800;
}
.field-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 800;
}
.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff4fb;
}
.bulk-toolbar select { max-width: 260px; }
.enrichment-progress-panel[hidden] { display: none; }
.progress-track {
    height: 10px;
    border-radius: 999px;
    background: #f1dcf4;
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-gradient);
    transition: width .25s ease;
}
.enrichment-progress-stats {
    font-size: 13px;
}
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-dialog {
    width: min(820px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
}
.modal-dialog::backdrop {
    background: rgba(37, 20, 47, 0.48);
    backdrop-filter: blur(2px);
}
.modal-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-gradient);
    box-shadow: 0 24px 70px rgba(37, 20, 47, 0.24);
}
.modal-heading {
    margin-bottom: 16px;
}
.icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: #fffafd;
    cursor: pointer;
}
.icon-button:hover {
    border-color: #d59edf;
    background: #fff4fb;
}
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.filters input { min-width: 220px; }
.filters .button { min-width: 120px; }
.summary-line { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--muted); }
.details { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.details dt { color: #80538a; font-weight: 800; }
.details dd { margin: 0; }
.message-preview {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafd;
    color: var(--ink);
    font-weight: 400;
    line-height: 1.65;
    white-space: pre-line;
}
.message-preview strong,
.message-preview b { font-weight: 800; }
.message-preview em,
.message-preview i { font-style: italic; }
.message-preview p { margin: 0 0 12px; }
.message-preview p:last-child { margin-bottom: 0; }
.card { padding: 18px; display: grid; gap: 12px; }
.card h2 { margin-top: 4px; }
.card p { color: var(--muted); min-height: 42px; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); }
.card-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
.card-actions form { margin: 0; }
.card-actions .button { width: 100%; }

nav[role="navigation"] { margin-top: 16px; color: var(--muted); }
nav[role="navigation"] svg { width: 18px; color: var(--primary); }
nav[role="navigation"] a, nav[role="navigation"] span {
    border-color: var(--line) !important;
}
nav[role="navigation"] a:hover { background: #fff4fb; }

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-card {
    width: min(100%, 440px);
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-gradient);
    box-shadow: var(--shadow);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.auth-brand strong { display: block; font-size: 22px; color: var(--ink); }
.auth-form { display: grid; gap: 16px; }
.auth-copy { color: var(--muted); margin-bottom: 0; line-height: 1.55; }
.auth-link {
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
}
.auth-link .material-symbols-rounded { font-size: 18px; }
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.remember-row input { width: auto; accent-color: var(--pink); }
.email-builder-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 250, 254, 0.72);
}
.sequence-list { display: grid; gap: 12px; }
.sequence-step {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fffafd;
}
.sequence-step.compact { margin-bottom: 12px; }
.sequence-step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sequence-step-head label {
    max-width: 180px;
    margin: 0;
}
.rich-editor-wrap {
    display: grid;
    gap: 8px;
}
.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.rich-editor-toolbar button,
.rich-editor-toolbar select {
    width: auto;
    min-height: 34px;
    border: 1px solid #d9c1df;
    border-radius: 8px;
    background: #fffafd;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    padding: 7px 10px;
    cursor: pointer;
}
.rich-editor-toolbar button {
    min-width: 36px;
}
.rich-editor-toolbar button:hover,
.rich-editor-toolbar select:hover {
    border-color: #c65bd2;
    background: #fff4fb;
}
.rich-email-editor {
    min-height: 180px;
    border: 1px solid #d9c1df;
    border-radius: 8px;
    padding: 12px;
    background: #fffafd;
    color: var(--ink);
    font-weight: 400;
    line-height: 1.65;
    white-space: pre-wrap;
    outline: none;
}
.rich-email-editor:focus {
    outline: 3px solid rgba(226, 54, 143, 0.16);
    border-color: #c65bd2;
    background: #fff;
}
.rich-email-editor:empty::before {
    content: attr(data-placeholder);
    color: #aa94b0;
}
.mailbox-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.mailbox-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fffafd;
}
.form-grid.nested {
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
}

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(84vw, 320px);
        max-width: 100%;
        transform: translateX(-105%);
        transition: transform .22s ease;
        overflow-y: auto;
        box-shadow: 22px 0 48px rgba(37, 20, 47, 0.28);
    }
    .mobile-menu-open .sidebar { transform: translateX(0); }
    .mobile-menu-open { overflow: hidden; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 50;
        border: 0;
        background: rgba(25, 10, 34, 0.46);
        cursor: pointer;
    }
    .mobile-menu-open .sidebar-backdrop { display: block; }
    .sidebar-close {
        width: 40px;
        height: 40px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        background: rgba(255, 255, 255, 0.10);
        cursor: pointer;
    }
    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
        border: 1px solid var(--line);
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--primary);
        background: #fffafd;
        box-shadow: var(--shadow-soft);
        cursor: pointer;
        flex: 0 0 auto;
    }
    .nav { grid-template-columns: 1fr; }
    .stats-grid, .cards-grid, .content-grid, .content-grid.wide-left, .connector-strip, .form-grid, .mailbox-grid, .pagespeed-grid { grid-template-columns: 1fr; }
    .campaign-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .email-test-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .email-test-form .button { grid-column: 1 / -1; }
    .filters { grid-template-columns: 1fr; }
    .filters input { min-width: 0; }
    .card-actions { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .topbar-title { align-items: flex-start; }
    .topbar-actions { width: 100%; flex-wrap: wrap; }
    .actions-menu { width: 100%; }
    .actions-menu summary { width: 100%; }
    .actions-menu-panel {
        left: 0;
        right: auto;
        width: 100%;
    }
    .actions-inline { flex-wrap: wrap; }
    .inline-expand-form { width: 100%; }
    .inline-expand-form input { flex: 1 1 100px; }
    .account-switcher { width: 100%; }
    .account-switcher select { width: 100%; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 640px) {
    .email-test-form { grid-template-columns: 1fr; }
}
