/* Shared mobile Workbench shell — Home, Daily Challenges, Player Profiles.
   Owns header geometry, content gutters and first-section spacing.
   Page internals keep their existing responsive layouts. Desktop is untouched. */
@media (max-width:860px),
       (pointer:coarse) and (orientation:landscape) and (max-height:600px) and (max-width:1100px) {
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) {
    --gtt-public-mobile-gutter:12px;
    --gtt-public-mobile-content-gap:14px;
    --gtt-public-mobile-heading-gap:16px;
  }

  /* One masthead regardless of which public route is rendered.
     No DC-specific logo, action or account shrinking is permitted. */
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) #wb2-shell .wb2-bar {
    box-sizing:border-box!important;
    height:var(--gtt-mobile-top)!important;
    min-height:var(--gtt-mobile-top)!important;
    max-height:var(--gtt-mobile-top)!important;
    padding:env(safe-area-inset-top,0px)
      calc(10px + env(safe-area-inset-right,0px)) 0
      calc(10px + env(safe-area-inset-left,0px))!important;
    gap:7px!important;
    align-items:center!important;
    overflow:visible!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) #wb2-shell .wb2-bar .wb2-brand {
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
    justify-content:center!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) #wb2-shell .wb2-bar .wb2-brand-img {
    display:block!important;
    flex:0 0 36px!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    max-height:36px!important;
    object-fit:contain!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) #wb2-shell .wb2-bar .wb2-actions {
    display:flex!important;
    flex:0 0 auto!important;
    align-items:center!important;
    justify-content:flex-end!important;
    width:auto!important;
    min-width:0!important;
    gap:6px!important;
    padding:0!important;
    margin-left:auto!important;
    border:0!important;
  }

  /* Same outer edge, first row and bottom-tab clearance on all three
     sections. DC uses a hidden .dc-mobile-sections sibling; Home and
     Profiles have wrappers. These must not create extra page gutters. */
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) .main-area > #content.content {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin-inline:auto!important;
    padding:calc(var(--gtt-mobile-top) + var(--gtt-public-mobile-content-gap))
      var(--gtt-public-mobile-gutter)
      calc(var(--gtt-mobile-bottom) + 22px)!important;
    overflow-x:clip!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"][data-current-view="home"]
  #content > .h162-root,
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"][data-current-view="playerprofiles"]
  #content > .gpp-page {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding-inline:0!important;
    margin-inline:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="home"],[data-current-view="playerprofiles"],
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) #content :is(.h162-root > .h162-header,
                  .gpp-page > header.page-head,
                  .dc-mobile-sections + header.page-head) {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 0 var(--gtt-public-mobile-heading-gap)!important;
    padding:0!important;
  }

  /* Desktop headings can set a 205px flex basis which turns into a large
     vertical blank space when Daily pages stack their header on phones. */
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]:is(
    [data-current-view="overview"],[data-current-view="calendar"],
    [data-current-view="challenges"],[data-current-view="rankings"],
    [data-current-view="records"],[data-current-view="history"],
    [data-current-view="comparison"]
  ) #content > .dc-mobile-sections + header.page-head > div {
    flex:0 0 auto!important;
    min-height:0!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
  }
}
