
/* Compact touch-first layouts. Desktop rules remain unchanged. */
.sheet-mobile-nav,.tt-mobile-battle-nav,.gm-mobile-nav{display:none}
.sheet-mobile-group{display:contents}
@media(max-width:760px){
 html{scroll-padding-top:112px}
 body{max-width:100%;overflow-x:clip}
 #cardTableRoot{min-width:0;padding-bottom:8px}
 #cardTableRoot .tt-header{position:sticky;top:0;z-index:15;display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:3px;padding:4px 6px;min-height:0;padding-top:max(4px,env(safe-area-inset-top))}
 #cardTableRoot .tt-brand{grid-column:1;grid-row:1;justify-content:flex-start;font-size:clamp(17px,5vw,23px);min-height:40px;border-width:5px;padding:3px 5px;white-space:normal}
 #cardTableRoot .tt-brand .tt-mark{height:35px;width:35px;margin:-3px 3px -3px 0;flex-shrink:0}
 #cardTableRoot .tt-brand:after,#cardTableRoot .tt-tab.active:after{display:none}
 #cardTableRoot .tt-icon-button{grid-column:2;grid-row:1;min-height:44px;min-width:44px;padding:0;font-size:21px}
 #cardTableRoot .tt-nav{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1.2fr .65fr .85fr 1fr .85fr;gap:2px;overflow:visible;min-width:0}
 #cardTableRoot .tt-tab,#cardTableRoot a.tt-gm-nav{border-width:4px;min-width:0;min-height:44px;white-space:normal;font-size:clamp(10px,3vw,14px);padding:3px 1px;line-height:1.1;overflow-wrap:anywhere}
 #cardTableRoot .tt-observer-bar{position:relative;padding:6px;gap:5px;font-size:12px}
 #cardTableRoot .tt-observer-bar label{flex:1}
 #cardTableRoot .tt-observer-bar .tt-button{min-height:44px;width:100%}
 #cardTableRoot .tt-entry{margin:14px 8px;padding:12px;max-width:none}
 #cardTableRoot .tt-entry h1{font-size:22px}
 #cardTableRoot .tt-entry input{font-size:16px}
 #cardTableRoot .tt-button,#cardTableRoot select,.gm-app .online-btn{min-height:44px}
 #cardTableRoot .tt-battle-layout{display:flex;gap:6px;padding:6px 7px 98px;min-width:0;max-width:100%}
 #cardTableRoot .tt-battle-layout>*{min-width:0;max-width:100%;width:100%;order:initial}
 #cardTableRoot .tt-battle-layout>.tt-hero-panel{order:0;border-width:5px;padding:3px;margin:0}
 #cardTableRoot .tt-hero-panel:after,#cardTableRoot .tt-focus:after{display:none}
 #cardTableRoot .tt-hero-id{align-items:center;gap:6px;margin:0 0 3px}
 #cardTableRoot .tt-hero-id .tt-portrait{width:42px;height:42px;flex:0 0 42px;border-width:3px}
 #cardTableRoot .tt-hero-id .tt-name{font-size:19px;margin:0}
 #cardTableRoot .tt-hero-id .tt-class{font-size:11px;margin:2px 0;padding:2px}
 #cardTableRoot .tt-hero-panel .tt-parchment{padding:2px}
 #cardTableRoot .tt-stats{margin:1px 0;gap:3px}
 #cardTableRoot .tt-stat{display:grid;grid-template-columns:20px 1fr;grid-template-rows:auto auto;align-items:center;gap:1px 3px;border-width:4px;padding:2px;min-height:43px}
 #cardTableRoot .tt-stat label{grid-column:2;grid-row:1;font-size:11px;text-align:center;border:0;padding:0}
 #cardTableRoot .tt-stat img{grid-column:1;grid-row:1/3;width:20px;height:20px;margin:0}
 #cardTableRoot .tt-stat b{grid-column:2;grid-row:2;font-size:17px;text-align:center}
 #cardTableRoot .tt-battle-layout:not([data-battle-mobile-view="hero"]) .tt-hero-panel :is(.tt-bonus-h,.tt-bonus-list,.tt-hero-details){display:none}
 #cardTableRoot .tt-mobile-battle-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;order:1}
 #cardTableRoot .tt-mobile-battle-nav button,.sheet-mobile-nav button,.gm-mobile-nav button{min-height:44px;color:#38210c;background:#e9c990 url("./art/parchment.svg") center/cover;border:4px solid transparent;border-image:url("./art/ornate-frame.svg") 30 stretch;font:700 14px Georgia;padding:4px;overflow-wrap:anywhere}
 #cardTableRoot .tt-mobile-battle-nav button[aria-pressed="true"],.sheet-mobile-nav button[aria-pressed="true"],.gm-mobile-nav button[aria-pressed="true"]{background:linear-gradient(#97301e,#54100d);color:#fff0cc}
 #cardTableRoot .tt-battle-layout>.tt-handpanel{order:2;padding:0}
 #cardTableRoot .tt-battle-layout>.tt-focus{order:3;border-width:6px;padding:3px}
 #cardTableRoot .tt-battle-layout>.tt-center{order:2}
 #cardTableRoot .tt-battle-layout:not([data-battle-mobile-view="cards"])>.tt-handpanel,#cardTableRoot .tt-battle-layout:not([data-battle-mobile-view="cards"])>.tt-focus{display:none}
 #cardTableRoot .tt-battle-layout:is([data-battle-mobile-view="cards"],[data-battle-mobile-view="hero"])>.tt-center{display:none}
 #cardTableRoot .tt-battle-layout[data-battle-mobile-view="demo"] .tt-history,#cardTableRoot .tt-battle-layout[data-battle-mobile-view="log"] .tt-diagram{display:none}
 #cardTableRoot .tt-battle-layout[data-battle-mobile-view="log"] .tt-history>summary{display:none}
 #cardTableRoot .tt-battle-layout[data-battle-mobile-view="cards"] .tt-handhead{display:flex;gap:4px;align-items:center}
 #cardTableRoot .tt-handhead h2{font-size:13px}
 #cardTableRoot .tt-handhead .tt-tag{font-size:10px}
 #cardTableRoot .tt-handhead .tt-button{font-size:11px;padding:3px;min-height:32px}
 #cardTableRoot .tt-hand{min-height:0;padding:11px 3px 8px;gap:4px;scroll-snap-type:x mandatory;justify-content:flex-start}
 #cardTableRoot .tt-hand .tt-card{flex:0 0 clamp(106px,31vw,137px);border-width:5px;padding:1px;gap:2px;scroll-snap-align:start;min-height:0}
 #cardTableRoot .tt-hand .tt-card:after{width:23px;height:18px;top:-9px}
 #cardTableRoot .tt-hand .tt-card strong{font-size:12px;min-height:28px;padding:1px}
 #cardTableRoot .tt-hand .tt-card .tt-mini-art{min-height:0;aspect-ratio:1.25}
 #cardTableRoot .tt-hand .tt-card small{font-size:10px;min-height:13px;line-height:1.1}
 #cardTableRoot .tt-hand .tt-card .tt-cost{font-size:12px;margin:0;border-width:3px}
 #cardTableRoot .tt-hand .tt-card.active{transform:translateY(-4px)}
 #cardTableRoot .tt-focus{display:grid;grid-template-columns:64px minmax(0,1fr);gap:3px}
 #cardTableRoot .tt-focus-heading{grid-column:2;grid-row:1;border-width:0;padding:2px;font-size:17px;min-height:0}
 #cardTableRoot .tt-focus-ribbon{grid-column:2;grid-row:2;border-width:0;padding:1px;font-size:12px;margin:0}
 #cardTableRoot .tt-focus-art{grid-column:1;grid-row:1/3;min-height:0;max-height:64px;height:64px;width:64px;aspect-ratio:1;border-width:2px;margin:0}
 #cardTableRoot .tt-focus-attrs{grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}
 #cardTableRoot .tt-focus-attrs div{border-width:3px;padding:2px}
 #cardTableRoot .tt-focus-attrs small{font-size:10px}
 #cardTableRoot .tt-focus-attrs strong{font-size:12px}
 #cardTableRoot .tt-description-panel{grid-column:1/-1;border-width:3px;padding:4px;margin:0}
 #cardTableRoot .tt-description-panel h3{font-size:14px;margin:0 0 2px}
 #cardTableRoot .tt-focus-description{font-size:14px;line-height:1.3;max-height:115px;overflow:auto;margin:0}
 #cardTableRoot .tt-focus-footer{grid-column:1/-1;padding:0}
 #cardTableRoot .tt-focus-footer .tt-button{border-width:5px;font-size:16px!important;padding:4px}
 #cardTableRoot .tt-battle-layout>.tt-footer{position:fixed;bottom:0;left:0;right:0;width:100%;z-index:12;order:5;gap:2px;padding:5px max(7px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));background:#26150eee;border-top:2px solid #b98436;box-shadow:0 -3px 10px #0008}
 #cardTableRoot .tt-footer .tt-button{min-height:44px;border-width:5px;padding:4px;font-size:17px!important}
 #cardTableRoot .tt-footer .tt-footer-note:first-child:not(#tableNotice){display:none}
 #cardTableRoot #tableNotice{font-size:11px;line-height:1.15;text-align:center;max-height:24px;overflow:auto}
 #cardTableRoot .tt-stage{min-height:180px;aspect-ratio:1.6}
 #cardTableRoot .tt-scheme-note{font-size:12px}
 #cardTableRoot .tt-equipment,#cardTableRoot .tt-inventory{margin:8px 6px;max-width:100%;padding:7px;border-width:6px}
 #cardTableRoot .tt-equip-board{margin:8px auto;gap:5px}
 #cardTableRoot .tt-equip-slot{border-width:5px;padding:3px;font-size:13px}
 #cardTableRoot .tt-equip-slot h3{font-size:15px}
 #cardTableRoot .tt-equip-slot img{max-height:75px}
 #cardTableRoot .tt-equip-slot select{font-size:16px}
 #cardTableRoot .tt-equip-portrait{max-width:110px;margin:auto}
 #cardTableRoot .tt-deck-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 #cardTableRoot .tt-deck-list .tt-card{width:100%;min-width:0;border-width:6px}
 #cardTableRoot .tt-deck-list .tt-card strong{font-size:14px}
 body.rpg-table-mode.rpg-sheet-mode #cardTableRoot{position:sticky;top:0}
 body.rpg-sheet-mode #rpgSheetWorkspace{padding:5px 5px 20px;max-width:100%}
 body.rpg-sheet-mode #rpgSheetWorkspace>header{margin:0;padding:4px;border-width:4px}
 body.rpg-sheet-mode #rpgSheetWorkspace>header h1{font-size:16px}
 body.rpg-sheet-mode #rpgSheetWorkspace .topbutton{font-size:12px;min-height:40px}
 body.rpg-sheet-mode #rpgSheetWorkspace .tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;overflow:visible;margin:4px 0;padding:0}
 body.rpg-sheet-mode #rpgSheetWorkspace .tab{font-size:11px;white-space:normal;min-height:44px;padding:3px 1px;border-width:4px;overflow-wrap:anywhere}
 body.rpg-sheet-mode #rpgSheetWorkspace .paper-sheet{padding:5px;border-width:5px;overflow:visible}
 body.rpg-sheet-mode #rpgSheetWorkspace .sheet-heading{display:none}
 .sheet-mobile-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;margin:0 0 8px}
 .sheet-mobile-nav button{font-size:12px}
 .sheet-mobile-group{display:block}
 #characterSheet[data-sheet-mobile] [data-sheet-part]{display:none}
 #characterSheet[data-sheet-mobile="overview"] [data-sheet-part="overview"],#characterSheet[data-sheet-mobile="attributes"] [data-sheet-part="attributes"],#characterSheet[data-sheet-mobile="equipment"] [data-sheet-part="equipment"],#characterSheet[data-sheet-mobile="talents"] [data-sheet-part="talents"],#characterSheet[data-sheet-mobile="skills"] [data-sheet-part="skills"],#characterSheet[data-sheet-mobile="notes"] [data-sheet-part="notes"]{display:block}
 #characterSheet[data-sheet-mobile="overview"] .sheet-identity{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:5px;gap:6px}
 #characterSheet[data-sheet-mobile="attributes"] .paper-choices{display:grid;grid-template-columns:1fr;gap:3px}
 #characterSheet[data-sheet-mobile="attributes"] .sheet-points{display:grid;position:static;padding:5px;gap:3px}
 #characterSheet .sheet-layout{display:block}
 #characterSheet .sheet-core,#characterSheet .sheet-aside,#characterSheet .sheet-attributes{margin:0}
 #characterSheet .sheet-attributes .stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 #characterSheet .sheet-attributes .stat{padding:4px;border-width:4px;min-width:0}
 #characterSheet .statrow{gap:3px}
 #characterSheet .stat-input{width:40px;max-width:100%;min-width:0}
 #characterSheet .step{min-width:36px;width:36px;min-height:44px}
 #characterSheet .stat-mod{width:43px;height:43px}
 #characterSheet .stat-hint{font-size:10px}
 #characterSheet .sheet-combat-grid .metric{min-height:72px;padding:4px}
 #characterSheet .sheet-combat-grid .metric .num{font-size:28px}
 #characterSheet .sheet-resource-row{margin:5px 0 8px}
 #characterSheet .sheet-resource-row>*{padding:5px}
 #characterSheet .paper-skills{display:grid;grid-template-columns:1fr}
 #characterSheet .skill-line{min-height:39px;font-size:14px}
 #characterSheet .skill-line input{width:19px;height:19px}
 #characterSheet .sheet-hand-grid{grid-template-columns:1fr}
 #characterSheet .skill-sheet-jump{margin:5px 0;padding:7px}
 #characterSheet .sheet-bottom>div:first-child{max-width:100%}
 #characterSheet .sheet-save{justify-content:start}
 #rpgSheetWorkspace .skill-grid{grid-template-columns:1fr}
 #rpgSheetWorkspace .skill-tools{grid-template-columns:1fr 1fr;gap:6px;padding:8px}
 #rpgSheetWorkspace .skill-card{padding:8px}
 #rpgSheetWorkspace .skill-head{padding:7px;gap:6px}
 #rpgSheetWorkspace .card{border-width:6px;padding:8px}
 #rpgSheetWorkspace .tablewrap{max-width:100%;overflow-x:auto}
 .gm-app{padding:7px;max-width:100%}
 .gm-app .gm-top{gap:3px}
 .gm-app .gm-top .online-help{font-size:11px}
 .gm-app .gm-brand{font-size:24px}
 .gm-app .online-box{padding:9px;min-width:0}
 .gm-app .gm-session-top h2{font-size:19px}
 .gm-mobile-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;margin:7px 0;position:sticky;top:0;z-index:8;background:#25170f;padding:3px 0}
 .gm-mobile-nav button{font-size:12px;padding:3px 1px}
 .gm-app [data-gm-mobile-view] .online-layout{margin-top:5px;display:block}
 .gm-app [data-gm-mobile-view] :is(.gm-new-game,.gm-heroes,.gm-played,.online-side){display:none}
 .gm-app [data-gm-mobile-view="heroes"] .gm-heroes,.gm-app [data-gm-mobile-view="cards"] .gm-played,.gm-app [data-gm-mobile-view="states"] .online-side,.gm-app [data-gm-mobile-view="setup"] .gm-new-game{display:block}
 .gm-app .online-person{padding:6px}
 .gm-app .gm-issued-code{flex-wrap:wrap;overflow-wrap:anywhere}
 .gm-sheet-dialog{max-height:95dvh}
 .gm-sheet-top{gap:6px}
 .gm-sheet-top .online-btn{min-height:44px}
}
@media(max-width:360px){
 #characterSheet .statrow{gap:2px}
 #characterSheet .stat-input{width:32px;padding:2px}
 #characterSheet .step{min-width:30px;width:30px}
 #cardTableRoot .tt-focus-attrs strong{font-size:11px}
}
@media print{.sheet-mobile-nav,.tt-mobile-battle-nav,.gm-mobile-nav{display:none!important}#characterSheet [data-sheet-part]{display:block!important}}

.tt-deck-mobile-nav{display:none}
#cardTableRoot .tt-deck-item{display:contents}
@media(max-width:760px){
 #cardTableRoot .tt-deck-mobile-nav{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:8px}
 #cardTableRoot .tt-deck-mobile-nav button{min-height:44px;background:#ead0a1;border:4px solid transparent;border-image:url("./art/ornate-frame.svg") 30 stretch;color:#38200d;font:700 14px Georgia}
 #cardTableRoot .tt-deck-mobile-nav button[aria-pressed="true"]{color:#ffebc6;background:linear-gradient(#982a1b,#570d0c)}
 #cardTableRoot [data-deck-mobile-view="learned"] .tt-deck-item[data-deck-owned="false"]{display:none}
 #cardTableRoot .tt-deck-item{min-width:0}
 #cardTableRoot .tt-handhead .tt-button{min-height:44px}
 #cardTableRoot .tt-focus-art+ .tt-focus-description{grid-column:1/-1}
 #cardTableRoot .tt-battle-layout>.tt-footer{max-width:none}
 #characterSheet[data-sheet-mobile="overview"] .skill-sheet-jump,#characterSheet[data-sheet-mobile="notes"] .sheet-bottom{display:flex}
 #characterSheet .sheet-identity .paper-name{grid-column:1/-1}
}
@media(max-width:760px) and (orientation:landscape) and (max-height:480px){
 #cardTableRoot .tt-header,body.rpg-table-mode.rpg-sheet-mode #cardTableRoot{position:relative}
 #cardTableRoot .tt-battle-layout>.tt-footer{position:static}
 #cardTableRoot .tt-battle-layout{padding-bottom:8px}
}

@media(max-width:760px){
 #cardTableRoot .tt-full-gear{grid-template-columns:repeat(2,minmax(0,1fr))}
 #cardTableRoot .tt-full-gear .tt-equip-hero{grid-column:1/-1;grid-row:1}
 #cardTableRoot .tt-full-gear .tt-equip-armor{grid-column:auto;grid-row:auto;width:100%;max-width:none}
 #cardTableRoot .tt-accessory{min-height:0}
 #cardTableRoot .tt-accessory-icon{min-height:34px;font-size:26px}
 #cardTableRoot #ttBagForm{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #cardTableRoot #ttBagForm label:first-child{grid-column:1/-1}
 #cardTableRoot .tt-bag-controls{width:84px}
 #cardTableRoot .tt-bag-controls .tt-button{font-size:11px;padding:3px}
}

@media(max-width:760px){.gm-mobile-nav{grid-template-columns:repeat(5,minmax(0,1fr))}.gm-mobile-nav button{font-size:11px}.gm-app [data-gm-mobile-view="items"] .online-layout{display:none}}
