/* Layouts for portrait tablet (.port, 820 wide) and phone (.phone, 420 wide). Landscape (.land) is the original 1180 x 820 design. */
.app .brand-name{white-space:nowrap}
.app .stage{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}

/* ===== Portrait tablet ===== */
.app.port[data-skin] .topbar{padding:12px 20px;grid-template-columns:auto 1fr auto}
.app.port[data-skin] .brand-name{font-size:21px}
.app.port[data-skin] .clockchip{justify-self:center}
.app.port[data-skin] .clockchip>span:not(.wxchip):not(.netchip){display:none}
.app.port[data-skin] .stage{padding:4px 20px 20px}
.app.port[data-skin] .tiles{gap:14px}
.app.port[data-skin] .tile{padding:18px 18px}
.app.port[data-skin] .tile-head{gap:12px;flex-wrap:wrap}
.app.port[data-skin] .tile .avatar{--av:64px}
.app.port[data-skin] .tile-name{font-size:42px}
.app.port[data-skin] .tile-now{font-size:17px}
.app.port[data-skin] .ring{--rd:92px}
.app.port[data-skin] .tile-foot{flex-wrap:wrap;gap:10px}
.app.port[data-skin] .dchip{width:44px;height:44px}.app.port[data-skin] .dc-ic{font-size:21px}
.app.port[data-skin] .tile-stars svg{font-size:30px}
.app.port[data-skin] .list-head{flex-wrap:wrap;gap:12px}
.app.port[data-skin] .list-head .back{order:1}
.app.port[data-skin] .list-head .rewards-btn{order:2;margin-left:auto}
.app.port[data-skin] .list-head .who{order:3;flex-basis:100%}
.app.port[data-skin] .list-head .timecard{order:4;width:100%}
.app.port[data-skin] .list-title{font-size:34px}
.app.port[data-skin] .items{grid-template-columns:1fr 1fr;gap:12px}
.app.port[data-skin] .item-text{font-size:21px}
.app.port[data-skin] .item-ic{width:62px;height:62px;font-size:32px}
.app.port[data-skin] .cols{grid-template-columns:1fr;gap:12px}

/* ===== Phone ===== */
.app.phone[data-skin] .topbar{padding:10px 14px;grid-template-columns:auto 1fr auto;gap:8px}
.app.phone[data-skin] .brand-name{font-size:18px;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.app.phone[data-skin] .brand-mark{width:30px;height:30px;font-size:16px}
.app.phone[data-skin] .clockchip{justify-self:end;gap:6px;font-size:13px}
.app.phone[data-skin] .clockchip>span:not(.netchip){display:none}
.app.phone[data-skin] .clockchip b{font-size:20px}
.app.phone[data-skin] .clockchip svg{display:none}
.app.phone[data-skin] .parentbtn{min-height:40px;padding:0 12px}
.app.phone[data-skin] .parentbtn span{display:none}
.app.phone[data-skin] .stage{padding:0 14px 14px}
.app.phone[data-skin] .hint{font-size:15px}
.app.phone[data-skin] .tiles{grid-template-columns:1fr;grid-template-rows:repeat(auto-fit,minmax(0,1fr));gap:10px}
.app.phone[data-skin] .tile{padding:12px 14px;gap:6px}
.app.phone[data-skin] .tile-head{gap:10px;flex-wrap:nowrap}
.app.phone[data-skin] .tile .avatar{--av:52px;font-size:26px}
.app.phone[data-skin] .tile-name{font-size:32px}
.app.phone[data-skin] .tile-now{font-size:14px}
.app.phone[data-skin] .ring{--rd:68px}.app.phone[data-skin] .ring b{font-size:17px}
.app.phone[data-skin] .tile-foot{gap:8px;flex-wrap:nowrap}
.app.phone[data-skin] .dchip{width:36px;height:36px;border-width:2px}.app.phone[data-skin] .dc-ic{font-size:17px}
.app.phone[data-skin] .dchip::after{width:18px;height:18px;right:-5px;top:-5px;font-size:11px;line-height:18px}
.app.phone[data-skin] .dchips{display:flex;gap:6px}
.app.phone[data-skin] .tile-stars svg{font-size:22px}
.app.phone[data-skin] .tile-nums{font-size:16px;gap:8px}
.app.phone[data-skin] .list{gap:10px}
.app.phone[data-skin] .list-head{flex-wrap:wrap;gap:8px}
.app.phone[data-skin] .list-head .back{order:1;min-height:44px;padding:0 14px}
.app.phone[data-skin] .list-head .rewards-btn{order:2;margin-left:auto;min-height:44px;padding:0 14px}
.app.phone[data-skin] .list-head .who{order:3;flex-basis:100%;gap:10px}
.app.phone[data-skin] .list-head .timecard{order:4;width:100%;padding:8px 12px}
.app.phone[data-skin] .list-head .avatar{--av:48px}
.app.phone[data-skin] .list-title{font-size:26px}
.app.phone[data-skin] .list-kicker{font-size:14px}
.app.phone[data-skin] .tc-big{font-size:28px}
.app.phone[data-skin] .items{grid-template-columns:1fr;gap:8px}
.app.phone[data-skin] .item{padding:8px 12px;gap:10px}
.app.phone[data-skin] .item-text{font-size:18px;text-align:left}
.app.phone[data-skin] .item-ic{width:46px;height:46px;font-size:26px;border-radius:12px}
.app.phone[data-skin] .item .box{width:40px;height:40px}
.app.phone[data-skin] .stat-row{gap:8px}.app.phone[data-skin] .stat{padding:10px}.app.phone[data-skin] .stat b{font-size:22px}.app.phone[data-skin] .stat span{font-size:12px}
.app.phone[data-skin] .cols{grid-template-columns:1fr;gap:10px}
.app.phone[data-skin] .cel-card{width:calc(100% - 28px);padding:24px 18px}

/* Families with fewer than 4 kids */
.app .tiles.n1,.app .tiles.n2{grid-template-columns:1fr;grid-template-rows:repeat(var(--n,2),minmax(0,1fr))}
.app .tiles.n1{--n:1}.app .tiles.n2{--n:2}
.app .tiles.n1 .tile,.app .tiles.n2 .tile{flex-direction:row;align-items:center;justify-content:space-between;gap:24px}
.app .tiles.n1 .tile-head,.app .tiles.n2 .tile-head{flex:1}
.app .tiles.n3 .tile:last-child:nth-child(3){grid-column:1/-1}
.app.phone .tiles.n1 .tile,.app.phone .tiles.n2 .tile,.app.port .tiles.n1 .tile,.app.port .tiles.n2 .tile{flex-direction:column;align-items:stretch;justify-content:space-between}
.app.phone .tiles.n3{grid-template-columns:1fr}.app.phone .tiles.n3 .tile:last-child:nth-child(3){grid-column:auto}

/* Content scrolls behind the home bar: the scroller reaches the screen edge and carries the safe-area padding itself */
.app[data-skin] .stage{padding-bottom:calc(22px + var(--sab,0px))}
.app.port[data-skin] .stage{padding-bottom:calc(20px + var(--sab,0px))}
.app.phone[data-skin] .stage{padding-bottom:calc(14px + var(--sab,0px))}
