/* Compact mobile sheet/timeline and query-result cards aligned with timetable query UI. */

/* Map query results reuse the timetable query visual language. */
.map-results{
  display:grid;
  gap:10px;
  padding:8px 8px 28px;
  border-top:0!important;
  border-radius:8px;
  background:#f3f6f9;
  overscroll-behavior-y:auto;
  scroll-padding-bottom:28px;
}
.map-query-course{
  margin:0;
  padding:12px 13px;
  border:1px solid #dce4ec!important;
  border-radius:8px;
  background:#fff;
  box-shadow:0 1px 2px rgba(31,50,70,.06);
}
.map-query-course:hover{
  border-color:#c5d3e0!important;
  box-shadow:0 2px 7px rgba(31,50,70,.09);
}
.map-query-course + .map-query-course{border-top-width:1px!important}
.result-summary{margin-bottom:8px}

@media(max-width:899px){
  .course-sheet{max-height:100dvh}
  .map-controls{display:none!important}

  /* Summary text is a quick jump to current query results. */
  .sheet-summary{
    align-items:center;
  }
  .sheet-summary #today-status{
    cursor:pointer;
    touch-action:manipulation;
  }
  .sheet-summary #today-status:active{opacity:.72}
  .sheet-summary #sheet-expand{
    align-self:center;
    display:grid;
    place-items:center;
    width:24px;
    min-width:24px;
    height:24px;
    min-height:24px;
    padding:0;
    margin:0;
    border:1px solid #d7e0e8;
    border-radius:999px;
    background:#f3f6f8;
    color:#657587;
    box-shadow:inset 0 1px 0 #fff;
    font-size:14px;
    font-weight:650;
    line-height:1;
  }
  .sheet-summary #sheet-expand:active{
    transform:scale(.94);
    background:#e9eef3;
  }

  /* Collapsed "今日…" bar: strip almost all vertical padding while retaining a usable grab affordance. */
  .course-sheet.is-collapsed{
    height:46px!important;
    min-height:46px;
  }
  .course-sheet.is-collapsed .drag-handle{
    height:10px;
    min-height:10px;
    padding:2px 8px 0;
  }
  .course-sheet.is-collapsed .drag-handle span{
    width:34px;
    height:3px;
  }
  .course-sheet.is-collapsed .sheet-summary{
    padding:0 12px 1px;
    gap:7px;
    min-height:34px;
    height:34px;
  }
  .course-sheet.is-collapsed .sheet-summary strong{
    font-size:13px;
    line-height:24px;
    min-height:24px;
  }
  .course-sheet.is-collapsed .sheet-summary button{
    width:24px;
    min-width:24px;
    min-height:24px;
    height:24px;
    padding:0;
    font-size:14px;
    line-height:1;
  }

  /* When expanded, halve the vertical gap between the 今日… summary and the ruler. */
  .course-sheet:not(.is-collapsed) .sheet-summary{
    padding-bottom:7px;
  }
  .course-sheet:not(.is-collapsed) .sheet-summary strong{
    line-height:24px;
  }

  /* Controls sit just above the much thinner collapsed sheet. */
  .map-controls{bottom:62px}
  .map-locate-button{bottom:62px}
  .map-location-toast{bottom:114px}

  /* Compact ruler. */
  .timeline-row{margin-top:2px}
  .timeline-shell{
    height:78px;
    border-color:#d4dde6;
    background:linear-gradient(180deg,#fff 0%,#fbfcfd 62%,#f6f8fa 100%);
    box-shadow:inset 0 1px 0 #fff,0 2px 8px rgba(37,56,74,.05);
  }
  .ruler-track{height:76px;background:transparent}
  .ruler-day-label{top:1px;font-size:7.5px;color:#7b8792}
  .ruler-course{
    top:21px;
    height:19px;
    line-height:17px;
    font-size:9.5px;
    padding:0 6px;
  }
  .ruler-tick{top:44px;background:#d6dde4}
  .ruler-tick.minor{height:3px;background:#dce2e8}
  .ruler-tick.medium{height:6px;background:#bfc9d3}
  .ruler-tick.major{height:9px;background:#8e9cab}
  .ruler-label{top:54px;font-size:8px;color:#6f7b87}
  .ruler-period{height:10px;padding-top:0;font-size:7.5px;color:#75818d;border-color:#d7dee5}

  /* Keep date above the main time readout; time is larger and visually centered. */
  .timeline-marker .timeline-date{
    top:1px;
    left:50%;
    transform:translateX(-50%);
    font-size:8px;
    line-height:1.1;
    color:#7b8792;
    white-space:nowrap;
  }
  .timeline-marker .timeline-time{
    top:15px;
    left:50%;
    transform:translateX(-50%);
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:66px;
    height:23px;
    padding:0 8px;
    border-radius:8px;
    font-size:13px;
    font-weight:750;
    line-height:1;
    letter-spacing:.01em;
  }
  .timeline-marker i{top:40px}
  .timeline-marker:has(.timeline-date:not([hidden])) .timeline-time{top:15px}
  .timeline-marker:has(.timeline-date:not([hidden])) i{top:40px}

  .timeline-actions{grid-template-rows:26px minmax(0,1fr);gap:4px}
  .timeline-reset{height:26px;min-height:26px;border-radius:7px;font-size:9px;padding:0 3px}
  .timeline-reset svg{width:12px;height:12px}
  .cike-button{border-radius:8px;font-size:13px;padding:5px 4px}

  /* “9月12日 · X门正在上课” is secondary context, not a headline. */
  .result-summary{
    margin:7px 2px 4px;
    font-size:11px;
    font-weight:500;
    line-height:1.35;
    color:#728090;
  }

  .map-results{
    gap:9px;
    padding:7px 6px 36px;
    scroll-padding-bottom:36px;
  }
  .map-query-course{
    padding:11px 12px;
    border-radius:7px;
  }
}
