.haff-text-toggle{flex:none;min-height:32px;padding:4px 10px;border:1px solid #668061;border-radius:3px;background:#1c2d24;color:#d9efc8;font:700 12px/1.2 system-ui;white-space:nowrap;cursor:pointer}
.haff-text-toggle[aria-pressed=true]{border-color:#b6ef7b;background:#34472c;color:#f0ffd8}
.topbar>.haff-text-toggle{margin-left:auto}
.topbar>.haff-text-toggle+.haff-ui-toggle{margin-left:0}
.hbc-preparing .topbar>.prototype{margin-right:0}
html body.hbc-preparing .topbar>.haff-ui-toggle,
html.haff-mobile-mode body.hbc-preparing .topbar>.haff-ui-toggle{margin-right:164px}
.hbc-preparing .topbar>.haff-text-toggle{position:relative;z-index:5;min-height:24px;height:24px}
html.haff-mobile-mode body.hbc-preparing .topbar>.haff-text-toggle{min-height:34px;height:34px}
body:has(#battle-view:not([hidden])) .topbar>.haff-text-toggle{display:none}
.haff-description{white-space:pre-line;overflow-wrap:anywhere}
.haff-simple-text .haff-description{line-height:1.55}
.haff-description:is(.hgl-item-effect,.item-special-effect,.prep-skill>p,.hi-rear-detail,.hbc-hover-tier>span){display:block;max-height:180px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;touch-action:pan-y}
.haff-simple-text :is(.hbc-hover-limit,.hbc-tier-open,.hgl-item-source,.item-rule-details){display:none}

/* A fixed choice screen: only the effect text scrolls, and actions stay in view. */
body:has(.tactic-choice-page){height:100dvh;overflow:hidden}
body:has(.tactic-choice-page) .topbar{height:44px;min-height:44px;padding:4px max(10px,env(safe-area-inset-right)) 4px max(10px,env(safe-area-inset-left));gap:8px}
body:has(.tactic-choice-page) main{height:calc(100dvh - 44px);min-height:0;display:flex;flex-direction:column;padding:0 max(12px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
body:has(.tactic-choice-page) #campaign-shell{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
body:has(.tactic-choice-page) #campaign-shell>.campaign-hud,
body:has(.tactic-choice-page) #campaign-shell>.compact-progress,
body:has(.tactic-choice-page) .career-badge{display:none}
body:has(.tactic-choice-page) .campaign-top-actions{position:static;margin:0;flex:none;height:28px}
body:has(.tactic-choice-page) .campaign-top-actions button{min-height:26px;padding:3px 8px;font-size:11px}
body:has(.tactic-choice-page) #campaign-notice{flex:none;margin:0;font-size:11px}
body:has(.tactic-choice-page) #campaign-notice:empty{display:none}
.campaign-choice-page.tactic-choice-page{flex:1;min-height:0;max-width:1120px;display:flex;flex-direction:column;position:relative;gap:8px;padding:8px 0 0;overflow:hidden}
.tactic-choice-page>.campaign-heading{flex:none;min-height:30px;padding:0 170px 0 0;gap:8px;align-items:center}
.tactic-choice-page>.campaign-heading h2{font-size:20px}
.tactic-choice-page>.campaign-heading>span{font-size:11px}
.tactic-choice-page>.opening-operator{position:absolute;right:0;top:0;display:flex;align-items:center;gap:8px;width:150px;height:42px;min-height:0;padding:0;margin:0;border:0;background:none}
.tactic-choice-page>.opening-operator img{width:34px;height:40px;object-fit:cover}
.tactic-choice-page>.opening-operator h3{font-size:12px;margin:0}
.tactic-choice-page>.opening-operator :is(.eyebrow,p){display:none}
.tactic-choice-page>.choice-current-tactics{flex:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:0;font-size:11px;line-height:1.4}
.campaign-choice-page.tactic-choice-page>.opening-protocols{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0;padding:5px}
.campaign-choice-page.tactic-choice-page .opening-protocol[data-quality]{display:flex;flex-direction:column;min-height:0;height:100%;box-sizing:border-box;padding:14px;gap:8px;text-align:left}
.tactic-choice-page .opening-protocol[data-selected=true]{outline:2px solid var(--hq-color);outline-offset:2px;background:linear-gradient(155deg,var(--hq-surface),#233029)}
.campaign-choice-page.tactic-choice-page .opening-protocol .tactic-grade{flex:none;min-height:24px;gap:6px}
.campaign-choice-page.tactic-choice-page .tactic-grade>.tactic-icon{width:18px;height:18px;flex-basis:18px;padding:2px}
.campaign-choice-page.tactic-choice-page .hq-badge{min-height:0;border-width:1px;padding:3px 6px;font-size:11px;letter-spacing:0}
.campaign-choice-page.tactic-choice-page .opening-protocol h3{flex:none;font-size:18px;line-height:1.3;margin:0}
.campaign-choice-page.tactic-choice-page .opening-protocol>.tactic-description{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;padding:0 6px 0 0;margin:0;white-space:pre-line;font:14px/1.65 system-ui;color:#d4dce0}
.tactic-description:focus-visible{outline:1px solid var(--hq-color);outline-offset:2px}
.tactic-choice-page .tactic-progress{flex:none;font-size:10px;line-height:1.4}
.tactic-choice-page .tactic-select{flex:none;min-height:36px;width:100%;padding:5px 10px;border-color:var(--hq-color);color:var(--hq-color);background:#0b171aaa;font-size:13px}
.tactic-choice-page .tactic-select[aria-pressed=true]{background:var(--hq-color);color:#131c16}
.tactic-choice-page>.choice-page-actions{flex:none;gap:8px;min-height:40px;padding:5px 0 0;margin:0}
.tactic-choice-page>.choice-page-actions button{width:auto;min-width:100px;min-height:36px;padding:6px 14px;font-size:13px}
@media(max-height:540px){
  .tactic-choice-page>.campaign-heading h2{font-size:16px}
  .campaign-choice-page.tactic-choice-page{gap:4px;padding-top:4px}
  .campaign-choice-page.tactic-choice-page .opening-protocol[data-quality]{padding:8px 10px;gap:5px}
  .campaign-choice-page.tactic-choice-page .opening-protocol h3{font-size:15px}
  .campaign-choice-page.tactic-choice-page .opening-protocol>.tactic-description{font-size:12px;line-height:1.5}
  .tactic-choice-page .tactic-theme{display:none}
  .haff-description:is(.hgl-item-effect,.item-special-effect,.prep-skill>p,.hi-rear-detail,.hbc-hover-tier>span){max-height:100px}
}
@media(max-width:650px) and (orientation:portrait){
  body:has(.tactic-choice-page) .topbar>span:not(.prototype){display:none}
  .tactic-choice-page>.campaign-heading{padding-right:0}
  .tactic-choice-page>.opening-operator{display:none}
  .campaign-choice-page.tactic-choice-page>.opening-protocols{grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(0,1fr));gap:6px}
  .campaign-choice-page.tactic-choice-page .opening-protocol[data-quality]{display:grid;grid-template-columns:1fr auto;grid-template-rows:22px minmax(0,1fr);padding:8px;gap:4px 8px}
  .tactic-choice-page .tactic-grade{display:none!important}
  .tactic-choice-page .opening-protocol h3{grid-area:1/1;font-size:14px!important}
  .tactic-choice-page .tactic-description{grid-area:2/1}
  .tactic-choice-page .tactic-select{grid-area:1/2/3/3;align-self:center;min-width:60px}
  .tactic-choice-page .tactic-progress{display:none}
}
