:root {
    --bg: #060a08;
    --surface: rgba(14, 22, 18, 0.7);
    --surface-hover: rgba(22, 36, 29, 0.85);
    --border: rgba(34, 197, 94, 0.16);
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #94a3b8;
    --dim: #64748b;

    --accent: var(--green);
    --accent-ink: #04140a;
    --danger: #f87171;

    --r-1: 12px;
    --r-2: 16px;
    --r-3: 18px;
    --r-4: 20px;

    --t: 200ms cubic-bezier(0.16, 1, 0.3, 1);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --spring: cubic-bezier(0.34, 1.35, 0.64, 1);

    --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    background-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Фоновые градиенты: фиксированный GPU-слой вместо background-attachment:fixed
   (fixed-attachment заставлял перерисовывать весь вьюпорт при покачивании тайлов) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.16) 0%, transparent 65%),
        radial-gradient(circle at 100% 100%, rgba(34, 197, 94, 0.06) 0%, transparent 45%);
}

::selection { background: var(--green); color: #000; }

.spot {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%),
                rgba(34, 197, 94, 0.12) 0%, transparent 70%);
    display: none;
}
@media (hover: hover) and (pointer: fine) {
    .spot { display: block; }
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
a { color: var(--green); }
.mono { font-family: var(--mono); color: #fff; }
.muted { color: var(--text-muted); margin: 0; }
.neg { color: var(--green); }

/* ---------- layout ---------- */

.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.layout { display: flex; flex-direction: column; gap: 18px; }
.col-pay { display: flex; flex-direction: column; gap: 14px; }

/* ---------- entrance ---------- */

.reveal { animation: reveal 420ms var(--ease) both; }
.layout > *:nth-child(1) { animation-delay: 0ms; }
.layout > *:nth-child(2) { animation-delay: 70ms; }
.layout > *:nth-child(3) { animation-delay: 140ms; }
.legal { animation-delay: 200ms; }

@keyframes reveal {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 50%; display: block; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.brand-sub { font-size: 13px; color: var(--text-muted); }

.block { display: flex; flex-direction: column; gap: 10px; }

.section-label,
.label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.label-val { color: var(--green); text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ---------- plans ---------- */

.plans {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.plan {
    position: relative;
    z-index: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 14px;
    min-height: 96px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--r-4);
    color: var(--text-main);
    touch-action: manipulation;
    transition: border-color var(--t), background var(--t), box-shadow var(--t), transform 160ms var(--ease);
}
@media (hover: hover) {
    .plan:hover { border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.035); }
}
.plan:active { transform: scale(0.975); }
.plan[aria-pressed="true"] {
    color: #fff;
    background: rgba(34, 197, 94, 0.09);
    border-color: var(--green);
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.25), inset 0 0 15px rgba(34, 197, 94, 0.06);
}
.plan[aria-pressed="true"] .plan-title { color: #fff; }

/* ---------- plan fan (декор справа) ---------- */

.plan-visual {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0 16%, #000 44%);
    mask-image: linear-gradient(90deg, transparent 0 16%, #000 44%);
}

.fan {
    position: absolute;
    bottom: -38px;
    right: -10px;
    width: 78px;
    height: 100px;
    transition: transform 320ms var(--spring);
}

/* 6 и 12 месяцев: веер наклонён на 20° против часовой */
.plan[data-id="6m"] .fan,
.plan[data-id="12m"] .fan { transform: rotate(-20deg); }

/* 1 месяц: правее и с лёгким наклоном по часовой */
.plan[data-id="1m"] .fan { right: -22px; transform: rotate(10deg); }

.fan-tile {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 13px;
    border: 1px solid rgba(34, 197, 94, 0.22);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='100'%3E%3Cpath d='M14 82 36 56m0 0 20 12m-20-12 16-26m0 0 14 12' stroke='%2322c55e' stroke-opacity='.45' fill='none'/%3E%3Ccircle cx='14' cy='82' r='2.6' fill='%2316a34a'/%3E%3Ccircle cx='36' cy='56' r='4' fill='%234ade80'/%3E%3Ccircle cx='36' cy='56' r='10' fill='none' stroke='%2322c55e' stroke-opacity='.3'/%3E%3Ccircle cx='56' cy='68' r='2.6' fill='%2316a34a'/%3E%3Ccircle cx='52' cy='30' r='3.4' fill='%2322c55e'/%3E%3Ccircle cx='66' cy='42' r='2.2' fill='%2322c55e' fill-opacity='.7'/%3E%3C/svg%3E"),
        linear-gradient(165deg, rgba(24, 48, 36, 0.95), rgba(9, 18, 13, 0.94) 58%, rgba(34, 197, 94, 0.12));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
    opacity: 0.92;
    transform-origin: 92% 96%;
    transition: transform 320ms var(--spring);
    animation: fanFloat 7s ease-in-out infinite;
}

.fan-tile:nth-child(1) { transform: rotate(-9deg); }
.fan-tile:nth-child(2) {
    transform: rotate(0deg);
    animation-delay: -2.3s;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='100'%3E%3Cpath d='M18 76a26 26 0 0 1 40-20' stroke='%2322c55e' stroke-opacity='.4' fill='none'/%3E%3Cpath d='M10 84a38 38 0 0 1 56-30' stroke='%2322c55e' stroke-opacity='.22' fill='none'/%3E%3Cpath d='M58 56 32 30' stroke='%234ade80' stroke-opacity='.6' stroke-width='1.4'/%3E%3Ccircle cx='58' cy='56' r='4' fill='%234ade80'/%3E%3Ccircle cx='32' cy='30' r='3' fill='%2322c55e'/%3E%3Ccircle cx='60' cy='24' r='2' fill='%2316a34a'/%3E%3C/svg%3E"),
        linear-gradient(200deg, rgba(20, 40, 30, 0.95), rgba(8, 16, 11, 0.94) 58%, rgba(34, 197, 94, 0.14));
}
.fan-tile:nth-child(3) { transform: rotate(8deg); animation-delay: -4.6s; }
.fan-tile:nth-child(4) { transform: rotate(16deg); animation-delay: -1.1s; }

@media (hover: hover) {
    .plan:hover .fan { transform: translateY(-6px); }
    .plan[data-id="6m"]:hover .fan,
    .plan[data-id="12m"]:hover .fan { transform: rotate(-20deg) translateY(-6px); }
    .plan[data-id="1m"]:hover .fan { transform: rotate(10deg) translateY(-6px); }
    .plan:hover .fan-tile:nth-child(1) { transform: rotate(-20deg) translateX(-6px); }
    .plan:hover .fan-tile:nth-child(2) { transform: rotate(-3deg); }
    .plan:hover .fan-tile:nth-child(3) { transform: rotate(17deg) translateX(4px); }
    .plan:hover .fan-tile:nth-child(4) { transform: rotate(26deg) translateX(9px); }
}

@keyframes fanFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -4px; }
}

@media (prefers-reduced-motion: reduce) {
    .fan-tile { animation: none; transition: none; }
}

@media (max-width: 1023px) {
    .fan { width: 60px; height: 82px; bottom: -30px; right: -6px; }
    .plan[data-id="1m"] .fan { right: -16px; }
    .fan-tile:nth-child(n+2) { display: none; }
}

@media (max-width: 479px) {
    .plan-visual { display: none; }
}

.plan-title { font-size: 13px; font-weight: 600; color: var(--text-muted); transition: color var(--t); }
.plan-price {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin-top: auto;
    color: #fff;
}
.plan-sub { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.plan-tag {
    position: absolute;
    top: -9px;
    right: 10px;
    font-size: 10px;
    font-weight: 800;
    background: var(--green);
    color: #000;
    padding: 2px 7px;
    border-radius: 8px;
    animation: tagPop 260ms var(--spring) both;
    animation-delay: 220ms;
}
@keyframes tagPop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: none; }
}

/* ---------- input ---------- */

.field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--r-2);
    transition: border-color var(--t), box-shadow var(--t);
}
.field:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1), 0 0 22px rgba(34, 197, 94, 0.12);
}
.field[data-invalid="true"] {
    border-color: rgba(248, 113, 113, 0.65);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
    animation: shake 260ms var(--ease);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.field-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--dim);
    pointer-events: none;
    transition: color var(--t), transform 220ms var(--ease);
}
.field.is-typing .field-icon { transform: scale(1.1); }
.field.is-resolved .field-icon,
.field.is-resolving .field-icon { opacity: 0; }

.field .id-avatar {
    margin-left: 14px;
    animation: avatarIn 240ms var(--spring) both;
}
@keyframes avatarIn {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: none; }
}

.field-meta {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: opacity 160ms var(--ease);
}
.field.is-resolving .field-meta {
    display: inline-block;
    width: 72px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
    background-size: 200% 100%;
    animation: shimmer 1.1s linear infinite;
}
.field.is-resolving .id-avatar {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}
.field.is-resolving .id-avatar span { opacity: 0; }

.field-edit {
    flex-shrink: 0;
    padding: 10px 4px;
    background: none;
    border: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--green);
    transition: opacity var(--t);
}
.field-edit:hover { opacity: 0.8; }
.field:focus-within .field-icon { color: var(--green); }

input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    background: transparent;
    border: 0;
    border-radius: var(--r-2);
    font-size: 16px;
    color: #fff;
    caret-color: var(--green);
}
.field input {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding-left: 44px;
    transition: padding-left 220ms var(--ease);
}
.field.is-resolved input,
.field.is-resolving input { padding-left: 0; font-weight: 700; }
input::placeholder { color: var(--dim); }
input:focus { outline: none; }

.err {
    margin: 0;
    font-size: 12.5px;
    color: var(--danger);
    animation: swap 180ms var(--ease);
}

/* ---------- identity ---------- */

.id-avatar {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    color: var(--green);
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.25);
    text-transform: uppercase;
    transition: background var(--t), border-color var(--t);
}
.id-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 220ms var(--ease);
}
.id-avatar img.loaded { opacity: 1; }

/* ---------- promo ---------- */

.link-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    background: none;
    border: 0;
    color: var(--green);
    font-size: 12.5px;
    font-weight: 600;
    transition: opacity var(--t);
}
.link-btn:hover { opacity: 0.85; }
.link-btn svg { transition: transform var(--t); }
.link-btn[aria-expanded="true"] svg { transform: rotate(90deg); }

.promo-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 240ms var(--ease);
}
.promo-collapse > * { overflow: hidden; }
.promo-collapse.is-open { grid-template-rows: 1fr; }
.promo-form { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.promo-collapse:not(.is-open) .promo-form { padding-top: 0; }

.row { display: flex; gap: 8px; }
.row input {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    height: 46px;
    padding: 0 14px;
    font-size: 16px;
    transition: border-color var(--t), box-shadow var(--t);
}
.row input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.btn-ghost {
    height: 46px;
    padding: 0 16px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: var(--green);
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    transition: background var(--t), transform 140ms var(--ease), opacity var(--t);
}
.btn-ghost:hover:not(:disabled) { background: rgba(34, 197, 94, 0.22); }
.btn-ghost:active:not(:disabled) { transform: scale(0.97); }
.btn-ghost:disabled { opacity: 0.5; }

.applied {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 10px;
    border-radius: 9px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    font-size: 12.5px;
    line-height: 18px;
    color: #86efac;
    animation: bannerIn 260ms var(--spring) both;
}
.applied .icon-btn { width: 22px; height: 22px; font-size: 16px; border-radius: 6px; }
@keyframes bannerIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    transition: color var(--t), background var(--t);
}
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* ---------- summary ---------- */

.summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--r-3);
    padding: 16px 18px;
}
.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.sum-row > span:last-child { color: var(--text-main); }
.sum-row.total {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 10px;
    font-size: 15px;
    color: var(--text-main);
}
.sum-row.total output {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}
.tick { animation: tick 200ms var(--ease); }
@keyframes tick {
    from { opacity: 0.4; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.btn-primary {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 18px 24px;
    background: var(--green);
    color: #000;
    border: 0;
    border-radius: var(--r-3);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 10px 30px var(--green-glow);
    transition: transform 140ms var(--ease), box-shadow var(--t), filter var(--t);
}
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.32) 50%, transparent 68%);
    transform: translateX(-120%);
    pointer-events: none;
}
@media (hover: hover) {
    .btn-primary:hover:not(:disabled)::after {
        transform: translateX(120%);
        transition: transform 520ms var(--ease);
    }
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-primary:active:not(:disabled) {
    transform: scale(0.975);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}
.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.07);
    color: var(--dim);
    box-shadow: none;
}
.btn-primary.is-busy { pointer-events: none; opacity: 0.8; }

.hint {
    margin: 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
    min-height: 1em;
    transition: color var(--t);
}

/* ---------- footer ---------- */

.legal {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.34);
}
.legal a { color: rgba(255, 255, 255, 0.42); transition: color var(--t); }
.legal a:hover, .legal a:focus-visible { color: var(--green); }
.legal-name { color: rgba(255, 255, 255, 0.5); font-weight: 600; }
.legal-small { font-size: 11.5px; line-height: 1.55; margin: 4px 0; }
.legal-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.legal-links a { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.legal-links span { color: rgba(255, 255, 255, 0.2); }
@media (max-width: 400px) {
    .legal-links { flex-direction: column; gap: 4px; }
    .legal-links span { display: none; }
}

/* ---------- modals ---------- */

.sticky-bar { display: none; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(6, 10, 8, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fade 180ms ease-out;
}
.sheet {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: rise 280ms var(--spring);
    overflow: hidden;
}
.sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.sheet-head h3 { margin: 0; font-size: 16px; }
.sheet-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    font-size: 14px;
}
.sheet-foot {
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.sheet-foot .btn-ghost { width: 100%; height: 48px; }

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--green);
    animation: spin 900ms linear infinite;
}

.check { width: 56px; height: 56px; }
.check circle {
    fill: none;
    stroke: rgba(34, 197, 94, 0.35);
    stroke-width: 2;
}
.check path {
    fill: none;
    stroke: var(--green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 32;
    stroke-dashoffset: 32;
    animation: draw 500ms 120ms var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.done-title { margin: 0; font-size: 18px; font-weight: 800; }
.order {
    animation: fade-up 300ms 160ms var(--ease) both;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.order span { color: #fff; }

/* ---------- legal document ---------- */

.sheet-legal {
    width: 100%;
    max-width: 720px;
    height: 86vh;
    height: 86dvh;
}
.doc {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    color: #c9d4d0;
}
.doc-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 40px);
    font-size: 15px;
    line-height: 1.7;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}
.doc-inner h1 {
    font-size: clamp(20px, 4.5vw, 27px);
    line-height: 1.25;
    color: var(--green);
    margin: 0 0 20px;
}
.doc-inner h1 span { font-size: 0.62em; color: var(--text-muted); font-weight: 500; }
.doc-inner h2 {
    font-size: clamp(16px, 3.2vw, 19px);
    line-height: 1.35;
    color: #fff;
    margin: 26px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.doc-inner p { margin: 0 0 12px; }
.doc-inner ul, .doc-inner ol { margin: 0 0 12px; padding-left: 20px; }
.doc-inner li { margin-bottom: 6px; }
.doc-inner a { color: var(--green); }
.doc-inner strong { color: #fff; }
.doc-skeleton { padding: 32px 24px; display: flex; flex-direction: column; gap: 12px; }
.doc-skeleton i {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05));
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

@media (min-width: 700px) { .doc-inner { font-size: 16px; } }
@media (min-width: 1200px) { .doc-inner { font-size: 16.5px; line-height: 1.75; } }

/* ---------- responsive ---------- */

@media (min-width: 360px) {
    .wrap { padding-left: 20px; padding-right: 20px; }
}

@media (min-width: 600px) {
    .wrap { max-width: 520px; padding-top: 32px; }
    .modal { align-items: center; }
    .sheet {
        max-width: 420px;
        max-height: 86vh;
        border-radius: 24px;
    }
    .sheet-legal { max-width: min(940px, 92vw); height: 88vh; height: 88dvh; }
}

@media (max-width: 599px) {
    .sheet-legal { max-width: 100%; }
}

@media (min-width: 1024px) {
    .wrap {
        max-width: 960px;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 32px 24px;
        justify-content: center;
        justify-content: safe center;
        gap: 24px;
    }
    .layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-areas:
            "brand brand"
            "plans pay";
        grid-template-rows: auto minmax(0, 1fr);
        column-gap: 48px;
        row-gap: 26px;
        align-items: stretch;
    }
    .brand { grid-area: brand; }
    #plans-block {
        grid-area: plans;
        height: 100%;
        min-height: 0;
    }
    #plans-block .plans {
        flex: 1;
        grid-auto-rows: minmax(0, 1fr);
        max-height: 360px;
    }
    #plans-block .plan {
        padding: 18px 16px;
        justify-content: center;
        gap: 6px;
    }
    #plans-block .plan .plan-price { margin-top: 0; }
    .col-pay { grid-area: pay; gap: 12px; align-self: start; }
    #promo-block { gap: 0; }
    #promo-block .promo-collapse.is-open { margin-top: 8px; }
    .summary { padding: 15px 18px; gap: 10px; }
    .sum-row.total { padding-top: 8px; }
    .btn-primary { padding: 16px 24px; }
    .hint { font-size: 12px; }
    .brand-sub { font-size: 12.5px; }

    .legal {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: baseline;
        gap: 3px 10px;
        padding-top: 16px;
        font-size: 11.5px;
    }
    .legal > div { display: inline; }
    .legal-name,
    .legal > div:nth-child(2),
    .legal > div:nth-child(3) { white-space: nowrap; }
    .legal-name::after,
    .legal > div:nth-child(2)::after {
        content: " ·";
        color: rgba(255, 255, 255, 0.2);
    }
    .legal-small {
        flex: 1 0 100%;
        margin: 0;
        font-size: 11px;
        text-align: center;
        text-wrap: balance;
    }
    .legal-links { flex: 1 0 100%; }
}

@media (min-width: 1024px) and (max-height: 820px) {
    .wrap { padding: 20px 24px; gap: 16px; }
    .layout {
        grid-template-columns: minmax(0, 1fr) 370px;
        column-gap: 40px;
        row-gap: 18px;
    }
    #plans-block .plan { padding: 13px 14px; gap: 4px; }
    .plan-price { font-size: 21px; }
    #plans-block .plans { max-height: 320px; }
    .summary { padding: 13px 16px; gap: 10px; }
    .sum-row.total { padding-top: 8px; }
    .sum-row.total output { font-size: 23px; }
    .btn-primary { padding: 15px 22px; font-size: 15px; }
    .legal { padding-top: 12px; }
}

@media (max-width: 359px) {
    .field-meta { display: none; }
    .field .id-avatar { margin-left: 12px; }

    .plans { grid-template-columns: 1fr; gap: 6px; }
    .plan { padding: 12px; min-height: 76px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
    .plan-price { margin-top: 0; font-size: 19px; }
    .plan-sub { width: 100%; }
    .wrap { padding: 14px 12px 24px; gap: 18px; }
    .brand-name { font-size: 16px; }
    .summary { padding: 14px; }
    .sum-row.total output { font-size: 23px; }
    .label, .brand-sub { font-size: 12.5px; }
    .legal { font-size: 11.5px; }
}

@media (max-height: 640px) and (max-width: 899px) {
    .wrap { padding-top: 12px; gap: 16px; }
    .brand img { width: 34px; height: 34px; }
    .plan { min-height: 80px; }
}

.sticky-sum { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sticky-sum b { color: #fff; font-size: 17px; }

/* ---------- motion ---------- */

@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
    .spinner { animation-duration: 3s !important; animation-iteration-count: infinite !important; }
    .spot { display: none !important; }
}
