/* Deliberately isolated from all desktop styling. */
@media(max-width:700px){
 #chartbox #tip{display:none}
 #mobile-chart-inspector{padding:14px;border:1px solid var(--line);margin:12px 0;background:var(--panel)}
 #mobile-chart-inspector label{display:flex;flex-direction:column;gap:8px}
 #mobile-chart-match{width:100%;min-width:0;font-size:16px}
 .mobile-chart-buttons{display:flex;gap:8px;margin:12px 0}
 .mobile-chart-buttons button{flex:1;min-height:44px}
 .mobile-chart-readout{font:14px/1.6 var(--mono);overflow-wrap:anywhere}
 .mobile-chart-readout a{display:flex;justify-content:center;align-items:center;min-height:44px;text-decoration:none}
 .h2h #allopp{overflow-x:clip}
 .h2h #opphead{display:grid;min-width:0;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)!important;gap:10px;padding:10px 14px;height:auto}
 #opphead label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--muted)}
 #opphead select{min-width:0;width:100%;font-size:13px}
 .h2h #oppwrap{min-width:0;width:100%;height:66vh;overflow-x:hidden}
 .mobile-opponent{padding:14px;border-bottom:1px solid var(--line);background:var(--panel)}
 .mobile-opponent h3{font-family:var(--mono);font-size:16px;overflow-wrap:anywhere}
 .mobile-opponent dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;margin:14px 0}
 .mobile-opponent dt{font-size:11px;color:var(--muted)}
 .mobile-opponent dd{font-size:16px;margin:2px 0 0;font-family:var(--mono);font-weight:600}
 .mobile-opponent p{font-size:12px;color:var(--muted);line-height:1.6}
 .mobile-opponent>a{display:flex;align-items:center;justify-content:center;min-height:44px;text-decoration:none}
 .mobile-opponent-empty{padding:16px;color:var(--muted)}
 .h2h #meethead{display:none}
 .h2h #meetwrap{min-width:0;width:100%;height:66vh;overflow-x:hidden}
 .h2h #rivalry{overflow-x:clip}
 .mobile-meeting{height:208px;box-sizing:border-box;display:grid;grid-template-rows:22px 44px 44px 24px 44px;gap:2px;padding:8px 14px;border-bottom:1px solid var(--line);background:var(--panel);font-size:13px}
 .mobile-meeting .date{font-size:12px;color:var(--t-date)}
 .mobile-meeting-side{display:grid;grid-template-columns:minmax(0,1fr) 50px;gap:12px;align-items:center}
 .mobile-meeting-side>span{overflow-wrap:anywhere;line-height:1.25;font-weight:600}
 .mobile-meeting-side small{display:inline-block;width:38px;font-size:10px;color:var(--muted);font-weight:400}
 .mobile-meeting-side b{font-family:var(--mono);font-size:20px;text-align:right;color:var(--t-score)}
 .mobile-meeting-basis{font-size:10px;color:var(--muted);line-height:1.15;margin:0;align-self:center}
 .mobile-meeting>a{display:flex;align-items:center;justify-content:center;min-height:44px;text-decoration:none}
 dialog.mobile-match{position:fixed;inset:0;margin:0;width:100%;max-width:100%;height:100dvh;max-height:100dvh;padding:0;border:0;background:var(--panel);color:var(--ink)}
 dialog.mobile-match[open]{display:flex;flex-direction:column}
 dialog.mobile-match::backdrop{background:#0009}
 .mobile-match-head{flex:none;padding:12px 16px;padding-top:max(12px,env(safe-area-inset-top));border-bottom:1px solid var(--line)}
 .mobile-match-head h2{font-family:var(--mono);font-size:16px;line-height:1.4;overflow-wrap:anywhere}
 .mobile-match-date{font-size:12px;color:var(--muted);margin:5px 0 10px}
 .mobile-match-head button{width:100%}
 .mobile-match-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;padding-bottom:env(safe-area-inset-bottom)}
 .mobile-match-content .drawer{display:block;border:0;padding:16px;font-size:13px}
 .mobile-match-content .dgroup{margin-bottom:22px}
 .mobile-match-content .drawer h4{font-size:12px;margin-bottom:10px}
 .mobile-match-content .drawer dl{grid-template-columns:100px minmax(0,1fr);gap:7px 10px}
 .mobile-match-content .drawer dt{font-size:12px}
 .mobile-match-content dd,.mobile-match-content a{overflow-wrap:anywhere}
 .mobile-match-content .drawer table{font-size:11px}
 .mobile-match-content .drawer td,.mobile-match-content .drawer th{padding:3px 2px;white-space:normal}
 .topbar{padding:8px 14px;gap:5px}
 .topbar .brand{grid-template-columns:minmax(0,1fr);gap:5px;width:100%}
 .topbar .site-brand{grid-column:1;grid-row:1}
 .site-brand .brand-logo{width:160px;flex-basis:160px}
 .brand-ball{width:52px;height:54px;flex-basis:52px;margin-right:-18px}
 .topbar .buildinfo{font-size:10px}
 .mobile-menu{grid-column:1;grid-row:2}
 .mobile-menu>summary{padding:10px;min-height:44px}
 .mobile-menu .mainnav{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
 .mobile-menu .mainnav a{white-space:normal;min-height:44px;display:flex;align-items:center}
 .mobile-menu .themeswitch{margin:8px 0}
 button,input:not([type=range]):not([type=checkbox]):not([type=radio]),select{min-height:44px}
 .chips button{min-width:44px;margin-bottom:4px}
 summary{min-height:44px}
 .filterbar{gap:8px;padding:6px 14px}
 .filterbar .ghostbtn{min-height:44px;padding:8px 12px}
 .filterbar .fcount{font-size:11px}
 .expbtn{min-width:44px}
 .tablehead.fx,.trow.fx{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) 44px!important}
 .hero h2{font-size:15px}.hero-sub{font-size:11px}.hero{padding:8px 14px}
 .hero-stats{margin-top:6px;padding-top:6px}
 .mobile-modal-open{overflow:hidden}
 dialog.mobile-filters{position:fixed;inset:0;width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;background:var(--panel);color:var(--ink)}
 dialog.mobile-filters::backdrop{background:#0009}
 dialog.mobile-filters .filters{display:flex;flex-direction:column;height:100%;max-height:none;overflow:hidden;border:0;padding:0}
 .mobile-filters .filters-head{position:static;flex:none;gap:12px;padding:10px 14px;padding-top:max(10px,env(safe-area-inset-top))}
 .mobile-filters .filters-head h2{margin-right:auto}
 .mobile-filter-fields{overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:0}
 .mobile-filter-note{font-size:12px;color:var(--muted);padding:0 16px}
 .mobile-filter-footer{flex:none;padding:12px 16px;padding-bottom:max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--panel)}
 .mobile-primary{width:100%;font-size:16px;background:var(--line-soft);color:var(--ink);border:2px solid var(--t-accent)}
 .mobile-group{grid-column:1/-1;margin:8px 0}
 .mobile-group>summary{padding:10px 14px}
 .mobile-group>.card{margin-top:8px}
 .analysis>button{width:100%;margin-top:10px}
 .mobile-jumps{position:sticky;top:0;z-index:6;background:var(--panel);padding:8px 14px;border-bottom:1px solid var(--line)}
 .mobile-jumps button{width:100%}
 .mobile-table-hint{font-size:12px;color:var(--muted);margin:8px 14px}
 .mobile-team-search{display:flex;flex-direction:column;gap:5px;padding:10px 14px}
 .tmsteps{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .tmsteps label{grid-column:1/-1;grid-row:2}
 .tmsteps #step-status{grid-column:1/-1}
 .tmsteps #previous{grid-column:1;grid-row:1}.tmsteps #next{grid-column:2;grid-row:1}
 .sc>.rulebar>.rule.grow:empty{display:none}
 .sc>.rulebar{min-height:0;height:auto}
 .scbody{display:flex;flex-direction:column}
 .scbody>.sctable{order:0}.scbody>.mobile-group{order:1}
 .sc>.mobile-group{margin:8px 14px}
 .sc .intro p{margin:6px 0}
 .sc .intro .mobile-group .warn{font-size:12px}
 .tablebar-right>.mobile-group{margin:0}.tablebar-right>.mobile-group>summary{padding:10px}
 .tablebar-right>.mobile-group[open]{width:100%}
 .tablebar-right>.mobile-group>button{display:block;width:100%;margin-top:6px}
 .sc:not(.mobile-full-table) .sctable{overflow-x:hidden}
 .sc:not(.mobile-full-table) .tablewrap{min-width:0;width:100%}
 .sc:not(.mobile-full-table) .tablehead{display:none}
 .sc:not(.mobile-full-table) .trow{height:100px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-rows:24px 40px 36px}
 .sc:not(.mobile-full-table) .trow>div{min-width:0;white-space:normal;font-size:12px}
 .sc:not(.mobile-full-table) .trow>div:first-child{grid-row:1;grid-column:1/-1}
 .sc:not(.mobile-full-table) .trow>div:nth-child(2){grid-row:2;grid-column:1}
 .sc:not(.mobile-full-table) .trow>div:nth-child(4){grid-row:2;grid-column:2}
 .sc:not(.mobile-full-table) .trow>div:nth-child(3){grid-row:3;grid-column:1}
 .sc:not(.mobile-full-table) .trow>div:nth-child(5){grid-row:3;grid-column:2}
 .sc:not(.mobile-full-table) .trow>div:nth-child(3)::before{content:'As played: ';font-size:10px;color:var(--muted)}
 .sc:not(.mobile-full-table) .trow>div:nth-child(5)::before{content:'Restated: ';font-size:10px;color:var(--muted)}
 .sc:not(.mobile-full-table) .trow>div:nth-child(n+6){display:none}
 /* Reading copy uses the clear mono face; display headings keep their pixel face. */
 .topbar .buildinfo,.hero-sub,.filterbar .fcount,.note,.rulenote,.chartnote,
 .charthead p,.mobile-filter-note,.mobile-table-hint,.mobile-opponent p,
 .mobile-match-date,.sc .intro .mobile-group .warn,#step-status{
   font-family:var(--mono);font-size:14px;line-height:1.55;overflow-wrap:anywhere;
 }
 .note{color:var(--muted)}
 .mobile-opponent dt,#opphead label,.mobile-match-content .drawer dt,
 .mobile-match-content .drawer h4{font-family:var(--mono);font-size:13px;line-height:1.4}
 .mobile-match-content .drawer{font-size:14px;line-height:1.5}
 .hero-stats span,.card-label,.asat-label,.f>span,.f>label,.rule>span{
   font-family:var(--mono);line-height:1.4;
 }
 .ghostbtn,.chips button,.segbtns button,.themeswitch button,
 .mobile-group>summary,.tmextras>summary,.tmoptions>summary,.tmcontext>summary{
   font-family:var(--mono)!important;font-size:14px;line-height:1.4;
 }
 input:not([type=range]):not([type=checkbox]):not([type=radio]),select,#opphead select{
   font-family:var(--mono)!important;font-size:16px!important;
 }
 button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{
   outline:2px solid var(--t-accent);outline-offset:3px;
 }
}
