*{box-sizing:border-box}html{background:#171813;color:#eee;font-family:Arial,sans-serif}body{margin:0;background:#171813}.shell{width:min(720px,100%);margin:auto;padding:20px 14px 0}header{border-bottom:2px solid #c9a34e;margin-bottom:20px}header small{color:#c9a34e;font-weight:800;letter-spacing:.08em}h1{font-size:2rem;margin:.25rem 0 0}header p{margin:.25rem 0 1rem;color:#aaa;font-weight:700}h2{font-size:.8rem;letter-spacing:.12em;color:#c9a34e;margin:24px 0 8px}.setup{display:grid;grid-template-columns:1fr 1fr;gap:10px}.setup label{font-size:.7rem;font-weight:800;color:#bbb}.setup select{display:block;width:100%;margin-top:5px;padding:12px;border:1px solid #555;background:#24251f;color:#fff;border-radius:6px}.position,.purchase{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#24251f;border:1px solid #414239;border-radius:8px;padding:12px;margin:8px 0}.position-main{min-width:0}.position strong,.purchase strong{display:block}.position small,.purchase small{display:block;color:#c9a34e;margin-top:3px}.stats{font-size:.78rem;margin-top:7px;color:#ddd}.skills{font-size:.72rem;color:#aaa;margin-top:4px}.stepper{display:flex;align-items:center;gap:8px;flex:0 0 auto}.stepper button{width:42px;height:42px;border:1px solid #777;border-radius:6px;background:#303129;color:#fff;font-size:1.4rem;font-weight:800}.stepper button:disabled{opacity:.25}.stepper b{min-width:22px;text-align:center;font-size:1.1rem}.bad{border-color:#c75}.spacer{height:185px}.summary{position:fixed;z-index:10;bottom:0;left:0;right:0;background:#0e0f0c;border-top:2px solid #c9a34e;display:grid;grid-template-columns:repeat(4,1fr);gap:2px;padding:10px max(12px,calc((100vw - 700px)/2));box-shadow:0 -8px 24px #0008}.summary div{text-align:center}.summary small{display:block;color:#999;font-size:.6rem;font-weight:800}.summary strong{font-size:.78rem}.summary button{grid-column:1/-1;margin-top:7px;padding:12px;border:0;border-radius:6px;background:#c9a34e;color:#15150f;font-weight:900;letter-spacing:.08em}.summary button:disabled{background:#444;color:#888}.summary p{grid-column:1/-1;text-align:center;margin:2px 0 0;color:#c88;font-size:.72rem}.summary p.ok{color:#9c9}@media(max-width:440px){.shell{padding-left:10px;padding-right:10px}.setup{grid-template-columns:1fr}.position{align-items:flex-start}.stats{line-height:1.45}.summary{padding-left:8px;padding-right:8px}.summary strong{font-size:.7rem}}
[hidden]{display:none!important}.back{border:1px solid #555;background:#24251f;color:#c9a34e;border-radius:6px;padding:10px 12px;font-weight:900;letter-spacing:.05em;margin:0 0 16px}.roster-head{background:#20211c;border:1px solid #414239;border-radius:8px;padding:16px;margin-bottom:18px}.roster-head>small{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.roster-head h2{font-size:1.6rem;letter-spacing:.02em;color:#fff;margin:5px 0 14px}.roster-league{color:#aaa;font-size:.72rem;font-weight:800;letter-spacing:.035em;line-height:1.35;margin:-8px 0 14px;overflow-wrap:anywhere}.roster-facts{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;color:#aaa;font-size:.7rem}.roster-facts b{color:#eee}.player-card{display:flex;align-items:center;gap:12px;background:#24251f;border:1px solid #414239;border-radius:8px;padding:13px 12px;margin:8px 0}.player-number{color:#c9a34e;font-size:1.05rem;font-weight:900;min-width:34px}.player-body{min-width:0;flex:1}.player-body>strong{display:block;font-size:1.05rem}.player-body small{display:block;color:#c9a34e;margin-top:5px}.chevron{font-size:1.8rem;color:#777}.roster-note{color:#777;text-align:center;font-size:.68rem;padding:18px 0 32px}
.player-card{cursor:pointer}.player-card:active{transform:translateY(1px);background:#292a23}.player-detail{background:#20211c;border:1px solid #414239;border-radius:8px;padding:18px}.player-detail>small,.player-section>small{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.player-detail-title{display:flex;align-items:center;gap:14px;margin:10px 0 18px}.player-detail-title>span{color:#c9a34e;font-size:1.5rem;font-weight:900;min-width:46px}.player-detail-title h2{font-size:1.7rem;letter-spacing:0;color:#fff;margin:0}.player-detail-title p{color:#999;margin:4px 0 0;font-size:.78rem}.player-characteristics{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;border-top:1px solid #414239;border-bottom:1px solid #414239;padding:14px 0;margin-bottom:16px;text-align:center;font-weight:800;font-size:.85rem}.player-section{padding:10px 0}.player-section p{margin:5px 0 0;color:#ddd;line-height:1.4}.player-section strong{display:block;color:#eee;margin-top:5px;font-size:1.05rem}.player-nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin:12px 0}.player-nav button{border:1px solid #555;background:#24251f;color:#c9a34e;border-radius:6px;padding:12px 8px;font-weight:900;letter-spacing:.04em}.player-nav button:last-child{justify-self:stretch}.player-nav button:disabled{opacity:.25}.player-nav span{color:#888;font-size:.72rem;font-weight:800;text-align:center;min-width:52px}@media(max-width:440px){.player-characteristics{font-size:.76rem}.player-nav button{font-size:.7rem}}
.zoom-row{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;margin-top:12px;padding:14px 0 2px;border:0;border-top:1px solid #414239;background:transparent;color:#eee}.zoom-row span{display:flex;flex-direction:column;gap:5px}.zoom-row small,.advancement-detail>small,.adv-current>small,.adv-buy>small{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.zoom-row strong{font-size:.9rem}.zoom-row>b{font-size:1.8rem;color:#777}.advancement-detail{background:#20211c;border:1px solid #414239;border-radius:8px;padding:18px}.advancement-detail h2{font-size:1.7rem;letter-spacing:0;color:#fff;margin:8px 0 0}.adv-sub{margin:4px 0 18px;color:#999}.spp-field{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid #414239;border-bottom:1px solid #414239;padding:14px 0;color:#c9a34e;font-size:.72rem;font-weight:900;letter-spacing:.06em}.spp-field input,.char-roll input{width:92px;padding:10px;border:1px solid #666;border-radius:6px;background:#2b2c25;color:#fff;font-size:1rem}.adv-current,.adv-buy{padding:18px 0;border-bottom:1px solid #414239}.adv-current:last-child,.adv-buy:last-child{border-bottom:0}.adv-current #advCurrent{margin-top:10px}.adv-tag{display:flex;justify-content:space-between;gap:8px;padding:9px 10px;background:#292a23;border-radius:6px;margin:6px 0;font-size:.78rem}.adv-tag small{color:#aaa}.adv-buy select{width:100%;margin-top:10px;padding:11px;border:1px solid #666;border-radius:6px;background:#2b2c25;color:#fff}.adv-methods{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.adv-methods button,.char-option{padding:11px 8px;border:1px solid #666;border-radius:6px;background:#303129;color:#c9a34e;font-weight:900}.adv-methods button:disabled,.char-option:disabled{opacity:.3}.char-roll{margin-top:10px}.char-roll input{margin-bottom:8px}.char-option{display:block;width:100%;margin:6px 0;text-align:left}.adv-hint{color:#999;font-size:.72rem;line-height:1.4;margin-top:8px}.adv-error{color:#c88}.adv-ok{color:#9c9}
.spp-total{display:flex;align-items:end;justify-content:space-between;border-top:1px solid #414239;border-bottom:1px solid #414239;padding:14px 0}.spp-total small{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.spp-total strong{font-size:1.8rem}.spp-event-row{display:flex;align-items:center;justify-content:space-between;background:#292a23;border-radius:6px;padding:10px;margin:6px 0}.spp-event-row span{display:flex;flex-direction:column;gap:3px}.spp-event-row small{color:#999;font-size:.68rem}.spp-event-row>strong{color:#c9a34e;font-size:1.05rem}.spp-event-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.spp-event-buttons button{display:flex;flex-direction:column;gap:3px;padding:12px 8px;border:1px solid #666;border-radius:6px;background:#303129;color:#c9a34e;font-weight:900}.spp-event-buttons button small{color:#aaa;font-weight:700}.spp-event-buttons button:last-child:nth-child(odd){grid-column:1/-1}@media(max-width:380px){.spp-event-buttons{grid-template-columns:1fr}}

.spp-stepper{display:flex;align-items:center;gap:12px}.spp-stepper strong{min-width:1.4em;text-align:center;color:#c9a34e;font-size:1.05rem}.spp-stepper button{width:42px;height:42px;border:1px solid #666;border-radius:6px;background:#303129;color:#c9a34e;font-size:1.35rem;font-weight:900;line-height:1}.spp-stepper button:disabled{opacity:.3}
.persistence-panel{background:#20211c;border:1px solid #414239;border-radius:8px;padding:12px;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between;gap:10px}.persistence-panel button,.persistence-actions button{border:1px solid #c9a34e;background:#303129;color:#c9a34e;border-radius:6px;padding:11px 12px;font-weight:900;letter-spacing:.04em}.persistence-panel button:disabled{opacity:.3}.persistence-panel small,.persistence-actions small{color:#888;font-size:.68rem;line-height:1.35}.persistence-actions{border-top:1px solid #414239;margin-top:14px;padding-top:14px;display:flex;align-items:center;justify-content:space-between;gap:10px}.persistence-actions small.saved{color:#9c9}@media(max-width:440px){.persistence-panel,.persistence-actions{align-items:stretch;flex-direction:column}.persistence-panel button,.persistence-actions button{width:100%}}

.injury-status-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #414239;border-bottom:1px solid #414239;padding:14px 0}.injury-status-row span{display:flex;flex-direction:column;gap:4px}.injury-status-row small{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.injury-status-row button,.injury-buttons button{border:1px solid #666;border-radius:6px;background:#303129;color:#c9a34e;font-weight:900;padding:11px}.injury-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.injury-buttons button{display:flex;flex-direction:column;gap:3px}.injury-buttons button small{color:#aaa;font-weight:700}.injury-buttons button:last-child:nth-child(odd){grid-column:1/-1}.injury-tag{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#292a23;border-radius:6px;padding:9px 10px;margin:6px 0}.injury-tag span{display:flex;flex-direction:column;gap:3px}.injury-tag small{color:#999;font-size:.68rem}.injury-tag button{width:38px;height:38px;border:1px solid #666;border-radius:6px;background:#303129;color:#c9a34e;font-size:1.2rem;font-weight:900}@media(max-width:380px){.injury-buttons{grid-template-columns:1fr}}

/* Legacy is historical career data, not an SPP source. */
.legacy-row{display:grid;grid-template-columns:minmax(0,1fr) auto 72px;gap:10px;align-items:center;background:#292a23;border-radius:6px;padding:10px;margin:6px 0}.legacy-row>span{display:flex;flex-direction:column;gap:3px}.legacy-row small{color:#999;font-size:.68rem}.legacy-stepper{display:flex;align-items:center;gap:8px}.legacy-stepper button{width:34px;height:34px;border:1px solid #666;border-radius:5px;background:#303129;color:#c9a34e;font-size:1.15rem;font-weight:900}.legacy-stepper button:disabled{opacity:.3}.legacy-stepper strong{min-width:24px;text-align:center}.legacy-career{border-left:1px solid #555;padding-left:9px;display:grid;text-align:right}.legacy-career b{font-size:1.15rem;color:#c9a34e}.legacy-career em{font-style:normal;color:#999;font-size:.62rem}.legacy-spp-check{margin-top:12px;padding:12px;border:1px solid #6a5a34;border-radius:6px;background:#26251f;color:#d6c28d;font-size:.78rem;font-weight:700}@media(max-width:380px){.legacy-row{grid-template-columns:1fr auto}.legacy-career{grid-column:1/-1;border-left:0;border-top:1px solid #555;padding:8px 0 0;display:flex;justify-content:space-between}}

/* a living roster can buy a new player without rebuilding existing players. */
.roster-add-player{margin:0 0 18px}.roster-add-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.roster-add-controls select{min-width:0;width:100%;padding:11px;border:1px solid #666;border-radius:6px;background:#2b2c25;color:#fff}.roster-add-controls button{padding:11px 14px;border:1px solid #c9a34e;border-radius:6px;background:#303129;color:#c9a34e;font-weight:900;letter-spacing:.04em}.roster-add-controls button:disabled{opacity:.3}.roster-add-player>small{display:block;color:#888;font-size:.68rem;line-height:1.35;margin-top:7px}.roster-add-player>small.ok{color:#9c9}@media(max-width:440px){.roster-add-controls{grid-template-columns:1fr}.roster-add-controls button{width:100%}}


/* roster slots have identity; buried players free their number without reindexing survivors. */
.roster-status-block{border-top:1px solid #414239;margin-top:14px;padding-top:14px;display:grid;gap:8px}.roster-status-block>small{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.roster-status-block>strong{font-size:.9rem}.roster-status-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.roster-status-actions button{padding:11px 8px;border:1px solid #666;border-radius:6px;background:#303129;color:#eee;font-weight:900}.roster-status-actions .danger{border-color:#8d5d55;color:#e0a19a}.player-card.inactive{opacity:.55}.player-card.inactive .player-body>strong:after{content:' · INACTIVE';color:#999;font-size:.65rem;font-weight:700}@media(max-width:380px){.roster-status-actions{grid-template-columns:1fr}}

/* post-creation team purchases share Treasury / TV / persistence with the living roster. */
.roster-team-purchases{margin:0 0 18px}.team-purchase-hint{color:#999;font-size:.72rem;line-height:1.4;margin:0 0 9px}.live-purchase{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#24251f;border:1px solid #414239;border-radius:8px;padding:10px 12px;margin:7px 0}.live-purchase>span{display:flex;flex-direction:column;gap:3px;min-width:0}.live-purchase>span strong{font-size:.9rem}.live-purchase>span small{color:#999;font-size:.66rem;line-height:1.25}.live-stepper{display:flex;align-items:center;gap:10px;flex:0 0 auto}.live-stepper button{width:42px;height:42px;border:1px solid #666;border-radius:6px;background:#303129;color:#c9a34e;font-size:1.35rem;font-weight:900}.live-stepper button:disabled{opacity:.28}.live-stepper b{min-width:22px;text-align:center}.roster-team-purchases>small{display:block;color:#888;font-size:.68rem;line-height:1.35;margin-top:7px}.roster-team-purchases>small.ok{color:#9c9}@media(max-width:440px){.live-purchase{align-items:flex-start}.live-purchase>span{padding-top:4px}}

/* explicit roster lifecycle. The user, not inference, decides which economy rules apply. */
.team-phase-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.team-phase-head h2{margin-right:auto}
.team-phase-control{display:grid;grid-template-columns:1fr 1fr;border:1px solid #666;border-radius:7px;overflow:hidden;min-width:210px}
.team-phase-control button{border:0;border-right:1px solid #666;background:#24251f;color:#888;padding:9px 8px;font-size:.65rem;font-weight:900;letter-spacing:.04em}
.team-phase-control button:last-child{border-right:0}
.team-phase-control button.active{background:#c9a34e;color:#171812}
#teamPhaseNote{color:#c9a34e;font-weight:800}
@media(max-width:440px){.team-phase-head{align-items:stretch;flex-direction:column}.team-phase-control{width:100%;min-width:0}.team-phase-control button{padding:11px 6px}}

.desktop-import-panel{background:#20211c;border:1px solid #414239;border-radius:8px;padding:12px;margin-bottom:14px;display:grid;gap:10px}.desktop-import-panel>div{display:grid;gap:3px}.desktop-import-panel small{color:#888;font-size:.68rem;line-height:1.35}.desktop-import-panel label{display:grid;gap:4px;color:#aaa;font-size:.68rem;font-weight:900;letter-spacing:.06em}.desktop-import-panel select,.desktop-import-panel button{min-height:42px;border:1px solid #c9a34e;background:#303129;color:#c9a34e;border-radius:6px;padding:9px 10px;font-weight:900}.desktop-import-panel button{letter-spacing:.04em}.desktop-import-panel #desktopImportStatus.ok{color:#9c9}.desktop-import-panel #desktopImportStatus.bad{color:#d99}


/* player identity is canonical state, now visible and editable in Henchman. */
.player-position{color:#aaa;font-size:.72rem;font-weight:800;margin:2px 0 5px}.player-name-edit{display:grid;gap:5px;margin:14px 0;padding:12px;background:#20211c;border:1px solid #414239;border-radius:7px}.player-name-edit label{color:#c9a34e;font-size:.65rem;font-weight:900;letter-spacing:.1em}.player-name-edit input{width:100%;padding:11px 12px;border:1px solid #666;border-radius:6px;background:#2b2c25;color:#fff;font:inherit;font-weight:800}.player-name-edit input::placeholder{color:#777}

/* existing roster editing */
.roster-identity-edit,.roster-economy-edit,.player-number-edit{display:grid;gap:.65rem;margin-top:1rem}
.roster-identity-edit{grid-template-columns:1fr 1fr}
.roster-identity-edit label,.roster-economy-edit label,.player-number-edit label{display:grid;gap:.35rem;font-size:.78rem;font-weight:800;letter-spacing:.06em;color:#aaa}
.roster-identity-edit input,.roster-economy-edit input,.player-number-edit input{width:100%;box-sizing:border-box;background:#22231f;color:#f1f1ee;border:1px solid #55564f;border-radius:10px;padding:.8rem;font:inherit}
.adv-tag{position:relative;padding-right:3rem}
.adv-tag button[data-remove-adv]{position:absolute;right:.55rem;top:50%;transform:translateY(-50%);width:2.2rem;height:2.2rem;border-radius:8px;border:1px solid #6b6250;background:#292822;color:#d5aa4d;font-size:1.25rem;font-weight:900}
@media(max-width:520px){.roster-identity-edit{grid-template-columns:1fr}}

/* Post-game is team state. Player events remain on PLAYER. */
.post-game-entry{margin:0 0 18px}.post-game-entry>small{display:block;color:#888;font-size:.68rem;line-height:1.4;margin-top:7px}.post-game-current,.post-game-calc{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:12px 0}.post-game-current span,.post-game-calc span{display:grid;gap:4px;background:#24251f;border:1px solid #414239;border-radius:8px;padding:10px}.post-game-current small,.post-game-calc small{color:#999;font-size:.62rem;font-weight:900;letter-spacing:.08em}.post-game-current strong,.post-game-calc strong{color:#c9a34e}.post-game-form{display:grid;gap:10px;margin:14px 0}.post-game-form label{display:grid;gap:5px;color:#aaa;font-size:.68rem;font-weight:900;letter-spacing:.06em}.post-game-form input[type="text"],.post-game-form input[type="number"]{width:100%;box-sizing:border-box;background:#22231f;color:#f1f1ee;border:1px solid #55564f;border-radius:8px;padding:.75rem;font:inherit}.post-game-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.post-game-check{display:flex!important;grid-template-columns:none!important;align-items:center;gap:10px!important;background:#24251f;border:1px solid #414239;border-radius:8px;padding:12px}.post-game-check input{width:22px;height:22px}.post-game-register{width:100%;min-height:48px;border:1px solid #c9a34e;background:#303129;color:#c9a34e;border-radius:7px;font-weight:900;letter-spacing:.05em}.post-game-detail>#postGameStatus{display:block;color:#888;font-size:.7rem;line-height:1.4;margin:8px 0 14px}.post-game-detail>#postGameStatus.ok{color:#9c9}.post-game-detail>#postGameStatus.adv-error{color:#d99}.match-history-row{display:grid;gap:3px;background:#292a23;border-radius:6px;padding:10px;margin:6px 0}.match-history-row span{font-size:.78rem}.match-history-row small{color:#999;font-size:.68rem}@media(max-width:380px){.post-game-pair,.post-game-current,.post-game-calc{grid-template-columns:1fr}}


/* Expensive Mistakes uses live Treasury, not match-entry DOM. */
.mistake-mobile{margin-top:18px;padding-top:16px;border-top:1px solid #414239}.mistake-mobile>small:first-child{color:#c9a34e;font-weight:900;letter-spacing:.08em}.mistake-treasury{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}.mistake-treasury span,.mistake-result{display:grid;gap:4px;background:#24251f;border:1px solid #414239;border-radius:8px;padding:10px}.mistake-treasury small,.mistake-result small{color:#999;font-size:.62rem;font-weight:900;letter-spacing:.08em}.mistake-treasury strong,.mistake-result strong{color:#c9a34e}.mistake-rolls{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.mistake-rolls label{display:grid;gap:5px;color:#aaa;font-size:.68rem;font-weight:900;letter-spacing:.06em}.mistake-rolls input{width:100%;box-sizing:border-box;background:#22231f;color:#f1f1ee;border:1px solid #55564f;border-radius:8px;padding:.75rem;font:inherit}.mistake-result{margin:10px 0}.mistake-mobile>#mistakeApplyStatus{display:block;color:#888;font-size:.7rem;line-height:1.4;margin-top:8px}.mistake-mobile>#mistakeApplyStatus.ok{color:#9c9}@media(max-width:380px){.mistake-treasury,.mistake-rolls{grid-template-columns:1fr}}
/* Match history is editable state, with explicit mobile actions. */
.match-history-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:7px}.match-history-actions button,.post-game-cancel{min-height:40px;border:1px solid #55564f;background:#303129;color:#ddd;border-radius:7px;font-weight:900;letter-spacing:.04em}.match-history-actions button.danger{border-color:#875b5b;color:#e2aaaa}.post-game-cancel{width:100%;margin-top:8px;background:#24251f}.post-game-cancel[hidden]{display:none}

.roster-notes textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:7rem;background:#20211d;color:#f2f2ef;border:1px solid #55574f;border-radius:14px;padding:16px;font:inherit;line-height:1.4}
.roster-notes textarea:focus{outline:2px solid #d3aa4d;outline-offset:1px}


/* persistent Henchman frame. Content changes; the frame stays. */
body{padding-top:76px}
.henchman-appbar{position:fixed;z-index:30;top:0;left:0;right:0;background:#0e0f0c;border-bottom:2px solid #c9a34e;box-shadow:0 5px 18px #0008}
.henchman-appbar-inner{width:min(720px,100%);min-height:76px;margin:auto;padding:10px 14px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px}
.shell-back{width:44px;height:44px;border:1px solid #555;border-radius:8px;background:#24251f;color:#c9a34e;font-size:2rem;line-height:1;font-weight:900;padding:0 0 4px}
.shell-identity{min-width:0;display:grid;gap:2px}
.shell-identity small{color:#c9a34e;font-size:.62rem;font-weight:900;letter-spacing:.1em}
.shell-identity strong{font-size:1.05rem;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shell-context{max-width:210px;color:#888;font-size:.62rem;font-weight:800;letter-spacing:.04em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Old per-view back buttons remain in the DOM for the proven motor, but the shell owns navigation visually. */
#rosterView>.back,#postGameView>.back,#playerView>.back,#sppView>.back,#legacyView>.back,#injuryView>.back,#advancementView>.back{display:none}
@media(max-width:440px){body{padding-top:70px}.henchman-appbar-inner{min-height:70px;padding:8px 10px}.shell-context{display:none}.henchman-appbar-inner{grid-template-columns:auto minmax(0,1fr)}.shell-back{width:42px;height:42px}.shell-identity strong{font-size:1rem}}

/* A2.1 · MICROSCOPE — sideways movement stays within thumb reach at PLAYER depth. */
.microscope-rail{position:sticky;top:68px;z-index:18;margin:0 -1px 12px;padding:8px;background:rgba(13,15,12,.96);border:1px solid #3d3e36;border-top:0;border-radius:0 0 8px 8px;box-shadow:0 8px 18px rgba(0,0,0,.22)}
.microscope-rail span::before{content:attr(data-prefix);color:#c9a34e;letter-spacing:.08em}
.microscope-rail[data-depth] span::before{content:attr(data-depth) ' ';color:#c9a34e;letter-spacing:.08em}
@media(max-width:440px){.microscope-rail{top:64px;margin-left:-8px;margin-right:-8px;border-left:0;border-right:0;border-radius:0}.microscope-rail button{padding:11px 6px}}

/* A2.2 · MICROSCOPE — keep the sideways player axis at deeper player workspaces. */
.deep-microscope-rail{margin-bottom:12px}
.deep-microscope-rail button:disabled{opacity:.3}


/* A3.2 · roster-level actions belong above roster content, not inside it. */
.roster-actionbar{margin:0 0 14px;padding:10px;background:#20211c;border:1px solid #414239;border-radius:8px}
.roster-actionbar-buttons{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.roster-actionbar-buttons button{min-height:44px;border:1px solid #c9a34e;background:#303129;color:#c9a34e;border-radius:6px;padding:10px 8px;font-weight:900;letter-spacing:.06em}
.roster-actionbar-status{display:flex;justify-content:space-between;gap:12px;margin-top:7px}
.roster-actionbar-status small{color:#777;font-size:.62rem;line-height:1.25}
.roster-actionbar-status small.saved{color:#9c9}
@media(max-width:440px){.roster-actionbar{margin-left:0;margin-right:0}.roster-actionbar-status{display:block}.roster-actionbar-status small{display:block}.roster-actionbar-status small+small{margin-top:2px}}

/* A3.3 · Team Management workspace */
.team-management-entry{margin:0 0 18px}
.team-management-entry>small{display:block;color:#888;font-size:.68rem;line-height:1.4;margin-top:7px}
#teamManagementView>.roster-team-purchases{margin-top:18px}
.team-management-head{margin-bottom:18px}


/* A5.1 · HENCHMAN IDENTITY AUDITION
   The Gamekeeper owns the tool. Mr. PoopyPants got his colours all over it.
   Identity-only pass: no navigation, state or motor changes. */
:root{
  --hench-blue:#174f83;
  --hench-red:#bd1820;
  --hench-orange:#cf7731;
  --hench-teal:#2f83a6;
  --hench-magenta:#d12fa8;
  --hench-green:#78a96c;
  --hench-ink:#0d1112;
}
.henchman-appbar{
  background:linear-gradient(100deg,#0b0f11 0%,#102431 58%,#132b27 100%);
  border-bottom-color:var(--hench-orange);
  box-shadow:0 5px 18px #0009, inset 0 -1px 0 rgba(47,131,166,.35);
}
.henchman-appbar-inner{grid-template-columns:auto auto minmax(0,1fr) auto}
.henchman-mark{
  width:46px;height:46px;border-radius:50%;flex:0 0 46px;
  border:2px solid var(--hench-orange);
  background-image:url('assets/henchman.png');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  box-shadow:0 0 0 2px #111,0 0 14px rgba(207,119,49,.25);
}
.shell-identity small{color:var(--hench-orange)}
.shell-identity strong{color:#f3f1e8}
.shell-context{color:#8fb8ad}
.shell-back{border-color:#315c66;background:#152329;color:var(--hench-orange)}

/* PoopyPants palette is grime/accent, not a carnival repaint. */
h2,.roster-head>small,.advancement-detail>small{color:var(--hench-orange)}
.zoom-row b,.microscope-rail span::before,.microscope-rail[data-depth] span::before{color:var(--hench-teal)}
.roster-actionbar-buttons button,.post-game-register{
  border-color:var(--hench-teal);color:#b7e1e5;background:#1c2c31;
}
.roster-actionbar-buttons button:nth-child(2){border-color:var(--hench-green);color:#c9e2c3}
.roster-actionbar-buttons button:nth-child(3){border-color:var(--hench-magenta);color:#e8a9da}
.roster-head,.advancement-detail,.roster-actionbar,.team-management-entry .zoom-row,.post-game-entry .zoom-row{
  border-color:#42534e;
}
.roster-facts b,.post-game-current strong,.post-game-calc strong,.mistake-treasury strong,.mistake-result strong{color:var(--hench-orange)}
.roster-notes textarea:focus{outline-color:var(--hench-teal)}

@media(max-width:440px){
  .henchman-appbar-inner{grid-template-columns:auto auto minmax(0,1fr);gap:8px}
  .henchman-mark{width:42px;height:42px;flex-basis:42px}
}

/* B3 · GAMEKEEPER TRANS */
.roster-actionbar-buttons #handoffSend,.roster-actionbar-buttons #handoffReceive{border-color:var(--hench-orange);color:#f0b36c}
.handoff-dialog{border:0;padding:0;background:transparent;max-width:min(92vw,430px);width:100%;color:#eee}.handoff-dialog::backdrop{background:rgba(0,0,0,.72)}
.handoff-card{position:relative;background:#20211c;border:1px solid var(--hench-orange);border-radius:12px;padding:22px;box-shadow:0 18px 60px #000}.handoff-card>small:first-of-type{color:var(--hench-orange);font-weight:900;letter-spacing:.08em}.handoff-card h2{margin:.35rem 0}.handoff-card p{color:#aaa}.handoff-close{position:absolute;right:10px;top:8px;border:0;background:transparent;color:#aaa;font-size:1.7rem}.handoff-primary{width:100%;min-height:48px;border:1px solid var(--hench-orange);background:#33291f;color:#ffd09a;border-radius:7px;font-weight:900;letter-spacing:.06em}.handoff-card label{display:block;color:#aaa;font-size:.72rem;font-weight:800;letter-spacing:.05em}.handoff-card input{display:block;width:100%;box-sizing:border-box;margin:7px 0 12px;padding:13px;background:#11120f;border:1px solid #555;color:#fff;border-radius:7px;font:900 1.35rem monospace;letter-spacing:.12em;text-align:center}.handoff-code{margin:14px 0 4px;padding:15px;border:1px solid #6f8b70;background:#151b15;border-radius:8px;color:#b9e7bb;text-align:center;font:900 2.1rem monospace;letter-spacing:.12em}.handoff-dialog-status{display:block;margin-top:12px;color:#999;white-space:pre-line}.handoff-dialog-status.ok{color:#9c9}.handoff-dialog-status.bad{color:#e99}
@media(max-width:520px){.roster-actionbar-buttons{grid-template-columns:repeat(5,1fr);gap:5px}.roster-actionbar-buttons button{font-size:.68rem;padding:9px 3px}}


/* Mobile install invitation. Shown only when the browser itself offers a PWA install prompt. */
.install-invite{position:relative;max-width:580px;margin:14px auto 0;box-sizing:border-box;padding:13px 48px 13px 14px;background:#20211c;border:1px solid var(--hench-orange);border-radius:8px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px}
.install-invite>div{display:grid;gap:4px}.install-invite strong{color:var(--hench-orange);font-size:.78rem;letter-spacing:.07em}.install-invite small{color:#aaa;font-size:.68rem;line-height:1.35}.install-invite>button{border:1px solid var(--hench-orange);background:#33291f;color:#ffd09a;border-radius:6px;padding:10px 14px;font-weight:900;letter-spacing:.05em}.install-invite .install-dismiss{position:absolute;right:8px;top:5px;border:0;background:transparent;color:#888;padding:5px;font-size:1.25rem;line-height:1}
@media(max-width:768px) and (pointer:coarse){.install-invite{margin:12px 12px 0}}
