/* Character menu inspired by the supplied menu video; existing actions stay wired. */
body[data-page=sheet]:not(.active-combat-focus){background:radial-gradient(ellipse at 35% 0%,#571e2b88,transparent 62%),linear-gradient(155deg,#150f17,#060e15 75%)}
body[data-page=sheet]:not(.active-combat-focus) main{max-width:1300px;display:flex;flex-direction:column;gap:22px;padding-top:12px;min-height:75vh}
body[data-page=sheet]:not(.active-combat-focus) #sheet{order:0;background:transparent;border:0;box-shadow:none;padding:16px 0;margin:0}
body[data-page=sheet]:not(.active-combat-focus) #sheet:before,body[data-page=sheet]:not(.active-combat-focus) #sheet:after{display:none}
body[data-page=sheet]:not(.active-combat-focus) #status{order:-1;margin:0}
body[data-page=sheet]:not(.active-combat-focus) .character-readout{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));max-width:900px;margin:0 auto;gap:24px;align-items:stretch}
body[data-page=sheet]:not(.active-combat-focus) .identity-panel,body[data-page=sheet]:not(.active-combat-focus) .vitals-panel,.neural-panel{position:relative;min-height:245px;padding:22px;border:1px solid #943545;border-top:3px solid #ce475c;background:linear-gradient(145deg,#421e2a66,#0b1420e6);box-shadow:inset 0 0 28px #d13b4510;overflow:hidden}
.neural-panel{display:none}body[data-page=sheet] .neural-panel{display:block}
body[data-page=sheet] .readout-label{font-size:13px;color:#f07b89;letter-spacing:.1em}body[data-page=sheet] #character-name{font-size:32px;color:#f08c95;margin:28px 0 12px;overflow-wrap:anywhere}body[data-page=sheet] #class-level{font-size:15px;line-height:1.4}body[data-page=sheet] .balance-panel{margin-top:22px}body[data-page=sheet] #health{font-size:29px;margin-top:28px}.neural-panel h2{font-size:18px;color:#91e5e0;margin:8px 0}.neural-panel strong{font:600 34px 'DGEN Display',sans-serif;color:#7de6df}.neural-panel p{font-size:14px;color:#b9c5ce}.neural-emblem{position:absolute;right:12px;top:35px;font:100px sans-serif;color:#ff536618;pointer-events:none}
body[data-page=sheet]:not(.active-combat-focus) .identity-panel .balance-panel{position:absolute;top:16px;right:18px;align-items:flex-end;gap:2px;margin:0;border:0;padding:0}
body[data-page=sheet]:not(.active-combat-focus) .identity-panel .balance-panel span{text-align:right}
body[data-page=sheet]:not(.active-combat-focus) .identity-panel .balance-panel strong{font-size:22px}
body[data-page=sheet]:not(.active-combat-focus) #character-nav{order:1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;border:0;padding:0;margin-top:8px}
body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=sheet]{display:none}
#character-nav button{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;overflow:hidden;isolation:isolate;min-width:0;min-height:62px;text-align:left;padding:10px 6px;border:1px solid #883443;border-left:5px solid #b94253;background:#09121de8;color:#7de5e4;font-size:14px;letter-spacing:.02em;transition:color .12s,background .12s,border-color .12s,box-shadow .12s,transform .12s;clip-path:polygon(0 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%)}
#character-nav .nav-icon{display:block;flex:0 0 24px;width:24px;height:24px;object-fit:contain;filter:brightness(0) saturate(100%) invert(84%) sepia(38%) saturate(560%) hue-rotate(128deg) brightness(100%) contrast(92%)}
#character-nav button[aria-current=page]{border-color:#ac4b58;background:#25131e;color:#a8eeeb}
#character-nav button:not(:disabled):is(:hover,:focus-visible){border-color:#81ffff;border-left-color:#81ffff;background:#67e6e5;color:#081923;box-shadow:0 0 24px #54e6e528;transform:translateY(-2px);outline:none}
#character-nav button:after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:repeating-linear-gradient(0deg,transparent 0 7px,#b6ffff33 7px 8px);opacity:0}
#character-nav button:not(:disabled):is(:hover,:focus-visible):after{opacity:1;animation:menu-scan .2s ease-out 1}
#character-nav button:not(:disabled):active{transform:translateY(0);background:#d1ffff}
@keyframes menu-scan{0%{transform:translateX(-45%);opacity:.1}45%{transform:translateX(8%);opacity:1}100%{transform:translateX(0);opacity:1}}
body[data-page=sheet] #equipped-section{max-width:900px;margin:28px auto 0;border-top:1px solid #6c3444;padding-top:16px}
@media(max-width:720px){body[data-page=sheet]:not(.active-combat-focus) .character-readout{gap:10px;grid-template-columns:1fr}body[data-page=sheet]:not(.active-combat-focus) .identity-panel,body[data-page=sheet]:not(.active-combat-focus) .vitals-panel,.neural-panel{min-height:0;padding:18px}body[data-page=sheet] #character-name{margin-top:16px}body[data-page=sheet]:not(.active-combat-focus) #character-nav{grid-template-columns:repeat(2,minmax(0,1fr))}#character-nav button{font-size:16px;padding:12px 10px}}
@media(prefers-reduced-motion:reduce){#character-nav button{transition:none}#character-nav button:not(:disabled):is(:hover,:focus-visible){transform:none}#character-nav button:not(:disabled):is(:hover,:focus-visible):after{animation:none}}
body[data-page=sheet]:not(.active-combat-focus) #sheet{display:block}
body[data-page=sheet]:not(.active-combat-focus) .character-readout{width:100%}
body[data-page=sheet]:not(.active-combat-focus) .vitals-panel{margin-top:0}
/* Wallet stays in the header, rather than overlapping the identity label. */
header #header-balance{margin:0 0 0 auto;padding:0;border:0;flex:0 0 auto;gap:2px;align-items:flex-end}
header #header-balance span{flex:none;font-size:10px;letter-spacing:.12em}
header #header-balance strong{margin:0;font-size:24px;letter-spacing:0;white-space:nowrap;color:var(--accent)}
#character-nav .nav-icon{pointer-events:none}
@media(min-width:721px){body[data-page=sheet]:not(.active-combat-focus) #character-nav{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}}

/* Larger labels without changing the bottom navigation button dimensions. */
#character-nav button{font-size:22px}

/* Compact main readouts: exact RAM figures above one proportional row. */
body[data-page=sheet]:not(.active-combat-focus) :is(.identity-panel,.vitals-panel,.neural-panel){min-height:202px;padding:18px}
body[data-page=sheet]:not(.active-combat-focus) #character-name{margin-top:20px}
body[data-page=sheet]:not(.active-combat-focus) #health{margin-top:20px}
.ram-meter-compact .ram-cells{flex-wrap:nowrap;gap:4px}
.ram-meter-compact .ram-cell{flex:1 1 0;min-width:0;max-width:15px;height:32px}
@media(max-width:720px){body[data-page=sheet]:not(.active-combat-focus) :is(.identity-panel,.vitals-panel,.neural-panel){min-height:0}}
/* Fill the main HUD viewport while retaining natural scrolling on short screens. */
@media(min-width:721px){
 body[data-page=sheet]:not(.active-combat-focus) main{min-height:calc(100svh - 86px);margin-top:12px;margin-bottom:0;padding-top:12px;padding-bottom:18px;gap:18px}
 body[data-page=sheet]:not(.active-combat-focus) #sheet{flex:1;display:flex;flex-direction:column;gap:22px;padding:14px 0}
 body[data-page=sheet]:not(.active-combat-focus) .character-readout{flex:1;min-height:clamp(202px,calc((100svh - 220px)*.48),340px);max-width:none}
 body[data-page=sheet]:not(.active-combat-focus) :is(.identity-panel,.vitals-panel,.neural-panel){padding:clamp(18px,2.5vh,28px)}
 body[data-page=sheet]:not(.active-combat-focus) #equipped-section{width:100%;max-width:none;margin:0;padding-top:18px}
 body[data-page=sheet]:not(.active-combat-focus) #equipment{align-items:stretch}
 body[data-page=sheet]:not(.active-combat-focus) #equipment>.equipped-card,
 body[data-page=sheet]:not(.active-combat-focus) #equipment>.accessory-stack{min-height:clamp(156px,calc((100svh - 220px)*.34),260px)}
 body[data-page=sheet]:not(.active-combat-focus) #equipment .equipped-card.icon-item>.crafting-weapon-icon{height:clamp(78px,calc((100svh - 220px)*.23),184px)}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav{margin-top:auto;flex-shrink:0;gap:12px}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav button{min-height:64px}
}
@media(min-width:721px){
 body[data-page=sheet]:not(.active-combat-focus) #character-nav{grid-template-columns:repeat(5,minmax(0,1fr))}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav button{font-size:clamp(15px,2.35vw,22px);padding:10px 5px}
 body[data-page=sheet]:not(.active-combat-focus) .character-readout{min-height:clamp(202px,calc((100svh - 220px)*.44),320px)}
 body[data-page=sheet]:not(.active-combat-focus) #equipment>.equipped-card,
 body[data-page=sheet]:not(.active-combat-focus) #equipment>.accessory-stack{min-height:clamp(156px,calc((100svh - 220px)*.30),240px)}
 body[data-page=sheet]:not(.active-combat-focus) #equipment .equipped-card.icon-item>.crafting-weapon-icon{height:clamp(78px,calc((100svh - 220px)*.20),164px)}
}
/* Fit the main sheet to the media viewport; other pages retain normal scrolling. */
@media(min-width:721px) and (min-height:600px){
 body[data-page=sheet]:not(.active-combat-focus){height:100svh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 body[data-page=sheet]:not(.active-combat-focus)>header{flex:0 0 auto}
 body[data-page=sheet]:not(.active-combat-focus) main{flex:1 1 0;width:100%;min-height:0;max-height:100%;margin:0 auto;padding:12px 20px 16px;gap:14px}
 body[data-page=sheet]:not(.active-combat-focus) #status:empty{display:none}
 body[data-page=sheet]:not(.active-combat-focus) #status{flex:0 0 auto;margin:0;font-size:12px}
 body[data-page=sheet]:not(.active-combat-focus) #sheet{flex:1 1 0;min-height:0;display:grid;grid-template-rows:minmax(0,1.12fr) minmax(0,1fr);gap:20px;padding:12px 0 0}
 body[data-page=sheet]:not(.active-combat-focus) .character-readout{min-height:0;height:100%;gap:20px}
 body[data-page=sheet]:not(.active-combat-focus) :is(.identity-panel,.vitals-panel,.neural-panel){min-height:0;padding:clamp(16px,2.3vh,24px)}
 body[data-page=sheet]:not(.active-combat-focus) #equipped-section{display:flex;flex-direction:column;min-height:0;padding-top:14px}
 body[data-page=sheet]:not(.active-combat-focus) #equipped-section h2{margin-bottom:14px;flex:0 0 auto}
 body[data-page=sheet]:not(.active-combat-focus) #equipment{flex:1 1 0;min-height:0;grid-template-rows:minmax(0,1fr)}
 body[data-page=sheet]:not(.active-combat-focus) #equipment>.equipped-card,
 body[data-page=sheet]:not(.active-combat-focus) #equipment>.accessory-stack{min-height:0}
 body[data-page=sheet]:not(.active-combat-focus) #equipment .equipped-card{display:flex;flex-direction:column;padding:16px;min-height:0}
 body[data-page=sheet]:not(.active-combat-focus) #equipment .equipped-card>span:first-child{font:600 clamp(15px,1.9vw,19px)/1.2 'DGEN Display',sans-serif;letter-spacing:.06em;flex:0 0 auto}
 body[data-page=sheet]:not(.active-combat-focus) #equipment .equipped-card.icon-item>.crafting-weapon-icon{height:0;min-height:0;flex:1 1 0;width:100%;margin-top:10px}
 body[data-page=sheet]:not(.active-combat-focus) #equipment .accessory-stack>.equipped-card{padding-bottom:40px}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav{flex:0 0 auto;margin:0;gap:10px}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav button{min-height:54px}
}

body[data-page=sheet] .ram-meter-compact .ram-label{font:600 18px/1.3 'DGEN Display',sans-serif;letter-spacing:.04em;margin-bottom:8px}
#menu-humanity-note:empty{display:none}

/* Advancement belongs to the Identity card, leaving the bottom navigation stable. */
body[data-page=sheet] #character-nav [data-page=progression-page]{display:none}
body[data-page=sheet] #identity-level-up{position:absolute;inset:auto 16px 16px;min-height:42px;padding:8px 12px;background:#112630;color:var(--cyan);border:1px solid #6cbbc2;font:600 20px/1.2 'DGEN Display',sans-serif;opacity:0;pointer-events:none;transition:opacity .15s}
body[data-page=sheet] .identity-panel:is(:hover,:focus-within) #identity-level-up{opacity:1;pointer-events:auto}
body[data-page=sheet] .identity-panel:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}
@media(hover:none){body[data-page=sheet] #identity-level-up{opacity:1;pointer-events:auto}}
@media(prefers-reduced-motion:reduce){body[data-page=sheet] #identity-level-up{transition:none}}
@media(min-width:721px) and (min-height:600px){
 body[data-page=sheet]:not(.active-combat-focus) main{gap:24px}
 body[data-page=sheet]:not(.active-combat-focus) #sheet{grid-template-rows:minmax(0,min(28svh,245px)) minmax(0,1fr);gap:24px}
 body[data-page=sheet]:not(.active-combat-focus) .character-readout{gap:24px}
}
/* Keep equipment compact; share spare vertical room between the three groups. */
@media(min-width:721px) and (min-height:600px){
 body[data-page=sheet]:not(.active-combat-focus) main{gap:20px;justify-content:space-evenly}
 body[data-page=sheet]:not(.active-combat-focus) #sheet{display:contents}
 body[data-page=sheet]:not(.active-combat-focus) .character-readout{height:clamp(202px,28svh,245px);min-height:0;flex:none;margin:0}
 body[data-page=sheet]:not(.active-combat-focus) #equipped-section{height:auto;min-height:0;flex:none}
 body[data-page=sheet]:not(.active-combat-focus) #equipment{flex:none;height:156px}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav{margin:0}
}
/* Let accessory artwork use more of the compact card. */
body[data-page=sheet]:not(.active-combat-focus) #equipment .accessory-stack>.equipped-card{padding:12px 10px 28px}
body[data-page=sheet]:not(.active-combat-focus) #equipment .accessory-stack .crafting-weapon-icon{margin-top:4px;padding:0;width:100%}
/* Humanity lives in the Cyberware HUD; the main readout uses two larger cards. */
body[data-page=sheet] .character-readout>.neural-panel{display:none}
body[data-page=sheet]:not(.active-combat-focus) .character-readout{grid-template-columns:repeat(2,minmax(0,1fr))}
body[data-page=sheet]:not(.active-combat-focus) :is(.identity-panel,.vitals-panel){padding:24px}
body[data-page=sheet]:not(.active-combat-focus) .readout-label{font-size:16px}
body[data-page=sheet]:not(.active-combat-focus) #character-name{font-size:40px;margin-top:20px}
body[data-page=sheet]:not(.active-combat-focus) #class-level{font-size:19px}
body[data-page=sheet]:not(.active-combat-focus) #health{font-size:34px;margin-top:20px;margin-bottom:14px}
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact .ram-label{font-size:21px}
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact .ram-cell{max-width:22px;height:36px}
@media(max-width:720px){body[data-page=sheet]:not(.active-combat-focus) .character-readout{grid-template-columns:1fr}}
body[data-page=sheet]:not(.active-combat-focus) #health{margin-top:14px;margin-bottom:10px}
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact{margin:10px 0 0}
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact .ram-cell{height:32px}
/* Thin RAM shards span the readout from edge to edge. */
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact .ram-cells{width:100%;justify-content:space-between;gap:3px}
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact .ram-cell{flex:0 1 12px;max-width:12px;width:12px;height:32px;border-width:1px}
body[data-page=sheet]:not(.active-combat-focus) .ram-meter-compact .ram-cell:before{left:2px;width:2px}
/* Main HUD navigation follows the readout and equipment sections. */
body[data-page=sheet]:not(.active-combat-focus){height:auto;min-height:100svh;overflow:auto}
body[data-page=sheet]:not(.active-combat-focus) main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto auto auto auto auto;align-content:start;justify-content:normal;max-width:1000px;width:100%;height:auto;max-height:none;min-height:0;flex:none;gap:20px;margin:16px auto 0;padding:0 20px 24px}
body[data-page=sheet]:not(.active-combat-focus) #sheet,body[data-page=sheet]:not(.active-combat-focus) #character-nav{display:contents}
body[data-page=sheet]:not(.active-combat-focus) #status{grid-column:1/-1;grid-row:1;order:0}
body[data-page=sheet]:not(.active-combat-focus) #character-nav button{min-height:84px;padding:18px 20px;font-size:clamp(25px,3.4vw,36px);white-space:normal;overflow-wrap:anywhere;text-align:center}
body[data-page=sheet]:not(.active-combat-focus) #character-nav .nav-icon{width:40px;height:40px;flex-basis:40px}
body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=stats-page]{grid-column:1;grid-row:2}
body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=skills-page]{grid-column:2;grid-row:2}
body[data-page=sheet]:not(.active-combat-focus) .character-readout{grid-column:1/-1;grid-row:3;max-width:none;margin:0;min-height:202px;height:auto;gap:20px}
body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=inventory-page]{grid-column:1;grid-row:4}
body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=cyberware-page]{grid-column:2;grid-row:4}
body[data-page=sheet]:not(.active-combat-focus) #equipped-section{grid-column:1/-1;grid-row:5;width:100%;max-width:none;margin:0;height:auto;padding-top:16px}
body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=combat-page]{grid-column:1/-1;grid-row:6;justify-self:center;width:min(100%,460px);min-height:96px;font-size:38px}
@media(max-width:500px){
 body[data-page=sheet]:not(.active-combat-focus) main{gap:14px;padding-inline:12px}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav button{padding:14px 8px;flex-direction:column;font-size:25px;gap:8px}
 body[data-page=sheet]:not(.active-combat-focus) #character-nav [data-page=combat-page]{flex-direction:row}
}
