/* Styles stay inside the purchase dialog; the legacy layout keeps its utilities. */
#purchase-modal .hidden, #purchase-modal.hidden { display:none !important; }
#purchase-modal .purchase-error { margin:12px 0; color:#b42335; font-size:13px; line-height:1.5; }
#purchase-modal .purchase-spinner { display:inline-block; flex:0 0 auto; width:21px; height:21px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:purchase-spin .8s linear infinite; }
@keyframes purchase-spin { to { transform:rotate(360deg); } }
#purchase-modal .purchase-payment-step { padding:24px; container-type:inline-size; container-name:purchase-payment; }
#purchase-modal .purchase-payment-back { display:inline-flex; align-items:center; gap:4px; margin:0 0 18px; padding:6px 0; border:0; background:transparent; color:#45617c; font:inherit; font-size:13px; cursor:pointer; }
#purchase-modal .purchase-payment-back:hover { color:#0969ff; }
#purchase-modal .purchase-payment-back svg { width:18px; height:18px; }
#purchase-modal .purchase-payment-heading { margin:0; color:#152238; font-size:23px; font-weight:650; line-height:1.25; }
#purchase-modal .purchase-payment-caption { margin:12px 0 18px; color:#64738b; font-size:13px; line-height:1.55; overflow-wrap:anywhere; }
#purchase-modal .purchase-payment-caption strong { color:#334155; font-weight:600; }
#purchase-modal .purchase-payment-total { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin:0 0 18px; color:#69768b; font-size:14px; }
#purchase-modal .purchase-payment-total strong { color:#152238; font-size:23px; font-weight:750; }
#purchase-modal .purchase-payment-loading { display:flex; justify-content:center; align-items:center; gap:10px; min-height:100px; color:#58728f; font-size:14px; }
#purchase-modal .purchase-payment-widget { --purchase-payment-background:#f6f7f8; box-sizing:border-box; width:100%; min-width:0; }
/* Continue the bank's light background below its last payment section. */
#purchase-modal .purchase-payment-widget:not(:empty) { padding-bottom:16px; border-radius:12px; background:var(--purchase-payment-background); }
#purchase-modal .purchase-payment-widget iframe { display:block; width:100%; max-width:100%; border:0; border-radius:12px 12px 0 0; background:var(--purchase-payment-background); }
/* The bank switches to white when the iframe itself is narrower than 360px. */
@container purchase-payment (max-width:359.4px) {
    #purchase-modal .purchase-payment-widget { --purchase-payment-background:#fff; }
}
#purchase-modal .purchase-payment-message { margin:12px 0 0; color:#4b607a; font-size:13px; line-height:1.5; }
#purchase-modal .purchase-payment-message:empty { display:none; }
#purchase-modal .purchase-payment-actions { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:14px; }
#purchase-modal .purchase-payment-retry { padding:10px 13px; border:1px solid #dbe3ee; border-radius:9px; color:#234875; background:#f3f7fc; font:inherit; font-size:13px; cursor:pointer; }
#purchase-modal .purchase-payment-external { color:#0969df; font-size:13px; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
#purchase-modal [data-purchase-panel] { overscroll-behavior:contain; }
#purchase-modal [data-purchase-panel]:focus { outline:none; }
#purchase-modal.purchase-concept-modal { position:fixed; inset:0; z-index:100; color:#101a31; font-family:inherit; }
#purchase-modal .pmc-overlay { position:absolute; inset:0; background:rgba(29,42,61,.53); backdrop-filter:blur(5px); }
#purchase-modal .pmc-positioner { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:24px; pointer-events:none; }
#purchase-modal .pmc-panel { position:relative; display:grid; grid-template-columns:minmax(0,40%) minmax(0,60%); width:min(100%,960px); max-height:calc(100dvh - 48px); overflow-y:auto; background:#fff; border:1px solid rgba(255,255,255,.8); border-radius:20px; box-shadow:0 28px 76px rgba(15,27,46,.25); pointer-events:auto; animation:purchase-enter .2s ease; }
@keyframes purchase-enter { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
#purchase-modal .pmc-panel, #purchase-modal .pmc-panel * { box-sizing:border-box; }
#purchase-modal .pmc-close { position:absolute; z-index:5; top:16px; right:16px; display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:50%; color:#59708e; background:#f1f4f8; cursor:pointer; transition:background .15s ease,color .15s ease; }
#purchase-modal .pmc-close:hover { color:#152238; background:#e2e9f2; }
#purchase-modal .pmc-close svg { width:20px; height:20px; }
#purchase-modal .pmc-close:focus-visible, #purchase-modal .purchase-payment-back:focus-visible, #purchase-modal .purchase-payment-retry:focus-visible, #purchase-modal .purchase-payment-external:focus-visible, #purchase-modal .pmc-submit:focus-visible { outline:3px solid #6ba3ff; outline-offset:3px; }
#purchase-modal .pmc-product { min-width:0; padding:32px; background:linear-gradient(125deg,#f4f8ff 0%,#edf4ff 100%); }
#purchase-modal .pmc-product-content { min-width:0; }
#purchase-modal .pmc-kicker { margin:0 0 12px; color:#8193ae; font-size:11px; font-weight:600; line-height:1.3; letter-spacing:.025em; text-transform:uppercase; }
#purchase-modal .pmc-product-title { margin:0; color:#10182d; font-size:26px; font-weight:600; line-height:1.25; letter-spacing:normal; text-wrap:balance; overflow-wrap:anywhere; }
#purchase-modal .pmc-product-description { margin:10px 0 0; color:#697f9e; font-size:14px; font-weight:400; line-height:1.5; overflow-wrap:anywhere; }
#purchase-modal .pmc-apps { margin:20px 0; }
#purchase-modal .pmc-app-icons { display:flex; flex-wrap:wrap; align-items:center; gap:18px; }
#purchase-modal .pmc-app-icons > img { display:block; width:48px; height:48px; object-fit:contain; }
#purchase-modal .pmc-facts { margin:0; }
#purchase-modal .pmc-fact { display:grid; grid-template-columns:28px minmax(0,1fr); align-items:center; gap:14px; padding:12px 0; border-top:1px solid #d7e2f0; }
#purchase-modal #modal-activation-region-row { border-top:0; }
#purchase-modal .pmc-fact-icon { display:grid; place-items:center; width:28px; height:28px; color:#086bff; }
#purchase-modal .pmc-fact-icon svg { display:block; width:24px; height:24px; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#purchase-modal .pmc-fact-label { display:block; margin:0; color:#6a80a0; font-size:12px; font-weight:400; line-height:1.5; }
#purchase-modal .pmc-fact-value { display:block; margin:2px 0 0; color:#101a31; font-size:15px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
#purchase-modal .pmc-license-details { padding:12px 0 12px 42px; border-top:1px solid #d7e2f0; color:#6a80a0; overflow-wrap:anywhere; }
#purchase-modal .pmc-license-details strong { display:block; margin:0; color:#243651; font-size:12px; font-weight:500; line-height:1.5; }
#purchase-modal .pmc-license-details p { margin:4px 0 0; font-size:12px; line-height:1.6; }
#purchase-modal .pmc-license-details p:empty { display:none; }
#purchase-modal .pmc-support { padding-bottom:0; }
#purchase-modal .pmc-support .pmc-fact-value { margin-top:0; font-size:14px; }
#purchase-modal .pmc-support .pmc-fact-label { margin-top:3px; font-size:12px; }
#purchase-modal .pmc-checkout { min-width:0; padding:40px; background:#fff; }
#purchase-modal .pmc-heading { margin:0; padding:0 24px 0 0; color:#111827; font-size:26px; font-weight:400; line-height:1.3; letter-spacing:normal; text-wrap:balance; }
#purchase-modal .pmc-form { margin:0; }
#purchase-modal .pmc-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:center; gap:12px; margin:24px 0 0; padding:0; list-style:none; }
#purchase-modal .pmc-step { display:flex; flex:1 1 auto; align-items:center; gap:8px; min-width:0; color:#617797; }
#purchase-modal .pmc-step:last-child { flex:0 0 auto; }
#purchase-modal .pmc-step:not(:last-child)::after { content:''; flex:1 1 auto; min-width:8px; height:1px; margin-left:2px; background:#c9d4e4; }
#purchase-modal .pmc-step-number { display:grid; place-items:center; flex:0 0 auto; width:30px; height:30px; border-radius:50%; color:#617797; background:#eef2f7; font-size:13px; font-weight:500; line-height:1; }
#purchase-modal .pmc-step strong { color:inherit; font-size:13px; font-weight:400; line-height:1.25; white-space:nowrap; }
#purchase-modal .pmc-step[aria-current="step"] { color:#086bff; }
#purchase-modal .pmc-step[aria-current="step"] .pmc-step-number { color:#fff; background:#086bff; }
#purchase-modal .pmc-step[aria-current="step"] strong { font-weight:500; }
#purchase-modal .pmc-email-block { margin-top:28px; }
#purchase-modal .pmc-email-block label { display:block; margin-bottom:8px; color:#111827; font-size:14px; font-weight:500; line-height:1.5; }
#purchase-modal .pmc-email-field { position:relative; }
#purchase-modal .pmc-email-field svg { position:absolute; width:20px; height:20px; left:16px; top:50%; transform:translateY(-50%); color:#7c94b4; pointer-events:none; }
#purchase-modal .pmc-email-field input { display:block; width:100%; height:52px; margin:0; padding:0 16px 0 46px; border:1px solid #c2d0e2; border-radius:10px; outline:0; color:#263a56; background:#fff; font:inherit; font-size:16px; transition:border-color .15s ease,box-shadow .15s ease; }
#purchase-modal .pmc-email-field input::placeholder { color:#a4b3cb; opacity:1; }
#purchase-modal .pmc-email-field input:focus { border-color:#086bff; box-shadow:0 0 0 3px rgba(8,107,255,.09); }
#purchase-modal .pmc-email-field input[aria-invalid="true"] { border-color:#dc3545; box-shadow:0 0 0 3px rgba(220,53,69,.08); }
#purchase-modal .pmc-email-hint { margin:8px 0 0; color:#7187a6; font-size:13px; line-height:1.5; }
#purchase-modal .pmc-total { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin-top:28px; padding:0; border:0; }
#purchase-modal .pmc-total > span { color:#526b8e; font-size:14px; font-weight:400; line-height:1.5; }
#purchase-modal .pmc-total strong { color:#111827; font-size:28px; font-weight:600; line-height:1.25; letter-spacing:normal; white-space:nowrap; }
#purchase-modal .pmc-submit { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:52px; margin-top:16px; padding:12px 16px; border:1px solid #ffc400; border-radius:10px; color:#111a2c; background:linear-gradient(115deg,#ffd528,#ffc400); font:inherit; font-size:16px; font-weight:600; line-height:1.5; cursor:pointer; box-shadow:0 4px 12px rgba(229,175,0,.1); transition:background .15s ease,box-shadow .15s ease,transform .15s ease; }
#purchase-modal .pmc-submit:hover { background:linear-gradient(115deg,#ffde50,#ffce21); box-shadow:0 8px 22px rgba(229,175,0,.19); }
#purchase-modal .pmc-submit:active { transform:translateY(1px); }
#purchase-modal .pmc-submit svg { flex:0 0 auto; width:20px; height:20px; }
#purchase-modal .pmc-submit:disabled { opacity:.75; cursor:wait; }
#purchase-modal .pmc-loading { font-size:15px; cursor:wait; }
#purchase-modal .pmc-payment-notice { display:flex; align-items:center; justify-content:center; gap:6px; margin:16px 0 0; color:#7990b0; font-size:12px; line-height:1.5; text-align:center; }
#purchase-modal .pmc-payment-notice > svg { flex:0 0 auto; width:16px; height:18px; }
#purchase-modal .pmc-payment-notice > span { max-width:100%; }
#purchase-modal .pmc-payments { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); width:min(100%,320px); margin-inline:auto; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; margin-top:16px; }
#purchase-modal .pmc-payment-badge { display:inline-flex; align-items:center; justify-content:center; gap:4px; min-width:0; height:34px; padding:4px; border:1px solid #e0e7f1; border-radius:7px; color:#172f47; background:#fff; font-size:10px; font-weight:500; line-height:1; white-space:nowrap; }
#purchase-modal .pmc-payment-badge img { display:block; width:auto; max-width:100%; height:18px; object-fit:contain; }
#purchase-modal .pmc-payment-badge-tpay { border-color:#e0e7f1; background:#fff; color:#101a2b; }
#purchase-modal .pmc-checkout .purchase-payment-step { padding:0; }
/* Optical sizes preserve each logo's native proportions inside equal frames. */
#purchase-modal .pmc-payment-badge-mir img { width:40px; height:auto; }
#purchase-modal .pmc-payment-badge-tpay img { width:50px; height:auto; }
#purchase-modal .pmc-payment-badge-sber img { width:16px; height:16px; }
#purchase-modal .pmc-payment-badge-sbp img { width:auto; height:19px; }
#purchase-modal .pmc-checkout .purchase-payment-heading { font-size:24px; font-weight:400; line-height:1.3; }
#purchase-modal .pmc-checkout .purchase-payment-total strong { font-size:24px; font-weight:600; }
/* Keep checkout spacing independent of the product description's height. */
@media (min-width:881px) {
    #purchase-modal .pmc-checkout { display:flex; flex-direction:column; }
    #purchase-modal #purchase-checkout-details { flex:0 0 auto; margin-block:auto; }
}
@media (min-width:881px) and (max-width:1060px) {
    #purchase-modal .pmc-product { padding:28px; }
    #purchase-modal .pmc-checkout { padding:36px 28px; }
}
@media (max-width:880px) {
    #purchase-modal .pmc-positioner { padding:12px; }
    #purchase-modal .pmc-panel { display:block; width:min(100%,480px); max-height:calc(100dvh - 24px); border-radius:18px; }
    #purchase-modal .pmc-close { top:12px; right:12px; }
    #purchase-modal .pmc-product { padding:24px; border-bottom:1px solid #dce5f0; }
    #purchase-modal .pmc-kicker { padding-right:36px; margin-bottom:10px; }
    #purchase-modal .pmc-product-title { max-width:calc(100% - 20px); font-size:24px; }
    #purchase-modal .pmc-app-icons > img { width:44px; height:44px; }
    #purchase-modal .pmc-fact { grid-template-columns:26px minmax(0,1fr); gap:12px; }
    #purchase-modal .pmc-fact-icon { width:26px; height:26px; }
    #purchase-modal .pmc-license-details { padding-left:38px; }
    #purchase-modal .pmc-support { padding-bottom:0; }
    #purchase-modal .pmc-checkout { padding:28px 24px; }
    #purchase-modal .pmc-heading { padding:0; font-size:24px; }
    #purchase-modal .pmc-steps { gap:8px; margin-top:20px; }
    #purchase-modal .pmc-step { gap:6px; }
    #purchase-modal .pmc-step-number { width:28px; height:28px; font-size:12px; }
    #purchase-modal .pmc-step strong { font-size:12px; }
    #purchase-modal .pmc-step:not(:last-child)::after { min-width:4px; margin-left:0; }
    #purchase-modal .pmc-email-block { margin-top:24px; }
    #purchase-modal .pmc-total { margin-top:24px; }
    #purchase-modal .pmc-total strong { font-size:26px; }
    #purchase-modal .pmc-payment-badge { height:30px; padding:4px; gap:4px; font-size:10px; }
    #purchase-modal .pmc-payment-badge-mir img { width:36px; }
    #purchase-modal .pmc-payment-badge-tpay img { width:46px; }
    #purchase-modal .pmc-payment-badge-sber img { width:15px; height:15px; }
    #purchase-modal .pmc-payment-badge-sbp img { height:17px; }
}
@media (max-width:760px) {
    #purchase-modal .purchase-payment-widget:not(:empty) { padding-bottom:12px; }
}
@media (max-width:360px) {
    #purchase-modal .pmc-positioner { padding:8px; }
    #purchase-modal .pmc-panel { max-height:calc(100dvh - 16px); }
    #purchase-modal .pmc-product { padding:24px 20px; }
    #purchase-modal .pmc-product-title { font-size:22px; }
    #purchase-modal .pmc-checkout { padding:24px 20px; }
    #purchase-modal .pmc-heading { font-size:22px; }
    #purchase-modal .pmc-step { position:relative; flex-direction:column; gap:6px; text-align:center; }
    #purchase-modal .pmc-step-number { width:26px; height:26px; }
    #purchase-modal .pmc-step strong { font-size:11px; }
    #purchase-modal .pmc-step:not(:last-child)::after { position:absolute; top:13px; left:calc(50% + 21px); width:calc(100% - 34px); min-width:0; }
    #purchase-modal .pmc-payments { grid-template-columns:repeat(2,minmax(0,1fr)); width:180px; }
    #purchase-modal .pmc-payment-badge { font-size:10px; }
}
@media (prefers-reduced-motion:reduce) {
    #purchase-modal .pmc-panel { animation:none; }
    #purchase-modal .purchase-spinner { animation-duration:1.8s; }
    #purchase-modal .pmc-close, #purchase-modal .pmc-submit, #purchase-modal .pmc-email-field input { transition:none; }
}
