/* Wide layouts preserve the same navigation and selection; only placement
   changes. Rem-based minimums let larger text naturally wrap into fewer columns. */
.metric-launchers {display:flex;flex-wrap:wrap}
.metric-launcher {flex:1 1 4.75rem}
.topbar {height:auto;min-height:calc(78px + var(--app-safe-top))}
.mobile-brand {min-width:0;white-space:normal;overflow-wrap:anywhere}
.top-right {flex-shrink:0}
.record-filters {grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr))}
.detail-metrics dl {grid-template-columns:repeat(auto-fit,minmax(min(100%,4.5rem),1fr))}
.my-stats {grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr))}
.record-row-value {min-width:0}
.metric-tabs button {min-width:0}
.app-sheet .dialog-body {min-width:0}
html {scroll-padding-top:calc(var(--app-header-height,calc(78px + var(--app-safe-top))) + 10px);scroll-padding-bottom:max(calc(110px + var(--app-safe-bottom)),calc(var(--app-navigation-height,64px) + 28px + var(--app-safe-bottom)))}
.content {padding-bottom:max(calc(115px + var(--app-safe-bottom)),calc(var(--app-navigation-height,64px) + 38px + var(--app-safe-bottom)))}
/* WebKit's semantic body style opts touch devices into Dynamic Type; other
   engines keep the existing system font fallback. macOS keeps its normal base. */
@supports(font:-apple-system-body){
  @media(any-pointer:coarse){html{font:-apple-system-body}}
}
@media(max-width:699px){.topbar{min-height:calc(68px + var(--app-safe-top))}}
@media(min-width:700px) and (max-width:1023px){
  .app-shell {max-width:820px}
  .greeting {min-height:260px}
}
@media(min-width:700px){
  /* Fade the illustration itself into the full-width sky. A transparent
     overlay on an unmasked image still exposes its rectangular left edge. */
  .greeting,.illustrated-heading {
    background:linear-gradient(105deg,light-dark(#d3eafa,#20223a),light-dark(#bcdff3,#303b65));
  }
  .greeting::before,.illustrated-heading::before {
    inset:0 0 0 auto;
    width:auto;height:100%;max-width:100%;aspect-ratio:3/2;
    background-image:var(--hero-wash),var(--hero-art);
    background-size:100% 100%;
    background-position:center;
    -webkit-mask-image:linear-gradient(90deg,transparent 0%,#00000014 12%,#00000057 26%,#000000b8 42%,#000 60%);
    mask-image:linear-gradient(90deg,transparent 0%,#00000014 12%,#00000057 26%,#000000b8 42%,#000 60%);
  }
  /* Give the homepage sheep more presence while keeping its feet in frame. */
  .greeting::before {inset:auto 0 0 auto;height:140%}
}
@media(min-width:1024px){
  .app-shell {max-width:1120px}
  .greeting {min-height:240px}
  .calendar-mode .workspace {display:grid;grid-template-columns:minmax(328px,344px) minmax(0,1fr);grid-template-areas:'calendar filters' 'calendar search' 'calendar tasks';column-gap:24px;align-items:start}
  .calendar-mode #calendar-panel {grid-area:calendar;position:sticky;top:calc(var(--app-header-height,calc(78px + var(--app-safe-top))) + 18px);padding-inline:10px}
  .calendar-mode .list-heading {grid-area:filters;margin:0 0 8px}
  .calendar-mode #search-form {grid-area:search;margin:0 0 10px}
  .calendar-mode #filter-panel {grid-area:tasks;min-width:0}
  .calendar-mode .calendar-toolbar {justify-content:flex-start}
  .calendar-mode .calendar-period {flex:1 1 auto}
  .calendar-mode .calendar-navigation {margin-left:auto}
  .calendar-mode .calendar-weekdays,.calendar-mode .calendar-grid {gap:0}
  .calendar-mode .calendar-day {min-height:44px}
  .calendar-mode .calendar-month-button {font-size:.9375rem}
  .calendar-mode .list-subtitle {margin-top:10px}
}
@media(min-width:1024px) and (max-height:700px){
  .calendar-mode #calendar-panel {position:static}
}
@media(min-width:560px) and (max-height:500px){
  .topbar {height:auto;min-height:calc(58px + var(--app-safe-top));padding-block:5px;padding-top:calc(5px + var(--app-safe-top))}
  .greeting {min-height:185px;gap:5px}
  .home-greeting-copy {padding-top:15px}
  .greeting h1 {font-size:1.5rem;margin:5px 0}
  .daily-progress {margin-bottom:10px}
  .bottom-tabs {min-height:58px;padding-block:4px}
  .bottom-tab {min-height:46px;padding-block:3px}
  .content {padding-bottom:max(calc(90px + var(--app-safe-bottom)),calc(var(--app-navigation-height,58px) + 28px + var(--app-safe-bottom)))}
}
