/* Shared inner-page finish. Loaded after page-local styles. */
@font-face {
  font-family: "Lab Grotesque";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/LabGrotesque-Regular.woff") format("woff");
}

@font-face {
  font-family: "Lab Grotesque";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/LabGrotesque-Medium.woff") format("woff");
}

@font-face {
  font-family: "Lab Grotesque";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/LabGrotesque-Bold.woff") format("woff");
}

:root, .help-page {
  --font-display: "Lab Grotesque", Arial, sans-serif;
  --font-body: "Lab Grotesque", Arial, sans-serif;
  --service-font-display: "Lab Grotesque", Arial, sans-serif;
  --service-font-body: "Lab Grotesque", Arial, sans-serif;
  --service-font-data: "Lab Grotesque", Arial, sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: "Lab Grotesque", Arial, sans-serif;
}

/* Some page-local rules set Inter or Arial directly; preserve their metrics, only replace the family. */
body :where(
  h1, h2, h3, h4, h5, h6, p, a, abbr, b, strong, em, small, span,
  li, dt, dd, label, legend, summary, time, figcaption, blockquote,
  button, input, select, option, textarea, code, .shared-footer__title
) {
  font-family: "Lab Grotesque", Arial, sans-serif !important;
}

:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  border-radius: 8px !important;
}

/* Match each page's actual content edge without changing its content width. */
[data-site-header] { border-radius: 12px; }
@media (min-width: 1081px) {
  [data-site-header], [data-site-header].is-scrolled {
    width: min(1200px, calc(100% - 48px));
  }
  .legal-page [data-site-header], .legal-page [data-site-header].is-scrolled {
    width: min(1180px, calc(100% - 48px));
  }
  .blog-page [data-site-header], .blog-page [data-site-header].is-scrolled {
    width: min(1152px, calc(100% - 48px));
  }
}

/* Primary surfaces. Decorative media and deliberately round devices are excluded. */
:is(
  .blog-card,
  .mchd-owner-card,
  .monitoring-calculator,
  .callback-dialog,
  .catalog-card,
  .company-certificate,
  .company-certificate-modal,
  .company-contact,
  .company-facts > div,
  .company-hero,
  .company-reviews__proof,
  .company-team__header,
  .driver-card-type,
  .driver-price-match__panel,
  .driver-rto-bonus__panel,
  .era-category-dialog,
  .era-document-card,
  .era-process-card,
  .era-vehicle-card,
  .era-vehicle-hotspot__panel,
  .estimate-card,
  .faq-item,
  .faq-panel,
  .help-errors-dialog,
  .help-errors-directory,
  .help-errors-list__item,
  .help-cta,
  .help-download,
  .help-law-note,
  .help-manual-card,
  .help-memo-page,
  .mchd-dialog,
  .monitoring-card,
  .monitoring-catalog__panel,
  .monitoring-image-dialog,
  .monitoring-installation__form-card,
  .monitoring-product-card,
  .contact-business,
  .contact-business__mail,
  .contact-office,
  .contact-requisites,
  .object-control-map__panel,
  .object-product-card,
  .object-product-dialog__details,
  .object-zone-panel,
  .product-dialog,
  .proof-panel,
  .related-card,
  .skzi-document-card,
  .skzi-service-card,
  .utp-cookie-panel,
  .video-kit-card,
  .blog-feature,
  .blog-notice,
  .blog-preview-note,
  .blog-page [data-blog-card],
  .legal-callout,
  .legal-document,
  .legal-table-wrap,
  .legal-toc
) {
  border-radius: 12px !important;
}

/* Shrink grid tracks when two desktop CTAs cannot fit at their preferred width. */
.catalog-card__actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.catalog-card__actions, .monitoring-product-card__actions) > :is(a, button) {
  border-radius: 8px !important;
}
button, [role="button"] { border-radius: 8px !important; }
:is([data-login-dialog], [data-req-dialog], [data-mega-card]) { border-radius: 12px !important; }

/* Equal-size call to action controls when card layout has room for them. */
@media (min-width: 601px) {
  :is(
    .catalog-card__actions,
    .monitoring-product-card__actions
  ) > :is(a, button) {
    width: min(200px, 100%);
    max-width: 100%;
    min-height: 42px;
    height: 42px;
    box-sizing: border-box;
    justify-self: center;
    justify-content: center;
    padding-inline: 12px;
    text-align: center;
  }
}

/* Dialog and information helpers use the same contained surface. */
:is(
  .driver-card-price-tooltip,
  .monitoring-journey__vehicle-tooltip,
  .object-camera-tooltip,
  .help-errors-dialog__result,
  .product-dialog__note
) {
  border-radius: 12px !important;
}

/* Buttons and navigation controls use the compact homepage radius. */
:is(
  .blog-button,
  .blog-feature-cta,
  .blog-search-control,
  .button,
  .callback-dialog__close,
  .company-button,
  .contact-button,
  .dopog-tanker__button,
  .era-button,
  .era-category-dialog__close,
  .era-law-card__cta,
  .era-vehicle-slide__summary,
  .faq-summary,
  .faq-contact__primary,
  .faq-contact__telegram,
  .fuel-calculator__cta,
  .fuel-calculator__form-cta,
  .fuel-calculator__mode-button,
  .heaters-catalog__more-button,
  .heaters-choice__button,
  .help-cta,
  .help-errors-dialog__close,
  .help-errors-dialog__result-close,
  .help-fines__button,
  .legal-button,
  .mchd-dialog__close,
  .menu-toggle,
  .mobile-menu__close,
  .monitoring-calculator__cta,
  .monitoring-catalog__more-button,
  .monitoring-final__cta,
  .monitoring-image-dialog__close,
  .monitoring-journey__cta,
  .monitoring-journey__final-cta,
  .price-match__cta,
  .price-trust-cta,
  .product-dialog__close,
  .round-view__cta,
  .video-equipment-item__summary,
  .video-product-variants__control,
  [data-curtain-cta],
  [data-login-close],
  [data-login-open],
  [data-req-close],
  [data-req-submit],
  [data-back-to-top]
) {
  border-radius: 8px !important;
}

/* Shared MAX/Telegram control mirrors the homepage treatment and focus ring. */
.messenger-switch {
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(1, 20, 46, 0.1);
}

.messenger-switch__action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

/* An open FAQ is a calm navy/white surface without a red accent bar. */
.faq-item.is-open {
  border-color: var(--sv-navy, #002f6c);
  background: var(--sv-navy, #002f6c);
  box-shadow: 0 14px 32px rgba(0, 47, 108, 0.16);
}

.faq-item.is-open :is(.faq-summary, .faq-question, .faq-index, .faq-toggle) {
  color: #fff;
}

.faq-item.is-open .faq-answer p,
.faq-item.is-open .faq-answer a {
  color: #fff;
}

/* Help affordances remain circular by meaning, rather than inheriting control edges. */
:is(
  .driver-card-price-help > button,
  .fuel-calculator__help,
  .monitoring-calculator__help,
  .era-vehicle-hotspot summary,
  .video-product-dialog__zoom
) {
  border-radius: 50% !important;
}

/* The 30-day GLONASS trial section retains straight corners. */
.glonass-page .monitoring-journey,
.glonass-page .monitoring-journey * {
  border-radius: 0 !important;
}

.glonass-page .monitoring-hero .monitoring-card__online i,
.glonass-page .monitoring-hero .monitoring-final__connection-active i,
.glonass-page .monitoring-hero .monitoring-camera-feed__rec i {
  border-radius: 50% !important;
}

/* Shared estimate forms use their own selectors and previously forced square geometry. */
:is(.installation-page, .skzi-page, .driver-card-page, .era-page) .estimate-card {
  border-radius: 12px !important;
  overflow: hidden;
}

:is(.installation-page, .skzi-page, .driver-card-page, .era-page) .estimate-card__route-outline {
  clip-path: inset(0 round 12px);
}

:is(.installation-page, .skzi-page, .driver-card-page, .era-page) .field :is(input, select, textarea) {
  border-radius: 8px !important;
}

/* Header actions are controls even when their page-local rules do not add a border. */
:is([data-header-phone], [data-burger], [data-mobile-phone]) {
  border-radius: 8px !important;
}

/* The invoice annotation is text, not a handwriting asset. */
.price-match__invoice-edit span {
  font-family: "Lab Grotesque", Arial, sans-serif !important;
}

/* FAQ has no decorative red strip; keyboard focus remains clearly visible. */
.faq-panel { border-top: 0; }
.faq-summary:focus-visible { outline-color: var(--sv-navy, #002f6c); }
.faq-item.is-open .faq-summary:focus-visible { outline-color: #fff; }
/* Keep media/child surfaces within their card corners. */
:is(.contact-office, .company-hero, .blog-feature, .blog-card) { overflow: hidden; }
/* Russian headings keep their established size and break at language-aware points. */
.legal-hero h1 { hyphens: auto; word-break: normal; overflow-wrap: anywhere; }
:is(.price-geo, .driver-process-step, .era-vehicle-slider) { border-radius: 12px !important; }
:is(.product-document, .product-dialog__decision-price, .product-dialog__highlights > div) { border-radius: 12px !important; }

/* Shared footer uses the tachograph page's system font stack; SVG icon paths keep their shapes. */
body #footer,
body #footer :where(a,p,span,div,h1,h2,h3,h4,h5,h6,li,ul,ol,button,address,small,strong,b,em,label) {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, Inter, "Helvetica Neue", Arial, sans-serif !important;
}
