/* Phase 4 mobile UX (HIG / M3 / WCAG 2.2 AA). Media-scoped only: desktop (>980px) is unchanged. */
.msheet{display:none}
@media (max-width:980px){
  .topbar{padding-top:env(safe-area-inset-top)}
  .bar{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .tabbar{grid-template-columns:repeat(5,1fr);gap:2px;padding:6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));border-top:1px solid var(--line)}
  .tabbar a,.tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:56px;padding:6px 2px;font:600 .8rem/1.2 inherit;color:var(--muted);background:none;border:0;border-radius:16px;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .tabbar a::before{display:none}
  .tabbar .ti{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;padding:0;box-sizing:content-box;border-radius:999px;transition:background .2s}
  .tabbar .ti{padding:3px 18px}
  .tabbar a[aria-current=page],.tabbar button.on{color:var(--ink)}
  .tabbar a[aria-current=page] .ti,.tabbar button.on .ti{background:var(--green-soft);color:var(--green)}
  .tabbar a:focus-visible,.tabbar button:focus-visible{outline:3px solid var(--green);outline-offset:-3px}
  .msheet[open]{display:block;position:fixed;inset:auto 0 0 0;margin:0;width:100%;max-width:none;border:0;border-radius:24px 24px 0 0;padding:8px 16px calc(16px + env(safe-area-inset-bottom));background:var(--surface);color:var(--ink);box-shadow:0 -10px 40px rgba(0,0,0,.18)}
  .msheet::backdrop{background:rgba(15,31,23,.42)}
  .msheet-h{display:flex;align-items:center;justify-content:space-between;padding:8px 4px 4px}
  .msheet-t{font-weight:700;font-size:1.05rem}
  .msheet-x{width:48px;height:48px;border:0;border-radius:999px;background:var(--surface-2);color:var(--ink);font-size:1.05rem;cursor:pointer}
  .msheet-nav{display:flex;flex-direction:column;padding:4px 0}
  .msheet-nav a{display:flex;align-items:center;min-height:52px;padding:0 14px;border-radius:14px;font-weight:600;font-size:1.05rem;color:var(--ink);text-decoration:none}
  .msheet-nav a[aria-current=page]{background:var(--green-soft);color:var(--green)}
}
@media (max-width:760px){
  html{-webkit-text-size-adjust:100%}
  body{font-size:16px;line-height:1.75}
  p,li,dd,td{font-size:1rem}
  .wrap{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
  /* type hierarchy */
  .hero h1{font-size:1.95rem;line-height:1.35}
  .phead h1,h1{line-height:1.35}
  .lead{font-size:1.05rem;line-height:1.8}
  .muted,small{line-height:1.6}
  .crumbs{font-size:.95rem;padding:1rem 0 .6rem;flex-wrap:wrap}
  .crumbs a{display:inline-flex;align-items:center;min-height:44px}
  /* touch targets >= 44-48px */
  .btn{min-height:48px;padding:.8rem 1.2rem}
  .iconbtn{min-width:44px;min-height:44px;justify-content:center}
  input,select,textarea{font-size:16px!important;min-height:48px}
  .filters select,.filters input{min-height:48px;font-size:16px}
  .filters{grid-template-columns:1fr 1fr}
  .filters .f-search,.filters .chk{grid-column:1/-1}
  .filters label>span{font-size:.875rem}
  .filters .chk,label.chk{min-height:44px!important;display:flex;align-items:center;gap:.6rem}
  label.chk input{width:22px;height:22px}
  .tabs a,.tabs button{min-height:48px;padding:.8rem 1rem;font-size:1rem}
  .mode button,.seg button{min-height:48px;font-size:1rem}
  .mode{display:grid;width:100%}
  .pager a,.pager button{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  .foot a{display:inline-flex;align-items:center;min-height:44px}
  .pn a{min-height:64px}
  /* cards & lists: readable at 360-430 */
  .mgrid{gap:.75rem}
  .mcard h2{font-size:1.02rem;line-height:1.45}
  .mcard .ne{font-size:.85rem}
  .chip{font-size:.8rem;padding:.4rem .6rem}
  .qcard p{font-size:1rem}
  .qcard .k{font-size:.875rem}
  .eres .cd,.mrow .nm small,.genl small,.pn small{font-size:.875rem}
  .ptile .tn{font-size:.9rem;min-height:44px;display:flex;align-items:center;justify-content:center;line-height:1.35}
  .steps{font-size:1rem}
  .steps b{width:32px;height:32px}
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  table{font-size:.95rem}
  img,svg,video,iframe{max-width:100%}
  pre,code{white-space:pre-wrap;word-break:break-word}
  .sym{white-space:normal}
  /* share card & forms */
  .contrib-card{padding:1.1rem;border-radius:20px}
  .contrib-btns{width:100%;display:grid;grid-template-columns:1fr;gap:.6rem}
  .contrib-btns .btn{width:100%}
  .cdlg{width:100%;max-width:100%;max-height:100%;height:100%;margin:0;border-radius:0;padding:calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom))}
  .cdlg h2{font-size:1.2rem;padding-inline-end:56px;line-height:1.4;margin-top:.4rem}
  .cdlg-x{top:calc(8px + env(safe-area-inset-top));inset-inline-end:8px}
  .xbtn{width:48px;height:48px}
  .cdlg label,.cdlg legend{font-size:1rem}
  .cdlg small{font-size:.875rem}
  .cdlg .frow{grid-template-columns:1fr;gap:0}
  .cdlg .inl{display:flex;min-height:48px;margin:0;gap:.6rem;font-size:1rem}
  .cdlg .chk{font-size:.95rem}
  .cdlg input[type=radio],.cdlg input[type=checkbox]{width:22px;height:22px}
  .cdlg input[type=file]{padding:.6rem}
  .factions{position:sticky;bottom:calc(-16px - env(safe-area-inset-bottom));background:var(--surface);padding:.8rem 0 calc(.2rem + env(safe-area-inset-bottom));margin-top:.6rem;display:grid;grid-template-columns:2fr 1fr}
  .factions .btn{width:100%}
  .wordmark{display:inline-flex;align-items:center;min-height:44px}
  .pill{min-height:44px;padding-inline:1rem;font-size:1rem}
  .pill.sm{min-height:44px;min-width:44px}
  .linkbtn{display:inline-flex;align-items:center;min-height:44px;font-size:1rem}
  .tryex{font-size:1rem;line-height:1.9}
  .eyebrow{font-size:.875rem}
  #mDetail p.muted,#cDetail p.muted{font-size:1rem!important}
  .cdlg .chk a{display:inline;padding-block:.5rem}
}
