/* UX-001–UX-011: shared readable controls and responsive service layouts. */
:root {
  --gb-form-ink: #172b22;
  --gb-form-muted: #43594d;
  --gb-form-error: #a51d30;
  --gb-control-height: 48px;
}

/* A single form component; only public /send.php forms are enhanced. */
html body form.gb-lead-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
  color: var(--gb-form-ink);
  font-size: 16px !important;
  line-height: 1.4 !important;
}
html body form.gb-lead-form .gb-field {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-column: 1 / -1 !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}
html body form.gb-lead-form .gb-field-label {
  display: block !important;
  margin: 0 !important;
  color: var(--gb-form-ink) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
}
html body form.gb-lead-form .gb-field :is(input, textarea, select) {
  display: block !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: var(--gb-control-height) !important;
  height: var(--gb-control-height) !important;
  margin: 0 !important;
  padding: 11px 12px !important;
  border: 1px solid #83978b !important;
  border-radius: 6px !important;
  box-sizing: border-box;
  color: var(--gb-form-ink) !important;
  background: #fff !important;
  font: inherit !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
}
html body form.gb-lead-form .gb-field :is(input, textarea)::placeholder { color: #596d61; opacity: 1; }
html body form.gb-lead-form .gb-field textarea { min-height: 112px !important; height: 112px !important; resize: vertical !important; }
html body form.gb-lead-form .gb-field input[type="file"] { height: auto !important; padding: 10px !important; }
html body form.gb-lead-form .gb-field input[type="file"]::file-selector-button { min-height: 36px; margin-right: 8px; font: inherit; }
html body form.gb-lead-form :is(button[type="submit"], button:not([type]), input[type="submit"]) {
  display: flex !important;
  grid-column: 1 / -1 !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: var(--gb-control-height) !important;
  height: auto !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  box-sizing: border-box;
  border-radius: 6px !important;
  color: #102b1f !important;
  background: #8df0c7 !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  line-height: 1.4 !important;
  white-space: normal !important;
}
html body form.gb-lead-form > strong { font-size: 20px !important; line-height: 1.35 !important; }
html body form.gb-lead-form > span:not(.gb-field-label) { margin: 0 !important; font-size: 14px !important; line-height: 1.4 !important; }
html body form.gb-lead-form .gb-field-error {
  display: block !important;
  grid-column: 1 / -1 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--gb-form-error) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}
html body form.gb-lead-form .gb-field-error[hidden] { display: none !important; }
html body form.gb-lead-form .gb-field [aria-invalid="true"] { border-color: var(--gb-form-error) !important; border-width: 2px !important; }
/* This legacy template declares its compact control font with !important. */
html body.moscow-v4.moscow-service-v5.page-store form.gb-lead-form .gb-field :is(input, textarea, select) { font-size: 16px !important; }
html body form.gb-lead-form :is(.contact-form-row-v5, .contact-form-submit-v5) { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; min-width: 0; }

/* Legal copy stays visible; no inherited sr-only/compact presentation. */
html body .gb-legal,
html body form.gb-lead-form .gb-legal {
  display: block !important;
  position: static !important;
  grid-column: 1 / -1 !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
  opacity: 1 !important;
  color: var(--gb-form-muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  letter-spacing: normal !important;
}
html body .gb-legal :is(a, span, small),
html body form.gb-lead-form .gb-legal :is(a, span, small) { color: inherit !important; font-size: inherit !important; line-height: inherit !important; }
html body .gb-legal a,
html body form.gb-lead-form .gb-legal a { text-decoration: underline !important; text-underline-offset: 2px; }
html body .gb-legal--inverse { --gb-form-muted: #d8e5de; }
html body form.gb-lead-form label.gb-legal { min-height: 44px !important; cursor: pointer; }
html body form.gb-lead-form .gb-legal input[type="checkbox"] { width: 20px; height: 20px; margin: 0 7px 0 0; vertical-align: middle; }
html body form.gb-lead-form > small,
html body form.gb-lead-form .g6-cta-security,
html body.moscow-v4.moscow-service-v5.page-seo-search form.gb-lead-form :is(.g6-cta-security, .y6-cta-security) { font-size: 12px !important; line-height: 1.5 !important; margin: 0 !important; color: var(--gb-form-muted) !important; }
html body form.gb-lead-form.gb-lead-form--inverse { --gb-form-ink: #edf7f1; --gb-form-muted: #d8e5de; --gb-form-error: #ffb3be; }
html body form.gb-lead-form.gb-lead-form--inverse .gb-field :is(input, textarea, select) { color: #172b22 !important; }
html body form.gb-lead-form.gb-lead-form--inverse .gb-field [aria-invalid="true"] { border-color: #b42038 !important; }

/* Service form containers grow with their controls rather than clipping them. */
html body.moscow-service-v5 :is(.m5-final, .ss-final) {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr) !important;
  align-items: start !important;
  gap: 24px !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 28px !important;
}
html body.moscow-service-v5 :is(.m5-final, .ss-final) > * { min-width: 0; max-width: 100%; }
html body.moscow-service-v5 :is(.m5-cta-points, .ss-final > ul) { grid-column: 1 / -1 !important; }
html body.moscow-service-v5 :is(.m5-cta-copy, .ss-final > div) p { font-size: 14px !important; line-height: 1.5 !important; }
html body.moscow-service-v5 :is(.m5-cta-points, .ss-final > ul) li { font-size: 14px !important; line-height: 1.5 !important; }
html body.moscow-service-v5 .m5-hero-form { width: min(100%, 420px) !important; max-width: 100% !important; height: auto !important; padding: 18px !important; }
html body.moscow-service-v5 :is(.m5-faq, .ss-faq) summary { min-height: 48px !important; padding: 13px 36px 13px 14px !important; font-size: 16px !important; line-height: 1.4 !important; }
html body.moscow-service-v5 :is(.m5-faq, .ss-faq) details p { font-size: 14px !important; line-height: 1.5 !important; }
html body.moscow-service-v5 :is(.m5-faq, .ss-faq) summary::after { font-size: 20px !important; line-height: 1 !important; }

@media (max-width: 900px) {
  html body.moscow-v4.moscow-service-v5 .bread-hero > p { font-size: 16px !important; line-height: 1.5 !important; }
  html body.moscow-service-v5 main p { font-size: 14px !important; line-height: 1.5 !important; }
  html body.moscow-service-v5 main h3 { font-size: 16px !important; line-height: 1.4 !important; }
  html body.moscow-service-v5 main summary { min-height: 48px !important; padding: 13px 14px !important; font-size: 16px !important; line-height: 1.4 !important; }
  html body.moscow-v4.moscow-service-v5.page-seo-search .yandex-process .steps p,
  html body.moscow-v4.moscow-service-v5.page-seo-search .m5-faq details p { font-size: 14px !important; line-height: 1.5 !important; }
  html body.moscow-v4.moscow-service-v5.page-seo-search .yandex-process .steps h3 { font-size: 16px !important; line-height: 1.4 !important; }
  html body.moscow-v4.moscow-service-v5 main .m5-final ul.m5-cta-points { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  html body.moscow-v4.moscow-service-v5 main .m5-final ul.m5-cta-points li,
  html body.moscow-v4.moscow-service-v5:is(.page-seo-search, .page-store, .page-tilda, .page-landing) main .m5-final ul.m5-cta-points li { font-size: 14px !important; line-height: 1.5 !important; }
  html body.moscow-service-v5 main :is(.bc-process, .bc-advantages, .bc-faq-grid, .m5-process-source .steps, .y6-case-result) { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; height: auto !important; }
  html body.moscow-service-v5 main :is(.bc-process, .bc-advantages, .m5-process-source .steps) > * { min-width: 0 !important; height: auto !important; padding: 14px !important; }
  html body.moscow-service-v5 main :is(.ss-system, .ss-system-steps, .ss-system-result) { height: auto !important; min-height: 0 !important; }
  html body.moscow-service-v5 main .ss-system-steps { grid-template-columns: minmax(0, 1fr) !important; }
  html body.moscow-service-v5 main .ss-system-steps > article { height: auto !important; padding: 16px !important; }
  html body.moscow-service-v5 main :is(.m5-six-grid, .m5-five-grid, .m5-four-grid, .ss-grid, .ss-process-grid, .bc-card-grid) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    min-width: 0 !important;
  }
  html body.moscow-service-v5 main :is(.m5-six-grid, .m5-five-grid, .m5-four-grid, .ss-grid, .ss-process-grid, .bc-card-grid) > :is(article, li, .bc-card) {
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 16px !important;
    box-sizing: border-box;
  }
  html body.moscow-service-v5 main :is(.m5-six-grid, .m5-five-grid, .m5-four-grid, .ss-grid, .ss-process-grid, .bc-card-grid) h3 {
    min-width: 0 !important;
    width: auto !important;
    margin: 0 0 8px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    letter-spacing: normal !important;
    overflow-wrap: break-word;
  }
  html body.moscow-service-v5 main :is(.m5-six-grid, .m5-five-grid, .m5-four-grid, .ss-grid, .ss-process-grid, .bc-card-grid) :is(p, li) { font-size: 14px !important; line-height: 1.5 !important; }
  html body.moscow-service-v5 .m5-capabilities article { background: #fff !important; }
  html body.moscow-service-v5 .m5-capability-visual { width: 100% !important; height: 80px !important; margin-bottom: 14px !important; }
  html body.moscow-service-v5 .m5-visual-tag { color: #245f48 !important; font-size: 12px !important; line-height: 1.35 !important; }
  html body.moscow-service-v5 :is(.m5-final, .ss-final) { grid-template-columns: minmax(0, 1fr) !important; padding: 22px 16px !important; }
  html body.moscow-service-v5 :is(.m5-final, .ss-final) > * { grid-column: 1 !important; }
  html body.moscow-service-v5 :is(.m5-final, .ss-final) h2 { font-size: 28px !important; line-height: 1.15 !important; }
  html body.moscow-service-v5 :is(.ss-faq-grid, .m5-faq-grid) { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  html body:is(.page-seo-search, .page-seo-store) footer.site-footer { display: block !important; height: auto !important; }
}
@media (max-width: 599px) {
  html body.moscow-service-v5 main :is(.m5-six-grid, .m5-five-grid, .m5-four-grid, .ss-grid, .ss-process-grid, .bc-card-grid) { grid-template-columns: minmax(0, 1fr) !important; }
  html body.moscow-service-v5 main :is(.bc-process, .bc-advantages, .bc-faq-grid, .m5-process-source .steps, .y6-case-result) { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Regional primary and inverse contact roles. */
html body.spb-home-rd .spb-rq-actions button.callback-open,
html body.spb-home-rd .spb-rq-actions button.callback-open:is(:hover, :focus-visible, :active) { color: #14251b !important; }
html body.spb-site .site-footer .site-footer-phone,
html body.spb-site .site-footer .site-footer-phone:is(:link, :visited, :hover, :focus-visible, :active) { color: #f1faf5 !important; }

/* Price layout: all tracks may shrink; graphic remains inside its column. */
html body.prices-page .hero .container { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
html body.prices-page .hero-graphic { min-width: 0 !important; max-width: 100% !important; height: auto !important; margin: 0 !important; }
html body.prices-page .hero-graphic-image { position: relative !important; left: auto !important; top: auto !important; width: 100% !important; max-width: 100% !important; height: auto !important; clip-path: none !important; }
html body.prices-page .calc-layout > * { min-width: 0; max-width: 100%; }
html body.prices-page .calc-note { transform: none !important; }
html body.prices-page .calc-note svg { max-width: 100%; margin-left: 0 !important; }
@media (min-width: 1000px) {
  html body.prices-page .calc-section .container.calc-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, .45fr) !important; gap: 24px !important; }
}
@media (min-width: 650px) and (max-width: 1399px) {
  html body.prices-page .calc-section .container.calc-layout { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body.prices-page .calc-note { display: flex !important; grid-column: 1 / -1 !important; justify-content: center; align-items: center; gap: 18px; padding: 0 !important; }
  html body.prices-page .calc-note p { max-width: 34ch; font-size: 15px; }
  html body.prices-page .calc-note svg { width: 80px; height: 50px; }
}
html body.prices-page :is(.factor p, .service-item span, .faq-column .faqs details p, .factors-head p, .compare-head p) { color: #43594d !important; }
html body.prices-page .site-footer { --red: #0c6f51; }
html body.prices-page .site-footer :is(.site-footer-all, .site-footer-telegram, .site-footer-project) { color: #0c6f51 !important; }
html body.prices-page .faqs summary { min-height: 44px; font-size: 14px; line-height: 1.4; }
html body.prices-page .faqs details p { font-size: 14px; line-height: 1.5; }
html body.prices-page .calc-disclaimer { font-size: 12px; line-height: 1.5; color: #d8e5de; }
html body.prices-page :is(.factors-head p, .compare-head p, .contact-form .form-status) { font-size: 12px !important; line-height: 1.5 !important; }

/* Contact hero: min-content must not enlarge the 320 px layout. */
html body.page-contacts :is(.contact-hero-v5, .contact-hero-copy-v5, .contact-direct-v5, .contact-channel-v5) { min-width: 0 !important; max-width: 100%; box-sizing: border-box; }
html body.page-contacts .contact-channel-v5 { grid-template-columns: 78px minmax(0, 1fr) 20px; }
html body.page-contacts .contact-channel-v5 > * { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  html body.page-contacts .contact-hero-v5 { grid-template-columns: minmax(0, 1fr) !important; }
  html body.page-contacts .contact-hero-copy-v5 h1 { max-width: 100%; min-width: 0; font-size: clamp(32px, 10vw, 46px) !important; overflow-wrap: break-word; }
}
