/* Phone refinements; desktop keeps its existing columns and compact controls. */
.mass-mobile-requirement{display:none}
@media(max-width:700px){
  body main,body .view,body .panel{min-width:0}
  body .settlement-name-row h1{min-width:0;overflow-wrap:anywhere}
  body .town-panel .panel-heading{flex-wrap:wrap;gap:8px}
  body .town-panel .panel-heading h2{min-width:0;overflow-wrap:anywhere}
  body dialog{max-width:calc(100vw - 24px);max-height:88dvh;overflow:auto;overscroll-behavior:contain}
  body :is(input,select,textarea){font-size:16px;max-width:100%;box-sizing:border-box}
  body :is(#keepManagerContent,#massRecruitContent,#massTransfersContent)>.panel{padding:14px}
  body :is(#keepManagerContent,#massRecruitContent,#massTransfersContent) .panel-heading{flex-wrap:wrap;gap:10px}
  body :is(#keepManagerContent,#massRecruitContent,#massTransfersContent) .panel-heading h1{font-size:1.5rem;overflow-wrap:anywhere}
  body :is(#keepManagerContent,#massRecruitContent,#massTransfersContent) button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
  body :is(#keepManagerContent,#massRecruitContent,#massTransfersContent) :is(input,select){min-width:0}
  body :is(.keep-plan-editor,.mass-transfer-planning){grid-template-columns:minmax(0,1fr)}
  body .keep-plan-editor>section{min-width:0}
  body .keep-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  body .keep-upgrade-list li:not(.empty){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px}
  body .keep-upgrade-list .keep-drag{display:none}
  body .keep-upgrade-list li>span{overflow-wrap:anywhere}
  body .keep-upgrade-list li>div button{width:44px;min-width:44px;min-height:44px;padding:6px;font-size:18px}
  body .keep-template-bulk label{min-width:0;flex-basis:100%}
  body :is(.keep-plan-actions,.keep-bulk-actions,.mass-recruit-presets){gap:8px}
  body :is(.keep-plan-actions,.keep-bulk-actions,.mass-recruit-presets)>button{flex:1 1 140px;min-width:0}
  body .mass-recruit-presets label{width:100%;min-width:0}
  body :is(.mass-recruit-mix,.mass-transfer-resource-grid){grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  body .mass-recruit-mix label{min-width:0;padding:10px;overflow-wrap:anywhere}
  body .mass-recruit-mix input{width:calc(100% - 1.25em);max-width:100%}
  body .mass-recruit-targets input{width:100%}
  body :is(.mass-recruit-table-wrap,.mass-transfer-table-wrap){max-width:100%;min-width:0;overflow:visible}
  body :is(.mass-recruit-table,.mass-transfer-table){display:block;width:100%;min-width:0;max-width:100%;position:relative}
  /* Keep column headings accessible while showing field labels in each card. */
  body :is(.mass-recruit-table,.mass-transfer-table) thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body :is(.mass-recruit-table,.mass-transfer-table) tbody{display:grid;gap:14px}
  body :is(.mass-recruit-table,.mass-transfer-table) tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px;border:1px solid #49759d;border-radius:6px;background:#10263d;min-width:0}
  body :is(.mass-recruit-table,.mass-transfer-table) tbody th{grid-column:1/-1;min-width:0;padding:0 0 10px;border:0;border-bottom:1px solid #345878;overflow-wrap:anywhere}
  body :is(.mass-recruit-table,.mass-transfer-table) tbody th label{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:44px}
  body :is(.mass-recruit-table,.mass-transfer-table) tbody td{display:flex;flex-direction:column;gap:6px;min-width:0;max-width:none;padding:10px;border:1px solid #345878;border-radius:5px;overflow-wrap:anywhere}
  body :is(.mass-recruit-table,.mass-transfer-table) td[data-label]::before{content:attr(data-label);font-size:14px;font-weight:600;line-height:1.4;color:#dceafa}
  body :is(.mass-recruit-table,.mass-transfer-table) input[type=number]{width:100%;min-width:0;min-height:44px;font-size:16px}
  body :is(.mass-recruit-table,.mass-transfer-table) input[type=checkbox]{width:20px;height:20px;flex:0 0 20px}
  body :is(.mass-recruit-table,.mass-transfer-table) tbody :is(td.mass-budget-cell,td[colspan]){grid-column:1/-1}
  body .mass-recruit-table .mass-target-progress{min-width:0;max-width:none;font-size:14px;margin:0}
  body .mass-locked{font-size:14px}
  body .mass-mobile-requirement{display:block;font-size:14px;line-height:1.4;margin-top:4px}
  body :is(.mass-recruit-pages,.raid-pages){flex-wrap:wrap;gap:8px}
  body #massRecruitSubmit{width:100%}
  body .farm-unit-choices{grid-template-columns:repeat(9,minmax(150px,1fr));max-width:100%;min-width:0;overscroll-behavior-x:contain}
  body .farm-unit-choices label{min-height:54px}
  body .farm-unit-choices input,body .farm-outgoing-filter input{width:20px;height:20px;flex-basis:20px}
  body .farm-unit-actions button,body .farm-target-filters button,body .raid-target-actions button{min-height:44px}
  body .farm-target-filters label:not(.farm-outgoing-filter){flex:1 1 130px;min-width:0}
  body .farm-target-filters select{width:100%;min-width:0;min-height:44px}
  body .raid-assistant-controls label{min-width:0;width:100%}
  body .raid-target-actions button{flex:1 1 auto}
  body .incoming-support-source button,body .incoming-support-fill button,body .incoming-overview-actions button{min-height:44px;white-space:normal}
  body .incoming-overview-actions{gap:8px}
}
