/* HealthAndLife.ru 1.35.167: all medical author cards come AFTER the full article on mobile.
   Desktop sidebar and desktop CMS author placement remain unchanged. */
@media (max-width: 860px) {
  /* Generic CMS material: author is second DOM child; visually put it after article body and sources. */
  #main-content article.article--standard-medical {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
  }
  #main-content article.article--standard-medical > * {order:0 !important;min-width:0;}
  #main-content article.article--standard-medical > .article-author-wrap {
    order:10 !important;
    width:min(100%, 1000px);
    margin:24px auto 42px;
  }
  #main-content article.article--standard-medical > .article-author-wrap > .medical-author-meta {
    width:100%;max-width:100%;margin:0;
  }

  /* The custom article templates share a main + right-sidebar layout.
     Their previous mobile rules disagreed (grid-row:1, order:-1, order:1)
     and sometimes hid the entire sidebar. Keep the actual reading order:
     all article sections, then the author card. */
  #main-content article :is(
    .cg-shell,.ait-shell,.tsh-shell,.weight-shell,.hb-layout,.ea-layout,.osa-layout,
    .cob-layout,.ms-layout,.prl-shell,.glc-shell,.frt-shell,.ft3-shell,
    .sp-shell,.tg-shell,.cort-shell,.ogtt-shell,.chl-shell,
    .hypo-shell,.nodule-shell,.thyro-shell
  ) {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    min-width:0;
  }
  #main-content article :is(
    .cg-shell,.ait-shell,.tsh-shell,.weight-shell,.hb-layout,.ea-layout,.osa-layout,
    .cob-layout,.ms-layout,.prl-shell,.glc-shell,.frt-shell,.ft3-shell,
    .sp-shell,.tg-shell,.cort-shell,.ogtt-shell,.chl-shell,
    .hypo-shell,.nodule-shell,.thyro-shell
  ) > :is(main,.chl-content) {
    order:0 !important;
    grid-row:auto !important;
    grid-column:auto !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0;
  }
  #main-content article :is(
    .cg-sidebar,.ait-sidebar,.tsh-sidebar,.weight-sidebar,.hb-sidebar,.ea-sidebar,.osa-side,
    .cob-side,.ms-sidebar,.prl-sidebar,.glc-aside,.frt-aside,.ft3-aside,
    .sp-aside,.tg-aside,.cort-aside,.ogtt-sidebar,.chl-sidebar,
    .hypo-sidebar,.nodule-sidebar,.thyro-sidebar
  ) {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    order:10 !important;
    grid-row:auto !important;
    grid-column:auto !important;
    position:static !important;
    top:auto !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0;
    padding:0 !important;
    margin:24px 0 42px !important;
    gap:0 !important;
  }
  /* HOMA-IR already has a separate closing author banner; use the unified card instead. */
  #main-content article .ea-author-closing {display:none !important;}
  /* Sidebar navigation and cross-links are redundant below the long article.
     Show its one medical author/review card, even when older mobile CSS hides the sidebar. */
  #main-content article :is(
    .cg-sidebar,.ait-sidebar,.tsh-sidebar,.weight-sidebar,.hb-sidebar,.ea-sidebar,.osa-side,
    .cob-side,.ms-sidebar,.prl-sidebar,.glc-aside,.frt-aside,.ft3-aside,
    .sp-aside,.tg-aside,.cort-aside,.ogtt-sidebar,.chl-sidebar,
    .hypo-sidebar,.nodule-sidebar,.thyro-sidebar
  ) > :not(:is(
    .cg-review-card,.ait-review-card,.tsh-review-card,.weight-review-card,
    .hb-review-card,.ea-doctor-card,.osa-review,.cob-review-card,.ms-reviewer,.prl-author-card,
    .glc-author,.frt-author,.ft3-author,.sp-aside__author,.tg-author,
    .cort-aside__author,.ogtt-review-card,.chl-author,
    .hypo-review-card,.nodule-review-card,.thyro-review-card
  )) {display:none !important;}
  #main-content article :is(
    .cg-sidebar,.ait-sidebar,.tsh-sidebar,.weight-sidebar,.hb-sidebar,.ea-sidebar,.osa-side,
    .cob-side,.ms-sidebar,.prl-sidebar,.glc-aside,.frt-aside,.ft3-aside,
    .sp-aside,.tg-aside,.cort-aside,.ogtt-sidebar,.chl-sidebar,
    .hypo-sidebar,.nodule-sidebar,.thyro-sidebar
  ) > :is(
    .cg-review-card,.ait-review-card,.tsh-review-card,.weight-review-card,
    .hb-review-card,.ea-doctor-card,.osa-review,.cob-review-card,.ms-reviewer,.prl-author-card,
    .glc-author,.frt-author,.ft3-author,.sp-aside__author,.tg-author,
    .cort-aside__author,.ogtt-review-card,.chl-author,
    .hypo-review-card,.nodule-review-card,.thyro-review-card
  ) {
    display:block !important;
    position:static !important;
    order:0 !important;
    grid-column:auto !important;
    grid-row:auto !important;
    box-sizing:border-box;
    width:100% !important;
    max-width:540px !important;
    min-width:0 !important;
    margin:0 auto !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }
}
