/* Keep the board inside the screen; each list owns its vertical scroll. */
body:is(:has(#content > .kanban),.mobile-board-controls){height:100vh;height:100dvh;overflow:hidden}
body:is(:has(#content > .kanban),.mobile-board-controls)>main{height:100%;display:flex;flex-direction:column;min-height:0;overflow:hidden}
body:is(:has(#content > .kanban),.mobile-board-controls)>main>header,body:is(:has(#content > .kanban),.mobile-board-controls) .test-banner{flex-shrink:0}
body:is(:has(#content > .kanban),.mobile-board-controls) .page{flex:1;min-height:0;display:flex;flex-direction:column;padding-bottom:12px;overflow:hidden}
body:is(:has(#content > .kanban),.mobile-board-controls) .page-heading,body:is(:has(#content > .kanban),.mobile-board-controls) #stats,body:is(:has(#content > .kanban),.mobile-board-controls) #toolbar{flex-shrink:0}
body:is(:has(#content > .kanban),.mobile-board-controls) #content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
body:is(:has(#content > .kanban),.mobile-board-controls) #content>p{flex-shrink:0}
#content>.kanban{flex:1;min-height:0;height:100%;overflow-x:auto;overflow-y:hidden;align-items:stretch;padding-bottom:10px;overscroll-behavior-x:contain}
#content>.kanban>.column{height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;scroll-padding-top:65px}
#content>.kanban>.column>.column-head{position:sticky;top:-12px;z-index:2;background:#eef0e4;padding-top:12px;box-shadow:0 4px 8px #eef0e4}
#content>.kanban>.column.is-collapsed{overflow:hidden;scrollbar-gutter:auto}
@media(max-width:650px){body:is(:has(#content>.kanban),.mobile-board-controls){display:flex;flex-direction:column}body:is(:has(#content>.kanban),.mobile-board-controls)>aside{flex-shrink:0;max-height:25dvh;overflow:auto}body:is(:has(#content>.kanban),.mobile-board-controls)>main{flex:1;height:auto;min-height:0}body:is(:has(#content>.kanban),.mobile-board-controls) #stats,body:is(:has(#content>.kanban),.mobile-board-controls) .test-banner,body:is(:has(#content>.kanban),.mobile-board-controls) .page-heading .eyebrow,body:is(:has(#content>.kanban),.mobile-board-controls) #subtitle{display:none}body:is(:has(#content>.kanban),.mobile-board-controls) .page{padding:10px 12px}body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar{margin:10px 0;gap:6px}body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar .search{min-width:0;flex-basis:100%}body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar select{max-width:44%;min-width:0}body:is(:has(#content>.kanban),.mobile-board-controls) #resultCount{display:none}}
/* Compact overview leaves the available height to the lists. */
body:is(:has(#content>.kanban),.mobile-board-controls)>main>header{height:52px;min-height:52px;padding:0 20px}
body:is(:has(#content>.kanban),.mobile-board-controls) .test-banner,body:is(:has(#content>.kanban),.mobile-board-controls) .page-heading .eyebrow,body:is(:has(#content>.kanban),.mobile-board-controls) #subtitle{display:none}
body:is(:has(#content>.kanban),.mobile-board-controls) .page{padding:12px 20px 8px}
body:is(:has(#content>.kanban),.mobile-board-controls) .page-heading{gap:12px;min-height:40px}
body:is(:has(#content>.kanban),.mobile-board-controls) h1{font-size:23px;margin:0}
body:is(:has(#content>.kanban),.mobile-board-controls) #stats{display:flex;gap:8px;margin:10px 0 0;flex-wrap:wrap}
body:is(:has(#content>.kanban),.mobile-board-controls) .stat{padding:7px 12px;border-radius:7px;box-shadow:none}
body:is(:has(#content>.kanban),.mobile-board-controls) .stat>div{display:flex;align-items:center;gap:12px}
body:is(:has(#content>.kanban),.mobile-board-controls) .stat strong{display:inline;font-size:18px;margin:0}
body:is(:has(#content>.kanban),.mobile-board-controls) .stat i{display:none}
body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar{margin:10px 0;gap:8px}
#content>.kanban>.column{scroll-behavior:auto;overflow-anchor:none}
#content>.kanban .cover-photo{contain:paint}
@media(hover:none){#content>.kanban .card:hover{transform:none}}
@media(max-width:650px){body:is(:has(#content>.kanban),.mobile-board-controls) .page{padding:8px 12px}body:is(:has(#content>.kanban),.mobile-board-controls) h1{font-size:20px}body:is(:has(#content>.kanban),.mobile-board-controls) #stats{display:none}body:is(:has(#content>.kanban),.mobile-board-controls)>main>header{padding:0 12px}}

/* Phone controls stay below the independently scrolling board. */
@media(max-width:650px){
 body:is(:has(#content>.kanban),.mobile-board-controls) #content{order:1}
 body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar{order:2;flex-shrink:0;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 -12px -8px;padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px));background:#fff;border-top:1px solid #dce2dc;box-shadow:0 -3px 12px #172c2910;z-index:3}
 body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar .search{flex:1 1 100%;min-width:0;margin:0;min-height:44px}
 body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar .search input{font-size:16px;min-width:0;width:100%}
 body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar select{flex:1 1 0;min-width:0;max-width:none;min-height:44px;padding:8px;font-size:12px}
 body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar .archive-filter{display:flex;align-items:center;gap:5px;min-height:44px;font-size:12px;white-space:nowrap}
 body:is(:has(#content>.kanban),.mobile-board-controls) #toolbar .archive-filter input{width:20px;height:20px;margin:0}
}
