@import url('./typography-tokens.css');
@import url('./site-font-adapter.css');
@import url('./button-outline.css');
@import url('./button-geometry.css');

/* Typography rules below; outlined actions use the imported button-outline contract.
   Existing light/dark/special surface colours are preserved.
   Important type declarations bridge older local styles and their ID selectors;
   component geometry, colour, motion and content remain in their own files. */
html body[data-typography="shared"]{font:var(--type-font-body);letter-spacing:normal;word-spacing:normal}
html body[data-typography="shared"] :is(button,input,textarea,select){font-family:var(--type-ui)}

/* Match the space between the eyebrow and heading in “Четыре шага”. */
.landing-page { --landing-heading-gap: 16px; }
.landing-page main .eyebrow:has(+ :is(h1,h2,h3,.us-heading)) {
  display: block;
  margin-block-end: calc(var(--landing-heading-gap) - var(--heading-layout-gap, 0px));
}
.landing-page main .eyebrow + :is(h1,h2,h3) { margin-block-start: 0; }

/* Reading text, including generated blog content and client conversations. */
html body[data-typography="shared"] :is(
  p,li,.intro,.bubble,.bubble p,.help-message,.help-message p,.help-checklist,
  .help-note,.help-example,.help-preview,.info,.result,.empty,.blog-loading,.blog-empty,
  .feature-copy>p,.chapter-copy>p,.chapter-heading>p,.showcase-heading>p,.us-heading>p,
  .cinematic-intro,.cinematic-description,.crypto-platforms-copy>p,.crypto-platforms-intro,
  .pricing-heading>p,.catalog-copy>p,.releases-intro p,.offer-inclusions li,
  .release-custom p,.release-terms p,.pricing-unit p,.pricing-pilot p,
  .reason-card p,.help-route-card p,.help-factors p,.order-card p
){font:var(--type-font-body)!important;letter-spacing:normal;word-spacing:normal}

/* The hero keeps its owner-defined four lines; leads use the approved 18px role. */
html body[data-typography="shared"] :is(
  .hero-bottom>p,.help-hero>div>p,.blog-intro>p,.blog-article-header>p,.request-layout>section>p:first-of-type
){font:var(--type-font-lead)!important;letter-spacing:normal}

/* Display type; the artwork-based homepage h1 retains its existing geometry. */
html body[data-typography="shared"] :is(h1,h2):not(:where(.hero h1,.hero h2)){
  font-family:var(--type-display)!important;
  font-weight:var(--type-weight-display)!important;
  line-height:var(--type-leading-display)!important;
  letter-spacing:var(--type-tracking-display)!important;
  word-spacing:normal!important;
  text-transform:uppercase;
  overflow-wrap:anywhere;
}
html body[data-typography="shared"] h1:not(:where(.hero h1)){font-size:clamp(48px,5.6vw,var(--type-size-display))!important}
html body[data-typography="shared"] h2{font-size:clamp(40px,4.4vw,var(--type-size-section))!important}
html body[data-typography="shared"]:where(.landing-page) :where(main,.footer-call) h2{
  letter-spacing:var(--type-tracking-section)!important;
  word-spacing:var(--type-word-spacing-section)!important;
}
html body[data-typography="shared"] :is(.feature-copy,.chapter-copy,.chapter-heading,.footer-call){min-width:0}

html body[data-typography="shared"] :is(
  h3,h4,h5,h6,.spec-summary>strong,.help-steps b,
  .help-section h2,.help-route-card h2,.help-contact h2,
  .blog-card h2,.blog-featured h2,.blog-list-heading h2,.blog-follow h2,.blog-article-body h2,
  .panel h2,.dialog-head h2,.dialog-tabs h2,.workflow h2,.chat-title h2,
  .assistant-account-dialog h2,.help-chat-head h2
):not(:where(.brand-banner h3,.collection-copy h3)){
  font:var(--type-font-title)!important;
  letter-spacing:var(--type-tracking-title)!important;
  word-spacing:normal!important;
  text-transform:none!important;
  overflow-wrap:anywhere;
}
/* The strip owns its responsive column sizing; every title shares 24px. */
html body[data-typography="shared"] .spec-summary--details>strong{white-space:normal!important}

/* All labelled buttons share 16px/600. Their different silhouettes stay local. */
html body[data-typography="shared"] :is(
  button,.button,.btn,.cta,.text-button,.mini-button,.blog-read,.blog-follow a,
  .request-secondary,.header-register,.help-contact-links a,.contact-tag span
){font:var(--type-font-button)!important;letter-spacing:normal;word-spacing:normal}
/* Footer text actions are navigation items, including those implemented as buttons. */
html body[data-typography="shared"] :is(nav,.nav,.header-actions>a,.footer-links a,.footer-links button,.footer-contact-column a,.blog-footer-links a){font:var(--type-font-body)!important;letter-spacing:normal}
html body[data-typography="shared"] :is(nav a,.nav a){font-size:16px!important;font-weight:400!important;line-height:1.6!important}

/* Native fields use readable 16px text on desktop and phone alike. */
html body[data-typography="shared"] :is(input,textarea,select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]){font:var(--type-font-body)!important;letter-spacing:normal}
html body[data-typography="shared"] :is(label,legend){font:500 14px/1.6 var(--type-ui)!important;letter-spacing:normal}
html body[data-typography="shared"] :is(.scenario-options label,.check,.request-consent){font:var(--type-font-note)!important}
html body[data-typography="shared"] :is(table,caption,th,td,summary,.workflow-steps,.workflow-steps li){font:var(--type-font-note)!important;letter-spacing:normal}
html body[data-typography="shared"] summary{font:var(--type-font-button)!important}
html body[data-typography="shared"] .faq-list summary{
  font-size:clamp(var(--type-size-lead), calc(var(--type-size-body) + .25vw), 19px)!important;
  overflow-wrap:anywhere;
}

/* Metadata and secondary labels use the shared 12px role; no faded colour is imposed. */
html body[data-typography="shared"] :is(
  small,figcaption,.helper,.error,.badge,.chip,.blog-tag,.blog-meta,.blog-pagination,.blog-back,
  .footer,.help-footer,.blog-footer,.footer-contact-note,.request-privacy,.contact-privacy,
  .brief-hint,.help-fine,.input-error,.recommendation,.plan-description,.plan-recommendation,
  .plan-price span,.catalog-price span,.catalog-total span,.plan-volume span,
  .us-toolbar,.us-preview-caption,.panel-caption,.board-status,.under-demo,
  .preview-note,.style-label small,.style-bottom,.reason-footer,.fan-progress,
  .motion-meta,.cinematic-preview-nav,.cinematic-loop-status,
  .help-chat-head p,.help-chat-status,.help-chat-privacy,.help-voice-settings,.help-voice-hint,
  .help-suggestions-hint,.help-voice-draft>span,.help-record-time,.voice-status,.guest-note,
  #draft-state,#request-status,#brief-status,#lead-voice-status,.contact-field-hint,
  .required-mark,.optional,.conversation-button small,.bubble small
){font:var(--type-font-caption)!important;letter-spacing:normal}
html body[data-typography="shared"] :is(.eyebrow,.hero-stat>.eyebrow){font:var(--type-font-eyebrow)!important;letter-spacing:var(--type-tracking-caption)!important;text-transform:uppercase}
html body[data-typography="shared"] :is(code,pre,kbd,samp){font-family:var(--type-mono)!important;font-size:12px;line-height:1.7;letter-spacing:normal}
html body[data-typography="shared"] :is(.process-tooltip-card,.receipt-toast,.help-answer-sources,.blog-video figcaption){font:var(--type-font-note)!important;letter-spacing:normal}

/* The same numeric specimen is used by counters and volumes. */
html body[data-typography="shared"] :is(.hero-stat strong,.plan-volume strong,.catalog-total strong,.help-big-number,.quota-grid strong){font:500 56px/1 var(--type-ui)!important;letter-spacing:-.06em!important}
html body[data-typography="shared"] .hero-stat strong{letter-spacing:-.02em!important}
html body[data-typography="shared"] .hero-stat>.eyebrow{font:var(--type-font-eyebrow)!important}
html body[data-typography="shared"] .hero-stat small{font:400 12px/16.8px var(--type-ui)!important}

/* Icons are drawings or glyphs, not labelled text buttons. */
html body[data-typography="shared"] :is(.process-info-button){font:19px/1 var(--type-ui)!important}
html body[data-typography="shared"] :is(.help-close,.icon-button,[data-account-close],.dialog-close){font:24px/1 var(--type-ui)!important}
html body[data-typography="shared"] :is(.cinematic-play-icon,.button-orbit,.fan-controls button,.reason-footer button,.motion-control){font-family:var(--type-ui)!important}
html body[data-typography="shared"] .brand-pixel{font-family:'CardLab Silkscreen',monospace!important}
html body[data-typography="shared"] .brand-pixel .brand-name{font-family:inherit!important}

/* More readable type may wrap; let labels grow instead of clipping text. */
html body[data-typography="shared"] :is(.button,.text-button,.help-suggestions button,.us-segments button,.effect-options button,.collection-controls button,.fan-tabs button,.release-selector button){white-space:normal;overflow-wrap:anywhere}
html body[data-typography="shared"] :is(.us-segments,.effect-options,.collection-controls,.fan-tabs){flex-wrap:wrap}
html body[data-typography="shared"] :is(.us-segments button,.effect-options button,.collection-controls button,.fan-tabs button){min-width:min(100%,100px);height:auto;min-height:44px}
html body[data-typography="shared"] :is(.help-chat-head,.panel-head,.plan-top){flex-wrap:wrap}
html body[data-typography="shared"] :is(.header .button,.hero-buttons .button){white-space:nowrap;overflow-wrap:normal}
html body[data-typography="shared"] .help-launcher{font:var(--type-font-button)!important;letter-spacing:normal;white-space:nowrap}
html body[data-typography="shared"] .help-widget:not(.embedded) .help-chat{max-height:min(790px,calc(100dvh - 160px))}
html body[data-typography="shared"] .spec-grid>div{min-height:0}
html body[data-typography="shared"] .blog-follow{flex-wrap:wrap}
html body[data-typography="shared"] .help-page{min-width:0}
/* Small UI text in interactive demos uses the same caption/note roles. Artwork
   inside matrix tiles, game covers and banners remains at its native scale. */
html body[data-typography="shared"] :is(
  .us-file-note,.us-size,.us-panel-title,.us-live-label,.us-range output,.chips>span,
  .queue-profile,.queue-item>div,.queue-foot,.demo-toolbar,.demo-toolbar>span,
  .batch-bottom>span,.editor-toolbar>span,.art-kicker,.chapter-tag,.ui-badge,
  .matrix-head>span,.matrix-row>span,.collection-sizes>span,.number-list>span,
  .pipeline-state,.pipeline-upload,.pipeline-footer>span,.delivery-toolbar>span,
  .delivery-heading>span,.delivery-files i,.reason-number,.pilot-steps>span,
  .footer-bottom>span,.help-header>.wrap>span,.help-nav-group>b
){font:var(--type-font-caption)!important;letter-spacing:normal}
html body[data-typography="shared"] :is(.pipeline-node>b,.delivery-heading>b,.queue-profile b,.us-panel-title>span:first-child){font:600 14px/1.6 var(--type-ui)!important;letter-spacing:normal}
html body[data-typography="shared"] :is(.help-volume-result,.delivery-stages>div>span){font:var(--type-font-title)!important;letter-spacing:var(--type-tracking-title)!important}
html body[data-typography="shared"] :is(.help-hero-actions>a,.help-modes a,.help-factors a,.help-section details a){font:var(--type-font-button)!important;letter-spacing:normal}
html body[data-typography="shared"] p :is(a,span,b,strong){font-size:inherit!important;line-height:inherit!important}
html body[data-typography="shared"] .collection-sizes{flex-wrap:wrap;height:auto}
html body[data-typography="shared"] :is(.pipeline-node,.queue-item>div,.us-file-note){overflow-wrap:anywhere}
@media(max-width:760px){
  html body[data-typography="shared"] :is(.help-header nav,.blog-header nav){flex-wrap:wrap}
  html body[data-typography="shared"] .document-header.has-menu nav{flex-wrap:nowrap}
  html body[data-typography="shared"] :is(.release-plans,.help-factors){grid-template-columns:1fr}
  html body[data-typography="shared"] .request-actions{align-items:stretch}
  html body[data-typography="shared"] .topbar{height:auto;min-height:82px;flex-wrap:wrap;padding-block:14px}
}
