/* Mobile readability layer. Desktop rules and all data/permission logic remain unchanged. */
@media screen and (max-width: 767px) {
 html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
 body { font-size:16px!important; line-height:1.65!important; }
 /* The legacy templates contain inline 10–12px text. Establish a readable floor
    while retaining inherited heading sizes rather than scaling the entire page. */
 body :is(div,p,li,label,small,td,th,summary,figcaption,dt,dd,code,time,input,select,textarea,button,a,span,b,strong,em) {
   font-size:max(14px,1em)!important;
 }
 body :is(p,li,label,td,th,summary,small) { line-height:1.65!important; }
 body :is(input,select,textarea) { font-size:16px!important; max-width:100%; box-sizing:border-box; }
 body :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,button,.btn,.nav-btn,summary) { min-height:44px; }
 body :is(button,.btn,.nav-btn) { line-height:1.45!important; white-space:normal; }
 body :is(input[type=checkbox],input[type=radio]) { min-width:20px; min-height:20px; vertical-align:middle; }
 body h1 { font-size:24px!important; line-height:1.4!important; overflow-wrap:anywhere; }
 body h2 { font-size:19px!important; line-height:1.45!important; }
 body h3 { font-size:17px!important; line-height:1.5!important; }
 body :is(small,.hint,.note,.sub,.subtitle,.form-note,.table-note,.company-meta,.stat-card small,.identity-table td small,.eyebrow) { font-size:14px!important; }
 body :is(.badge,.pill,.status,.identity-badge) { font-size:14px!important; line-height:1.45!important; }
 body :is(.container,.wrap,.panel,.card,.form-body,.device-results,.center) { min-width:0; }
 body :is(.table-wrap,.table-container,.table-responsive,.section,.port-group) { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
 body table { font-size:16px!important; }
 body :is(th,td) { padding:11px 10px!important; }
 body table:has(tr>:nth-child(5)) { min-width:680px; table-layout:auto!important; }
 body div:has(>#tab_ep) { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); }
 body div:has(>#tab_ep)>div { min-height:52px; padding:12px 8px!important; font-size:16px!important; box-sizing:border-box; }
 body :is(.toolbar,.tools,.actions,.tabs,.config,.editor-actions,.panel-title) { flex-wrap:wrap; gap:10px; }
 body .header { height:auto!important; min-height:56px; }
 body .header :is(a,.nav-btn) { display:inline-flex; align-items:center; justify-content:center; min-height:44px; }
 body :is(.header,.topbar) :is(nav,.top-right) { flex-wrap:wrap; }
 body :is(.header,.topbar) .brand strong { font-size:18px!important; }
 body .header .brand span { font-size:14px!important; }
 body :is(.header .account summary #user_info,.header .account summary) { max-width:none!important; font-size:14px!important; }
 body .header nav { width:100%; justify-content:space-between; }
 .xh-home .header { padding:15px; }
 .xh-home .header .brand img { width:40px; height:40px; }
 .xh-home .refresh-area { display:flex; flex-wrap:wrap; gap:10px; }
 .xh-home .stat-card { padding:15px 12px; text-align:left; }
 .xh-home .stat-card strong { font-size:30px!important; }
 .xh-home :is(.stat-label,.company-status,.company-meta,.alert-footer,.result-note) { font-size:14px!important; }
 .xh-home .company-title a { font-size:17px!important; }
 .xh-home .company-links { gap:8px; flex-wrap:wrap; }
 .xh-home .company-links a { min-height:44px; padding:10px 12px; display:inline-flex; align-items:center; }
 .xh-home .tabs { width:100%; display:flex; flex-wrap:wrap; }
 .xh-home .tabs button { flex:1 1 auto; padding:9px 12px; }
 .xh-home .v2-shortcut-grid { gap:18px 8px; padding:18px 10px; }
 .xh-home .v2-shortcut-grid :is(button,a) { font-size:15px!important; min-height:70px; }
 .xh-home .v2-bottom { min-height:68px; }
 .xh-home .v2-bottom button { font-size:14px!important; min-height:48px; padding:4px 8px; }
 .xh-home .v2-bottom button>span { font-size:23px!important; }
 .xh-home>.container { padding-bottom:105px; }
 .xh-page :is(.mobile-device-link,.elec-device-name,.mobile-port-title,.elec-mobile-port) { font-size:16px!important; }
 .xh-page :is(.mobile-device-row,.elec-device-row) { flex-wrap:wrap; gap:10px; }
 .xh-page .summary-bar { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .xh-page :is(.meta,.tools) { gap:12px; }
 .xh-page .tools :is(input,select) { min-width:0!important; flex:1 1 160px; }
 .xh-page .history-tools { flex-wrap:wrap; gap:10px; }
 .xh-page .header>div { overflow-wrap:anywhere; }
 /* Protocol lab: expand rows and show metadata without clipping fixed heights. */
 .topbar { height:auto!important; padding:14px 16px; flex-wrap:wrap; gap:12px; }
 .topbar .top-right { margin-left:0; width:100%; justify-content:space-between; }
 .topbar .top-right .pill:after { font-size:14px!important; }
 .panel-title { height:auto!important; min-height:64px; padding:14px 16px; }
 .device-page { padding:22px 14px 0; }
 .device-layout { grid-template-columns:minmax(0,1fr); }
 .form-pair,.identity-inputs { grid-template-columns:minmax(0,1fr); }
 .step-strip { padding:14px 10px; gap:6px; }
 .step-strip>div { flex-direction:column; text-align:center; flex:1; gap:7px; }
 .step-strip span { font-size:14px!important; }
 .step-strip small { display:none; }
 .device-status { align-items:flex-start; }
 .device-status h2 { font-size:19px!important; }
 .device-status :is(span,small) { font-size:14px!important; line-height:1.65; }
 .test-cards article { display:block; }
 .test-cards b { margin:7px 0; font-size:20px!important; }
 .test-cards p { display:block!important; font-size:14px!important; }
 .identity-summary { gap:10px; }
 .identity-table { max-height:none; }
 .identity-table table { min-width:520px; }
 .identity-table :is(td p,td small,code) { font-size:14px!important; }
 .identity-table td:last-child { width:82px; }
 .identity-add { flex-wrap:wrap; }
 .identity-add input { min-width:0; flex:1 1 220px; }
 .device-footer,.platform-location { flex-wrap:wrap; gap:12px; }
 .platform-location a { min-height:44px; display:inline-flex; align-items:center; }
 .device-footer button,.demo-link { min-height:44px; }
 .editor textarea,.raw-result,.technical pre { font-size:14px!important; line-height:1.8!important; }
 .editor footer { flex-wrap:wrap; }
 .modal { padding:24px 18px; }
}
@media screen and (max-width:700px) {
 body #content table { min-width:0!important; }
 body #content td { width:100%!important; box-sizing:border-box; }
 body #content td::before { font-size:14px!important; }
}
