.sync-page { min-height: 100vh; background: var(--bg); color: var(--ink); }
.sync-wrap { width: var(--shell); max-width: 1100px; margin-inline: auto; }

/* Header: edge to edge on the ink field, brand mark left, one quiet link right. */
.sync-header { background: var(--ink-field); color: var(--on-ink); }
.sync-header .sync-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-height); }
.sync-header img { height: 28px; width: auto; }
.sync-header a.sync-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-ink-muted); font-size: var(--fs-small); font-weight: 600; }
.sync-header a.sync-back:hover { color: var(--on-ink); }

/* Hero: compact title band, edge to edge, no frame. */
.sync-hero { padding-top: calc(var(--header-height) + 24px); background: var(--ink-field); color: var(--on-ink); padding-block: 24px 40px; }
.sync-hero .eyebrow { color: var(--accent-on-dark); margin-bottom: 14px; }
.sync-title { font-size: clamp(34px, 4.6vw, 60px); font-weight: 600; letter-spacing: var(--tr-h2); line-height: 1.02; max-width: 820px; }
.sync-hero p.sync-lead { margin-top: 16px; max-width: 620px; color: var(--on-ink-muted); font-size: var(--fs-lead); }

.sync-section { padding-block: 40px 64px; }
.sync-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 80px; align-items: start; }
.sync-grid h2 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: var(--tr-h3); margin-bottom: 12px; }

.payment-total { font-size: var(--fs-small); font-weight: 600; margin-top: 20px; }
.payment-note { font-size: var(--fs-small); color: var(--muted); margin-top: 16px; }
.payment-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* The consent row keeps a fixed height and never moves the page: the label
   wraps the checkbox, so a tap on the text toggles it in place. */
.payment-consent { display: flex; align-items: start; gap: 12px; min-height: 44px; margin-top: 20px; padding-block: 10px; font-size: var(--fs-small); line-height: 1.5; cursor: pointer; }
.payment-consent input { width: 20px; height: 20px; min-height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent-deep); }
.sync-page :is(button, a, input):focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 4px; }

.state { margin-top: 14px; font-size: var(--fs-small); }
.state:empty { display: none; }
.state.is-error { color: var(--danger); }
.sync-page .actions { margin-top: 24px; }
.sync-page .button[aria-disabled=true] { opacity: .45; pointer-events: none; }

/* Summary: the one tinted panel on the page. */
.sync-summary { background: var(--surface-2); padding: 24px; border-radius: var(--radius); }
.sync-summary > p:first-child { font-size: var(--fs-small); color: var(--muted); margin-bottom: 8px; }
.sync-summary h2 { font-size: var(--fs-h3); }
.sync-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: clamp(44px, 5vw, 64px); font-weight: 600; letter-spacing: var(--tr-h3); line-height: 1.1; margin: 8px 0 20px; }
.sync-price span { font-size: var(--fs-small); font-weight: 400; letter-spacing: normal; color: var(--muted); white-space: nowrap; }
.sync-summary .kv > div { grid-template-columns: 1fr; gap: 6px; padding-block: 12px; }
.sync-summary .kv dt { font-size: var(--fs-small); }
.sync-summary .kv dd { font-size: var(--fs-body); }
.sync-order { margin-top: 16px; font-size: var(--fs-micro); color: var(--muted); word-break: break-all; }

/* Risk agreement: plain article below the form, opened by its own link. */
.risk-agreement { border-top: 1px solid var(--line-strong); }
.risk-agreement h2 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: var(--tr-h3); margin-bottom: 16px; }
.risk-agreement p { max-width: 760px; margin-top: 14px; color: var(--muted-strong); }

.sync-prose p { max-width: 760px; color: var(--muted-strong); }
.sync-prose p + p { margin-top: 16px; }

/* Welcome after payment. */
.welcome-list { margin-top: 24px; max-width: 640px; }
.welcome-list > li { padding-block: 16px; border-top: 1px solid var(--line-strong); }
.welcome-list > li:last-child { border-bottom: 1px solid var(--line-strong); }
.welcome-list b { display: block; margin-bottom: 4px; }
/* Purchase welcome dialog, as in the Academy Mini App (public/app.css). */
.purchase-welcome { margin: auto; border: 1px solid var(--line); padding: 0; border-radius: var(--radius-lg); width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: var(--shadow); font-family: var(--font); color: var(--ink); background: var(--bg); }
.purchase-welcome::backdrop { background: color-mix(in srgb, var(--ink-field) 78%, transparent); }
.welcome-content { padding: clamp(24px, 5vw, 48px); }
.purchase-welcome .eyebrow { margin: 0; }
.purchase-welcome h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: var(--tr-h3); line-height: 1.12; margin: 12px 0 24px; }
.purchase-welcome p { margin: 16px 0; line-height: 1.55; }
.purchase-welcome .welcome-plan { font-size: var(--fs-lead); font-weight: 600; margin-bottom: 0; }
.welcome-chats { display: grid; gap: 12px; margin: 24px 0 0; }
.purchase-welcome .button { min-height: 48px; white-space: normal; text-align: center; width: 100%; }
.purchase-welcome .welcome-note { font-size: var(--fs-small); }
@media (prefers-reduced-motion: no-preference) {
  .purchase-welcome[open] { animation: welcome-appear .2s ease-out; }
  @keyframes welcome-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
#contact-block { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line-strong); max-width: 640px; }
.sync-contact-title { font-size: var(--fs-h3); font-weight: 600; letter-spacing: var(--tr-h3); margin-bottom: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contact-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.contact-form input { flex: 1 1 220px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); }

.sync-stack > * + * { margin-top: 16px; }
.sync-pre { margin-top: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: auto; font-size: var(--fs-micro); }
.sync-footer { padding-block: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }
.sync-footer .sync-wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.sync-footer a { display: inline-flex; align-items: center; min-height: 44px; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .sync-hero { padding-block: 16px 28px; }
  .sync-section { padding-block: 24px 40px; }
  .sync-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .sync-summary { padding: 20px; }
}

.sync-page .sync-hero { padding-top:calc(var(--header-height) + var(--s4)); }

/* Layout bridges for the approved reference. */
:root { --danger:var(--error); }
.method-list { margin-bottom:var(--s4); }
#consent-step h2,#invoice-step h2 { margin-top:var(--s4); }
#summary-price { font-size:var(--fs-h3); flex-wrap:wrap; }
#summary-price span { font-size:var(--fs-small); font-weight:400; }
#summary .kv { margin-top:var(--s4); }
#summary .kv > div { display:block; padding-block:var(--s2); }
#summary .kv dd { margin-top:var(--s1); }
.academy-plan[data-tier=pro30] { background:var(--plan-pro-bg); border-color:var(--line-strong); }
.academy-plan[data-tier=pro30] .academy-start { background:var(--accent-bright); color:var(--accent-ink); }
.academy-plan[data-tier=pro30] .academy-inclusions { background:var(--pro-inclusions); }
.academy-plan { border-color:var(--line-strong); }
.checkout-methods,.order-summary { border-color:var(--line-strong); }
.method:disabled { opacity:.6; cursor:default; }
.academy-footer .active-brand { max-width:240px; }
.form-layout { width:var(--shell); }

#account-access { margin-top:var(--s3); color:var(--muted); }

.month-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--s3); margin-top:var(--s4); }
.month-cards .month { background:var(--surface-2); padding:var(--s4); border-radius:var(--radius); }
.month-cards h3 { font-size:var(--fs-h3); line-height:1.25; margin-block:var(--s2); }
.month-cards .eyebrow { color:var(--muted); }
@media(max-width:900px){.month-cards{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.month-cards{grid-template-columns:1fr;}.month-cards .month{padding:var(--s3);}}

.method .method-circle { flex:0 0 18px; width:18px; height:18px; }

/* Infoblock highlight (issue 29): only opacity and transform animate, the tint sits on a pseudo layer. */
.reveal:not(.is-visible) { will-change: opacity, transform; }
.month-cards .month, .team > article { position: relative; isolation: isolate; }
.month-cards .month::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: var(--radius); pointer-events: none; opacity: 0; transition: opacity 420ms var(--ease-out); }
.month-cards .month::after { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.team > article::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); pointer-events: none; opacity: 0; transition: opacity 420ms var(--ease-out); }
.month-cards .month.is-lit::after, .team > article.is-lit::after { opacity: 1; }
.month-cards .month.reveal.is-visible, .team > article.reveal.is-visible, .tiers > article.reveal.is-visible { transition: opacity 560ms var(--ease-out) var(--delay, 0ms), transform 680ms var(--ease-out) var(--delay, 0ms); }
/* Recommended tariff: the same mint field as .tiers .recommended in the Academy Mini App, dark-safe. */
.tiers > article.recommended { padding: var(--s4); border: 0; border-radius: var(--radius); background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%), var(--surface-2); }
.tiers > article.recommended + article, .tiers > article + article.recommended { border-left: 0; }
/* Plain tariff: the same card as the recommended one (padding, radius, ground), without the lime field (Polina 16.11, issue 673). */
.tiers > article:not(.recommended) { padding: var(--s4); border: 0; border-radius: var(--radius); background: var(--surface-2); }
.tiers:has(> article.recommended) { gap: var(--s3); }
.pricing-compare { margin-top: var(--s2); }
.academy-shot { margin: var(--s4) 0 0; max-width: 340px; }
.academy-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
@media (max-width: 900px) {
  .site-header.is-scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 94%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .month-cards .month::after, .team > article::after { transition: none; } }

/* Academy in Telegram: button and screenshot centred in their column. */
#academy .actions { justify-content: center; }
#academy .academy-shot { margin-inline: auto; }

/* Lesson preview in the hero: a highlighted block on the same lime field as the Pro tariff, set lower than its neighbour. */
.lesson-preview { margin-top: var(--s5); padding: var(--s3); border-radius: var(--radius); background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%), color-mix(in srgb, var(--on-ink) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.lesson-preview figcaption { margin-top: var(--s3); }
.lesson-preview .preview-label { margin-bottom: var(--s3); }
@media (max-width: 900px) { .lesson-preview { margin-top: var(--s6); } }

/* Spacing scale (issue 29): heading to lead s3, lead to content s4, block to block s6, section to section s12 (s8 on phones). */
.section-eyebrow, .split .eyebrow, .intro .eyebrow { margin-bottom: var(--s2); }
.split > div > .lead:first-child, .intro-row > div > .lead:first-child { margin-top: 0; }
.lead + .kv, .lead + .actions, .lead + .rule-list { margin-top: var(--s4); }
.rule-list > * { padding-top: var(--s3); }
.section.shell.intro { max-width: none; margin-bottom: 0; }
.section.shell.intro > .lead, .section.shell.intro > div { max-width: 640px; }
main > .section + .section, .band + .band > .section:first-child, .band > .section + .section { padding-top: 0; }
@media (max-width: 900px) {
  .split, .intro-row { gap: var(--s3); }
}

/* Letter "Перед тем как начать" on about.html (issue 673): one highlighted card on the lime field of the lesson preview, set apart from the page by its own ground and ring. */
.letter { display: grid; gap: var(--s6); padding: var(--s8); border-radius: var(--radius); background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 14%, transparent), transparent 50%), radial-gradient(circle at 0 100%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 45%), color-mix(in srgb, var(--on-ink) 6%, var(--bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.letter-head .eyebrow { margin-bottom: var(--s2); }
.letter-head .h2 { margin: 0; }
.letter-text { max-width: 720px; display: grid; gap: var(--s2); }
.letter-text p { margin: 0; color: var(--on-ink-muted); font-size: var(--fs-lead); line-height: 1.6; }
.letter-text .letter-greeting { color: var(--on-ink); }
.letter h3 { margin: 0 0 var(--s1); font-size: var(--fs-lead); font-weight: 600; line-height: 1.3; }
.letter-pillars, .letter-points { display: grid; gap: var(--s4); margin: 0; padding: 0; list-style: none; }
.letter-pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.letter-points { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); }
.letter-pillars > div, .letter-points > li { padding-top: var(--s3); border-top: 1px solid var(--line); }
.letter-pillars p, .letter-points p { margin: 0; color: var(--on-ink-muted); line-height: 1.6; }
.letter-points > li { display: grid; grid-template-columns: 2.25em minmax(0, 1fr); gap: var(--s2); }
.letter-num { color: var(--accent-on-dark); font-weight: 800; font-size: var(--fs-micro); letter-spacing: .08em; line-height: 2.2; }
.letter-credo { padding-top: var(--s4); border-top: 1px solid var(--line); }
.letter-credo p { margin: 0; max-width: 820px; font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; }
.letter-credo .letter-sign { margin-top: var(--s3); color: var(--accent-on-dark); font-size: var(--fs-micro); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 900px) {
  .letter { gap: var(--s4); padding: var(--s4) var(--s3); }
  .letter-pillars, .letter-points { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
}

/* Buttons centred in their block on every public page (Polina 16.11, issue 673). Header, navigation and forms keep their own layout. */
main .actions { justify-content: center; }
main .hero .actions { justify-content: center; justify-items: center; }
main form .actions { justify-content: flex-start; }
main .format-options > article > .button, main .presentation-cta > .button { display: flex; width: fit-content; margin-inline: auto; }

/* Keep the registration CTA on the same left edge as its copy on desktop (issue 32). */
@media (min-width: 761px) {
  #free-lesson-registration .actions { justify-content: flex-start; }
}

/* Print: every block is shown at once, without transitions (issue 29 review). */
@media print {
  .reveal, .reveal-clip, .reveal:not(.is-visible) { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; animation: none !important; will-change: auto !important; }
  .month-cards .month::after, .team > article::after { display: none !important; }
}

/* Desktop-only gift annotation, kept outside the reading and click areas (issue 34). */
.free-lesson-gift { display: none; }
@media (min-width: 1201px) {
  #free-lesson-registration { position: relative; }
  #free-lesson-registration > .free-lesson-gift { display: block; position: absolute; right: var(--s4); bottom: calc(var(--s6) + var(--s4)); width: calc(100% - 352px); max-width: none; height: 260px; color: var(--accent-bright); pointer-events: none; }
  .free-lesson-gift-arrow { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-bright) 30%, transparent)); }
}
