/* Pay blog (pay.snapex.pro/blog, admin preview snapex.pro/admin/blog/preview/…) in the snapex.pro exchanger look (owner 02.11):
   on top of exchange.css + page.css + exchange-theme.css, colours only from the --ex-* variables, so the dark theme comes for free.
   Below the page — the infographic blocks (bx-*) written inline in an article body. */

:root {
    --bx-pm: #475569;
    --bx-sx: #047857;
    --bx-on-c: #ffffff;
    --bx-line: rgba(15, 23, 42, 0.1);
    --bx-line-2: rgba(15, 23, 42, 0.16);
}

:root[data-ex-theme="dark"] {
    --bx-pm: #a3b1c4;
    --bx-sx: #22c98b;
    --bx-on-c: #0b0f14;
    --bx-line: rgba(255, 255, 255, 0.1);
    --bx-line-2: rgba(255, 255, 255, 0.18);
}

/* ——— Page ——— */

.bx-main {
    max-width: 52rem;
}

.bx-note {
    max-width: 760px;
    margin: 0 auto 1rem;
    padding: 0.65rem 1rem;
    border: 1px dashed var(--ex-border-hover);
    border-radius: var(--ex-radius);
    background: var(--ex-surface);
    color: var(--ex-text);
    font-size: 0.875rem;
}

.bx-crumbs {
    margin: 0 0 0.75rem;
    color: var(--ex-muted);
    font-size: 0.8125rem;
}

.bx-crumbs a {
    color: var(--ex-muted);
    text-decoration: none;
}

.bx-crumbs a:hover {
    color: var(--ex-accent-hover);
    text-decoration: underline;
}

.bx-empty {
    text-align: center;
    color: var(--ex-muted);
}

.bx-main--list {
    max-width: 64rem;
}

.bx-list-title {
    margin: 0 0 1.25rem;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--ex-text);
}

@media (max-width: 600px) {
    .bx-list-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
}

.bx-note--queue {
    border-style: solid;
    border-color: var(--ex-accent);
}

/* Article cards: covers in a grid of two on a wide screen, one column on a phone. */
.bx-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bx-post {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--ex-border);
    border-radius: var(--ex-radius-card);
    background: var(--ex-surface);
    box-shadow: var(--ex-shadow-md);
    color: var(--ex-text);
    text-decoration: none;
    transition: border-color var(--ex-transition), transform var(--ex-transition), box-shadow var(--ex-transition);
}

.bx-post:hover {
    border-color: var(--ex-border-focus);
    box-shadow: var(--ex-shadow-lg);
    transform: translateY(-3px);
}

.bx-post__cover {
    display: block;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    border-bottom: 1px solid var(--ex-border);
    background: var(--ex-bg-alt);
}

.bx-post__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bx-post:hover .bx-post__cover img {
    transform: scale(1.03);
}

.bx-post__cover-blank {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--ex-accent);
}

.bx-post__cover-blank svg {
    width: 4rem;
    height: 4rem;
    opacity: 0.6;
}

.bx-post__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.1rem 1.25rem 1.25rem;
}

.bx-post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    color: var(--ex-muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.bx-post__title {
    color: var(--ex-text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

.bx-post:hover .bx-post__title {
    color: var(--ex-accent-hover);
}

:root:not([data-ex-theme="dark"]) .bx-post:hover .bx-post__title {
    color: #047857;
}

.bx-post__text {
    color: var(--ex-text);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.bx-post__more {
    margin-top: auto;
    padding-top: 0.25rem;
    color: var(--bx-sx);
    font-size: 0.875rem;
    font-weight: 600;
}

/* The newest of an odd number goes wide: cover left, text right. */
.bx-grid__wide {
    grid-column: 1 / -1;
}

.bx-grid__wide .bx-post {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.bx-grid__wide .bx-post__cover {
    height: 100%;
    border-right: 1px solid var(--ex-border);
    border-bottom: 0;
}

.bx-grid__wide .bx-post__body {
    justify-content: center;
    padding: 1.5rem 1.75rem;
}

.bx-grid__wide .bx-post__title {
    font-size: 1.4rem;
}

@media (max-width: 760px) {
    .bx-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .bx-grid__wide .bx-post {
        display: flex;
    }

    .bx-grid__wide .bx-post__cover {
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--ex-border);
    }

    .bx-grid__wide .bx-post__body {
        padding: 1.1rem 1.25rem 1.25rem;
    }

    .bx-grid__wide .bx-post__title {
        font-size: 1.125rem;
    }
}

.bx-hero {
    margin: 0 0 1.75rem;
    overflow: hidden;
    border: 1px solid var(--ex-border);
    border-radius: var(--ex-radius);
}

.bx-hero img {
    display: block;
    width: 100%;
    height: auto;
}

.bx-back {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.bx-back a {
    color: var(--ex-muted);
    text-decoration: none;
}

.bx-back a:hover {
    color: var(--ex-accent-hover);
    text-decoration: underline;
}

.bx-article.ex-page-article {
    margin-top: 0;
    border-radius: var(--ex-radius-card);
    box-shadow: var(--ex-shadow-md);
}

.bx-article .ex-page-article__title {
    margin-bottom: 0.5rem;
    font-size: 1.85rem;
}

.bx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0 0 1.5rem;
    color: var(--ex-muted);
    font-size: 0.8125rem;
}

.bx-meta__draft {
    padding: 0.1rem 0.55rem;
    border-radius: var(--ex-radius-full);
    background: var(--ex-accent-muted);
    color: var(--ex-text-primary);
    font-weight: 500;
}

.bx-prose {
    font-size: 1.0625rem;
    line-height: 1.7;
}

.bx-prose h2 {
    margin-top: 1.9em;
    font-size: 1.4rem;
}

.bx-prose strong,
.bx-prose b {
    color: var(--ex-text-primary);
}

.bx-prose ul:not([class]) li::marker {
    color: var(--ex-accent);
}

.bx-prose .lvb-scroll {
    margin: 0 0 1.25em;
    overflow-x: auto;
    border: 1px solid var(--bx-line);
    border-radius: var(--ex-radius);
}

.bx-prose .lvb-scroll .lvb-scroll {
    margin: 0;
    border: 0;
}

.bx-prose .lvb-scroll table {
    margin: 0;
    border-style: hidden;
    font-size: 0.875rem;
    line-height: 1.45;
}

.bx-prose th,
.bx-prose td {
    vertical-align: top;
}

.bx-prose thead th {
    color: var(--ex-text-primary);
}

.bx-prose .lvb-code-block {
    position: relative;
}

.bx-prose .lvb-codecopy {
    position: absolute;
    top: 0.4rem;
    inset-inline-end: 0.4rem;
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--ex-border);
    border-radius: 6px;
    background: var(--ex-surface);
    color: var(--ex-muted);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.bx-prose .lvb-codecopy svg {
    width: 14px;
    height: 14px;
}

.bx-cta {
    max-width: 760px;
    margin: 0 auto 1rem;
    padding: 1.75rem;
    border: 1px solid var(--ex-success-border);
    border-radius: var(--ex-radius-card);
    background: var(--ex-surface);
    box-shadow: var(--ex-shadow-md);
    text-align: center;
}

.bx-cta h2 {
    margin: 0 0 0.5rem;
    color: var(--ex-text-primary);
    font-size: 1.3rem;
}

.bx-cta p {
    margin: 0 auto 1.25rem;
    max-width: 36rem;
    color: var(--ex-text);
    line-height: 1.55;
}

.bx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 1.5rem;
    border: 0;
    border-radius: var(--ex-radius);
    background: #047857;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ex-transition), transform var(--ex-transition);
}

.bx-btn:hover {
    background: #065f46;
    transform: translateY(-1px);
}

:root[data-ex-theme="dark"] .bx-btn {
    background: var(--ex-accent);
    color: var(--ex-accent-text);
}

:root[data-ex-theme="dark"] .bx-btn:hover {
    background: var(--ex-accent-hover);
}

@media (max-width: 640px) {
    .bx-article.ex-page-article {
        padding: 1.25rem 1.1rem 1.5rem;
    }

    .bx-article .ex-page-article__title {
        font-size: 1.45rem;
    }

    .bx-prose {
        font-size: 1rem;
    }

    .bx-cta {
        padding: 1.4rem 1.1rem;
    }
}

/* ——— Infographic ——— */

.bx-prose .bx-fig {
    margin: 2em 0;
    padding: 22px 24px;
    border: 1px solid var(--bx-line);
    border-radius: 14px;
    background: var(--ex-surface-elevated);
    color: var(--ex-text);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.bx-prose .bx-fig ul,
.bx-prose .bx-fig ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bx-prose .bx-fig li + li {
    margin-top: 0;
}

.bx-prose .bx-fig__title {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--ex-text-primary);
}

.bx-prose .bx-fig__sub {
    margin: 0 0 18px;
    color: var(--ex-muted);
    font-size: 0.875rem;
}

.bx-prose .bx-fig figcaption,
.bx-prose .bx-fig__note {
    margin-top: 16px;
    color: var(--ex-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.bx-pm {
    --c: var(--bx-pm);
}

.bx-sx {
    --c: var(--bx-sx);
}

.bx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 16px;
    font-size: 0.8125rem;
    color: var(--ex-text);
}

.bx-legend span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-inline-end: 6px;
    border-radius: 3px;
    background: var(--c);
    vertical-align: -1px;
}

/* ——— A. Fee bars: one row per tariff, bar length = percent on a shared 0–5% axis ——— */

.bx-bars li {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
    padding: 7px 0;
}

.bx-bars__label {
    color: var(--ex-text-primary);
}

.bx-bars__label small {
    display: block;
    color: var(--ex-muted);
    font-size: 0.78rem;
}

.bx-bars__track {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bx-bars__bar {
    flex: 0 0 auto;
    width: calc(var(--v) * 0.82);
    min-width: 4px;
    height: 16px;
    border-radius: 4px;
    background: var(--c);
}

.bx-bars__val {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--ex-text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bx-axis {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: 14px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--bx-line);
    color: var(--ex-muted);
    font-size: 0.75rem;
}

.bx-axis__ticks {
    position: relative;
    height: 1.2em;
}

.bx-axis__ticks span {
    position: absolute;
    inset-inline-start: calc(var(--t) * 0.82);
    transform: translateX(-50%);
}

.bx-axis__ticks span:first-child {
    transform: none;
}

/* ——— A. Key numbers ——— */

.bx-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bx-stat {
    padding: 14px 16px;
    border-radius: 10px;
    border-inline-start: 4px solid var(--c);
    background: var(--ex-surface);
}

.bx-stat b {
    display: block;
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--ex-text-primary);
    font-variant-numeric: tabular-nums;
}

.bx-stat span {
    display: block;
    margin-top: 4px;
    color: var(--ex-text);
    font-size: 0.85rem;
}

.bx-stat em {
    display: block;
    margin-bottom: 6px;
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--c);
}

/* ——— B. Flow: two lanes side by side, numbered steps top to bottom ——— */

.bx-flow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.bx-lane__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
}

.bx-lane__name {
    font-weight: 600;
    color: var(--c);
}

.bx-lane__time {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ex-accent-muted);
    color: var(--ex-text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.bx-prose .bx-steps {
    display: grid;
    gap: 10px;
    counter-reset: bx-step;
}

.bx-steps li {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--bx-line-2);
    border-inline-start: 3px solid var(--c);
    border-radius: 8px;
    background: var(--ex-surface);
    color: var(--ex-text);
    font-size: 0.875rem;
    line-height: 1.35;
    overflow-wrap: normal;
    counter-increment: bx-step;
}

.bx-steps li::before {
    content: counter(bx-step);
    grid-row: span 2;
    font-weight: 700;
    color: var(--c);
}

.bx-steps li + li::after {
    content: "";
    position: absolute;
    top: -11px;
    inset-inline-start: 22px;
    width: 2px;
    height: 10px;
    background: var(--bx-line-2);
}

.bx-steps b {
    display: block;
    margin-bottom: 2px;
    color: var(--ex-text-primary);
    font-weight: 600;
}

/* ——— B. Checklist ——— */

.bx-check li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--bx-line);
}

.bx-check li:first-child {
    border-top: 0;
    padding-top: 0;
}

.bx-check li::before {
    content: "";
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid var(--bx-sx);
    border-radius: 5px;
}

.bx-check b {
    color: var(--ex-text-primary);
}

/* ——— C. Scenario cards ——— */

.bx-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 2em 0;
}

.bx-prose .bx-cards {
    padding: 0;
    list-style: none;
}

.bx-prose .bx-cards > li + li {
    margin-top: 0;
}

.bx-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 18px 16px;
    border: 1px solid var(--bx-line);
    border-radius: 14px;
    background: var(--ex-surface);
    color: var(--ex-text);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.bx-card__tag {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bx-on-c);
    background: var(--c);
}

.bx-prose .bx-card__who {
    margin: 0;
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.3;
    color: var(--ex-text-primary);
}

.bx-prose .bx-card p {
    margin: 0;
}

.bx-card__why {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--bx-line-2);
    color: var(--ex-muted);
    font-size: 0.8125rem;
}

/* ——— C. Scale: each criterion is a line between two poles, a dot per service ——— */

.bx-scale__poles {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--ex-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.bx-scale li {
    padding: 12px 0 14px;
    border-top: 1px solid var(--bx-line);
}

.bx-scale__name {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ex-text-primary);
}

.bx-scale__line {
    position: relative;
    height: 26px;
    margin: 0 9px;
}

.bx-scale__line::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 12px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--bx-pm), var(--ex-accent));
}

.bx-dot {
    position: absolute;
    top: 4px;
    inset-inline-start: var(--x);
    width: 18px;
    height: 18px;
    margin-inline-start: -9px;
    border: 3px solid var(--ex-surface-elevated);
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 0 1px var(--c);
}

.bx-scale__ends {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 2px;
    font-size: 0.8125rem;
    color: var(--ex-text);
}

.bx-scale__ends span:last-child {
    text-align: end;
}

@media (max-width: 640px) {
    .bx-prose table {
        font-size: 0.8125rem;
    }

    .bx-prose th,
    .bx-prose td {
        padding: 9px 6px;
    }

    .bx-prose .bx-fig {
        margin-inline: -0.5rem;
        padding: 18px 16px;
    }

    .bx-bars li,
    .bx-axis {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .bx-axis > span:first-child {
        display: none;
    }

    .bx-stats,
    .bx-cards,
    .bx-flow {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bx-prose .bx-scale__vals {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 6px 0 0;
    font-size: 0.8125rem;
}

.bx-scale__vals span::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-inline-end: 6px;
    border-radius: 50%;
    background: var(--c);
}

/* page.css breaks words anywhere — in the comparison table that splits short words of the narrow first column. */
.bx-prose table {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.bx-prose tbody td:first-child {
    min-width: 8.5rem;
    color: var(--ex-text-primary);
    font-weight: 500;
}

@media (max-width: 640px) {
    .bx-prose tbody td:first-child {
        min-width: 6.5rem;
    }

    .bx-prose .lvb-scroll table {
        min-width: 34rem;
    }
}

/* ——— Motion (owner 02.11: «инфографику живее»): a figure plays in when it scrolls into view — steps and checklist rows rise one
   after another, bars grow, scale dots slide in. The script in blog-post adds .bx-anim (and .is-in on view); without it — static. ——— */

.bx-steps li,
.bx-check li {
    transition: border-color var(--ex-transition), box-shadow var(--ex-transition), transform var(--ex-transition);
}

.bx-steps li:hover,
.bx-anim.is-in .bx-steps li:hover,
.bx-anim.is-in .bx-lane + .bx-lane .bx-steps li:hover {
    border-color: var(--c);
    transition-delay: 0s;
    box-shadow: var(--ex-shadow-md);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: no-preference) {
    .bx-anim .bx-steps li,
    .bx-anim .bx-check li,
    .bx-anim .bx-stat,
    .bx-anim .bx-card {
        opacity: 0;
        transform: translateY(12px);
    }

    .bx-anim.is-in .bx-steps li,
    .bx-anim.is-in .bx-check li,
    .bx-anim.is-in .bx-stat,
    .bx-anim.is-in .bx-card {
        opacity: 1;
        transform: none;
        transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    .bx-anim.is-in li:nth-child(2), .bx-anim.is-in .bx-stat:nth-child(2) { transition-delay: 0.08s; }
    .bx-anim.is-in li:nth-child(3), .bx-anim.is-in .bx-stat:nth-child(3) { transition-delay: 0.16s; }
    .bx-anim.is-in li:nth-child(4), .bx-anim.is-in .bx-stat:nth-child(4) { transition-delay: 0.24s; }
    .bx-anim.is-in li:nth-child(5) { transition-delay: 0.32s; }
    .bx-anim.is-in li:nth-child(6) { transition-delay: 0.4s; }
    .bx-anim.is-in li:nth-child(7) { transition-delay: 0.48s; }
    .bx-anim.is-in li:nth-child(8) { transition-delay: 0.56s; }

    /* The second lane follows the first. */
    .bx-anim.is-in .bx-lane + .bx-lane .bx-steps li { transition-delay: calc(0.45s + var(--bx-i, 0) * 0.08s); }
    .bx-lane + .bx-lane .bx-steps li:nth-child(2) { --bx-i: 1; }
    .bx-lane + .bx-lane .bx-steps li:nth-child(3) { --bx-i: 2; }
    .bx-lane + .bx-lane .bx-steps li:nth-child(4) { --bx-i: 3; }
    .bx-lane + .bx-lane .bx-steps li:nth-child(5) { --bx-i: 4; }

    .bx-anim .bx-bars__bar {
        transform: scaleX(0);
        transform-origin: left center;
    }

    [dir="rtl"] .bx-anim .bx-bars__bar {
        transform-origin: right center;
    }

    .bx-anim.is-in .bx-bars__bar {
        transform: none;
        transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s;
    }

    .bx-anim .bx-dot {
        opacity: 0;
    }

    .bx-anim.is-in .bx-dot {
        opacity: 1;
        transition: opacity 0.6s ease 0.2s;
    }
}
