/* One viewport for both themes and window modes. Wallpaper sizing stays in themes.css. */
html{height:100%;overflow:hidden}
body[data-theme]{--page-gap:clamp(12px,2.2vw,36px);--layout-gap:clamp(8px,1.3dvh,16px);--dashboard-width:1510px;--hero-space:calc(var(--banner-height,36dvh) - 16px);height:100dvh;min-height:0;min-width:0;overflow:hidden}
body[data-theme=glass]{--hero-space:clamp(110px,28dvh,380px)}
body[data-theme] .dashboard{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,.34fr) minmax(0,.66fr) var(--footer-height,16px);gap:var(--layout-gap);width:min(var(--dashboard-width),calc(100% - var(--page-gap)*2));height:100dvh;min-height:0;margin:0 auto;padding:calc(var(--hero-space) + env(safe-area-inset-top)) 0 var(--footer-bottom-space,max(12px,env(safe-area-inset-bottom)));justify-content:normal;align-content:stretch}
body[data-theme] .topbar{position:absolute;top:calc(var(--hero-space) - 66px);right:var(--page-gap);height:44px;padding:0;z-index:4}
body[data-theme] .profile-bar{position:absolute;top:calc(var(--hero-space) - 65px);right:calc(var(--page-gap) + 114px);left:auto;width:auto;height:44px;margin:0;transform:none;gap:10px}
body[data-theme=glass] .profile-bar{left:var(--page-gap);right:auto;padding:6px 10px}
body[data-theme] .profile-name{font-size:15px}
body[data-theme] .profile-clock{font-size:11px}
body[data-theme] .overview-cards,body[data-theme] .daily-cards{min-width:0;min-height:0;margin:0;gap:var(--layout-gap);grid-template-columns:minmax(0,1fr) minmax(0,1.45fr) minmax(0,1fr);align-items:stretch}
body[data-theme] .card,body[data-theme] .overview-cards .overview-card{height:auto;min-height:0;min-width:0;padding:clamp(12px,2dvh,24px);border-radius:18px}
body[data-theme] .overview-header{flex:none;margin-bottom:clamp(6px,1.2dvh,14px);gap:6px}
body[data-theme] .overview-provider{gap:8px}
body[data-theme] .overview-provider h2{font-size:clamp(12px,1.2vw,17px)}
body[data-theme] .overview-provider p{font-size:7px;letter-spacing:1.2px}
body[data-theme] .provider-mark{width:28px;height:28px}
body[data-theme] .balance-placeholder{margin:0 0 10px;gap:7px}
body[data-theme] .overview-value{font-size:clamp(24px,3.8dvh,38px)}
body[data-theme] .quota-detail{margin-bottom:6px}
body[data-theme] .empty-meter{height:5px;flex:none}
body[data-theme] .integration-caption{margin-top:8px;font-size:9px}
body[data-theme] .electricity-value{margin-bottom:6px}
body[data-theme] .empty-chart{min-height:0;margin-bottom:13px}
body[data-theme] .empty-chart-axis{bottom:-16px;font-size:8px}
body[data-theme] #codex-windows{min-height:0;padding:0;gap:6px;align-content:center}
body[data-theme] #codex-windows .empty-ring{width:min(76px,calc(100cqw / var(--quota-count,2) - 6px),9dvh);height:auto;aspect-ratio:1;flex:none}
body[data-theme] #codex-windows .empty-ring>span{font-size:clamp(12px,min(8cqw,3dvh),23px)}
body[data-theme] #codex-windows .reset-ring>span{font-size:clamp(9px,min(5cqw,1.8dvh),14px)}
body[data-theme] #codex-windows .quota-item{gap:4px;font-size:10px}
body[data-theme] #codex-windows .quota-item small{font-size:8px}
body[data-theme] .codex-account{padding:4px 7px}
body[data-theme] .codex-account-copy{gap:5px}
body[data-theme] .codex-account-copy strong,body[data-theme] .codex-account-copy small{font-size:10px}
body[data-theme] .card-header{flex:none;min-height:26px;margin-bottom:12px;gap:6px}
body[data-theme] .card-header h1,body[data-theme] .card-header h2{font-size:clamp(13px,1.3vw,18px);gap:9px}
body[data-theme] .card-header h1:after,body[data-theme] .card-header h2:after{position:static;display:none}
body[data-theme] .card-header .heading-icon svg{width:25px;height:25px}
body[data-theme] .work-card{display:flex;flex-direction:column}
body[data-theme] .work-card .work-main{flex:1;min-height:0;padding:0;align-content:center;text-align:left}
body[data-theme] .work-card.has-sticker .work-main{--sticker-size:clamp(56px,7vw,118px);column-gap:6px}
body[data-theme] .work-card #countdown-label{font-size:clamp(11px,1.2vw,16px);line-height:1.4;margin:0 0 5px}
body[data-theme] .work-card #countdown{font-size:clamp(23px,3vw,48px);line-height:1.25}
body[data-theme] .work-card.has-sticker #countdown{font-size:clamp(22px,calc((100cqw - var(--sticker-size) - 6px)/5.1),43px)}
body[data-theme] .work-card[data-mode=evening] #countdown{font-size:clamp(17px,5cqw,27px);line-height:1.4;white-space:normal}
body[data-theme] .work-card #work-caption{font-size:clamp(10px,.9vw,12px);line-height:1.5;margin-top:6px;word-break:normal;overflow-wrap:anywhere}
body[data-theme] .work-progress{flex:none;margin-top:12px}
body[data-theme] .work-card .progress-label{font-size:13px;margin-bottom:7px}
body[data-theme] .work-card .progress-label strong{font-size:15px}
body[data-theme] .work-card .timeline{font-size:11px;margin-top:8px}
body[data-theme] .work-card .work-footer{flex:none;flex-direction:row;flex-wrap:nowrap;margin-top:12px;padding-top:10px;font-size:11px;gap:6px}
body[data-theme] .work-card #vacation-countdown{font-size:11px}
body[data-theme] .work-card .work-footer svg{width:13px;height:13px}
body[data-theme] .daily-cards .music-card{display:flex;flex-direction:column;align-self:stretch;height:100%;min-height:0}
body[data-theme] .daily-cards .music-body{flex:1;display:grid;grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);min-height:0;margin:0;gap:clamp(8px,1.3vw,18px);align-items:stretch}
body[data-theme] .daily-cards .now-playing{display:grid;grid-template-rows:minmax(0,1fr) auto auto auto;align-items:center;justify-items:stretch;min-width:0;min-height:0;gap:5px}
body[data-theme] .daily-cards .music-card .cover-wrap{width:100%;height:100%;min-height:0;max-height:100%;aspect-ratio:auto;margin:0;background:transparent;box-shadow:none}
body[data-theme] .cover-wrap img{object-fit:contain;border-radius:10px}
body[data-theme] .track-title{font-size:12px;line-height:1.4}
body[data-theme] .track-artist{font-size:10px;line-height:1.3;margin:0}
body[data-theme] .daily-cards .now-playing .player-controls{margin:0;padding:0;gap:14px}
body[data-theme] .play-button{width:33px;height:33px}
body[data-theme] .daily-cards .tracklist{height:0;min-height:100%;overflow:auto;scrollbar-width:none;padding:0}
body[data-theme] .tracklist::-webkit-scrollbar,body[data-theme] dialog::-webkit-scrollbar{display:none}
body[data-theme] .track-row{min-height:32px;font-size:11px;padding:7px 6px}
body[data-theme] .music-error{flex:none;margin:4px 0 0;padding:4px;font-size:10px;line-height:1.4}
body[data-theme] .links-card.website-panel{display:block;min-height:0;padding:0;grid-column:auto}
body[data-theme] .website-grid{height:100%;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:var(--layout-gap)}
body[data-theme] .website-tile{min-height:0;padding:10px;gap:8px;flex-direction:row}
body[data-theme] .website-tile>strong{font-size:clamp(16px,1.5vw,24px)}
body[data-theme] .website-tile>svg{width:24px;height:24px}
body[data-theme] .page-footer{min-height:0;padding:0;align-items:center;justify-content:center;line-height:1;font-size:11px;letter-spacing:.2px;white-space:nowrap;color:#fff;text-shadow:0 1px 2px #24354b66}
body[data-theme] .settings-dialog{max-height:calc(100dvh - 24px);scrollbar-width:none}


/* Keep the glass copyright legible over detailed wallpaper. */
body[data-theme=glass]{--footer-height:calc(44px + env(safe-area-inset-bottom));--footer-bottom-space:0px}
body[data-theme=glass] .page-footer{width:auto;min-width:0;justify-self:stretch;position:relative;z-index:1;padding:8px 16px calc(8px + env(safe-area-inset-bottom));background:transparent;font-size:12px;line-height:1.4}
/* Only the backdrop spans the viewport; it must not widen the card grid. */
body[data-theme=glass] .page-footer::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:100vw;transform:translateX(-50%);z-index:-1;pointer-events:none;background:rgba(245,249,255,.4);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-top:1px solid #ffffff40}
body[data-theme] header.profile-bar{top:clamp(10px,2dvh,22px);left:auto;right:var(--page-gap);width:max-content;max-width:calc(100% - var(--page-gap)*2);padding:6px 10px;border:1px solid #ffffffb3;border-radius:28px;background:linear-gradient(115deg,#ffffffc9,#f3f8ffb8);box-shadow:0 5px 24px #344e7620;backdrop-filter:blur(24px);z-index:5}
body[data-theme] header.profile-bar .online{display:inline-flex}
body[data-theme] header.profile-bar .service-status{border:0;background:transparent;color:#5c718d;padding:4px 0;font-size:10px;gap:6px}
body[data-theme] header.profile-bar .service-status[data-state=offline]{color:#b7626c}
body[data-theme] header.profile-bar .profile-clock{display:block;margin:0;font-size:10px}
body[data-theme] header.profile-bar .theme-switch{margin:0;min-width:72px}
body[data-theme] header.profile-bar .tools{gap:3px;border-left:1px solid #a5b7d044;padding-left:6px}

@media(max-width:1100px){
  body[data-theme]{--hero-space:clamp(100px,24dvh,300px);--page-gap:16px}
  body[data-theme] .overview-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
  body[data-theme] .daily-cards{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);grid-template-rows:minmax(0,1fr) 48px}
  body[data-theme] .links-card.website-panel{grid-column:1/-1}
  body[data-theme] .website-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}
  body[data-theme] .website-tile>strong{font-size:16px}
  body[data-theme] .website-tile>svg{width:21px;height:21px}
  body[data-theme] .topbar .today,body[data-theme] .topbar .tool-separator{display:none}
  body[data-theme] .profile-bar{right:86px}
  body[data-theme] .overview-provider p{letter-spacing:.5px;font-size:6px}
  body[data-theme] .pending-badge{font-size:9px;padding:3px 6px}
}

@media(max-width:580px){
  body[data-theme]{--page-gap:10px;--layout-gap:8px;--hero-space:clamp(100px,18dvh,170px)}
  body[data-theme] .dashboard{grid-template-rows:clamp(114px,19dvh,172px) minmax(0,1fr) var(--footer-height,12px);padding-bottom:var(--footer-bottom-space,max(10px,env(safe-area-inset-bottom)))}
  body[data-theme] .overview-cards{gap:6px}
  body[data-theme] .daily-cards{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr) 38px;gap:8px}
  body[data-theme] .card,body[data-theme] .overview-cards .overview-card{padding:9px;border-radius:13px}
  body[data-theme] .overview-header,body[data-theme] [data-integration=codex] .overview-header{flex-wrap:wrap;gap:3px;margin-bottom:5px;align-items:center;min-height:37px}
  body[data-theme] .overview-provider{gap:4px;width:100%}
  body[data-theme] .overview-provider h2{font-size:11px}
  body[data-theme] .overview-provider p{display:none}
  body[data-theme] .provider-mark,body[data-theme] .electricity-mark svg{width:18px;height:18px;border-radius:5px}
  body[data-theme] .pending-badge{font-size:8px;padding:1px 4px;line-height:1.4}
  body[data-theme] .codex-account{margin:0;padding:1px 4px;max-width:100%}
  body[data-theme] .codex-account-copy{gap:4px}
  body[data-theme] .codex-account-copy strong,body[data-theme] .codex-account-copy small{font-size:8px}
  body[data-theme] .balance-placeholder{flex-wrap:wrap;gap:3px;margin-bottom:7px}
  body[data-theme] .overview-value{font-size:22px}
  body[data-theme] .overview-unit,body[data-theme] .quota-detail{font-size:8px}
  body[data-theme] .quota-detail{margin-bottom:4px}
  body[data-theme] .integration-caption{font-size:7px;margin-top:5px}
  body[data-theme] .empty-chart>span{font-size:7px;padding:2px}
  body[data-theme] .empty-chart-axis{font-size:6px;bottom:-13px}
  body[data-theme] #codex-windows{gap:3px;align-content:center}
  body[data-theme] #codex-windows .empty-ring{width:min(42px,calc(100cqw / var(--quota-count,2) - 6px))}
  body[data-theme] #codex-windows .quota-item{font-size:7px;gap:3px}
  body[data-theme] #codex-windows .quota-item small{font-size:6px;line-height:1.3}
  body[data-theme] #codex-windows .empty-ring>span{font-size:clamp(8px,calc(24cqw / var(--quota-count,2)),12px)}
  body[data-theme] #codex-windows .reset-ring>span{font-size:clamp(6px,calc(16cqw / var(--quota-count,2)),8px);letter-spacing:-.5px}
  body[data-theme] #codex-windows .remaining-ring:before{inset:3px}
  body[data-theme] .card-header{min-height:22px;margin-bottom:4px}
  body[data-theme] .card-header h1,body[data-theme] .card-header h2{font-size:13px;gap:6px}
  body[data-theme] .card-header .heading-icon svg{width:20px;height:20px}
  body[data-theme] .work-heading-icon{width:29px;height:20px}
  body[data-theme] .work-card .status-badge{font-size:10px;padding:3px 8px}
  body[data-theme] .work-card.has-sticker .work-main{--sticker-size:64px}
  body[data-theme] .work-card #countdown-label{font-size:11px;margin-bottom:2px}
  body[data-theme] .work-card #countdown,body[data-theme] .work-card.has-sticker #countdown{font-size:27px;line-height:1.15}
  body[data-theme] .work-card[data-mode=evening] #countdown{font-size:18px}
  body[data-theme] .work-card #work-caption{font-size:10px;line-height:1.3;margin-top:3px}
  body[data-theme] .work-progress{margin-top:5px}
  body[data-theme] .work-card .progress-label{font-size:10px;margin-bottom:4px}
  body[data-theme] .work-card .progress-label strong{font-size:11px}
  body[data-theme] .progress-track{height:5px}
  body[data-theme] .progress-track>div:after{top:.5px}
  body[data-theme] .work-card .timeline{font-size:9px;margin-top:4px}
  body[data-theme] .work-card .timeline svg{width:12px;height:12px}
  body[data-theme] .work-card .work-footer{font-size:9px;margin-top:5px;padding-top:4px;line-height:1.2}
  body[data-theme] .work-card #vacation-countdown{font-size:9px}
  body[data-theme] .work-card .work-footer svg{width:11px;height:11px}
  body[data-theme] .daily-cards .music-body{gap:10px;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}
  body[data-theme] .daily-cards .now-playing{gap:2px}
  body[data-theme] .track-title{font-size:10px}
  body[data-theme] .track-artist{font-size:8px}
  body[data-theme] .play-button{width:28px;height:28px}
  body[data-theme] .player-controls .icon-button{width:23px;height:23px}
  body[data-theme] .track-row{font-size:10px;min-height:27px;padding:5px 4px;gap:5px}
  body[data-theme] .playlist-count{font-size:10px}
  body[data-theme] .website-grid{gap:6px}
  body[data-theme] .website-tile{padding:5px;gap:4px;border-radius:11px}
  body[data-theme] .website-tile>strong{font-size:13px}
  body[data-theme] .website-tile>svg{width:16px;height:16px}
  body[data-theme] .page-footer{font-size:9px;letter-spacing:0}
  body[data-theme] .profile-name{font-size:12px}
  body[data-theme] .profile-bar{height:34px;top:calc(var(--hero-space) - 46px);gap:7px}
  body[data-theme] .profile-bar .profile-divider,body[data-theme] .profile-bar .online,body[data-theme] .profile-clock{display:none}
  body[data-theme] .topbar{height:34px;top:calc(var(--hero-space) - 46px)}
  body[data-theme] .theme-switch{padding:5px 7px;min-width:72px;font-size:10px}
  body[data-theme=glass] .profile-bar{max-width:calc(100% - 94px)}
  body[data-theme=glass] .profile-name{overflow:hidden;text-overflow:ellipsis}
}

@media(max-width:580px) and (max-height:740px){
  body[data-theme]{--hero-space:90px}
}
@media(max-width:580px) and (max-height:620px){
  body[data-theme]{--hero-space:68px;--layout-gap:6px}
  body[data-theme] .dashboard{grid-template-rows:110px minmax(0,1fr) var(--footer-height,10px);padding-bottom:var(--footer-bottom-space,6px)}
  body[data-theme] .daily-cards{grid-template-rows:minmax(0,1fr) minmax(0,1fr) 32px;gap:6px}
  body[data-theme] .card,body[data-theme] .overview-cards .overview-card{padding:7px}
  body[data-theme] .work-card.has-sticker .work-main{--sticker-size:52px}
  body[data-theme] .work-card #countdown,body[data-theme] .work-card.has-sticker #countdown{font-size:24px}
  body[data-theme] .work-card #countdown-label,body[data-theme] .work-card #work-caption{font-size:10px}
  body[data-theme] .work-card .work-footer{margin-top:3px;padding-top:3px;font-size:8px}
  body[data-theme] .work-card #vacation-countdown{font-size:8px}
}
@media(max-width:580px){
  body[data-theme] header.profile-bar{top:12px;height:36px;padding:4px 7px;gap:6px}
  body[data-theme] header.profile-bar .icon-button{width:26px;height:26px}
  body[data-theme] header.profile-bar .icon-button svg{width:17px;height:17px}
  body[data-theme] header.profile-bar .service-status{font-size:9px}
  body[data-theme] header.profile-bar .theme-switch{font-size:9px;min-width:65px;padding:4px 6px}
}
@media(max-width:380px){body[data-theme] header.profile-bar .profile-clock{display:none}}

@media(min-width:581px) and (max-height:800px){
  body[data-theme] .overview-header{margin-bottom:5px}
  body[data-theme] .overview-provider p{margin-top:3px}
  body[data-theme] .balance-placeholder{margin-bottom:5px}
  body[data-theme] .quota-detail{margin-bottom:4px}
  body[data-theme] .integration-caption{margin-top:4px;font-size:8px}
  body[data-theme] #codex-windows .empty-ring{width:min(64px,calc(100cqw / var(--quota-count,2) - 6px),6dvh)}
  body[data-theme] #codex-windows .empty-ring>span{font-size:clamp(12px,2.5dvh,18px)}
  body[data-theme] #codex-windows .reset-ring>span{font-size:clamp(8px,1.6dvh,12px)}
  body[data-theme] #codex-windows .quota-item{font-size:9px;gap:3px}
  body[data-theme] #codex-windows .quota-item small{font-size:7px}
  body[data-theme] .work-card #countdown,body[data-theme] .work-card.has-sticker #countdown{font-size:clamp(23px,3vw,35px)}
  body[data-theme] .work-card[data-mode=evening] #countdown{font-size:20px}
}
@media(max-width:580px) and (max-height:620px){
  body[data-theme] .overview-header,body[data-theme] [data-integration=codex] .overview-header{min-height:0;margin-bottom:3px;gap:0}
  body[data-theme] .provider-mark,body[data-theme] .electricity-mark svg{width:16px;height:16px}
  body[data-theme] .pending-badge{font-size:7px;padding:0 3px}
  body[data-theme] .balance-placeholder{margin-bottom:3px}
  body[data-theme] .quota-detail{font-size:7px;margin-bottom:2px}
  body[data-theme] .empty-meter{height:3px}
  body[data-theme] .integration-caption{font-size:7px;line-height:1.25;margin-top:3px}
  body[data-theme] #codex-windows .empty-ring{width:min(28px,calc(100cqw / var(--quota-count,2) - 6px))}
}
@media(max-width:580px) and (max-height:540px){
  body[data-theme]{--hero-space:48px}
  body[data-theme] .dashboard{grid-template-rows:100px minmax(0,1fr) var(--footer-height,10px)}
  body[data-theme] header.profile-bar{top:5px;height:30px}
  body[data-theme] .card,body[data-theme] .overview-cards .overview-card{padding:6px}
  body[data-theme] .overview-value{font-size:20px}
  body[data-theme] .card-header{min-height:20px;margin-bottom:2px}
  body[data-theme] .work-card.has-sticker .work-main{--sticker-size:44px}
  body[data-theme] .work-card #countdown-label,body[data-theme] .work-card #work-caption{font-size:9px;line-height:1.25}
  body[data-theme] .work-card #countdown,body[data-theme] .work-card.has-sticker #countdown{font-size:22px}
  body[data-theme] .work-progress{margin-top:3px}
  body[data-theme] .work-card .progress-label{font-size:8px;margin-bottom:3px}
  body[data-theme] .work-card .progress-label strong{font-size:9px}
  body[data-theme] .work-card .timeline{font-size:8px;margin-top:3px}
  body[data-theme] .work-card .timeline svg{height:10px}
  body[data-theme] .work-card .work-footer{font-size:8px;padding-top:2px;margin-top:2px}
}
@media(max-width:580px) and (orientation:landscape){
  body[data-theme]{--hero-space:36px}
  body[data-theme] .dashboard{grid-template-rows:92px minmax(0,1fr) var(--footer-height,10px)}
  body[data-theme] .daily-cards{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) 28px;gap:6px}
  body[data-theme] .links-card.website-panel{grid-column:1/-1}
}

@media(min-width:581px) and (max-height:600px){
  body[data-theme]{--hero-space:64px;--layout-gap:7px;--page-gap:12px}
  body[data-theme] .dashboard{grid-template-rows:minmax(0,.36fr) minmax(0,.64fr) var(--footer-height,12px);padding-bottom:var(--footer-bottom-space,8px)}
  body[data-theme] .topbar,body[data-theme] .profile-bar{top:8px;height:36px}
  body[data-theme] .overview-cards,body[data-theme] .daily-cards{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) minmax(0,.8fr);grid-template-rows:minmax(0,1fr)}
  body[data-theme] .links-card.website-panel{grid-column:auto}
  body[data-theme] .website-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
  body[data-theme] .card,body[data-theme] .overview-cards .overview-card{padding:9px}
  body[data-theme] .overview-header{margin-bottom:4px}
  body[data-theme] .overview-provider p{display:none}
  body[data-theme] .provider-mark{width:20px;height:20px}
  body[data-theme] .overview-value{font-size:23px}
  body[data-theme] .balance-placeholder{margin-bottom:5px}
  body[data-theme] .integration-caption{font-size:8px;margin-top:4px}
  body[data-theme] .empty-chart>span{font-size:8px}
  body[data-theme] .card-header{margin-bottom:4px;min-height:23px}
  body[data-theme] .card-header h1,body[data-theme] .card-header h2{font-size:12px}
  body[data-theme] .work-card #work-caption,body[data-theme] .work-card #countdown-label{font-size:10px}
  body[data-theme] .work-card.has-sticker .work-main{--sticker-size:48px}
  body[data-theme] .work-card #countdown,body[data-theme] .work-card.has-sticker #countdown{font-size:23px}
  body[data-theme] .work-progress{margin-top:5px}
  body[data-theme] .work-card .progress-label,body[data-theme] .work-card .timeline{font-size:9px;margin-bottom:4px}
  body[data-theme] .work-card .work-footer{font-size:8px;margin-top:5px;padding-top:4px}
  body[data-theme] .work-card #vacation-countdown{font-size:8px}
  body[data-theme] .track-row{font-size:10px;min-height:26px;padding:5px}
  body[data-theme] .track-title{font-size:10px}
  body[data-theme] .track-artist{font-size:8px}
  body[data-theme] .play-button{width:27px;height:27px}
  body[data-theme] .website-tile{flex-direction:column;padding:6px;gap:5px}
  body[data-theme] .website-tile>strong{font-size:13px}
  body[data-theme] .website-tile>svg{width:19px;height:19px}
}

/* Reserve content space before expanding the tide banner, including at 200% scaling. */
@media(min-width:1101px) and (min-height:601px){
  body[data-theme=tide]{--overview-height:clamp(200px,22dvh,240px);--daily-height:clamp(250px,28dvh,300px);--banner-height:calc(100dvh - var(--overview-height) - var(--daily-height) - var(--footer-height,16px) - var(--footer-bottom-space,max(12px,env(safe-area-inset-bottom))) - var(--layout-gap)*2 - env(safe-area-inset-top) + 16px)}
  body[data-theme=glass]{--hero-space:clamp(64px,min(28dvh,calc(100dvh - 475px - var(--footer-height) - var(--layout-gap)*2)),380px)}
  body[data-theme] .dashboard{grid-template-rows:minmax(200px,.34fr) minmax(275px,.66fr) var(--footer-height,16px)}
  body[data-theme=tide] .dashboard{grid-template-rows:var(--overview-height) var(--daily-height) var(--footer-height,16px)}
  body[data-theme] .work-card .work-main{flex:1 1 0;align-content:safe center}
  body[data-theme] .work-card .card-header{margin-bottom:6px}
  body[data-theme] .work-card .work-progress{margin-top:6px}
  body[data-theme] .work-card .work-footer{margin-top:8px;padding-top:8px}
  body[data-theme] .work-card.has-sticker .work-main{--sticker-size:clamp(56px,6vw,94px);position:relative}
  body[data-theme] .work-card.has-sticker .work-animation,
  body[data-theme] .work-card.has-sticker .lunch-sticker{position:absolute;grid-column:auto;grid-row:auto;right:0;top:50%;transform:translateY(-50%);width:var(--sticker-size);max-height:100%}
  body[data-theme] #codex-windows{container-type:size;align-content:safe center}
  body[data-theme] #codex-windows .empty-ring{width:min(76px,calc(100cqw / var(--quota-count,2) - 6px),max(28px,calc(100cqh - 54px)))}
}

/* Compact content as well as the daily row, keeping both rows on the same columns. */
@media(min-width:1101px) and (min-height:601px){
  body[data-theme] .dashboard .daily-cards .card{padding:12px}
  body[data-theme] .work-card .card-header{margin-bottom:4px;min-height:26px}
  body[data-theme] .work-card .status-badge{font-size:11px;padding:4px 9px;line-height:1.4}
  body[data-theme] .work-card #countdown-label{font-size:13px;margin-bottom:4px}
  body[data-theme] .work-card.has-sticker #countdown{font-size:32px}
  body[data-theme] .work-card[data-mode=evening] #countdown{font-size:20px}
  body[data-theme] .work-card #work-caption{font-size:10px;line-height:1.4;margin-top:4px}
  body[data-theme] .work-card .progress-label{font-size:11px;margin-bottom:5px}
  body[data-theme] .work-card .progress-label strong{font-size:13px}
  body[data-theme] .work-card .timeline{font-size:10px;margin-top:6px}
  body[data-theme] .work-card .work-footer{font-size:10px;line-height:1.4;margin-top:6px;padding-top:6px}
  body[data-theme] .work-card #vacation-countdown{font-size:10px}
  body[data-theme] .daily-cards .holdings-header{margin-bottom:8px}
  body[data-theme] .daily-cards .holdings-heading-group{row-gap:2px}
  body[data-theme] .daily-cards .holdings-date{line-height:1.2}
  body[data-theme] .daily-cards .holding-tile{padding:4px 12px}
  body[data-theme] .daily-cards .holding-title{line-height:1.2}
  body[data-theme] .daily-cards .holding-price-line{margin:6px 0 4px}
  body[data-theme] .daily-cards .holding-delta{line-height:1.3}
  body[data-theme] .daily-cards .holding-chart-wrap{margin-top:4px;min-height:16px}
  body[data-theme] .daily-cards .holding-chart{min-height:16px}
  body[data-theme] .daily-cards .holding-stats{margin-top:4px}
}

/* Values use their own ring diameter, independently of card width or zoom. */
body[data-theme] #codex-windows .empty-ring{container-type:inline-size}
body[data-theme] #codex-windows .empty-ring>span{font-size:clamp(5px,28cqw,22px);line-height:1;letter-spacing:0}
body[data-theme] #codex-windows .reset-ring>span{font-size:clamp(5px,18cqw,14px)}
body[data-theme] #codex-windows .remaining-ring:before{inset:clamp(3px,8cqw,6px)}
@media(max-width:580px){
  body[data-theme=glass]{--footer-height:calc(30px + env(safe-area-inset-bottom))}
  body[data-theme=glass] .page-footer{padding:5px 10px calc(5px + env(safe-area-inset-bottom));font-size:10px}
}

/* Keep the tide toolbar directly above, and aligned with, the overview cards. */
body[data-theme=tide] header.profile-bar{top:auto;bottom:calc(100dvh - var(--hero-space) - env(safe-area-inset-top) + var(--layout-gap));right:max(var(--page-gap),calc((100% - var(--dashboard-width))/2))}

/* Readable supporting text on desktop and high-density displays. */
@media(min-width:1101px){
  body[data-theme]{--text-small:clamp(12px,.75vw,14px);--text-note:clamp(12px,.7vw,13px);--text-detail:clamp(13px,.82vw,15px)}
  body[data-theme] .dashboard .overview-provider p{font-size:clamp(10px,.63vw,11px);letter-spacing:1px}
  body[data-theme] .dashboard .overview-unit,
  body[data-theme] .dashboard .pending-badge,
  body[data-theme] .dashboard .integration-caption,
  body[data-theme] .dashboard .electricity-power,
  body[data-theme] .dashboard .electricity-empty,
  body[data-theme] .dashboard .electricity-footnote,
  body[data-theme] .dashboard .empty-chart>span{font-size:var(--text-small)}
  body[data-theme] .dashboard .quota-detail{font-size:var(--text-detail)}
  body[data-theme] .dashboard #codex-windows .quota-item{font-size:var(--text-small)}
  body[data-theme] .dashboard #codex-windows .quota-item small,
  body[data-theme] .dashboard .empty-chart-axis{font-size:var(--text-note)}
  body[data-theme] .dashboard #codex-windows .quota-item small{max-width:100%;white-space:normal;text-align:center;line-height:1.25}
  body[data-theme] .dashboard #codex-windows:has(.quota-item:nth-child(3)) .empty-ring{width:min(76px,calc(100cqw / var(--quota-count,2) - 6px),max(28px,calc(100cqh - 62px)))}
  body[data-theme] .dashboard .codex-account-copy strong,
  body[data-theme] .dashboard .codex-account-copy small{font-size:var(--text-small)}
  body[data-theme] .dashboard .electricity-chart text{font-size:12px}
  body[data-theme] .dashboard .work-card #countdown-label{font-size:var(--text-detail)}
  body[data-theme] .dashboard .work-card #work-caption,
  body[data-theme] .dashboard .work-card .timeline,
  body[data-theme] .dashboard .work-card .work-footer,
  body[data-theme] .dashboard .work-card #vacation-countdown{font-size:var(--text-small)}
  body[data-theme] .dashboard .work-card .progress-label{font-size:var(--text-detail)}
  body[data-theme] .dashboard .holdings-date,
  body[data-theme] .dashboard .holding-title span,
  body[data-theme] .dashboard .holding-change,
  body[data-theme] .dashboard .holding-stats,
  body[data-theme] .dashboard .holdings-message{font-size:var(--text-small)}
  body[data-theme] .dashboard .holding-stats{gap:4px 8px}
  body[data-theme] .dashboard .page-footer{font-size:var(--text-small)}
  body[data-theme] header.profile-bar .service-status,
  body[data-theme] header.profile-bar .profile-clock,
  body[data-theme] header.profile-bar .theme-switch,
  body[data-theme] .service-tooltip{font-size:var(--text-small)}
  body[data-theme] .settings-dialog label,
  body[data-theme] .settings-dialog label>span,
  body[data-theme] .settings-dialog .settings-help,
  body[data-theme] .settings-dialog .rest-option small,
  body[data-theme] .settings-dialog .animation-preference small{font-size:var(--text-small)}
}
