/* GrowtopiaTools phone navigation + Daily Challenge calendar polish.
   Mobile-only presentation: route handlers, challenge data, and desktop UI stay unchanged. */
@media (max-width: 860px) {
  /* Every page gets its whole half of the Daily picker. Older favorite-row
     CSS reserved a 44px star column even when the star was absent, squeezing
     "Overview" and "Calendar" into broken one-word fragments. */
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-sheet-list.gtt-mobile-daily-grid {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-content:start!important;
    gap:8px!important;
    box-sizing:border-box!important;
    width:100%!important;
    padding:6px 12px 14px!important;
    overflow-x:hidden!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-daily-grid > .gtt-mobile-page-row {
    display:block!important;
    grid-template-columns:none!important;
    position:relative!important;
    min-width:0!important;
    width:100%!important;
    box-sizing:border-box!important;
    margin:0!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-daily-grid > .gtt-mobile-page-row > .gtt-mobile-page-link {
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    height:58px!important;
    min-height:58px!important;
    padding:8px 27px 8px 8px!important;
    gap:7px!important;
    text-align:left!important;
    overflow:hidden!important;
    border-radius:11px!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-daily-grid .gtt-mobile-page-icon {
    flex:0 0 27px!important;
    width:27px!important;
    height:29px!important;
    min-width:27px!important;
    object-fit:contain!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-daily-grid .gtt-mobile-page-name {
    display:block!important;
    flex:1 1 auto!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:clamp(11px,3.4vw,13px)!important;
    font-weight:750!important;
    line-height:1.16!important;
    letter-spacing:-.15px!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
  }
  /* Keep the existing favorite action reachable without taking an entire
     grid column. It is a separate button, not part of page navigation. */
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-daily-grid .gtt-mobile-page-row > .gtt-mobile-nav-star {
    display:grid!important;
    position:absolute!important;
    grid-column:auto!important;
    top:50%!important;
    right:2px!important;
    transform:translateY(-50%)!important;
    width:25px!important;
    height:36px!important;
    padding:3px!important;
    z-index:1!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-daily-grid .gtt-mobile-nav-star-art {
    width:19px!important;
    height:20px!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-sheet-heading {
    gap:10px!important;
    padding:13px 14px 7px!important;
    align-items:flex-start!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-sheet-titles {
    min-width:0!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-sheet h2 {
    font-size:18px!important;
    line-height:1.2!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-sheet p {
    line-height:1.35!important;
    font-size:11px!important;
  }
  html[data-gtt-design-mode="workbench"]
  #gtt-mobile-navigation.is-daily-picker .gtt-mobile-sheet-close {
    flex:0 0 42px!important;
    width:42px!important;
    height:42px!important;
    min-height:42px!important;
  }
}

/* The calendar remains a real seven-day grid. Phones show dates + original
   challenge icons, while the full accessible names and day-detail pane remain
   available on tap. Never squeeze a desktop-length title into a 40px cell. */
@media (max-width: 600px) {
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel {
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-content {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    padding:11px 9px 14px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-preview {
    box-sizing:border-box!important;
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week {
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    gap:3px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .weekday {
    min-width:0!important;
    padding:5px 0!important;
    font-size:9px!important;
    text-align:center!important;
    letter-spacing:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell {
    display:flex!important;
    position:relative!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    box-sizing:border-box!important;
    min-width:0!important;
    height:70px!important;
    min-height:70px!important;
    max-height:70px!important;
    padding:5px 2px 11px!important;
    gap:1px!important;
    border-radius:8px!important;
    overflow:hidden!important;
    touch-action:manipulation!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell .day-top {
    display:flex!important;
    align-items:center!important;
    align-self:stretch!important;
    justify-content:flex-start!important;
    box-sizing:border-box!important;
    min-height:12px!important;
    margin:0!important;
    padding:0 2px!important;
    font-size:10px!important;
    line-height:1.1!important;
    text-align:left!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell .day-top small {
    display:none!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell .day-art {
    display:flex!important;
    flex:1 1 auto!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell .day-art img {
    object-fit:contain!important;
    max-width:min(29px,100%)!important;
    max-height:33px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell :is(.day-title,.v86-random-subtitle) {
    display:none!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell .v5-cycle-label {
    display:block!important;
    position:absolute!important;
    top:auto!important;
    bottom:1px!important;
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
    max-width:calc(100% - 2px)!important;
    margin:0!important;
    padding:1px 2px!important;
    font-size:6px!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    pointer-events:none!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell .possible-flag {
    position:absolute!important;
    left:1px!important;
    right:1px!important;
    top:auto!important;
    bottom:1px!important;
    width:auto!important;
    max-width:calc(100% - 2px)!important;
    margin:0!important;
    font-size:6px!important;
    line-height:1.1!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  /* Full-page calendar: give title/actions each an intentional line, then
     keep date selectors and arrows centered, never clipped on small phones. */
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .gttdc-inline-calendar-bar {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    align-items:start!important;
    gap:7px!important;
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    padding:0 0 10px!important;
    margin-bottom:6px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .gttdc-inline-calendar-title {
    grid-column:1!important;
    grid-row:1!important;
    align-items:center!important;
    justify-self:stretch!important;
    min-width:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .gttdc-inline-calendar-title h2 {
    font-size:14px!important;
    line-height:1.22!important;
    word-break:normal!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .gttdc-inline-calendar-actions {
    grid-column:1!important;
    grid-row:2!important;
    justify-self:end!important;
    display:flex!important;
    justify-content:flex-end!important;
    align-items:center!important;
    gap:6px!important;
    flex-wrap:wrap!important;
    min-width:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .gttdc-inline-calendar-actions .text-button {
    font-size:11px!important;
    line-height:1.2!important;
    min-height:32px!important;
    padding:6px 8px!important;
    white-space:nowrap!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .gttdc-inline-calendar-bar > .v5-month-control {
    grid-column:1!important;
    grid-row:3!important;
    justify-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .v5-calendar-jumps {
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .v5-calendar-jumps .month-control-buttons {
    display:flex!important;
    gap:4px!important;
    flex:0 0 auto!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .v5-calendar-jumps .month-control-buttons button {
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-current-view="calendar"][data-theme="glass"]
  #content .calendar-panel .v5-calendar-jumps :is(.v47-picker,.v56-dc-picker,.v5-calendar-select,.cal-today) {
    box-sizing:border-box!important;
    min-width:0!important;
    min-height:36px!important;
    max-width:100%!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .selected-pane {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-wrap:break-word!important;
  }
}
@media (max-width: 355px) {
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  .gtt-mobile-daily-grid > .gtt-mobile-page-row > .gtt-mobile-page-link {
    padding-right:23px!important;
    padding-left:6px!important;
    gap:5px!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  .gtt-mobile-daily-grid .gtt-mobile-page-icon {
    flex-basis:24px!important;
    width:24px!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  .gtt-mobile-daily-grid .gtt-mobile-page-name {
    font-size:11px!important;
    letter-spacing:-.3px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-content {
    padding-inline:5px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week {
    gap:2px!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content .calendar-panel .calendar-week .day-cell {
    height:65px!important;
    min-height:65px!important;
    max-height:65px!important;
  }
}
