/* v30: inline recruitment shares the same dock with the existing selection roster. */
footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:40px 192px 36px 18px}
footer#commandDock[data-panel=units] .unitbar{display:flex;flex-direction:column;height:192px;max-height:192px;gap:7px;padding:5px 0}
.unitbar .resident-toolbar{flex:0 0 36px;display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin;align-items:center}
.unitbar .resident-toolbar button{flex-shrink:0;min-height:34px;border:1px solid #aa996666;padding:6px 10px;font-size:13px;white-space:nowrap;background:#344d3c;color:#f4e6bd}
.unitbar .resident-toolbar #addResidents{min-height:34px;background:#344d3c;border-color:#aa996666;color:#f4e6bd;padding:6px 10px;font-size:13px}
.unitbar .resident-toolbar button[aria-pressed=true],.unitbar .resident-toolbar #addResidents[aria-pressed=true]{background:#f0d38f;border-color:#ffe9aa;color:#253a28;font-weight:750}
.unitbar .resident-toolbar #unitHousing{margin-left:auto;flex-shrink:0;font-size:12px;white-space:nowrap}
.unitbar .resident-toolbar #residentDetails{font-size:12px;min-width:34px;padding:6px 8px}
#recruitmentPane{display:flex;flex:1;min-height:0;min-width:0;flex-direction:column;gap:5px}
.recruitment-scroll{display:flex;gap:5px;min-height:0;flex:1}
.recruitment-scroll>button{align-self:stretch;width:28px;min-width:28px;min-height:44px;padding:0;background:#3d5340;border:1px solid #b2a07388;color:#ffedbb;font-size:16px;border-radius:5px}
.recruitment-scroll>button:disabled{opacity:1;color:#89977c;background:#2c4032;border-color:#66714c}
#quickResidents{display:flex;min-width:0;flex:1;gap:6px;overflow-x:auto;overflow-y:hidden;padding:2px 2px 5px;scrollbar-width:thin;scrollbar-color:#d1b36e #1d3226;overscroll-behavior-x:contain;touch-action:pan-x}
#quickResidents .recruit-card{position:relative;flex:0 0 150px;display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:40px minmax(22px,1fr) 19px;align-items:center;gap:3px 6px;min-width:0;min-height:99px;padding:7px 8px;border:1px solid #e2c67d;border-radius:7px;background:linear-gradient(#f3dfaa,#dfc184);color:#253b29;box-shadow:inset 0 1px #fff5d0;text-align:left;white-space:normal;font:12px/1.25 system-ui;cursor:pointer;touch-action:pan-x}
#quickResidents .recruit-card:disabled{opacity:1;background:linear-gradient(#d1d4bc,#b8bfa5);border-color:#8f9f7b;color:#3c4e3e;box-shadow:inset 0 1px #e3e6d2;cursor:not-allowed}
#quickResidents .recruit-card:hover:not(:disabled){background:#ffebb4;border-color:#fff4ce}
#quickResidents .recruit-card:active:not(:disabled){background:#f8cd74;transform:translateY(1px)}
.recruit-portrait{font-size:28px;text-align:center;line-height:1}.recruit-portrait img{display:block;width:32px;height:38px;object-fit:contain;filter:drop-shadow(0 2px 1px #32412f40)}
.recruit-heading{align-self:center;min-width:0}.recruit-heading strong{display:block;font-size:12px;line-height:1.2}.recruit-heading small{display:block;margin-top:3px;font-size:10px;color:#4b5a3b;font-weight:400}
.recruit-cost{grid-column:1/-1;font-size:11px;line-height:1.35;font-weight:650}
.recruit-reason{grid-column:1/-1;font-size:10px;line-height:1.2;font-weight:750;border-top:1px solid #6c784b44;padding-top:4px;align-self:end;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#quickResidents button:disabled .recruit-reason{color:#654b31}
#recruitmentStatus{min-height:18px;max-height:32px;overflow:auto;margin:0;padding:0 2px;font:12px/1.4 system-ui;color:#f8e7b6}
#residentRosterPane{display:grid;grid-template-columns:174px minmax(0,1fr);flex:1;gap:7px;min-height:0;min-width:0}
#residentRosterPane #unitRoster{padding:3px 0}.unitbar #residentRosterPane .unit-types{align-content:start}
#recruitmentPane[hidden],#residentRosterPane[hidden]{display:none}
.unitbar button:focus-visible{outline:3px solid #fff1b3;outline-offset:-3px}
footer#commandDock.dock-collapsed[data-panel=units] .unitbar{display:none}
@media(max-width:760px){footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:44px 192px 34px}#residentRosterPane{grid-template-columns:137px minmax(0,1fr)}.unitbar .resident-toolbar #unitHousing{font-size:11px}.unitbar .resident-toolbar button,.unitbar .resident-toolbar #addResidents{padding:6px 8px;font-size:12px}#quickResidents .recruit-card{flex-basis:146px}.recruitment-scroll{gap:3px}.recruitment-scroll>button{min-width:25px;width:25px}}
@media(max-height:570px){footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:36px 169px 29px}footer#commandDock[data-panel=units] .unitbar{height:169px;max-height:169px;padding:2px 0;gap:4px}.unitbar .resident-toolbar{flex-basis:30px}.unitbar .resident-toolbar button,.unitbar .resident-toolbar #addResidents{min-height:30px;padding-top:3px;padding-bottom:3px}#recruitmentStatus{font-size:11px;max-height:18px}#quickResidents .recruit-card{grid-template-rows:32px minmax(18px,1fr) 18px;min-height:91px;padding:5px 7px}.recruit-portrait img{height:32px}.recruit-heading small{margin-top:1px}}

/* v32: army actions scroll without shrinking touch controls. */
#armyRecruitBar{overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}#armyRecruitBar button{flex:0 0 auto;white-space:nowrap}#armySummary{flex-shrink:0}
#trainingBuilding{padding:15px;margin:12px 0;background:#eee7d0;border:1px solid #b89e62;border-radius:10px;color:#2d432f}#trainingBuilding[hidden]{display:none}#trainingBuilding h3{margin:0 0 10px}#trainingBuilding p{font-size:14px;line-height:1.5}#trainingBuilding button{min-height:44px;padding:9px 12px;font-size:14px;font-weight:700;background:#efd08c;color:#263b2b;border:1px solid #aa914b}#trainingBuilding button:disabled{background:#d8ddc8;color:#58664e;opacity:1}.trainee{display:grid;grid-template-columns:1fr auto;gap:7px;padding:10px 0;border-top:1px solid #b8bc9d}.trainee span,.trainee small{font-size:12px}.trainee progress{width:100%;height:9px;accent-color:#5c813e}.trainee span{grid-column:1/-1}#stopTraining{background:#e0e5d0!important}

#recruitmentConditions{flex:0 0 auto;max-height:32px;overflow:auto;margin:0 2px;color:#f7e7b7;font-size:12px;line-height:1.35}#lumberBuilding{padding:14px;margin:12px 0;border:1px solid #bca576;border-radius:12px;background:#faf0d7;color:#30432f}#lumberBuilding button{min-height:44px;margin:4px;background:#f3d791;color:#293e2b;border:1px solid #ad884b}#lumberBuilding button:disabled{opacity:.55}#lumberSummary{font-weight:650;line-height:1.65}

/* Reserve space for the explicit recruitment conditions without clipping cards. */
footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:40px 229px 36px 18px}footer#commandDock[data-panel=units] .unitbar{height:229px;max-height:229px}#lumberBuilding[hidden]{display:none}
@media(max-width:760px){footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:44px 229px 34px}}
@media(max-height:570px){footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:36px 206px 29px}footer#commandDock[data-panel=units] .unitbar{height:206px;max-height:206px}}

#quickResidents .recruit-card[data-action=train]:not(:disabled){background:linear-gradient(#edf0c8,#c7d69d);border-color:#f1d78a}#quickResidents .recruit-card[data-action=train]:not(:disabled) .recruit-reason{color:#294e29}

/* v36: complete recruitment requirements and a direct route to missing buildings. */
.resident-toolbar #residentDetails{width:auto;min-width:44px;padding:5px 8px;white-space:nowrap;font-size:12px}.recruit-checks{list-style:none;padding:0;margin:8px 0;font-size:12px;line-height:1.55}.recruit-checks .met{color:#376447}.recruit-checks .missing{color:#82451d;font-weight:650}#residentChoices .requirement-action{min-height:36px;padding:8px;background:#ead39a;border-color:#b19653;text-align:center}.resident-card .resident-description{line-height:1.45}

/* v37: reserve the help row and two readable reason lines at every dock size. */
footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:40px 305px 36px 18px}
footer#commandDock[data-panel=units] .unitbar{height:305px;max-height:305px}
#quickResidents .recruit-card-wrap .recruit-card{grid-template-rows:40px minmax(22px,1fr) minmax(30px,auto);min-height:128px;flex:1 0 auto}
.recruit-card-wrap .recruit-help{flex:0 0 36px}
@media(max-width:760px){footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:44px 305px 34px}}
@media(max-height:570px){footer#commandDock[data-panel=units]:not(.dock-collapsed),.kids footer#commandDock[data-panel=units]:not(.dock-collapsed){grid-template-rows:36px 237px 29px}footer#commandDock[data-panel=units] .unitbar{height:237px;max-height:237px}#quickResidents .recruit-card-wrap .recruit-card{grid-template-rows:32px 20px 28px;min-height:102px;padding:4px 7px}#recruitmentConditions{max-height:17px}}

#quickResidents .recruit-reason{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:32px}
