/* FMI responsive safety layer — public front-end only. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:where(body.fmi-responsive-v1, body.bg-purple) *,
:where(body.fmi-responsive-v1, body.bg-purple) *::before,
:where(body.fmi-responsive-v1, body.bg-purple) *::after {
  box-sizing: border-box;
}

:where(body.fmi-responsive-v1, body.bg-purple) :where(img, video, canvas) {
  max-width: 100%;
  height: auto;
}

:where(body.fmi-responsive-v1, body.bg-purple) :where(iframe, embed, object) {
  max-width: 100%;
}

:where(
  .page-content-outer-holder,
  .page-content-holder,
  .page-content-holder-wide,
  .entry-content,
  .elementor,
  .elementor-section,
  .elementor-container,
  .elementor-column,
  .elementor-widget,
  .elementor-widget-wrap,
  .elementor-widget-container,
  .fmi-v90-picker,
  .fmi-v90-track,
  .fmi-v90-card
) {
  min-width: 0;
  max-width: 100%;
}

:where(.entry-content, .fmi-article-content, .fmi-blog-card, .fmi-final-page, .fmi-insta-page) {
  overflow-wrap: anywhere;
}

/* Articles: fluid shell, readable type and safe rich content. */
body.fmi-seo-v90-article :where(
  .fmi-article-wrap,
  .fmi-article-shell,
  .fmi-article-hero,
  .fmi-article-layout,
  .fmi-article-content,
  .fmi-article-aside,
  .fmi-related,
  .fmi-article-decision,
  .fmi-article-decision-grid,
  .fmi-article-cover
) {
  min-width: 0;
  max-width: 100%;
}

body.fmi-seo-v90-article .fmi-article-header-in {
  flex-wrap: wrap;
}

body.fmi-seo-v90-article .fmi-article-content :where(figure, img, video, iframe, embed, object) {
  max-width: 100%;
}

body.fmi-seo-v90-article .fmi-article-content figure {
  margin-inline: 0;
}

body.fmi-seo-v90-article .fmi-article-content :where(pre, code) {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

body.fmi-seo-v90-article .fmi-article-content pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.fmi-seo-v90-article .fmi-article-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

body.fmi-seo-v90-article .fmi-article-content a {
  overflow-wrap: anywhere;
}

/* Blog index: cards and navigation never force desktop width. */
body.fmi-remediation-blog :where(
  .fmi-blog-wrap,
  .fmi-blog-header-inner,
  .fmi-blog-main,
  .fmi-blog-grid,
  .fmi-blog-card,
  .fmi-blog-card > a,
  .fmi-blog-hubs,
  .fmi-blog-footer > div
) {
  min-width: 0;
  max-width: 100%;
}

body.fmi-remediation-blog .fmi-blog-card-meta {
  flex-wrap: wrap;
}

/* Custom public pages and Elementor sections. */
:where(.fmi-insta-page, .fmi-final-page) {
  width: 100%;
  max-width: min(100%, 1250px);
}

:where(.fmi-insta-grid, .fmi-insta-benefits, .fmi-insta-steps, .fmi-final-grid) > * {
  min-width: 0;
}

:where(.fmi-insta-actions, .fmi-final-actions) {
  max-width: 100%;
}

/* Forms, authentication and service catalogue. */
:where(.single-order-form, .new-order-form, .login-form, .kt-login-form, .kt-register-form) {
  min-width: 0;
  max-width: 100%;
}

:where(.single-order-form, .new-order-form, .login-form, .kt-login-form, .kt-register-form)
  :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  max-width: 100%;
}

.new-order-form .kt-row {
  min-width: 0;
}

.new-order-form [class*="kt-col-"] {
  min-width: 0;
  max-width: 100%;
}

.new-order-form table.shop_table {
  width: 100%;
  max-width: 100%;
}

:where(.kt-modal-inner, .kt-modal-content, .kt-notice-inner) {
  max-width: calc(100vw - 24px);
}

@media (max-width: 850px) {
  body.fmi-seo-v90-article .fmi-article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.fmi-seo-v90-article .fmi-article-aside > div {
    position: static;
  }

  body.fmi-seo-v90-article .fmi-related > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 782px) {
  :where(
    body.fmi-seo-v90-article,
    body.fmi-remediation-blog,
    body.fmi-master-home,
    body.perfect-body,
    body.page-template-login-register,
    body.bg-purple
  ) {
    max-width: 100%;
    overflow-x: clip;
  }

  :where(.page-content-outer-holder, .page-content-holder, .page-content-holder-wide) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  :where(.elementor-section .elementor-container, .elementor-column, .elementor-widget-wrap) {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  :where(.single-order-form, .new-order-form, .login-form, .kt-login-form, .kt-register-form)
    :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-size: 16px !important;
  }

  :where(
    .fmi-btn,
    .fmi-link-btn,
    .fmi-blog-topics a,
    .fmi-blog-pagination .page-numbers,
    .fmi-article-order,
    .fmi-article-aside a,
    .fmi-article-decision-link,
    .fmi-iglp-article-cta a,
    .fmi-insta-btn,
    .fmi-final-btn,
    .kt-login-submit,
    .kt-register-btn,
    .kando-sendo-order-box button
  ) {
    min-height: 44px;
  }

  .fmi-v90-track {
    scrollbar-width: thin;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
  }

  .fmi-v90-card {
    scroll-snap-align: start;
  }

  .new-order-form table.shop_table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  body.fmi-seo-v90-article .fmi-article-wrap {
    width: calc(100% - 16px);
  }

  body.fmi-seo-v90-article .fmi-article-header-in {
    min-height: 62px;
    gap: 9px 14px;
    padding-block: 8px;
  }

  body.fmi-seo-v90-article .fmi-article-header nav {
    min-width: 0;
    max-width: 100%;
    gap: 8px;
  }

  body.fmi-seo-v90-article .fmi-article-shell {
    margin-block: 10px 30px;
    padding: 17px 14px;
    border-radius: 18px;
  }

  body.fmi-seo-v90-article .fmi-article-hero {
    padding-block: 20px 22px;
  }

  body.fmi-seo-v90-article .fmi-article-hero h1 {
    margin-block: 11px 12px;
    font-size: clamp(25px, 7.5vw, 29px);
    line-height: 1.55;
    letter-spacing: 0;
  }

  body.fmi-seo-v90-article .fmi-article-hero > p {
    font-size: 13.5px;
    line-height: 1.95;
  }

  body.fmi-seo-v90-article .fmi-article-meta {
    gap: 6px 12px;
  }

  body.fmi-seo-v90-article .fmi-article-layout {
    gap: 18px;
    margin-top: 20px;
  }

  body.fmi-seo-v90-article .fmi-article-content {
    font-size: 14.5px;
    line-height: 2;
  }

  body.fmi-seo-v90-article .fmi-article-content h2 {
    margin-top: 30px;
    font-size: clamp(20px, 6vw, 23px);
    line-height: 1.65;
  }

  body.fmi-seo-v90-article .fmi-article-content h3 {
    margin-top: 24px;
    font-size: clamp(17px, 5vw, 19px);
  }

  body.fmi-seo-v90-article .fmi-article-content :where(ul, ol) {
    padding-inline-start: 22px;
    padding-inline-end: 0;
  }

  body.fmi-seo-v90-article .fmi-article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.fmi-seo-v90-article .fmi-article-content :where(th, td) {
    min-width: 9rem;
    white-space: normal;
  }

  body.fmi-seo-v90-article :where(
    .fmi-article-decision,
    .fmi-summary-box,
    .fmi-faq-box,
    .fmi-article-note,
    .fmi-iglp-article-cta,
    .fmi-article-aside > div
  ) {
    padding: 15px;
    border-radius: 15px;
  }

  body.fmi-seo-v90-article .fmi-article-decision-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.fmi-seo-v90-article .fmi-article-cover {
    margin-block: 18px;
  }

  body.fmi-seo-v90-article .fmi-article-cover img {
    width: 100%;
    border-radius: 14px;
  }

  body.fmi-seo-v90-article .fmi-related > div {
    grid-template-columns: minmax(0, 1fr);
  }

  body.fmi-remediation-blog .fmi-blog-wrap {
    width: calc(100% - 20px);
  }

  body.fmi-remediation-blog .fmi-blog-header-inner,
  body.fmi-remediation-blog .fmi-blog-footer > div {
    align-items: stretch;
  }

  body.fmi-remediation-blog .fmi-blog-header nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 7px;
  }

  body.fmi-remediation-blog .fmi-blog-header nav a {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 7px 5px;
    border: 1px solid var(--fmi-blog-line);
    border-radius: 10px;
    text-align: center;
    font-size: 11px;
  }

  body.fmi-remediation-blog .fmi-blog-main {
    padding-block: 20px 42px;
  }

  body.fmi-remediation-blog .fmi-blog-hero {
    padding-block: 22px 18px;
  }

  body.fmi-remediation-blog .fmi-blog-hero h1 {
    font-size: clamp(25px, 8vw, 32px);
    line-height: 1.55;
  }

  body.fmi-remediation-blog .fmi-blog-hero p {
    font-size: 14px;
    line-height: 1.95;
  }

  body.fmi-remediation-blog .fmi-blog-topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.fmi-remediation-blog .fmi-blog-topics a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
    font-size: 12px;
  }

  body.fmi-remediation-blog .fmi-blog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  body.fmi-remediation-blog .fmi-blog-card > a {
    padding: 17px;
  }

  body.fmi-remediation-blog .fmi-blog-card h2 {
    font-size: 17px;
    line-height: 1.7;
  }

  body.fmi-remediation-blog .fmi-blog-hubs {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 19px;
    border-radius: 17px;
  }

  body.fmi-remediation-blog .fmi-blog-hubs nav {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(.fmi-insta-page, .fmi-final-page) {
    margin-block: 14px 38px !important;
    padding-inline: 10px !important;
  }

  :where(.fmi-insta-hero, .fmi-final-hero) {
    padding: 30px 18px !important;
    border-radius: 20px !important;
  }

  :where(.fmi-insta-hero h1, .fmi-final-hero h1) {
    font-size: clamp(24px, 7.5vw, 30px) !important;
    line-height: 1.65 !important;
  }

  :where(.fmi-insta-hero p, .fmi-final-hero p) {
    font-size: 15px !important;
    line-height: 2 !important;
  }

  :where(.fmi-insta-grid, .fmi-insta-benefits, .fmi-insta-steps, .fmi-final-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :where(.fmi-insta-actions, .fmi-final-actions) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :where(.fmi-insta-actions .fmi-insta-btn, .fmi-final-actions .fmi-final-btn) {
    width: 100% !important;
  }

  body.fmi-platform-v90-order .page-content-outer-holder > .wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 10px !important;
  }

  :where(.login-form, .kt-login-form, .kt-register-form) {
    width: min(100%, 460px) !important;
    margin-inline: auto;
  }
}

@media (max-width: 370px) {
  body.fmi-seo-v90-article .fmi-article-wrap,
  body.fmi-remediation-blog .fmi-blog-wrap {
    width: calc(100% - 12px);
  }

  body.fmi-seo-v90-article .fmi-article-shell {
    padding-inline: 11px;
  }

  body.fmi-remediation-blog .fmi-blog-header nav,
  body.fmi-remediation-blog .fmi-blog-topics {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(body.fmi-responsive-v1, body.bg-purple) *,
  :where(body.fmi-responsive-v1, body.bg-purple) *::before,
  :where(body.fmi-responsive-v1, body.bg-purple) *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Standalone article/blog templates load their own UI and do not load the
   KandoPanel toolbar stylesheet. The legacy footer markup is still emitted by
   wp_footer(); its 1080px inline SVG otherwise widens mobile pages. */
body.fmi-seo-v90-article,
body.fmi-remediation-blog {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

body.fmi-seo-v90-article .sticky_toolbar_footer,
body.fmi-seo-v90-article .toolbar_mobile,
body.fmi-seo-v90-article .mfoot_1,
body.fmi-seo-v90-article .kt-modal-outer-holder,
body.fmi-remediation-blog .sticky_toolbar_footer,
body.fmi-remediation-blog .toolbar_mobile,
body.fmi-remediation-blog .mfoot_1,
body.fmi-remediation-blog .kt-modal-outer-holder {
  display: none !important;
}

/* Keep the keyboard skip link accessible without positioning it 999px beyond
   the viewport, which can also create horizontal scrolling in RTL browsers. */
body.fmi-remediation-blog .fmi-blog-skip {
  top: -100px;
  right: 8px;
}

body.fmi-remediation-blog .fmi-blog-skip:focus {
  top: 8px;
  right: 8px;
}

/* FMI updates page: keep responsive cards inside small viewports. */
@media (max-width: 782px) {
  body.page-template-panel-page .updates .fmi-mobile-table-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.page-template-panel-page .updates .fmi-mobile-table-scroll table.shop_table_responsive {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  body.page-template-panel-page .updates table.shop_table_responsive thead {
    display: none !important;
  }

  body.page-template-panel-page .updates table.shop_table_responsive tbody,
  body.page-template-panel-page .updates table.shop_table_responsive tr {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.page-template-panel-page .updates table.shop_table_responsive td {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 12px;
    align-items: flex-start;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.page-template-panel-page .updates table.shop_table_responsive td::before {
    flex: 0 0 74px;
    max-width: 74px;
  }

  body.page-template-panel-page .updates table.shop_table_responsive td > * {
    max-width: 100%;
  }
}
