/* HealthAndLife 1.35.138 — public content / mobile overflow regression fixes. */
#main-content,#main-content>*{min-width:0;max-width:100%;box-sizing:border-box}
#main-content :where(img,video,canvas,picture){max-width:100%;}
#main-content :where(figure img,.article-figure img,.glc-symptoms__figure img,.cort-symptoms__figure img){height:auto;object-fit:contain}
#main-content :where(iframe){max-width:100%;}
#main-content :where(svg){max-width:100%;}
#main-content :where(h1,h2,h3,h4,h5,h6,p,a,button,summary,li,dt,dd,th,td){overflow-wrap:anywhere}
#main-content :where(input,select,textarea,button){max-width:100%;min-width:0}
#main-content :where(.container,.glc-wrap,.sp-wrap,.cort-container,.chl-wrap,.prl-container,.article-container,.calculator-container,.medical-container){max-width:100%;box-sizing:border-box;min-width:0}
#main-content :where(.glc-main,.glc-aside,.sp-main,.sp-aside,.cort-main,.cort-aside,.chl-main,.chl-aside,.article-main,.article-body,.calculator-section,.calculator-card,.calculator-form,.calculator-result){min-width:0;max-width:100%}
/* Images with HTML width/height must remain fluid; do not override icon dimensions. */
#main-content :where(figure,.article-figure,.glc-symptoms__figure,.cort-symptoms__figure,.sp-ovary__art){max-width:100%;min-width:0}
#main-content :where(.glc-flow__viewport,.sp-process__viewport,.cort-axis-figure__viewport,.article-table-wrap,.glc-table-wrap,.sp-table-wrap,.table-responsive,.table-scroll,.calculator-table-wrap){max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
#main-content :where(.glc-flow__viewport,.sp-process__viewport,.cort-axis-figure__viewport) img{max-width:none;height:auto;display:block}
#main-content :where(.calculator-form,.calculator-result,.calculator-widget,.glc-interpreter,.sp-choice,.cort-route){position:relative;z-index:0;isolation:isolate}
@media(max-width:860px){
 #main-content :where(.glc-shell,.sp-shell,.cort-shell,.chl-shell){grid-template-columns:minmax(0,1fr);max-width:100%;column-gap:0}
 #main-content :where(.glc-page,.sp-page,.cort-page,.chl-page) :where(.glc-main,.sp-main,.cort-main,.chl-main){min-width:0}
 #main-content :where(.glc-page,.sp-page,.cort-page,.chl-page) :where(.glc-aside,.sp-aside,.cort-aside,.chl-aside){position:static;max-height:none;overflow:visible;min-width:0}
}
@media(max-width:767px){
 #main-content{width:100%;}
 #main-content :where(.container,.glc-wrap,.sp-wrap,.cort-container,.chl-wrap,.prl-container,.article-container,.calculator-container,.medical-container){width:calc(100% - 24px);margin-inline:auto}
 #main-content :where(.glc-page,.sp-page,.cort-page,.chl-page) :where(.glc-section,.sp-section,.cort-section,.chl-section){max-width:100%;min-width:0}
 #main-content :where(.glc-overview,.glc-split,.glc-meal,.glc-range,.glc-timeline,.glc-methods,.glc-symptoms,.glc-route,.glc-related,.sp-overview,.sp-split,.sp-ovaries,.sp-compare,.sp-signs,.sp-metabolic,.sp-risks,.sp-cases,.sp-choice,.cort-overview,.cort-rhythm,.cort-functions,.cort-test-grid,.cort-symptoms,.cort-route,.chl-related,.chl-split){grid-template-columns:minmax(0,1fr);min-width:0}
 #main-content :where(.glc-flow,.sp-process,.cort-axis-figure){max-width:100%;min-width:0}
 #main-content :where(.glc-hero,.sp-hero,.cort-hero,.chl-hero,.article-hero){max-width:100%;}
 #main-content :where(.glc-hero__chips,.sp-chipline,.cort-hero__links,.article-hero__links){max-width:100%;flex-wrap:wrap}
 #main-content :where(.glc-hero__chips,.sp-chipline,.cort-hero__links,.article-hero__links) a{max-width:100%;white-space:normal;overflow-wrap:anywhere}
 #main-content :where(.glc-page,.sp-page,.cort-page,.chl-page) :where(h1,h2,h3){max-width:100%;hyphens:auto}
 #main-content :where(.calculator-form,.calculator-result,.calculator-widget,.calculator-section){width:100%;max-width:100%;box-sizing:border-box}
 #main-content :where(.calculator-form,.calculator-result,.calculator-widget,.calculator-section) :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]),select,textarea){width:100%;max-width:100%;box-sizing:border-box}
 #main-content :where(.glc-table,.sp-table,.cort-table,.chl-table){max-width:none;}
 #main-content :where(.glc-table-wrap,.article-table-wrap,.table-responsive,.table-scroll,.calculator-table-wrap){width:100%;max-width:100%;}
 /* Fixed-size 3D diagrams remain readable inside an explicit horizontal viewport. */
 #main-content :where(.glc-flow__viewport,.sp-process__viewport,.cort-axis-figure__viewport){border-radius:inherit}
}
@media(max-width:390px){
 #main-content :where(.glc-wrap,.sp-wrap,.cort-container,.chl-wrap,.prl-container){width:calc(100% - 20px)}
 #main-content :where(.glc-section,.sp-section,.cort-section,.chl-section) :where(button,input,select,textarea){font-size:16px;}
}

/* Corrections for older endocrine and paediatric article templates. */
#main-content :where(.tsh-shell,.tsh-main,.tsh-card,.ait-branches,.ait-branch,.hypo-grid-2,.hypo-panel,.ms-risk-domains,.ms-risk-domain,.bone-age-ai,.bone-age-ai__visual){min-width:0;max-width:100%;}
#main-content :where(.tsh-main,.ait-branches,.hypo-grid-2,.ms-risk-domains,.bone-age-ai){grid-template-columns:minmax(0,1fr);}
#main-content :where(.tsh-card,.ait-branch,.hypo-panel,.ms-risk-domain){overflow-wrap:anywhere;}
#main-content :where(.tsh-card,.ait-branch,.hypo-panel,.ms-risk-domain) :where(b,strong,small,span){overflow-wrap:anywhere;}
#main-content .hal-mobile-table-viewport{box-sizing:border-box;max-width:100%;min-width:0;}
@media(max-width:900px){
 #main-content :where(.tsh-shell,.tsh-main){grid-template-columns:minmax(0,1fr)!important;min-width:0!important;max-width:100%;}
 #main-content :where(.tsh-card,.atpo-split,.atrttg-equation,.atrttg-process,.calcitonin-process,.thyroglobulin-process){min-width:0;max-width:100%;}
 #main-content :where(.tsh-summary__grid,.atpo-split,.attg-split,.atrttg-effect,.calcitonin-not-function,.calcitonin-nodule-grid,.calcitonin-after-flow){grid-template-columns:minmax(0,1fr);}
 #main-content :where(.hypo-grid-2,.hypo-grid-3,.hypo-treatment-grid,.ait-branches,.ait-grid,.ait-split,.ms-risk-domains,.ms-lifestyle-deep){grid-template-columns:minmax(0,1fr)!important;}
 #main-content :where(.hypo-panel,.ait-branch,.ms-risk-domain){min-width:0;max-width:100%;}
 #main-content :where(.hypo-panel__head,.ait-branch__head){min-width:0;flex-wrap:wrap;}
 #main-content .hal-mobile-table-viewport{display:block;width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
 #main-content .hal-mobile-table-viewport>table{max-width:none;min-width:max-content;}
}
@media(max-width:767px){
 #main-content :where(.bone-age-ai,.bone-age-ai__visual){grid-template-columns:minmax(0,1fr)!important;gap:9px;}
 #main-content .bone-age-ai__visual>i{transform:rotate(90deg);text-align:center;}
 #main-content :where(.tsh-hero__content,.tsh-container,.tsh-section-head,.hypo-panel,.ms-risk-domain,.bone-age-ai__visual){min-width:0;max-width:100%;}
 #main-content :where(.tsh-card,.ait-branch,.hypo-panel,.ms-risk-domain,.bone-age-ai__visual){padding-inline:clamp(12px,4vw,19px);}
 #main-content :where(.tsh-hero__grid,.tsh-summary__grid,.atpo-split,.atrttg-process,.atrttg-equation,.calcitonin-process,.bone-age-ai,.bone-age-ai__visual){grid-template-columns:minmax(0,1fr)!important;}
}
/* Targeted corrections identified by the mobile article-template audit. */
@media (max-width: 900px) {
 #main-content .atpo-table-wrap,
 #main-content .tg-table-wrap {display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 #main-content :where(.atpo-table-wrap,.tg-table-wrap)>table {width:max-content;max-width:none;min-width:690px}
 #main-content .tsh-hero__visual {max-width:100%;min-width:0;overflow:hidden}
 #main-content .tsh-summary__grid {grid-template-columns:minmax(0,1fr)}
 #main-content :where(.tsh-card,.tsh-section-head,.tsh-hero__content) {max-width:100%;min-width:0}
}
@media (max-width: 767px) {
 #main-content .ait-context-grid,
 #main-content .ait-example-grid,
 #main-content .hypo-context-grid,
 #main-content .hypo-example-grid,
 #main-content .hypo-diagnostic-grid {grid-template-columns:minmax(0,1fr)!important;max-width:100%;min-width:0}
 #main-content :where(.ait-context-grid,.ait-example-grid,.hypo-context-grid,.hypo-example-grid,.hypo-diagnostic-grid)>article {min-width:0;max-width:100%;overflow-wrap:anywhere}
 #main-content .hypo-flow {grid-template-columns:minmax(0,1fr)!important;max-width:100%;min-width:0;padding:14px}
 #main-content .hypo-flow>article {min-width:0;max-width:100%}
 #main-content .hypo-flow>i {transform:rotate(90deg);justify-self:center}
 #main-content :where(.hypo-grid-2,.hypo-grid-3,.hypo-treatment-grid,.hypo-ait-panel,.hypo-panel,.hypo-section,.hypo-main,.hypo-container) {min-width:0;max-width:100%;box-sizing:border-box}
 #main-content :where(.hypo-grid-2,.hypo-grid-3,.hypo-treatment-grid,.hypo-ait-panel) {grid-template-columns:minmax(0,1fr)!important}
 #main-content .ms-risk-domains {grid-template-columns:minmax(0,1fr)!important;min-width:0;max-width:100%}
 #main-content .ms-risk-domain {min-width:0!important;width:auto!important;max-width:100%!important;margin-inline:0!important;transform:none!important}
}

/* 1.35.168 — full mobile QA corrections: prevent narrow text columns and residual overflow. */
@media(max-width:900px){
  #main-content .hypo-hero__grid{
    grid-template-columns:minmax(0,1fr)!important;
    min-height:0!important;
    width:100%!important;
    max-width:100%!important;
  }
  #main-content .hypo-hero__content{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  #main-content .hypo-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  #main-content :where(.hypo-three-column,.hypo-grid-2,.hypo-bottom-grid,.hypo-sources ol){
    min-width:0!important;
    max-width:100%!important;
  }
}
@media(max-width:767px){
  #main-content .hypo-summary-grid,
  #main-content .hypo-three-column,
  #main-content .hypo-grid-2,
  #main-content .hypo-special-grid,
  #main-content .hypo-example-grid,
  #main-content .hypo-bottom-grid,
  #main-content .hypo-sources ol{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #main-content .hypo-symptom-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  #main-content .hypo-treatment-flow{
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
  }
  #main-content .hypo-treatment-flow>i{
    transform:rotate(90deg);
    justify-self:center;
  }
  #main-content :where(.hypo-summary-card,.hypo-diagnostic-card,.hypo-special-grid article,.hypo-example-grid article,.hypo-panel,.hypo-important,.hypo-sources){
    min-width:0!important;
    max-width:100%!important;
  }
  #main-content :where(.hypo-summary-card,.hypo-diagnostic-card,.hypo-special-grid article,.hypo-example-grid article,.hypo-panel,.hypo-important,.hypo-sources) :where(h2,h3,p,li,strong,small,span){
    max-width:100%!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
  }
}
@media(max-width:420px){
  #main-content .hypo-symptom-grid{grid-template-columns:minmax(0,1fr)!important}
}

/* Narrow-screen safety for editorial formula strips found during rendered QA. */
#main-content .ags-trajectory-review__formula,
#main-content .ags-trajectory-review__formula strong,
#main-content .ms-flow,
#main-content .ms-flow strong,
#main-content .ms-lifestyle-foundation__map,
#main-content .ms-lifestyle-foundation__map strong{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  white-space:normal!important;
  overflow-wrap:break-word!important;
  word-break:normal!important;
}
#main-content .ags-trajectory-review__formula strong{
  display:block!important;
  width:100%!important;
}
@media(max-width:360px){
  #main-content .ms-flow{padding-inline:14px!important}
  #main-content .ms-flow strong,
  #main-content .ms-lifestyle-foundation__map strong{
    width:100%!important;
    display:block!important;
    text-align:center!important;
  }
}

/* 1.35.168 — TSH special-situation cards: give headings and body copy full mobile width. */
@media(max-width:560px){
  #main-content .tsh-special{
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
  }
  #main-content .tsh-special__icon{
    width:64px!important;
    height:64px!important;
  }
  #main-content .tsh-special__icon-image{
    width:50px!important;
    height:50px!important;
  }
  #main-content .tsh-special>div:last-child,
  #main-content .tsh-special h2,
  #main-content .tsh-special p{
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
  }
}

/* 1.35.168 — compact editorial headers in AIT/thyrotoxicosis must not squeeze headings beside kickers. */
@media(max-width:560px){
  #main-content .ait-panel__head,
  #main-content .thyro-panel__head{
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:6px!important;
  }
  #main-content .ait-panel__head>span,
  #main-content .ait-panel__head>h2,
  #main-content .thyro-panel__head>span,
  #main-content .thyro-panel__head>h2{
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
  }

  /* Educational cases need full-width cards on phones, not three narrow columns. */
  #main-content .thyro-example-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #main-content .thyro-example-grid article{
    min-width:0!important;
    min-height:0!important;
  }
}

/* 1.35.168 — sleep-apnoea partner-observation cards: keep number, image and copy readable on phones. */
@media(max-width:600px){
  #main-content .osa-partner-observation__signals article{
    grid-template-columns:32px minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    gap:5px 10px!important;
    align-items:start!important;
  }
  #main-content .osa-partner-observation__signals article>span{
    grid-column:1!important;
    grid-row:1/4!important;
    align-self:start!important;
  }
  #main-content .osa-partner-observation__signals .osa-partner-signal__icon,
  #main-content .osa-partner-observation__signals .osa-partner-signal__icon--snore,
  #main-content .osa-partner-observation__signals .osa-partner-signal__icon--pause,
  #main-content .osa-partner-observation__signals .osa-partner-signal__icon--gasp{
    grid-column:2!important;
    grid-row:1!important;
    width:76px!important;
    height:76px!important;
    min-width:0!important;
    margin:0 0 3px!important;
    justify-self:start!important;
  }
  #main-content .osa-partner-observation__signals strong{
    grid-column:2!important;
    grid-row:2!important;
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    align-self:start!important;
  }
  #main-content .osa-partner-observation__signals p{
    grid-column:2!important;
    grid-row:3!important;
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    margin:2px 0 0!important;
  }
}

/* 1.35.168 — thyroid article hero grids: desktop artwork column must never collapse copy to zero width on phones. */
@media(max-width:900px){
  #main-content .ait-hero__grid,
  #main-content .thyro-hero__grid{
    grid-template-columns:minmax(0,1fr)!important;
    min-height:0!important;
    width:100%!important;
    max-width:100%!important;
  }
  #main-content .ait-hero__content,
  #main-content .thyro-hero__content{
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
  }
}
@media(max-width:560px){
  #main-content .thyro-symptom-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  #main-content .thyro-symptom-grid>div{
    min-width:0!important;
  }
}
@media(max-width:360px){
  #main-content .thyro-symptom-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
}

/* 1.35.168 — bottom utility/FAQ blocks become one readable column on phones. */
@media(max-width:620px){
  #main-content .ait-bottom-grid,
  #main-content .thyro-bottom-grid,
  #main-content .nodule-bottom-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #main-content :where(.ait-bottom-grid,.thyro-bottom-grid,.nodule-bottom-grid)>*{
    min-width:0!important;
    max-width:100%!important;
  }
}

/* 1.35.168 — child short-stature trajectory artwork must shrink with the phone card. */
@media(max-width:920px){
  #main-content .ss-trajectory-grid{
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  #main-content .ss-trajectory-grid>article{
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  #main-content .ss-trajectory-image{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    object-fit:contain!important;
  }
}

/* 1.35.168 — final phone/tablet page-width guard. Internal table/chart scrollers keep their own overflow. */
@media(max-width:900px){#main-content{overflow-x:clip;}}
