/* MetStat r101 — isolated bilingual guide/figure notes and targeted English layout fixes.
   Never recolor map pixels, risk classes, model status dots, or data legends. */
:root{--ms101-border:#c7bcd1;--ms101-ink:#25172c;--ms101-surface:#fff;--ms101-subtle:#f5f1fa}
html[data-ms95-theme="dark"]{--ms101-border:#7d7386;--ms101-ink:#f7f2ff;--ms101-surface:#3b3543;--ms101-subtle:#463d50}
/* r97's legacy placement must not win over r100 and r101 in English. */
html[lang="en"][dir="ltr"] body #mtApp:not([hidden]) #mtMain.mtPage{
 display:grid!important;grid-template-columns:340px minmax(0,1fr)!important;
 grid-template-rows:auto auto minmax(100px,auto) auto!important;
 gap:10px!important;direction:ltr!important;justify-content:stretch!important;
 align-items:start!important;width:100%!important;max-width:none!important;
}
html[lang="en"][dir="ltr"] body #mtApp:not([hidden]) #mtMain.mtPage > .apWB{
 grid-column:1/-1!important;grid-row:1!important;min-width:0!important}
html[lang="en"][dir="ltr"] body #mtApp:not([hidden]) #mtMain.mtPage > .mtTop{
 grid-column:1!important;grid-row:2!important;direction:ltr!important;
 min-width:0!important;max-width:100%!important;width:auto!important;margin:0!important}
html[lang="en"][dir="ltr"] body #mtApp:not([hidden]) #mtMain.mtPage > .card:not(.mtTop):not(.mtDet){
 grid-column:1!important;grid-row:3!important;direction:ltr!important;
 min-width:0!important;max-width:100%!important;width:auto!important;margin:0!important}
html[lang="en"][dir="ltr"] body #mtApp:not([hidden]) #mtMain.mtPage > .mtDet{
 grid-column:2!important;grid-row:2 / span 2!important;direction:ltr!important;
 min-width:0!important;max-width:100%!important;width:auto!important;margin:0!important}
html[lang="en"][dir="ltr"] body #mtApp:not([hidden]) #mtMain.mtPage > p.hint{grid-column:1/-1!important;grid-row:4!important}
html[lang="en"][dir="ltr"] body #mtApp #mtMain .mtBar.mtFilt{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html[lang="en"][dir="ltr"] body #mtApp #mtMain :is(.mtTop,.mtDet) :is(select,input,button){max-width:100%;min-width:0;box-sizing:border-box}
/* Do not apply RTL/fixed right-side ordering to the English custom tools. */
html[lang="en"][dir="ltr"] body :is(#apApp,#labApp,#synApp,#caApp,#mtApp,#flApp,#saApp,#obApp){direction:ltr!important}
html[lang="en"][dir="ltr"] body :is(#apApp,#labApp,#synApp,#caApp,#mtApp,#flApp,#saApp,#obApp) :is(.card,.panel,fieldset,form,label,small,h1,h2,h3,h4,p){direction:ltr}
/* Inline mixed language sources must not force a left panel back to the right. */
html[lang="en"][dir="ltr"] body #onApp:not([hidden]):has(> aside):has(> main),
html[lang="en"][dir="ltr"] body #apApp:not([hidden]):has(> aside):has(> main){direction:ltr!important}
/* The guide is a proper accessible dialog with subtle entry/exit animation. */
.ms101-guide{position:fixed;z-index:2147480000;box-sizing:border-box;
 border:1px solid var(--ms101-border);border-radius:16px;
 background:var(--ms101-surface);color:var(--ms101-ink);
 width:min(92vw,720px);max-width:720px;max-height:min(84vh,850px);
 margin:auto;padding:0;box-shadow:0 24px 65px #18102544;
 font-family:inherit;font-size:15px;line-height:1.7;overflow:auto;
 animation:ms101-enter .17s ease-out both}
.ms101-guide::backdrop{background:rgba(17,15,26,.43);animation:ms101-fade .16s ease-out both}
.ms101-guide.ms101-closing{animation:ms101-exit .15s ease-in forwards}
.ms101-guide.ms101-closing::backdrop{animation:ms101-fadeout .15s ease-in forwards}
.ms101-guide-head{position:sticky;top:0;z-index:1;background:var(--ms101-surface);
 display:flex;justify-content:space-between;align-items:center;gap:12px;
 padding:14px 20px;border-bottom:1px solid var(--ms101-border)}
.ms101-guide-head h2{font-size:18px;line-height:1.5;margin:0;color:var(--ms101-ink)}
.ms101-guide .ms101-close{font-size:25px;line-height:1;color:var(--ms101-ink);background:var(--ms101-subtle);
 border:1px solid var(--ms101-border);border-radius:10px;width:38px;height:38px;
 flex:0 0 38px;cursor:pointer}
.ms101-guide-content{padding:8px 22px 20px;direction:inherit;text-align:start}
.ms101-guide-content section{padding:9px 0;border-bottom:1px solid var(--ms101-border)}
.ms101-guide-content section:last-child{border-bottom:0}
.ms101-guide-content h3{font-size:15px;font-weight:750;color:var(--ms101-ink);margin:2px 0 4px}
.ms101-guide-content p{font-size:14px;margin:0;color:var(--ms101-ink);white-space:pre-wrap}
.ms101-info-button{display:inline-flex!important;align-items:center;justify-content:center;
 gap:5px;min-height:29px!important;width:auto!important;max-width:100%;margin:9px 8px 8px;
 padding:5px 11px!important;border:1px solid var(--ms101-border)!important;
 border-radius:9px!important;color:var(--ms101-ink)!important;
 background:var(--ms101-subtle)!important;font-size:12px!important;
 font-family:inherit!important;font-weight:650!important;white-space:normal!important;
 text-shadow:none!important;line-height:1.35!important;cursor:pointer}
.ms101-info-button:focus-visible,.ms101-close:focus-visible{outline:3px solid #a935eb;outline-offset:3px}
@keyframes ms101-enter{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}
@keyframes ms101-exit{from{opacity:1;transform:none}to{opacity:0;transform:translateY(6px) scale(.99)}}
@keyframes ms101-fade{from{opacity:0}to{opacity:1}}
@keyframes ms101-fadeout{from{opacity:1}to{opacity:0}}
@media(prefers-reduced-motion:reduce){.ms101-guide,.ms101-guide::backdrop,.ms101-guide.ms101-closing,.ms101-guide.ms101-closing::backdrop{animation:none!important}}
/* Meteogram / upper-air laboratory is #labApp, distinct from the summit #mtApp.
   Existing p20 CSS forces 'chart sidebar' and RTL even in English; reverse it. */
html[lang="en"][dir="ltr"] body #labApp:not([hidden]) .lab{
 display:grid!important;grid-template-columns:330px minmax(0,1fr)!important;
 grid-template-areas:"sidebar chart" "sidebar section"!important;
 gap:12px!important;direction:ltr!important;align-items:start!important;
 max-width:none!important;width:100%!important;min-width:0!important;
}
html[lang="en"][dir="ltr"] body #labApp:not([hidden]) .lab > .labIn{
 grid-area:sidebar!important;direction:ltr!important;min-width:0!important;
 margin:0!important;max-width:100%!important;width:100%!important;
}
html[lang="en"][dir="ltr"] body #labApp:not([hidden]) .lab > #labMg{
 grid-area:chart!important;direction:ltr!important;min-width:0!important;
 max-width:100%!important;width:100%!important;
}
html[lang="en"][dir="ltr"] body #labApp:not([hidden]) .lab > #labOut{
 grid-area:section!important;direction:ltr!important;min-width:0!important;
 max-width:100%!important;width:100%!important;
}
html[lang="en"][dir="ltr"] body #labApp:not([hidden]) .lab :is(button,select,input,textarea){
 max-width:100%;min-width:0;box-sizing:border-box}
