/* One continuous character sheet; scoped so inventory and mobile combat keep their layout. */
.sheet-quick-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 16px}
.sheet-metric{padding:12px;border:1px solid #365568;border-radius:8px;background:#102838;overflow-wrap:anywhere}
.sheet-metric dt{color:#b6cad5;font-size:12px}.sheet-metric dd{margin:4px 0;color:#8ce2df;font-weight:700;font-size:20px;font-variant-numeric:tabular-nums}.sheet-metric small{display:block;color:#a8c0ce;font-size:11px;line-height:1.65}
.sheet-detailed-stats{margin-top:22px}.sheet-detailed-stats>h4{margin:0;color:#deebf4;font-size:16px}
.sheet-metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0;padding:0 12px 12px}
.sheet-metric-note{margin:0;padding:2px 14px 16px;color:#aec5d4;font-size:12px;line-height:1.8}
.sheet-stat-detail[open]>summary{border-bottom:1px solid #365568;margin-bottom:12px}.sheet-stat-detail[open]>summary:after{content:'⌃'}
@media(max-width:600px){.sheet-quick-stats,.sheet-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.sheet-metric{padding:9px}.sheet-metric dd{font-size:18px}.sheet-metric-grid{padding:0 8px 8px}.sheet-stat-detail>summary{flex-wrap:wrap;gap:4px;padding:12px}.sheet-stat-detail>summary span{flex-basis:100%;margin-left:0}.sheet-stat-detail>summary:after{position:absolute;right:14px}.sheet-stat-detail{position:relative}}
#modal:is([data-view=identity],[data-view=character]):has(.commander-sheet){width:min(1020px,calc(100vw - 32px));max-height:90dvh;scroll-padding-top:132px;background:#0c1c2c}
#modal:has(.commander-sheet) .dialog-top{padding:14px 22px}
#modal:has(.commander-sheet) .dialog-top h2{font-size:22px;margin:2px 0}
#modal:has(.commander-sheet) #modalSubtitle{display:none}
#modal:has(.commander-sheet) #modalBody{padding:0 22px 24px}
.commander-sheet{--sheet-border:#365568;--sheet-muted:#a8c0ce;--sheet-cyan:#8ce2df;font-size:14px;line-height:1.6;min-width:0}
.commander-sheet *{box-sizing:border-box;min-width:0}
.commander-sheet button{min-height:42px}
.sheet-nav{position:sticky;top:78px;z-index:4;display:flex;gap:8px;padding:12px 0;margin-bottom:8px;background:#0c1c2cf5;border-bottom:1px solid #365568;backdrop-filter:blur(8px)}
.sheet-nav button{flex:1;padding:7px 8px;background:#152c3d;color:#cde3eb;font-size:13px;white-space:nowrap}.sheet-nav button b{display:inline-block;margin-left:5px;padding:0 6px;border-radius:5px;color:#f4dc9a;background:#60552b50;font-size:13px}
.sheet-identity{border:1px solid var(--sheet-border);border-radius:12px;overflow:clip;background:linear-gradient(130deg,#1a3747,#102537)}
.commander-summary{display:grid;grid-template-columns:92px minmax(0,1fr) auto;gap:18px;align-items:center;padding:18px}
.commander-avatar{height:108px;border-radius:10px;background:radial-gradient(ellipse,#588b8860,transparent 75%);border:1px solid #57777b55;overflow:hidden;display:grid;place-items:center}.commander-avatar canvas{width:90px;height:104px;object-fit:contain;image-rendering:pixelated}
#modalBody .commander-copy h3{font-size:23px;line-height:1.35;margin:4px 0;overflow-wrap:anywhere;color:#eff8ff}.commander-copy>p{margin:2px 0 8px;color:#b7d0d9;font-size:13px}.commander-badges{display:flex;flex-wrap:wrap;gap:6px}.commander-badges>span{padding:2px 7px;border-radius:5px;background:#09192399;font-size:11px;color:#bcd4dd}.commander-badges b{color:#dceaf2}
.commander-cp{text-align:right;max-width:220px}.commander-cp>span{font-size:12px;color:#c0c8bc}.commander-cp>strong{display:block;font-size:28px;color:#f5d58e;font-variant-numeric:tabular-nums;line-height:1.5}.commander-cp strong small{font-size:12px;font-weight:600}.commander-cp details{font-size:11px;color:#a4bac8}.commander-cp summary{cursor:pointer}.commander-cp details p{position:relative;font-size:12px;text-align:left;color:#c6d9e3;margin:8px 0 0}
.commander-edit{padding:0 18px 16px;border-top:1px solid #57777b40;background:#0b1b2780}.commander-edit .character-name-edit{margin:0}.commander-edit .name-edit{display:grid;grid-template-columns:1fr auto;gap:8px;margin:14px 0 8px}.commander-edit .name-edit label{grid-column:1/-1;font-size:12px;color:#b8cdd8}.commander-edit .name-edit input{width:100%;min-width:0}.commander-edit .name-edit button{padding:7px 15px;font-size:13px}.commander-edit .character-name-edit>p{font-size:11px;margin:6px 0;color:#a9bfca}.commander-edit .rename-notice:empty,.commander-edit .identity-notice:empty{display:none}.commander-edit .player-title-picker{margin:12px 0 0}.commander-edit .identity-notice{min-height:0;margin:8px 0 0;font-size:13px}
.sheet-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:26px 0 14px}.sheet-section-heading h3{font-size:20px!important;margin:3px 0!important}.sheet-section-heading p{font-size:12px;color:var(--sheet-muted);margin:0}.sheet-points{display:flex;align-items:center;gap:9px;padding:8px 12px;border:1px solid #87724b88;background:#57462933;border-radius:8px;font-size:11px;color:#daceb2;white-space:nowrap}.sheet-points b{font-size:22px;color:#f5d58e}
.sheet-derived{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:14px}.sheet-derived>div{padding:10px 12px;border:1px solid #365568;border-radius:8px;background:#102838}.sheet-derived small{display:block;font-size:11px;color:#b6cad5}.sheet-derived small span{font-size:9px;color:#779bad}.sheet-derived strong{font-size:19px;color:#dcebf1;display:block;font-variant-numeric:tabular-nums}.sheet-derived>div:first-child strong{color:#ffa3ae}.sheet-derived>div:nth-child(2) strong{color:#83d4f0}
.sheet-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.sheet-stat{padding:14px;border:1px solid #365568;border-radius:10px;background:linear-gradient(145deg,#193448,#102437)}.sheet-stat-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.sheet-stat-top .stat-help{border:0;padding:0 2px;background:none;color:var(--sheet-cyan);font-size:16px;font-weight:700}.sheet-stat-top .stat-help span{font-size:11px;color:#9ebaca}.sheet-stat-top>strong{font-size:28px;color:#ecf7fb;font-variant-numeric:tabular-nums}.sheet-stat-label{display:block;font-size:12px;color:#c6d8e2}.sheet-stat>small{display:block;font-size:11px;color:#93adbf;margin:2px 0 12px}.sheet-stat .stat-actions{gap:6px}.sheet-stat .stat-actions button{height:40px;font-size:12px;color:#a9e4e2;background:#163949;border-color:#48777d}.sheet-stat .stat-actions button:last-child{font-size:11px}.sheet-hint{font-size:11px;color:#9eb4c4;margin:12px 0 0}
.commander-sheet .talent-tree{margin:26px 0 20px}.commander-sheet .talent-tree>header{padding:16px;border-radius:10px;border-color:#365568;background:linear-gradient(115deg,#173b43,#182b40)}.commander-sheet .talent-tree>header h3{font-size:20px;margin:4px 0}.commander-sheet .talent-tree>header p{font-size:12px;color:#acc6cf;margin:4px 0 10px}.commander-sheet .talent-tree>header>b{font-size:13px;color:#f5d58e}.commander-sheet .talent-tree>header button{margin:4px 0 4px 12px;padding:6px 12px;font-size:12px}.commander-sheet .talent-branches{gap:16px}.commander-sheet .talent-branch>h4{font-size:13px;margin:14px 0}.commander-sheet .talent-node{padding:14px;border-color:#355264;border-radius:10px;margin-bottom:22px}.commander-sheet .talent-node:not(:last-child):after{font-size:17px;height:22px;line-height:22px}.commander-sheet .talent-node.learned{border-color:#527e85}.commander-sheet .talent-title h4{font-size:14px;line-height:1.5}.commander-sheet .talent-title span{font-size:11px}.commander-sheet .talent-icon{width:44px;height:44px;border-radius:8px}.commander-sheet .talent-node>p{font-size:12px;margin:10px 0;line-height:1.7;color:#c2d4df}.commander-sheet .talent-node>small{font-size:11px;line-height:1.6}.commander-sheet .skill-growth{font-size:12px}.commander-sheet .skill-growth strong{font-size:12px;line-height:1.6}.commander-sheet .talent-upgrades{gap:8px}.commander-sheet .talent-upgrades button{font-size:12px;min-height:42px}.commander-sheet .talent-reason{font-size:11px!important}
.sheet-extra{border:1px solid #365568;border-radius:9px;margin:12px 0;background:#102635}.sheet-extra>summary{display:flex;justify-content:space-between;gap:10px;cursor:pointer;padding:14px;font-size:13px;color:#d7e5ed}.sheet-extra>summary:after{content:'⌄';color:#7dccd2}.sheet-extra>summary span{margin-left:auto;font-size:11px;color:#9ebac8}.sheet-extra-body{padding:0 16px 16px;font-size:13px;color:#afc8d5}.sheet-extra .tabs{flex-wrap:wrap}.sheet-extra .tabs button{font-size:12px;padding:8px}
@media(max-width:600px){
 #modal:has(.commander-sheet){scroll-padding-top:120px}.sheet-nav{top:70px;gap:6px;padding:8px 0;margin-bottom:8px}.sheet-nav button{font-size:12px;padding:6px}.sheet-nav button b{font-size:11px;margin-left:2px;padding:0 4px}
 .commander-summary{grid-template-columns:64px minmax(0,1fr);gap:12px;padding:12px}.commander-avatar{height:80px}.commander-avatar canvas{width:62px;height:76px}#modalBody .commander-copy h3{font-size:20px}.commander-copy>.eyebrow{font-size:8px!important;letter-spacing:.08em!important}.commander-copy>p{font-size:12px;margin-bottom:5px}.commander-badges{gap:4px}.commander-badges>span{font-size:10px;padding:2px 5px}.commander-cp{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;text-align:left;max-width:none;border-top:1px solid #53738140;padding-top:8px}.commander-cp>strong{margin-left:auto;font-size:23px}.commander-cp details{flex-basis:100%;font-size:10px}.commander-edit{padding:0 12px 12px}.commander-edit .name-edit button{font-size:12px;padding:6px 10px}.commander-edit .character-name-edit>p{line-height:1.7}
 .sheet-section-heading{margin-top:22px;gap:8px}.sheet-section-heading h3{font-size:18px!important}.sheet-section-heading p{font-size:11px}.sheet-points{display:block;padding:6px 9px;text-align:center;font-size:10px}.sheet-points b{display:block;font-size:20px;line-height:1.2}.sheet-derived{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.sheet-derived>div{padding:7px 9px}.sheet-derived small{font-size:10px}.sheet-derived strong{font-size:17px}.sheet-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.sheet-stat{padding:10px}.sheet-stat-top>strong{font-size:24px}.sheet-stat-top .stat-help{font-size:15px}.sheet-stat .stat-actions{gap:4px}.sheet-stat .stat-actions button{font-size:11px}.sheet-stat .stat-actions button:last-child{font-size:10px}
 .commander-sheet .talent-branches{grid-template-columns:1fr}.commander-sheet .talent-tree>header{padding:12px}.commander-sheet .talent-tree>header h3{font-size:18px}.commander-sheet .talent-tree>header button{display:block;margin:10px 0 0;width:100%}.sheet-extra>summary{flex-wrap:wrap;font-size:12px;padding:12px}.sheet-extra>summary span{font-size:10px}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1200px){#modal:has(.commander-sheet){scroll-padding-top:115px}.sheet-nav{top:70px;padding:6px 0}.commander-summary{padding:12px}.commander-avatar{height:80px}.commander-avatar canvas{height:78px;width:68px}.commander-sheet .sheet-section-heading{margin-top:18px}}
@media(prefers-reduced-motion:reduce){.commander-sheet *{scroll-behavior:auto!important;transition:none!important}}

#modal:has(.commander-sheet){scroll-padding-top:calc(var(--sheet-head,78px) + 72px)}.commander-sheet .sheet-nav{top:var(--sheet-head,78px)}

#modal:has(.commander-sheet){scroll-padding-top:calc(var(--sheet-head,78px) + 72px)}.commander-sheet .sheet-nav{top:var(--sheet-head,78px)}

.player-name-row{display:flex;align-items:center;justify-content:space-between;gap:5px;min-width:0}.player-name-row #playerName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-name-row #playerPowerBadge{flex:none;font-size:9px;color:#edce8e;white-space:nowrap}#rebirthReadyButton{position:absolute;left:20px;top:315px;z-index:8;min-height:36px;padding:6px 12px;background:#574325;color:#ffe0a0;border-color:#b49354;font-size:12px}#rebirthReadyButton[hidden]{display:none!important}.rebirth-shortcut{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;margin-top:12px;border:1px solid #446270;border-radius:9px;background:#142c3c}.rebirth-shortcut.is-ready{border-color:#987c50;background:linear-gradient(100deg,#493f2444,#142c3c)}.rebirth-shortcut strong,.rebirth-shortcut small{display:block}.rebirth-shortcut strong{font-size:14px;color:#f0dbac}.rebirth-shortcut small{font-size:11px;color:#a7c4d1}.rebirth-shortcut button{padding:6px 12px;white-space:nowrap;font-size:12px}
@media(max-width:1300px),(pointer:coarse){#rebirthReadyButton{top:calc(var(--af-safe-top,10px) + 94px);left:var(--af-safe-left,10px);min-height:32px;padding:5px 8px;font-size:10px}.player-name-row #playerPowerBadge{font-size:8px}.player-name-row #playerName{max-width:68px}.rebirth-shortcut{padding:10px;gap:8px}.rebirth-shortcut strong{font-size:12px}.rebirth-shortcut small{font-size:10px}}

@media(max-width:900px),(pointer:coarse) and (max-width:1200px),(max-height:600px) and (max-width:1200px){#rebirthReadyButton{display:none!important}}

/* The shortcut participates in the action layout below the portrait. */
.desktop-player-actions #rebirthReadyButton,.player-tools #rebirthReadyButton{position:static!important;inset:auto!important;transform:none!important;order:-1;grid-column:1/-1;width:100%;min-height:44px;padding:9px 12px;font-size:12px;box-sizing:border-box}
.desktop-player-actions #rebirthReadyButton:not([hidden]),.player-tools #rebirthReadyButton:not([hidden]){display:flex!important;justify-content:center;align-items:center}

.class-change-open{font-size:11px;padding:4px 8px}.class-change-panel{max-width:680px;margin:auto}.class-change-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.class-change-grid button{min-height:44px;white-space:normal}#classChangeConfirm{margin-top:16px;padding:12px;border:1px solid #577080}@media(max-width:480px){.class-change-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.wing-settings{display:flex;gap:12px;align-items:center;padding:8px 0}.wing-settings canvas{width:140px;height:121px;flex-shrink:0;border-radius:8px}.wing-tier-buttons{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.wing-tier-buttons button{font-size:11px;min-height:34px;padding:5px 9px}.wing-tier-buttons button[aria-pressed=true]{border-color:#7ee4db;background:#22545b}.wing-settings small{font-size:10px}.wing-settings p{font-size:11px;margin:6px 0}@media(max-width:480px){.wing-settings canvas{width:92px;height:100px;object-fit:contain}.wing-tier-buttons button{min-height:40px}}

.wing-gallery{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding-bottom:8px}.wing-gallery figure{margin:0;background:#102530;border:1px solid #34505c;border-radius:6px;overflow:hidden}.wing-gallery canvas{width:100%;height:auto;display:block}.wing-gallery figcaption{font-size:10px;text-align:center;padding:3px 2px 6px}@media(max-width:650px){.wing-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}}

.roster-entry{display:flex;flex-direction:column;gap:6px}.roster-entry .roster-card{width:100%;flex:1}.roster-delete{font-size:12px;color:#ffb9bb;min-height:36px}#characterDeleteConfirm:not(:empty){padding:14px;margin:16px 0;border:1px solid #a75d67;border-radius:8px}#characterDeleteConfirm input{display:block;width:100%;margin:8px 0}#characterDeleteConfirm .danger{color:#fff;background:#923e4b}#characterDeleteConfirm button{min-height:44px;margin:4px}#characterDeleteConfirm [role=alert]{color:#ffc3be}

/* Localized action labels must remain readable on narrow screens. */
.rebirth-shortcut>div{min-width:0}
.rebirth-shortcut button{white-space:normal;overflow-wrap:anywhere;max-width:44%;flex-shrink:0;line-height:1.35}
