/* Laptops and desktops: one header on every page, pages at a readable width, a month that fits the screen.
   The query is APP_LAYOUT in js/lib/platform.js, negated; phones and tablets never get these rules. */
@media not ((max-width:700px) or ((any-pointer:coarse) and (min-height:600px) and (max-width:1400px))){
  /* Header: the wordmark, the streak, the tabs, then search and the bell, on one line on every page.
     The header box steps aside (display:contents) so its pieces share the tab bar's row instead of squeezing into one column. */
  .wrap{max-width:1180px;grid-template-columns:auto auto minmax(0,1fr) auto;column-gap:0}
  :is(body,.peek)[data-page] .wrap>.top{display:contents}
  .wrap>.top>*,.wrap>.tabbar{grid-row:1;align-self:stretch;display:flex;align-items:center;min-height:60px;margin:0 0 18px;border-bottom:1px solid var(--line)}
  .wrap>.top>.brand{grid-column:1;padding-right:20px;font-size:1.3rem}
  .wrap>.top>.sync{grid-column:2;padding-right:16px;justify-self:stretch}
  .wrap>.tabbar{grid-column:3;justify-content:flex-end;align-items:stretch}  /* tabs fill the row, so their labels share the wordmark's center line and the underline sits on the rule */
  .wrap>.top>.topacts{grid-column:4;gap:8px;padding-left:8px}
  .wrap>.top>.topacts:not(:has(>:not([hidden]))){padding:0}
  #crewhead .phead-acts{display:none}  /* the header above already carries the bell and search */
  .gtot{flex-direction:row;align-items:center;gap:8px}
  .gtot-n{font-size:1.6rem;line-height:1}
  .gtot-l{white-space:nowrap}

  /* Pages that are one column of cards read at about phone-and-a-half width, centered; Log keeps its two columns and Social its full width map. */
  body:not([data-page=log]):not([data-page=map]) main{max-width:760px;margin-inline:auto;width:100%}

  /* Month: the whole calendar fits a laptop screen */
  #month .cal .d{aspect-ratio:auto;height:clamp(52px,calc((100dvh - 380px) / 6),88px)}

  /* First visit: the progress bar, the question and the button share one column, centered on the screen with no gap between them */
  #onboard[open]{justify-content:center}
  .ob-body{flex:0 1 auto}
  .ob-top,.ob-foot{max-width:552px;padding-inline:16px}
  .ob-foot{padding-top:18px;padding-bottom:32px}
}

/* A narrower window: the tabs take their own row under the wordmark */
@media (max-width:1179px) and (not ((max-width:700px) or ((any-pointer:coarse) and (min-height:600px) and (max-width:1400px)))){
  .wrap>.top>*{border-bottom:0;margin-bottom:4px;min-height:48px}
  .wrap>.tabbar{grid-row:2;grid-column:1/-1;justify-content:flex-start;min-height:0}
}
