:root {
    --bg: #f4f6f9;
    --surface: #fff;
    --text: #1a2332;
    --muted: #5c6b7a;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --success-bg: #f0fdf4;
    --success-text: #15803d;
    --border: #e2e8f0;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(960px, 100% - 2rem);
    margin-inline: auto;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.logo {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.nav a:hover {
    color: var(--text);
}

.nav-logout {
    margin: 0;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
}

.btn-link:hover {
    color: var(--text);
}

.main {
    flex: 1;
    padding: 2rem 0;
}

.site-footer {
    margin-top: auto;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}

.auth-card {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.auth-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.9375rem;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.text-error {
    color: var(--danger);
}

.text-warning {
    color: #b45309;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-narrow {
    max-width: 360px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form input {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.form input:focus,
.form select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.form-messenger {
    max-width: 28rem;
}

.form-label-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 0.9rem;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    margin-top: -0.3rem;
    border: solid var(--muted);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    pointer-events: none;
}

.select-input {
    width: 100%;
    padding: 0.65rem 2.25rem 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.select-input:hover {
    border-color: #cbd5e1;
}

.select-wrap--messenger .select-input {
    border-left-width: 4px;
}

.select-wrap--type-whatsapp .select-input {
    border-left-color: #25d366;
}

.select-wrap--type-telegram .select-input {
    border-left-color: #229ed9;
}

.select-wrap--type-max .select-input {
    border-left-color: #7c3aed;
}

.select-wrap--type-custom .select-input {
    border-left-color: var(--muted);
}

.match-mode-fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.match-mode-fieldset legend {
    margin-bottom: 0.5rem;
    padding: 0;
}

.match-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.match-mode__option {
    margin: 0;
    font-weight: 500;
}

.match-mode__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.match-mode__label {
    display: block;
    padding: 0.65rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.match-mode__input:checked + .match-mode__label {
    background: var(--primary);
    color: #fff;
}

.match-mode__input:focus-visible + .match-mode__label {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.match-mode-hint {
    margin: 0.5rem 0 0;
}

.match-mode-hint[hidden] {
    display: none !important;
}

.match-field[hidden] {
    display: none !important;
}

.badge-match {
    background: #eff6ff;
    color: #1d4ed8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
}

a.btn {
    text-decoration: none;
}

.page-header h1 {
    margin: 0 0 0.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-hint {
    font-size: 0.8125rem;
    color: var(--muted);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
}

.checklist {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

.dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    margin: 0;
}

.dl dt {
    color: var(--muted);
    font-size: 0.875rem;
}

.dl dd {
    margin: 0;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.page-header-row h1 {
    margin: 0 0 0.25rem;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    background: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-compact th,
.table-compact td {
    font-size: 0.8125rem;
    padding: 0.5rem 0.65rem;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-code-inline {
    font-size: 0.75rem;
    font-weight: 400;
    margin-left: 0.25rem;
}

.status-with-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.table-action-icons {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.table-action-form {
    display: inline-flex;
    margin: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-icon:hover {
    color: var(--primary);
    border-color: #93c5fd;
    background: #eff6ff;
    text-decoration: none;
}

.btn-icon--danger:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.code-inline {
    font-size: 0.8125rem;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.code-block {
    display: block;
    font-size: 0.8125rem;
    background: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    word-break: break-all;
}

.code-block-pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-muted {
    background: #f1f5f9;
    color: var(--muted);
}

.badge-warning {
    background: #fffbeb;
    color: #b45309;
}

.badge-error {
    background: var(--error-bg);
    color: var(--error-text);
}

.filters-card {
    margin-bottom: 1rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filters-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.filters-grid input,
.filters-grid select {
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-form {
    margin-top: 0.75rem;
}

.btn-with-spinner.is-loading .btn-label {
    visibility: hidden;
}

.btn-with-spinner {
    position: relative;
    min-width: 12rem;
}

.btn-with-spinner.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.125rem;
    height: 1.125rem;
    margin: -0.5625rem 0 0 -0.5625rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.page-preloader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
}

.page-preloader[hidden] {
    display: none;
}

.page-preloader__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.page-preloader__text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.table-summary {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
}

.utm-compact {
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.field-hint {
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--muted);
}

.field-hint code {
    font-size: 0.9em;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem !important;
    font-weight: 500;
}

.checkbox-label input {
    width: auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.form-inline {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.link-card strong {
    color: var(--text);
}

.card-danger {
    border-color: #fecaca;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 0;
    }

    .nav {
        flex-wrap: wrap;
    }
}

/* ——— Dashboard ——— */

.dashboard-header .muted {
    margin-bottom: 0;
}

.dashboard-greeting {
    max-width: 36rem;
}

.stats-grid--dashboard {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card--link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card--link:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    text-decoration: none;
}

.stat-card--attention {
    border-color: #fde68a;
    background: #fffbeb;
}

.stat-card--attention:hover {
    border-color: #fbbf24;
}

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.card-head-row h2 {
    margin: 0;
}

.setup-steps {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setup-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}

.setup-step--current {
    border-color: #93c5fd;
    background: #eff6ff;
}

.setup-step__num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
}

.setup-step strong {
    display: block;
    margin-bottom: 0.2rem;
}

.setup-step p {
    margin: 0;
    font-size: 0.9375rem;
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.project-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}

.project-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.project-card__head h3 {
    margin: 0;
    font-size: 1rem;
    word-break: break-word;
}

.project-card__head h3 a {
    color: var(--text);
    text-decoration: none;
}

.project-card__head h3 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.project-card__meta {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
}

.setup-badges {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.setup-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    text-decoration: none;
}

.setup-badge--ok {
    background: var(--success-bg);
    color: var(--success-text);
}

.setup-badge--todo {
    background: #fffbeb;
    color: #b45309;
    border: 1px dashed #fcd34d;
}

.setup-badge--todo:hover {
    background: #fef3c7;
    text-decoration: none;
}

.setup-badge--neutral {
    background: #f1f5f9;
    color: var(--muted);
}

.setup-badge--neutral:hover {
    background: #e2e8f0;
    color: var(--text);
    text-decoration: none;
}

.dashboard-sync__desc {
    margin-bottom: 1rem;
}

.dashboard-sync__status {
    margin-bottom: 0.5rem;
}

.dashboard-sync__notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}

.dashboard-sync__notice--ready {
    color: var(--success-text);
    font-weight: 500;
}

.dashboard-sync__history {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.dashboard-sync__history h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.cron-run-queue-hint {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.spinner--sm {
    width: 1.125rem;
    height: 1.125rem;
    border-width: 2px;
}

@media (max-width: 600px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header .btn {
        align-self: flex-start;
    }
}

/* ——— Landing ——— */

body.landing {
    background: #0f172a;
    color: #e2e8f0;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.landing-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.landing .logo {
    color: #f8fafc;
    font-size: 1.25rem;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.landing-nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.35rem 0.5rem;
}

.landing-nav-link:hover {
    color: #fff;
}

.landing-main {
    flex: 1;
}

.landing-alerts {
    padding-top: 1rem;
}

.landing-footer {
    background: #0b1220;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.hero {
    padding: 4rem 0 5rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.35), transparent),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 999px;
}

.hero-title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.15;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.hero-lead {
    margin: 0 0 1.75rem;
    font-size: 1.125rem;
    line-height: 1.65;
    color: #94a3b8;
    max-width: 34rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hero-note {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-card {
    flex: 1 1 140px;
    max-width: 180px;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.hero-card-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.hero-messengers {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    font-size: 0.875rem;
    color: #e2e8f0;
}

.hero-messengers li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-wa { background: #22c55e; }
.dot-tg { background: #38bdf8; }
.dot-max { background: #a78bfa; }

.hero-card-meta {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
}

.hero-crm-deal {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.hero-arrow {
    font-size: 1.5rem;
    color: #3b82f6;
    font-weight: 700;
}

.section {
    padding: 4rem 0;
}

.section-title {
    margin: 0 0 2rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    text-align: center;
}

.features {
    background: #1e293b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.section-lead {
    margin: -1rem auto 2rem;
    max-width: 42rem;
    text-align: center;
    color: #94a3b8;
    font-size: 1.0625rem;
}

.feature-card {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius);
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: #f1f5f9;
}

.feature-card p {
    margin: 0;
    font-size: 0.9375rem;
    color: #94a3b8;
    line-height: 1.55;
}

.feature-card code {
    font-size: 0.85em;
    color: #93c5fd;
}

.feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.15);
    border-radius: 8px;
}

.steps {
    background: #0f172a;
}

.steps-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.steps-list li {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
}

.steps-list strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #f1f5f9;
}

.steps-list p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9375rem;
}

.steps-list code {
    font-size: 0.85em;
    color: #93c5fd;
}

.cta-band {
    padding: 3.5rem 0;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
}

.cta-band-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cta-band h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: #fff;
}

.cta-band p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

.cta-band-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.crm-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.crm-type-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.crm-type-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.crm-type-option-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 13.5rem;
    min-height: 5.5rem;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius, 8px);
    background: var(--surface, #fff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-type-input:checked + .crm-type-option-visual::after {
    content: "";
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none'%3E%3Cpath stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 5.5 4.5 9 11 1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.7rem auto;
}

.crm-type-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 4.75rem;
    object-fit: contain;
}

.crm-type-option:hover .crm-type-option-visual {
    border-color: var(--accent, #2563eb);
}

.crm-type-input:focus-visible + .crm-type-option-visual {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: 2px;
}

.crm-type-input:checked + .crm-type-option-visual {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 1px var(--accent, #2563eb);
}

.crm-panel {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.crm-panel-title {
    margin: 0 0 1rem;
    font-size: 1.0625rem;
}

.crm-subsection-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.dl-compact {
    margin-bottom: 1rem;
}

.dl-compact dt,
.dl-compact dd {
    margin-bottom: 0.35rem;
}

.mapping-grid-single {
    max-width: 24rem;
}

.crm-oauth-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.inline-alert {
    margin: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.crm-entity-select-label {
    max-width: 20rem;
    margin-bottom: 0.25rem;
}

.select-wrap--crm-entity .select-input {
    font-weight: 500;
}

.crm-filters-block {
    margin: 0 0 1.5rem;
}

.crm-filters-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.crm-filters-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.crm-filter-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.crm-filter-section:first-child {
    border-top: none;
    padding-top: 0;
}

.crm-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem 1rem;
}

.crm-filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.crm-filter-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.9375rem;
}

.crm-filter-name {
    font-weight: 600;
}

.crm-filter-meta {
    font-size: 0.8125rem;
}

.crm-filter-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.crm-filter-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    background: var(--surface);
}

.crm-filter-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.crm-active-filters {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.crm-active-filters li {
    margin-bottom: 0.35rem;
    font-size: 0.9375rem;
}

.crm-active-filters-empty {
    color: var(--muted);
    font-size: 0.9375rem;
}

.crm-active-filter-item {
    margin-bottom: 0.35rem;
    font-size: 0.9375rem;
}

.crm-filters-raw {
    margin-top: 0.75rem;
}

.crm-filters-raw summary {
    cursor: pointer;
    font-size: 0.875rem;
}

.crm-filter-standard-details {
    margin-top: 0.85rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    background: #fafbfc;
}

.crm-filter-standard-summary {
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--muted);
    user-select: none;
}

.crm-filter-standard-summary:hover {
    color: var(--text);
}

.crm-filter-standard-details[open] .crm-filter-standard-summary {
    margin-bottom: 0.85rem;
    color: var(--text);
}

.crm-filter-custom-empty {
    margin: 0 0 0.65rem;
    font-size: 0.875rem;
}

.form-section-title {
    margin: 1.75rem 0 0.35rem;
    font-size: 1.0625rem;
}

.form-section-desc {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.btn-danger-outline {
    color: var(--error-text);
    border-color: #fecaca;
}

.btn-danger-outline:hover {
    background: var(--error-bg);
    color: var(--error-text);
}

.crm-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.75rem 0 1.5rem;
    padding-bottom: 1rem;
}

.crm-panel-head .btn {
    margin: 0.25rem 0;
}

.crm-panel-head .crm-panel-title {
    margin: 0;
}

.help-doc h2 {
    margin: 1.75rem 0 0.65rem;
    font-size: 1.125rem;
}

.help-doc h2:first-of-type {
    margin-top: 0;
}

.help-doc-lead {
    margin: 0 0 1rem;
    color: var(--muted);
}

.help-list,
.help-steps {
    margin: 0 0 1rem;
    padding-left: 1.35rem;
}

.help-list li,
.help-steps li {
    margin-bottom: 0.45rem;
}

.copyable-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

.copyable-text__value {
    flex: 1 1 12rem;
    margin: 0;
    word-break: break-all;
}

.copyable-text__btn {
    flex-shrink: 0;
}

.help-faq {
    margin-top: 0.5rem;
}

.help-doc-actions {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.integrations {
    background: #0f172a;
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.integration-card {
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius);
}

.integration-card h3 {
    margin: 0 0 0.5rem;
    color: #f1f5f9;
}

.integration-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.code-snippet {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8125rem;
}

.code-snippet code {
    color: #93c5fd;
    white-space: pre-wrap;
    word-break: break-all;
}

.faq {
    background: #1e293b;
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius);
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #f1f5f9;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    float: right;
    color: #60a5fa;
    font-weight: 700;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    margin: 0.75rem 0 0;
    color: #94a3b8;
    font-size: 0.9375rem;
}

.landing-footer-inner {
    padding: 0.5rem 0;
}

.landing-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.landing-footer-tagline {
    margin: 0 0 0.5rem;
}

.landing-footer-contact {
    margin: 0;
}

.landing-footer-contact a {
    color: #cbd5e1;
    text-decoration: none;
}

.landing-footer-contact a:hover {
    color: #fff;
}

.landing-footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.875rem;
}

.landing-footer-nav a {
    color: #94a3b8;
    text-decoration: none;
}

.landing-footer-nav a:hover {
    color: #e2e8f0;
}

.landing-footer-copy {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
}

/* Modal */
body.modal-open {
    overflow: hidden;
}

.modal[hidden] {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    width: min(480px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.75rem;
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-title {
    margin: 0 2rem 0.35rem 0;
    font-size: 1.375rem;
}

.modal-subtitle {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.lead-form-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.lead-form-messages[hidden] {
    display: none;
}

.lead-form .form-field {
    margin-bottom: 1rem;
}

.lead-form .form-field:last-of-type {
    margin-bottom: 0;
}

.lead-form .form-hint {
    margin: -0.5rem 0 1rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.lead-form .field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #dc2626;
}

.lead-form .field-error[hidden] {
    display: none;
}

.lead-form .field-error-form {
    margin-bottom: 0;
}

.lead-form .form-field-form[hidden] {
    display: none;
}

.lead-form input.is-invalid,
.lead-form textarea.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.lead-form input.is-invalid:focus,
.lead-form textarea.is-invalid:focus {
    outline-color: #dc2626;
}

.lead-form .form-field.is-invalid .checkbox-label {
    color: #b91c1c;
}

.lead-form .form-field.is-invalid .checkbox-label input[type="checkbox"] {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.lead-form label {
    color: var(--text);
}

.lead-form textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    resize: vertical;
    min-height: 4.5rem;
}

.lead-form textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    line-height: 1.45;
    cursor: pointer;
}

.checkbox-label input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

.b-link {
    color: var(--primary);
    text-decoration: underline;
}

.muted-inline {
    font-weight: 400;
    color: var(--muted);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Cookie banner */
.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    padding: 1rem 0;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.cookie-banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-banner-text {
    margin: 0;
    flex: 1 1 280px;
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: #93c5fd;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Legal pages */
body.legal-page {
    background: #0f172a;
}

.legal-main {
    padding: 2.5rem 0 4rem;
}

.legal-container {
    width: min(760px, 100% - 2rem);
}

.legal-doc {
    padding: 2rem 2.25rem;
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.legal-doc h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.legal-updated {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.legal-doc h2 {
    margin: 1.75rem 0 0.65rem;
    font-size: 1.125rem;
}

.legal-doc p,
.legal-doc li {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.legal-doc ul,
.legal-doc ol {
    margin: 0 0 1rem;
    padding-left: 1.35rem;
}

.legal-requisites {
    margin: 0;
}

.legal-requisites dt {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--muted);
}

.legal-requisites dd {
    margin: 0.25rem 0 0;
    font-size: 1rem;
}

.legal-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-lead {
        margin-inline: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .integrations-grid {
        grid-template-columns: 1fr;
    }

    .landing-footer-grid {
        grid-template-columns: 1fr;
    }

    .landing-nav .landing-nav-link {
        display: none;
    }

    .legal-doc {
        padding: 1.25rem 1rem;
    }

    .cta-band-inner {
        flex-direction: column;
        text-align: center;
    }

    .cta-band-actions {
        justify-content: center;
    }
}
