/* Shared interaction language: readable rows, reserved action space, quiet feedback. */
.panel{font-family:system-ui,sans-serif}
.panel-card{background:#18251e;border-color:#56654d;color:#e7e2d0}
.panel-head{align-items:center;flex-shrink:0}
.panel-title,#bag .panel-title,#build .panel-title{font:500 23px system-ui;letter-spacing:0;color:#e7dfc6}
.panel-sub{color:#aebda3;opacity:1;font-size:12px}
.panel-sub:empty,.panel-foot:empty{display:none}
.panel-x{opacity:1;min-width:48px;min-height:48px;border:1px solid #4b5d45;border-radius:8px;background:#213229}
.panel button,.curtain button{touch-action:manipulation}
.panel button[hidden],.panel [hidden]{display:none!important}
.panel-body{min-height:0;overscroll-behavior:contain}
.panel-foot{flex-shrink:0}
.menu-done,.bag-done,.reset-settings{min-height:48px;padding:12px 18px;background:#2c402f;color:#dfdfc8;border:1px solid #657555;border-radius:7px;font:600 13px system-ui;cursor:pointer}
.panel button:active:not(:disabled){filter:brightness(1.18)}
.panel button:disabled{cursor:default}
.panel-go{background:#d8c28b;border:1px solid #ebdba7;box-shadow:none;color:#253126;font:600 14px system-ui;letter-spacing:0;min-height:50px}
.panel-go:active{box-shadow:none;transform:none}

/* Bag: the list scrolls independently of the selected item's actions. */
#bag .panel-card{width:min(1000px,96vw);height:min(850px,94dvh);max-height:94dvh;background:#17251e}
#bag .panel-head,#build .panel-head{padding:16px 22px;background:#1e2d24}
#bag .panel-sub,#build .panel-sub{margin-top:4px}
.bag-views{display:flex;gap:8px;padding:10px 20px 0;flex-shrink:0}
.bag-views button{flex:1;min-height:48px;background:transparent;color:#b5c5a7;border:1px solid #4e6247;border-radius:7px;font:600 14px system-ui;cursor:pointer}
.bag-views button[aria-pressed=true]{background:#354630;border-color:#c5b77e;color:#f0ddb0}
.bag-views span{margin-left:7px;font:12px ui-monospace,monospace;color:#a9bf97}
.bag-carry{padding:13px 22px;flex-shrink:0;border-bottom:1px solid #3b4e38}
.bag-carry .carry-label{align-items:center;gap:12px;letter-spacing:0;font-size:12px}
.bag-carry .carry-label>b{font-size:10px;letter-spacing:1px}
.bag-carry .carry-label>span{margin-right:auto;color:#e0ddc9}
.bag-carry strong{font-size:12px;font-weight:500;color:#c3d7a5;white-space:nowrap}
.bag-carry meter{display:block;width:100%;height:6px;margin-top:9px;appearance:none;background:#364b30;border:0;border-radius:4px}
.bag-carry meter::-webkit-meter-bar{background:#364b30;border:0;height:6px}
.bag-carry meter::-webkit-meter-optimum-value{background:#b5ca87}
.heavy .bag-carry meter::-webkit-meter-optimum-value{background:#d49d70}
.bag-carry meter::-moz-meter-bar{background:#b5ca87}
#bag .panel-body{display:grid;grid-template-columns:36% 64%;overflow:hidden;padding:0}
#bag .equipment-pane{padding:20px 16px;min-height:0;overflow:auto}
#bag .equipment-stage{height:300px;margin:15px 0}
#bag .equip-column{width:88px;bottom:0;gap:8px}
#bag .equip-slot{min-height:88px;flex:1;padding:8px 5px}
#bag .equip-slot>span{font-size:10px}
#bag .equip-slot>b{font-size:11px}
#bag .equip-slot .item-icon{height:30px;width:30px}
#bag .gear-stats{gap:10px;padding-top:12px}
#bag .gear-stats>span{font-size:10px;letter-spacing:.4px}
#bag .gear-stats b{font-size:17px}
#bag .inventory-pane{padding:16px;min-height:0;overflow:hidden}
#bag .inventory-search{width:100%;height:46px;font:16px system-ui;background:#122019;padding:10px 13px;border-color:#4a5f42}
#bag .inventory-heading{flex-shrink:0}
#bag .inventory-filters{gap:5px;padding:9px 0;flex-shrink:0}
#bag .inventory-filters button{flex:1;min-height:44px;padding:8px 5px;font:500 12px system-ui;letter-spacing:0;text-transform:capitalize;border-color:#3d5137}
#bag .inventory-filters [aria-pressed=true]{color:#243126;background:#d6c18b;border-color:#d6c18b}
.slot-filter{min-height:44px;margin-bottom:8px;text-align:left;border:1px solid #9e9767;background:#384831;color:#eddbac;border-radius:5px;padding:8px 12px;font:12px system-ui;cursor:pointer}
#bag .inventory-grid{display:flex;flex-direction:column;gap:7px;flex:1;min-height:0;max-height:none;overflow:auto;padding:2px 3px 6px}
#bag .inventory-item{flex-shrink:0;width:100%;min-height:76px;flex-direction:row;align-items:center;justify-content:start;gap:12px;padding:12px;background:#22362a;border:1px solid #4c6246;text-align:left;box-sizing:border-box}
#bag .inventory-item:hover{background:#30452f}
#bag .inventory-item.selected{background:#37492f;border-color:#ddc88d;box-shadow:inset 3px 0 #ddc88d}
.inventory-copy{flex:1;min-width:0}
.inventory-copy b{display:block;font:500 15px system-ui;text-transform:capitalize;color:#e9e5cf}
.inventory-copy small{display:block;font:11px/1.6 system-ui;color:#b0c0a3;margin-top:4px}
.equipped .inventory-copy small{color:#d1d9a4}
#bag .item-qty{position:static;font:600 14px ui-monospace,monospace;color:#e1d4a8;background:#15291e;border-radius:4px;padding:6px 8px}
.item-chevron{font-size:24px;color:#a3b78e}
#bag .inventory-item .item-icon{height:36px;width:36px}
#bag .inventory-empty{min-height:150px;flex-shrink:0}
#bag .panel-foot{padding:14px 22px 18px;opacity:1;background:#122019;max-height:45%;overflow:auto}
#bag .item-detail{padding:0;margin:0;min-height:0;border:0}
#bag .detail-heading b{font-size:18px}
#bag .detail-heading small{display:block;margin-top:4px;font:11px system-ui;letter-spacing:0;text-transform:none;color:#b7c5aa}
#bag .detail-heading>.item-icon{height:32px;width:32px}
#bag .item-hint{font:12px/1.5 system-ui;margin:8px 0;color:#b2c1a5}
.item-specs summary{font-size:12px;color:#dec890;min-height:36px;display:flex;align-items:center;cursor:pointer}
.item-specs summary::before{content:'＋';margin-right:8px}.item-specs[open] summary::before{content:'−'}
.item-specs .weapon-stats{padding:10px 0;margin-bottom:8px}
.bag-receipt{font:12px/1.5 system-ui;color:#ccdda9;min-height:18px;margin:6px 0 9px}
.bag-actions{display:flex;gap:10px}
#bag .item-actions{display:flex;flex:1;gap:8px;margin:0}
#bag .item-actions button{flex:1;min-height:50px;padding:10px 12px;font:600 13px system-ui;white-space:nowrap}
.bag-done{min-width:110px;min-height:50px}
#bag .bag-done{color:#e0dfca;background:#293e2d}

/* Construction: a compact catalog and a confirmation anchored under the materials. */
#build .panel-card{height:min(760px,94dvh);max-height:94dvh}
#build .panel-body{gap:22px;padding:20px;min-height:0}
.build-catalog{display:flex;flex-direction:column;gap:9px}
.build-card{min-height:84px;display:grid;grid-template-columns:48px 1fr;grid-template-rows:auto auto;gap:5px 15px;padding:14px;text-align:left;align-items:center}
.build-card>.item-icon{grid-column:1;grid-row:1/span 2;width:42px;height:42px;margin:0}
.build-card>b{font:500 16px system-ui}
.build-ready{font:12px system-ui}
.build-detail h2{font-size:25px}
.build-detail>p{font-size:14px}
.build-cost b{font-size:14px}.build-cost small{font-size:12px;line-height:1.5}
#build .panel-foot{padding:14px 22px 18px;background:#122019}
.build-status{min-height:20px;margin-bottom:9px;font:12px system-ui;color:#c6d5ad}
.build-footer-actions{display:flex;gap:10px}.build-footer-actions .build-choose{flex:1;min-height:50px;font:600 14px system-ui}.build-footer-actions .menu-done{min-width:110px}
.placement-bar{display:grid;grid-template-columns:1fr auto auto;width:min(470px,calc(100vw - 28px));box-sizing:border-box;padding:12px;gap:9px}
.placement-bar>span{grid-column:1/-1;max-width:none;font:12px system-ui;color:#d0dcc0}
.placement-bar button{min-height:48px;font:600 13px system-ui;padding:12px}
.placement-bar .place-build{background:#d7c18b;color:#253126}.placement-bar .place-build:disabled{background:#344230;color:#92a588;border-color:#4b5b3f}

/* Settings, navigation and missions use the same generous controls. */
#prefs .panel-card{width:min(620px,96vw);max-height:94dvh}
#prefs .panel-body{padding:12px 20px}
#prefs .panel-row{padding:16px 12px;min-height:58px;box-sizing:border-box;border-bottom:1px solid #394c34;border-radius:0;align-items:center}
#prefs .panel-text b{opacity:1;font-weight:500;font-size:15px}
#prefs .panel-text em{opacity:1;color:#aaba9d;font-size:12px;margin-top:6px}
#prefs .panel-value{opacity:1;font-size:13px;color:#d9c48e}
#prefs .panel-range{height:44px;margin:3px 0 0}
#prefs .panel-choice button{min-height:48px;opacity:1;background:#203328;font:500 12px system-ui}
#prefs .panel-choice button.on{background:#d4be86;color:#253225;border-color:#ead49d}
#prefs .panel-foot{padding:12px 22px 18px;opacity:1;background:#122019}
.settings-status{display:block;min-height:18px;margin-bottom:8px;color:#c5d8a8;font-size:12px}
.settings-actions{display:flex;gap:12px}.settings-actions button{flex:1}
.reset-settings{background:transparent;color:#b9c7ad}
.map-tools{justify-content:center;gap:8px}
.map-tools button{min-height:48px;min-width:48px;font:600 12px system-ui;letter-spacing:0;background:#2b402e;border-color:#607651;color:#e1d29e}
.map-people button{min-height:68px;padding:12px;border-color:#586e4d;touch-action:manipulation}
.map-person-copy{flex:1}.map-people b{font-size:13px}.map-person-copy small{font-size:11px;line-height:1.5}
#map .panel-foot{opacity:1}#map .panel-go{margin-top:12px;flex-shrink:0}
.curtain-item{min-height:56px;touch-action:manipulation}
.curtain-item:focus-visible{outline:2px solid #e9ce87;outline-offset:3px}
#character .character-editor nav{gap:8px;padding:6px 22px}
#character .character-editor nav button{flex:1;min-height:48px;padding:10px 6px;border-radius:4px;font-size:12px}
#character .character-fields button{min-height:48px;font-size:13px}
#character .character-fields .color-swatch{width:48px;height:48px}
#character .turn-character{width:48px;height:48px}
#character .panel-foot button,#challenges .panel-foot button,#mission .panel-foot button{min-height:50px;font-size:14px}
#character .character-field{font-size:13px}
.challenge-browser nav button{min-height:48px;font-size:12px}
.challenge-mechanic{font-size:12px}.challenge-total{font-size:13px}
.mission-hud>button{min-height:48px}
.pad-tab{min-width:50px;min-height:48px;font-size:11px}

@media(min-width:741px){
 .bag-views{display:none}
 #bag .panel-foot{display:grid;grid-template-columns:1fr auto;gap:0 20px}
 #bag .item-detail{grid-column:1;grid-row:1/span 2}
 .bag-receipt{grid-column:2;align-self:end;min-width:280px}
 .bag-actions{grid-column:2;grid-row:2;align-self:end;flex-wrap:wrap;max-width:390px}
 .bag-done{flex:1}
}
@media(max-width:740px){
 .panel-card,#bag .panel-card,#build .panel-card,#prefs .panel-card{width:100%;height:100dvh;max-height:100dvh;border-radius:0;box-sizing:border-box;padding-bottom:env(safe-area-inset-bottom)}
 #bag .panel-head,#build .panel-head,.panel-head{padding:10px 14px}
 .panel-title,#bag .panel-title,#build .panel-title{font-size:21px}
 .bag-views{padding:8px 12px 0}
 .bag-carry{padding:10px 16px}.bag-carry .carry-label>b{display:none}
 #bag .panel-body{display:flex;flex-direction:column}
 #bag[data-view=inventory] .equipment-pane,#bag[data-view=equipment] .inventory-pane{display:none}
 #bag[data-view=equipment] .item-detail,#bag[data-view=equipment] .item-actions,#bag[data-view=equipment] .bag-receipt{display:none}
 #bag[data-view=equipment] .bag-done{flex:1}
 #bag .inventory-pane{flex:1;padding:10px 12px 6px;min-height:0}
 #bag .inventory-filters{padding:7px 0}
 #bag .inventory-item{min-height:74px;padding:10px;gap:10px}
 #bag .equipment-pane{padding:14px 18px;flex:1;border:0}
 #bag .equipment-stage{height:280px;max-width:380px;margin:12px auto}
 #bag .equip-column{width:96px}
 #bag .equip-slot{min-height:82px}
 #bag .gear-stats b{display:block;margin-left:0}
 #bag .panel-foot{padding:10px 14px 13px;max-height:44%}
 #bag .detail-heading b{font-size:16px}
 #bag .item-hint{font-size:11px;margin:6px 0;line-height:1.45}
 .bag-receipt{font-size:11px;margin:5px 0 7px}
 .bag-actions{gap:8px;flex-wrap:wrap}
 #bag .item-actions{flex:1;gap:7px}
 #bag .item-actions button{padding:10px;font-size:12px}
 .bag-done{min-width:78px;padding:10px 12px;font-size:12px}
 #bag .item-specs summary{min-height:32px;font-size:11px}
 #build .panel-body{display:block;padding:14px}
 .build-catalog{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .build-card{display:flex;flex-direction:column;align-items:flex-start;min-height:92px;gap:6px;padding:10px;text-align:left}
 .build-card>.item-icon{height:26px;width:26px}.build-card>b{font-size:14px}.build-ready{font-size:11px}
 .build-detail{padding:20px 2px 0}.build-illustration{display:none}.build-detail h2{margin:0 0 10px}
 .build-detail>p{font-size:13px}.build-costs{margin-bottom:6px}
 #build .panel-foot{padding:12px 14px 16px}
 .build-footer-actions .menu-done{min-width:78px}
 .placement-bar{bottom:220px}
 #prefs .panel-body{padding:4px 10px}
 #prefs .panel-foot{padding:12px 14px 16px}
 #map .panel-body{padding:12px}
 #map .map-wrap{width:min(100%,48dvh)}
 #map.has-story .map-people{grid-template-columns:1fr;gap:8px}
 #map.has-story .map-people b{font-size:13px}
 #character .character-portrait{height:145px}
 #character[data-step="1"] .character-portrait,#character[data-step="2"] .character-portrait{display:none}
 #character .character-portrait canvas{width:130px;height:160px;top:0}
 #character .character-name{margin:50px 35px 0 120px;font-size:21px}
 #character .character-role{margin:6px 35px 0 120px}
 #character .turn-character{right:12px;bottom:12px}
 #character .character-editor nav{position:sticky;top:0;background:#1b2b21;z-index:1;padding:5px 12px}
 #character .character-fields{padding:18px 16px}
}
@media(max-height:520px){
 #bag .panel-head{padding:4px 12px}#bag .panel-sub{display:none}
 #bag .bag-carry{padding:5px 16px}.bag-carry meter{margin-top:4px}
 #bag .item-hint,#bag .item-specs{display:none}
 #bag .panel-foot{padding:8px 14px;max-height:42%}
 #bag .bag-receipt{margin:3px 0;min-height:15px}
}
@media(max-width:740px) and (max-height:620px){
 #bag .item-hint:not(.important){display:none}
 #bag .bag-receipt{margin:5px 0;min-height:18px}
 #bag .panel-foot{padding:9px 14px 11px}
 #bag .inventory-filters{padding:5px 0}
 #bag .bag-views{padding-top:5px}
}
