/* Collection terminals and field-kit dialogs share the battle console's ink,
   sea-glass rails and sunstone cursor. Rules and small values remain DM Sans. */
body.game-mode .game-storage .roster-console__body{display:block;min-height:0}
body.game-mode .storage-console:not(.roster-console--detail) .roster-detail{display:none}
body.game-mode .storage-console.roster-console--detail .storage-master{display:none}
body.game-mode .storage-console.roster-console--detail .roster-detail{display:block;width:100%;max-width:1100px;margin:auto;padding:0 22px 28px;border:0}
body.game-mode .storage-console .storage-master{width:100%;padding:14px 20px 24px;background-color:#142b37;background-image:linear-gradient(#6da6aa12 1px,transparent 1px),linear-gradient(90deg,#6da6aa12 1px,transparent 1px);background-size:24px 24px}
body.game-mode .storage-console .roster-console__header{background:#233b4c;border-bottom:3px double #73cfc2;padding:8px 20px}
body.game-mode .storage-console .roster-console__summary{margin:0;min-height:0}
body.game-mode .storage-console .roster-console__summary p{font-size:14px;line-height:1.4;color:#d8e5ec;margin:6px 0}
body.game-mode .storage-console .storage-controls{display:grid;grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr));gap:10px;padding:10px;background:#25364a;border:2px solid #78b7b6}
body.game-mode .storage-console .storage-controls label{min-width:0}
body.game-mode .storage-console .storage-controls label>span{font-size:14px;color:#dbe7ef}
body.game-mode .storage-console .storage-controls :is(input,select){width:100%;min-width:0;min-height:44px;border:1px solid #91c9c2;border-radius:0;background:#162c3d;color:#fff6df;font-size:16px}
body.game-mode .storage-console .storage-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;align-content:start}
body.game-mode .storage-console .reserve-card{display:flex;flex-direction:column;position:relative;align-items:center;gap:5px;min-height:200px;padding:12px 9px 10px;text-align:center;background:linear-gradient(135deg,#50728d40 0 40%,transparent 40%),#263d53;border:2px solid #7ebebd;border-radius:0;box-shadow:inset 0 -4px #132538;color:#fff5de}
body.game-mode .storage-console .reserve-card.selected{border-color:#ffda90;box-shadow:inset 0 0 0 2px #9b794a,inset 0 -4px #142739;background-color:#35575d}
body.game-mode .storage-console .reserve-card.fainted{background-color:#51364d;border-color:#bd859f}
body.game-mode .storage-console .reserve-card .roster-row__slot{position:absolute;left:7px;top:7px;font:600 16px/1 Pixelify,monospace;color:#b7eee2}
body.game-mode .storage-console .reserve-card>.sprite{width:64px;height:64px;flex-basis:auto;margin:3px 0;image-rendering:pixelated}
body.game-mode .storage-console .roster-row__main{display:flex;flex-direction:column;align-items:stretch;width:100%;min-width:0;gap:4px}
body.game-mode .storage-console .roster-row__name{display:block;min-width:0;margin:0}
body.game-mode .storage-console .reserve-card .roster-row__name strong{font:600 23px/1.05 Pixelify,monospace;white-space:normal;overflow-wrap:anywhere;color:#fff5de}
body.game-mode .storage-console .roster-row__species{font-size:13px;line-height:1.3;margin:0;color:#d5e5ec}
body.game-mode .storage-console .roster-row__types{display:none}
body.game-mode .storage-console .roster-row__health{display:flex;flex-direction:column;gap:4px;margin:2px 0}
body.game-mode .storage-console .roster-row__health .health-track{width:100%;height:9px}
body.game-mode .storage-console .roster-row__health>span{font-size:14px;line-height:1.2}
body.game-mode .storage-console .roster-row__location{font-size:12px;line-height:1.3;margin:0;color:#d3e6e8}
body.game-mode .storage-console .roster-row__arrow{display:none}
body.game-mode .storage-console .roster-shiny{display:inline-block;margin:2px;font-size:12px;color:#ffe49a}
body.game-mode .storage-console .storage-result-heading h2{font:600 26px/1.1 Pixelify,monospace;color:#ffdda1}
body.game-mode .storage-console .storage-pagination{margin:10px 0;padding:0 8px;min-height:46px}
body.game-mode .storage-console .storage-pagination :is(.text-button,span){font-size:14px}
body.game-mode .storage-console .roster-detail__backbar{background:#213648f5;border-bottom:2px solid #76bcb6}
body.game-mode .storage-console .roster-back{font:600 23px/1.1 Pixelify,monospace;min-height:44px}
body.game-mode .storage-console .roster-identity>.sprite{width:120px;height:120px;flex-basis:120px}

/* The field guide is a species index; the PC stores individual companions. */
body.game-mode .game-collection .guide-console{background:#142c39;color:#f5eee0;padding:16px 22px 24px}
body.game-mode .game-collection .page-heading{padding:0 0 12px;margin:0 0 10px;border-bottom:3px double #78c8bd;gap:12px}
body.game-mode .game-collection .page-heading h1{font:600 34px/1.1 Pixelify,monospace;color:#fff0cf;margin:0}
body.game-mode .game-collection .page-heading p{font-size:14px;line-height:1.5;margin-top:5px;color:#d4e3ea}
body.game-mode .game-collection .page-heading .eyebrow{display:none}
body.game-mode .game-collection .collection-total strong{font:600 32px/1 Pixelify,monospace;color:#ffdd98}
body.game-mode .game-collection .management-links{margin:0 0 12px;gap:8px}
body.game-mode .game-collection .management-links .button{min-height:44px;font-size:14px}
body.game-mode .game-collection .collection-toolbar{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(120px,.5fr);padding:10px;margin-bottom:14px;gap:10px;background:#26374d;border:2px solid #7db9bb}
body.game-mode .game-collection .collection-toolbar .segmented button{font-size:14px;min-height:44px;padding:8px 12px}
body.game-mode .game-collection .collection-toolbar :is(input,select){font-size:16px;min-height:44px;border-radius:0;background:#172f3f;color:#fff6de}
body.game-mode .game-collection .dex-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,30%);gap:16px;align-items:start}
body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
body.game-mode .game-collection .dex-card{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-height:112px;padding:20px 5px 9px;gap:5px;border-radius:0;background:linear-gradient(135deg,#44668050 0 45%,transparent 45%),#273e54;border:2px solid #70a7af;box-shadow:inset 0 -3px #122b39}
body.game-mode .game-collection .dex-card .sprite{width:48px;height:48px;margin:0;flex-basis:auto}
body.game-mode .game-collection .dex-card strong{font:600 14px/1.15 var(--body);text-shadow:none;color:#fff4df;min-height:16px;overflow-wrap:anywhere}
body.game-mode .game-collection .dex-card>span:last-child{display:none}
body.game-mode .game-collection .dex-card .dex-number{font-size:12px;top:5px;left:6px;color:#cce9ea}
body.game-mode .game-collection .dex-card .caught-mark{top:5px;right:5px;color:#ffdc98}
body.game-mode .game-collection .dex-detail{position:sticky;top:0;max-height:none;border-radius:0;background:#25384b;border:3px double #81c9bf;padding:2px}
body.game-mode .game-collection .detail-art{height:160px;min-height:0;background:radial-gradient(ellipse at 50% 70%,#8cc5b33b 0 35%,transparent 36%),#263e50}
body.game-mode .game-collection .detail-art .detail-sprite{width:120px;height:120px}
body.game-mode .game-collection .detail-content{padding:16px}
body.game-mode .game-collection .detail-content h2{font:600 32px/1.1 Pixelify,monospace;color:#ffdda3}
body.game-mode .game-collection .detail-content p{font-size:14px;line-height:1.6;color:#dbe5ed}
body.game-mode .game-collection .guide-return{min-height:44px;font-size:14px}
body.game-mode .game-collection .guide-owned .button{min-height:48px}
body.game-mode .game-collection .guide-empty{grid-column:1/-1;font-size:14px;padding:20px;border:2px solid #7fa9b2;background:#26394c;color:#fff3dc}

/* Dialogs are field instruments, with cost and state text kept in plain type. */
body.game-mode .modal{background:#252b40;color:#fff4de;padding:20px;border:3px double #91e0ce;border-radius:0}
body.game-mode .modal .modal-heading{background:linear-gradient(120deg,#284858,#2d3049);border-bottom:3px double #83cabb;margin:-2px -2px 16px;padding:8px 2px 14px;gap:12px}
body.game-mode .modal .modal-heading h2{font:600 30px/1.1 Pixelify,monospace;color:#fff2d4;overflow-wrap:anywhere}
body.game-mode .modal :is(p,li){font:400 14px/1.6 var(--body);color:#dce5ed}
body.game-mode .modal :is(.settings-row,.settings-save,.sound-settings,.shop-item,.learned-move,.held-item,.training-panel,.replacement-incoming){border-color:#6d9da9;border-radius:0;background:#243c50;color:#fff4de}
body.game-mode .modal .settings-row{padding:14px 0;background:none}
body.game-mode .modal .settings-row strong{font-size:16px;color:#fff3d5}
body.game-mode .modal .settings-row small{font-size:14px;line-height:1.4;color:#cddde7}
body.game-mode .modal .settings-save{padding:16px;border:2px solid #709eaa;margin-top:20px}
body.game-mode .modal .settings-save>strong{font:600 24px/1.1 Pixelify,monospace;color:#ffdda0}
body.game-mode .modal .settings-save>div{display:flex;flex-wrap:wrap;gap:10px}
body.game-mode .modal .sound-settings{padding:12px;border:1px solid #6e99a4}
body.game-mode .modal .sound-settings label{font-size:14px;color:#e3ebef}
body.game-mode .modal .toggle{min-width:52px;min-height:44px;border-radius:0;border-color:#8db8bc;background:#172e3e}
body.game-mode .modal .toggle.on{background:#386c66;border-color:#a4f3db}
body.game-mode .modal .toggle i{border-radius:0;background:#e3efe7}
body.game-mode .modal input[type=range]{padding:0;min-height:44px;accent-color:#ffcf82}
body.game-mode .modal .shop-list{display:grid;gap:10px}
body.game-mode .modal .shop-item{border:2px solid #7cb5b9;min-height:84px;padding:12px;gap:12px}
body.game-mode .modal .shop-item strong{font:600 24px/1.1 Pixelify,monospace;color:#fff3d4}
body.game-mode .modal .shop-item small{font-size:14px;line-height:1.4;color:#d5e4ed}
body.game-mode .modal .shop-price{color:#ffdb96;font-size:18px;white-space:nowrap}
body.game-mode .modal .shop-price small{font-size:12px;color:#e9dda9}
body.game-mode .modal .shop-symbol{color:#b7eee0;background:#1c3246;border-radius:0;border:1px solid #729da9}
body.game-mode .modal .shop-note{padding:12px;border-left:3px solid #ffce7c;background:#2d364a}
body.game-mode .modal .research-intro p{color:#dce5ed}
body.game-mode .modal:has(.research-intro){background:#252b40;color:#fff4de}
body.game-mode .modal:has(.research-intro) .modal-heading{background:#263d50}
body.game-mode .modal:has(.research-intro) .modal-heading h2{color:#fff3d4}
body.game-mode .modal .research-intro h3{font:600 29px/1.1 Pixelify,monospace;color:#ffdc99}
body.game-mode .modal .research-intro .research-intro__reward{background:#243e51;border:2px solid #7ab8b4;color:#dbe9eb;padding:12px;font-size:14px}
body.game-mode .modal .research-intro .text-button{color:#ffdb99;min-height:44px;font-size:14px}
body.game-mode .modal .help-quickstart{display:grid;gap:12px;margin:12px 0 18px}
body.game-mode .modal .help-quickstart>div{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;padding:14px;border:2px solid #77b7b4;background:linear-gradient(125deg,#38536a44 0 25%,transparent 25%),#23394c}
body.game-mode .modal .help-quickstart b{font:600 28px/1 Pixelify,monospace;color:#ffda95}
body.game-mode .modal .help-quickstart strong{display:block;font:600 24px/1.1 Pixelify,monospace;color:#fff0cd;margin-bottom:5px}
body.game-mode .modal .help-quickstart p{margin:0}
body.game-mode .modal .help-more{margin:12px 0;border-top:1px solid #779ba8}
body.game-mode .modal .help-more>summary{min-height:48px;display:flex;align-items:center;color:#ffdb96;font-size:16px;font-weight:700}
body.game-mode .modal .help-mechanics{background:none;border:0;padding:0}
body.game-mode .modal .help-mechanics strong{color:#ffdc99;font-size:16px}
body.game-mode .modal :is(.learned-move,.replacement-grid>button){border:2px solid #7ab5b5;border-radius:0;background:#233a50;padding:14px;color:#fff2d3}
body.game-mode .modal .learned-move strong{font:600 25px/1.1 Pixelify,monospace;color:#fff0cd}
body.game-mode .modal .learned-move :is(.move-facts,small){font-size:14px;color:#dbe6e9}
body.game-mode .modal .replacement-grid :is(strong,b){color:#ffe0a0}
body.game-mode .modal .replacement-grid small{font-size:14px;color:#d7e3ea}
body.game-mode .modal :is(.button,.text-button){min-height:44px;white-space:normal;font-size:14px}
body.game-mode .modal .danger{color:#ffb7b0}
body.game-mode .modal .battle-log{border-left:2px solid #6ea5ad;padding-left:12px}
body.game-mode .modal .battle-log p{border-color:#536e82;padding:9px 0}
body.game-mode .modal :is(.held-item-card,.training-summary,.training-stats>div,.condition-side,.condition-monster,.care-picker>button,.care-status,.care-moves){background:#233b50;border-color:#79afb4;border-radius:0;color:#fff1d8}
body.game-mode .modal :is(.held-item-card,.training-summary,.condition-monster,.care-status) :is(strong,h3){color:#ffe0a4}
body.game-mode .modal :is(.held-item-card,.training-summary,.condition-monster,.care-status) :is(small,span){color:#dbe5ed;font-size:14px}
body.game-mode .modal :is(.care-picker>button,.held-item-card){min-height:64px}
body.game-mode .modal .care-picker>button.selected{border-color:#ffd894;box-shadow:inset 0 0 0 1px #c49555;background:#315258}
body.game-mode .modal :is(.care-action small,.care-move,.care-moves-heading,.care-reason,.supply-fine){font-size:14px;line-height:1.5;color:#d9e5ed}
body.game-mode .modal .care-action{padding:14px;gap:8px;min-height:72px}
body.game-mode .modal .care-action strong{font-size:16px;color:#fff2d5}
body.game-mode .modal .care-move b{color:#b6efd0}
/* Change the capture palette only: recent special-capture geometry and rules stay. */
body.game-mode .capture-area{background:#292d44;color:#fff2d7;border-color:#7dc6bd}
body.game-mode .capture-area .controls-heading strong{color:#ffdda0}
body.game-mode .capture-area .controls-heading span{color:#dbe7ed}
body.game-mode .capture-area .text-button{color:#ffe0a4;border-color:#82b8ba}
body.game-mode .capture-area .capture-readiness>div{background:#203c4f;border-color:#709faa;color:#fff3de}
body.game-mode .capture-area .capture-readiness :is(span,small){color:#d4e5eb}
body.game-mode .capture-area .capture-readiness strong{color:#fff1d4}
body.game-mode .capture-area .capture-readiness strong.positive{color:#b7f3cb}
body.game-mode .capture-area .capture-advice{background:#243e4e;color:#ecf2ea;border-color:#76aaa9}
body.game-mode .capture-area .capture-advice p{color:#e0e9ee}
body.game-mode .capture-area .capture-advice.warning{background:#453746;border-color:#d8ad80}
body.game-mode .capture-area .capture-card{background:#254658;color:#fff4db;border-color:#7ab4b4;border-radius:0}
body.game-mode .capture-area .capture-card :is(strong,b){color:#ffe1a5}
body.game-mode .capture-area .capture-card :is(small,.capture-orb){color:#d7e8ed}
body.game-mode .capture-area .visitor-requirements p{background:#263c50;color:#eff0df;border-color:#89b7b1}
body.game-mode .capture-area .capture-shield-note{color:#e1e6ee}
@media(max-width:1100px){
 body.game-mode .storage-console .storage-list{grid-template-columns:repeat(4,minmax(0,1fr))}
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:700px){
 body.game-mode .storage-console .roster-console__header{padding:6px 10px}
 body.game-mode .storage-console .roster-tabs{gap:8px}
 body.game-mode .storage-console .roster-tabs button{font:600 21px/1.1 Pixelify,monospace;min-height:44px;gap:5px}
 body.game-mode .storage-console .roster-context{font-size:12px}
 body.game-mode .storage-console .roster-console__summary p{font-size:13px}
 body.game-mode .storage-console .storage-master{padding:10px}
 body.game-mode .storage-console .storage-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:9px}
 body.game-mode .storage-console .storage-search{grid-column:1/-1}
 body.game-mode .storage-console .storage-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body.game-mode .storage-console .reserve-card{min-height:192px;padding:9px 8px}
 body.game-mode .storage-console .reserve-card .roster-row__name strong{font:700 16px/1.2 var(--body)}
 body.game-mode .storage-console .roster-row__species{font-size:13px}
 body.game-mode .storage-console .roster-row__location{font-size:12px}
 body.game-mode .storage-console.roster-console--detail .roster-detail{padding:0 10px 20px}
 body.game-mode .storage-console .roster-identity>.sprite{width:84px;height:94px;flex-basis:84px}
 body.game-mode .game-collection .guide-console{padding:10px}
 body.game-mode .game-collection .page-heading{margin-bottom:10px;gap:8px}
 body.game-mode .game-collection .page-heading h1{font-size:27px}
 body.game-mode .game-collection .page-heading p{font-size:13px}
 body.game-mode .game-collection .collection-total strong{font-size:27px}
 body.game-mode .game-collection .collection-total small{font-size:10px}
 body.game-mode .game-collection .collection-toolbar{grid-template-columns:minmax(0,1fr) minmax(90px,.6fr);gap:8px;padding:8px}
 body.game-mode .game-collection .collection-toolbar .segmented{grid-column:1/-1;display:flex}
 body.game-mode .game-collection .collection-toolbar .segmented button{flex:1;font-size:14px;padding:8px 5px}
 body.game-mode .game-collection .dex-layout{display:block}
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 body.game-mode .game-collection .dex-card{min-height:103px;padding:18px 3px 7px;gap:4px}
 body.game-mode .game-collection .dex-card .sprite{width:42px;height:45px}
 body.game-mode .game-collection .dex-card strong{font-size:13px}
 body.game-mode .game-collection .guide-console.guide--detail :is(.page-heading,.management-links,.collection-toolbar,.dex-grid){display:none}
 body.game-mode .game-collection .guide-console:not(.guide--detail) .dex-detail{display:none}
 body.game-mode .game-collection .guide-console.guide--detail .dex-detail{display:block;position:static}
 body.game-mode .modal{padding:16px;max-width:calc(100vw - 20px)}
 body.game-mode .modal .modal-heading h2{font-size:26px}
 body.game-mode .modal .shop-item{gap:8px;padding:10px}
 body.game-mode .modal .shop-symbol{display:none}
 body.game-mode .modal .help-quickstart>div{padding:12px;gap:8px;grid-template-columns:26px minmax(0,1fr)}
}
@media(max-width:350px){
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.game-mode .storage-console .roster-tabs button{font-size:19px}
 body.game-mode .storage-console .roster-tabs button span{font-size:11px}
}
@media(max-height:500px) and (min-width:701px){
 body.game-mode .storage-console .roster-console__summary{display:none}
 body.game-mode .storage-console .roster-console__header{padding:4px 12px}
 body.game-mode .storage-console .storage-master{padding:8px 12px 18px}
 body.game-mode .storage-console .storage-controls{padding:6px;gap:8px}
 body.game-mode .storage-console .reserve-card{min-height:185px}
 body.game-mode .game-collection .guide-console{padding:10px 16px}
 body.game-mode .game-collection .page-heading p{display:none}
}

/* Counter and filters use compact real rows; bar tracks never shrink in flex. */
body.game-mode .storage-console .reserve-card .roster-row__health .health-track{display:block;flex:none;width:100%;height:10px;min-height:10px;border:2px solid #d3e7d5;background:#102738}
body.game-mode .storage-console .reserve-card .roster-row__health .health-track i{display:block;height:100%}
body.game-mode .game-collection .page-heading{display:flex;align-items:center;justify-content:space-between}
body.game-mode .game-collection .page-heading>div:first-child{flex:1;min-width:0}
body.game-mode .game-collection .page-heading .collection-total{flex:none;text-align:right;margin:0}
body.game-mode .game-collection .collection-toolbar>*{order:initial;min-width:0}
body.game-mode .game-collection .collection-toolbar .search-box{grid-column:auto;order:1}
body.game-mode .game-collection .collection-toolbar>label:not(.search-box){order:2}
body.game-mode .game-collection .collection-toolbar input::placeholder{color:#c3dce1}
body.game-mode .modal :is(.held-item-library>article,.ev-training-grid>div,.condition-combatants>article){background:#233b50;border:2px solid #77aeb4;border-radius:0;padding:14px;color:#fff1d8}
body.game-mode .modal :is(.held-item-library>article,.ev-training-grid>div,.condition-combatants>article) strong{color:#ffe0a4;font-size:18px}
body.game-mode .modal :is(.held-item-library>article,.ev-training-grid>div,.condition-combatants>article) :is(small,span){color:#dbe5ed;font-size:14px}
body.game-mode .modal .training-budget{padding:12px;background:#2c4054;border:2px solid #80b9b7}
body.game-mode .modal .training-budget strong{color:#ffdda2;font:600 27px/1.1 Pixelify,monospace}
@media(max-width:700px){
 body.game-mode .game-collection .page-heading{gap:12px}
 body.game-mode .game-collection .page-heading p{margin:0;font-size:14px;line-height:1.4}
 body.game-mode .game-collection .collection-toolbar .segmented{order:0}
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.game-mode .game-collection .dex-card strong{font-size:14px}
 body.game-mode .game-collection .dex-card{min-height:109px}
}
body.game-mode .storage-console :is(.roster-identity,.loadout-card,.complete-stats>div){border-radius:0}
body.game-mode .storage-console .roster-detail__tools{grid-template-columns:repeat(4,minmax(0,1fr))}
body.game-mode .storage-console .roster-detail__tools .button{font-size:14px;min-height:44px}
@media(max-width:700px){body.game-mode .storage-console .roster-detail__tools{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* R2: short screens keep words and complete action targets intact. */
body.game-mode .modal .modal-heading{display:flex;align-items:flex-start;flex-wrap:nowrap}
body.game-mode .modal .modal-heading h2{flex:1;min-width:0;max-width:none;white-space:normal;word-break:normal;overflow-wrap:normal;margin:4px 0 0}
body.game-mode .modal .modal-heading .icon-button{flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:8px}
body.game-mode .modal .help-quickstart>div{grid-template-columns:38px minmax(0,1fr);gap:10px}
body.game-mode .game-collection .guide-empty .text-button{min-height:44px;min-width:100px;font-size:14px}
body.game-mode .game-collection .management-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
body.game-mode .game-collection .management-links .button{padding:8px 10px;min-height:44px}
body.game-mode .game-collection .collection-toolbar .search-box{display:block;width:100%;min-width:0}
body.game-mode .game-collection .collection-toolbar .search-box input{width:100%;min-width:0;padding:9px 10px}
body.game-mode .game-collection .collection-toolbar>label:not(.search-box){grid-column:auto;width:100%;min-width:0}
body.game-mode .game-collection .collection-toolbar>label:not(.search-box) select{width:100%;min-width:0}
@media(max-width:350px){
 body.game-mode .game-window__heading h1{font-size:22px;line-height:1.1;word-break:normal;overflow-wrap:normal}
 body.game-mode .game-window__heading>div{min-width:0}
 body.game-mode .game-window__close.icon-button{padding:7px;gap:5px;max-width:121px}
 body.game-mode .game-window__close .game-window__back-label{font-size:12px;max-width:80px;line-height:1.25;white-space:normal}
}
/* R3: the arrow carries Back on the narrowest screens; keep its destination. */
@media(max-width:350px){
 body.game-mode .game-window__back-prefix{display:none}
 body.game-mode .game-collection .management-links .button{font-size:13px;line-height:1.3;white-space:normal;min-width:0;padding:8px 6px;gap:4px}
 body.game-mode .game-collection .management-links .button .icon{display:none}
}
/* Bag and replacement choices are the same console as Fight and Catch. */
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag,.tactical-switch){background:#292d44;color:#fff3dc;border-color:#80c9c1}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag,.tactical-switch) .controls-heading strong{color:#ffe0a4}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag,.tactical-switch) .controls-heading span{color:#dbe7ed}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag,.tactical-switch) .controls-heading .text-button{color:#ffdda0;border-color:#8abebd}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag) .capture-card{background:#254256;color:#fff1d5;border:2px solid #7faeb5;border-radius:0}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag) .capture-card strong{color:#ffe0a1}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag) .capture-card small{color:#dce6eb}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag) .capture-card:disabled{opacity:1;background:#2d384e;border-color:#6c8497}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag) .bag-hint{background:#253b4f;color:#dbe5ed;border-color:#739eab}
body.game-mode .battle-shell :is(.recovery-bag,.survival-bag) .bag-hint :is(strong,span){color:#dfe9ed}
body.game-mode .battle-shell .tactical-switch .tactical-card{background:linear-gradient(125deg,#42607733 0 40%,transparent 40%),#263e53;border:2px solid #7db9b6;border-radius:0;box-shadow:inset 0 -3px #14273b;color:#fff1d9}
body.game-mode .battle-shell .tactical-switch .tactical-card.selected{background:#345358;border-color:#e4c38a}
body.game-mode .battle-shell .tactical-switch .tactical-card:disabled{opacity:1;background:#29394e;border-color:#738f9f}
body.game-mode .battle-shell .tactical-switch .switch-identity strong{color:#fff2d4}
body.game-mode .battle-shell .tactical-switch .switch-identity small{color:#d5e4ed;font-size:14px;line-height:1.3}
body.game-mode .battle-shell .tactical-switch .switch-forecast{border-color:#628395}
body.game-mode .battle-shell .tactical-switch .switch-forecast :is(span,small){color:#d7e6eb;font-size:14px;line-height:1.4}
body.game-mode .battle-shell .tactical-switch .switch-forecast .risk{color:#ffbdae}
body.game-mode .battle-shell .tactical-switch .switch-note{color:#d6e5ed;font-size:14px;line-height:1.4}
/* Sticky submenus keep their dark surface at every viewport. This overrides
   older compact/capture headers without changing their position or sizing. */
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area:is(.capture-area,.recovery-bag,.survival-bag,.tactical-switch) .controls-heading{background:#292d44;color:#fff2d8}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area:is(.capture-area,.recovery-bag,.survival-bag,.tactical-switch) .controls-heading strong{color:#ffe0a4}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area:is(.capture-area,.recovery-bag,.survival-bag,.tactical-switch) .controls-heading>div>span{color:#dbe7ed}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area:is(.capture-area,.recovery-bag,.survival-bag,.tactical-switch) .controls-heading .text-button{color:#ffdda0;border-color:#8abebd}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .capture-area.visitor-capture .visitor-requirements{background:#263e51;border-color:#8abcb7;border-radius:0}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .capture-area.visitor-capture .visitor-requirements p{background:transparent;color:#eff4de}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .capture-area.visitor-capture .capture-advice{background:#253f50;border-color:#7eb3b4}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .capture-area.visitor-capture .capture-advice.warning{background:#453746;border-color:#d8ad80}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .capture-area.visitor-capture .capture-advice p{color:#e0e9ee}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .capture-area.visitor-capture .capture-advice .text-button{color:#ffdda0}
/* Capture's older compact skin has more specific selectors than generic
   menus. Keep the whole decision surface, not just its header, in night ink. */
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area{background:#292d44;color:#fff2d8;border-color:#80c9c1}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-readiness{background:#233c50;border-color:#78aaa9;color:#e4eced}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-readiness>div{background:transparent;border-color:#648b9c;color:#e4eced}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-readiness :is(span,small){color:#d5e5ec}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-readiness strong{color:#fff1d2}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-readiness strong.positive{color:#b8f2cb}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .visitor-decision{background:transparent;color:#e2e9ed}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-advice{background:#253e50;color:#e1e9ed;border-color:#7eb3b4}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-advice.warning{background:#453746;border-color:#d8ad80}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-advice p{color:#e0e9ee}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area [data-action=prepare-catch]{background:#2c5064;border:1px solid #93c7bd;border-radius:0;color:#ffdfa4}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area [data-action=prepare-catch]:hover:not(:disabled){background:#375d70;color:#ffe5b3;border-color:#ffda94}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area [data-action=prepare-catch] small{font-size:14px;color:#d9e8ed}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-options{background:transparent}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-card{background:#26495b;border-color:#89b9ba;border-radius:0;color:#fff2d9}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-card :is(strong,b){color:#ffe1a3}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-card :is(small,.capture-orb){color:#d9e7ed}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-card:disabled{opacity:1;background:#2e3d51;border-color:#698797;color:#c5d5df}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-card:disabled :is(strong,b,small){color:#c5d5df}
body.game-mode:has(.battle-shell)[data-battle-format] .battle-shell .action-area.capture-area .capture-shield-note{color:#dce5ed;font-size:14px;line-height:1.4}
/* Submenus stay in the command lane reserved by the existing arena layout.
   Overflow belongs inside the menu so both combatants' HP remains visible. */
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area:is(.capture-area,.tactical-switch,.recovery-bag,.survival-bag){height:var(--game-dock-height);min-height:0;max-height:var(--game-dock-height);overflow:auto;overscroll-behavior:contain}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area:is(.tactical-switch,.recovery-bag,.survival-bag)>.controls-heading{position:sticky;top:-9px;z-index:2;flex:none}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area:is(.tactical-switch,.recovery-bag,.survival-bag)>:is(.switch-grid,.capture-options,.switch-note,.bag-hint){flex:none}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.controls-heading{position:sticky;top:-9px;z-index:2;flex:none;margin:0}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-readiness{display:none}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>:is(.capture-advice,.capture-options,.capture-shield-note){flex:none}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-options>.capture-card:not(:disabled),
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-grid>.switch-card:not(:disabled){order:-1}
@media(min-width:701px), (min-width:480px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture){display:grid;grid-template-columns:minmax(220px,1fr) minmax(0,1.3fr);grid-template-rows:auto minmax(0,1fr);gap:8px 14px;overflow:hidden}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.controls-heading{position:static;grid-column:1;grid-row:1;min-width:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-advice{grid-column:1;grid-row:2;min-height:0;overflow:auto;margin:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-options{grid-column:2;grid-row:1/3;min-height:0;overflow:auto;align-content:start;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card{min-height:100px;padding:8px;gap:7px;align-items:center}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture):has(.capture-shield-note){grid-template-rows:auto minmax(0,1fr) auto}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-shield-note{grid-column:1/-1;grid-row:3;margin:0}
}
/* Give each desktop capsule a complete row inside its reserved right pane.
   Percentage captions wrap within their own column instead of crossing cards. */
@media(min-width:701px), (min-width:480px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-options{grid-template-columns:minmax(0,1fr)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card{display:grid;grid-template-columns:minmax(0,1fr) 80px;min-width:0;min-height:64px;padding:6px 8px;gap:6px;align-items:center}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card>.capture-orb{display:none}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card>span{min-width:0;white-space:normal;overflow-wrap:anywhere}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card strong{font:600 22px/1.1 Pixelify,monospace;white-space:normal;overflow-wrap:anywhere}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card>b{min-width:0;white-space:normal;overflow-wrap:normal;font-size:22px;line-height:1.2;text-align:right}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card>b small{display:block;white-space:normal;overflow-wrap:normal;font-size:14px;line-height:1.2;letter-spacing:0}
}
/* Tall tablets need the whole command width, just as portrait phones do.
   The shared dock variable reserves the matching HP/arena lane above it. */
@media(min-width:701px) and (max-width:1100px) and (min-height:501px){
 body.game-mode[data-battle-format=singles]:has(.battle-shell .capture-area){--game-dock-height:clamp(200px,30dvh,240px)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area{left:var(--game-gutter);right:var(--game-gutter);width:auto}
 body.game-mode:has(.battle-shell .capture-area)[data-battle-format=singles] .battle-shell :is(.battle-message,.battle-bottom){visibility:hidden}
}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area .capture-card>span{min-width:0;white-space:normal}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area .capture-card>b{min-width:0;white-space:normal;overflow-wrap:normal}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area .capture-card>b small{white-space:normal;overflow-wrap:normal;letter-spacing:0}
/* A full odds caption fits on one line in compact desktop rows. */
@media(min-width:701px), (min-width:480px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card{grid-template-columns:minmax(0,1fr) 112px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card>b small{white-space:nowrap}
}

/* Advice is a readable paragraph followed by its complete turn-spending action.
   Each pane may scroll inside the reserved command lane. */
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-advice{display:block;padding:6px;min-width:0}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-advice p{font:500 14px/1.35 var(--body);margin:0;min-width:0;white-space:normal;overflow-wrap:normal}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-advice [data-action=prepare-catch]{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:2px 6px;width:100%;max-width:100%;min-width:0;min-height:44px;padding:4px 6px;margin-top:6px;white-space:normal;font:700 14px/1.3 var(--body)}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-advice [data-action=prepare-catch] small{display:block;flex-basis:100%;margin:0;font:600 14px/1.2 var(--body)}
/* Narrow landscape uses separate stationary header and capsule panes as well.
   Touch utilities occupy one top rail, clear of either creature's name. */
@media(min-width:480px) and (max-width:700px) and (max-height:500px){
 body.game-mode:has(.battle-shell .capture-area)[data-battle-format=singles]{--game-dock-height:160px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area{left:var(--game-gutter);right:var(--game-gutter);width:auto;padding:10px}
 body.game-mode:has(.battle-shell .capture-area)[data-battle-format=singles] .battle-shell :is(.battle-message,.battle-bottom,.wild-label){visibility:hidden}
}
@media(pointer:coarse) and (min-width:480px) and (max-width:700px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-heading>div:last-child{left:126px;top:10px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-field-strip{left:270px;right:auto;top:10px;bottom:auto;width:125px;max-width:125px}
}
/* At the narrow landscape boundary, leave enough room for complete advice
   actions. Protected requirements stay in their own column while its adjacent
   preparation/capsules scroll together, never underneath that header. */
@media(min-width:480px) and (max-width:700px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture){grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area>.controls-heading{display:grid;grid-template-columns:minmax(0,1fr) 82px;gap:5px 8px;align-items:start}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area>.controls-heading strong{font:700 16px/1.25 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area>.controls-heading>div>span{font:500 14px/1.35 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area>.controls-heading>.text-button{min-width:0;min-height:44px;padding:4px;font:600 14px/1.25 var(--body);white-space:normal}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);grid-template-rows:auto auto;gap:8px 10px;overflow:auto;align-items:start}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture>.controls-heading{grid-column:1;grid-row:1/3;position:sticky;top:0;align-self:start;min-width:0;padding:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture>.visitor-decision{grid-column:2;grid-row:1;min-width:0;min-height:0;overflow:visible}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-advice{margin:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture>.capture-options{grid-column:2;grid-row:2;min-width:0;overflow:visible;grid-template-columns:minmax(0,1fr);gap:7px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card{display:grid;grid-template-columns:minmax(0,1fr) 100px;min-width:0;min-height:64px;padding:6px;gap:6px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card>.capture-orb{display:none}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card strong{font:700 16px/1.2 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card small{font:500 14px/1.2 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card>b{font:700 20px/1.1 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card>b small{display:block;white-space:normal;font:500 12px/1.1 var(--body)}
}
/* A capsule row grows with its label rather than painting into the next row.
   Protected right-side content has intrinsic tracks owned by the parent scroll. */
@media(min-width:480px) and (max-width:700px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-options{grid-auto-rows:max-content}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card{height:auto;min-height:100px;max-height:none;align-self:start}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture) .capture-card strong{font:600 20px/1.1 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture{grid-template-rows:max-content max-content}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture>:is(.visitor-decision,.capture-options){height:auto;max-height:none;min-height:min-content}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture>.capture-options{grid-auto-rows:max-content}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture .capture-card{height:auto;max-height:none;align-self:start}
}
/* Show portrait players the actual throw choices on opening Catch. Optional
   weakening guidance follows them and remains reachable in the same scroll. */
@media(max-width:700px) and (min-height:501px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.controls-heading{order:-2}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area:not(.visitor-capture)>.capture-options{order:-1}
}
