/* Working views on laptop screens. Keep browser zoom, forms and print intact. */
@media screen {
  html .calendar-week-link {
    min-width: 44px;
    min-height: 44px;
    padding: 4px 8px;
    border: 1px solid var(--fliq8-control);
    background: var(--fliq8-selected);
    color: var(--fliq8-text);
    cursor: pointer;
  }
  html #calendarView .calendar-period-row { position: relative; flex-wrap: wrap; }
  html .calendar-context-details { margin: 0; }
  html .calendar-context-content {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10;
    width: min(100%, 1000px);
    max-height: 60dvh;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--fliq8-control);
    border-radius: 8px;
    background: var(--fliq8-surface);
    box-shadow: var(--fliq-ui-depth);
  }
  html .calendar-context-details > summary {
    padding: 12px;
    cursor: pointer;
    color: var(--fliq8-secondary);
  }
}
@media screen and (min-width: 981px) and (max-width: 1600px) {
  html #calendarView .calendar-kpis strong { margin-top: 4px; }
}

/* Allocate the remaining window height to the complete calendar grid.
   Long lists scroll inside their day/month; dates and navigation stay visible.
   Reflow at narrow widths / zoom keeps normal document scrolling. */
@media screen and (min-width: 981px) and (min-height: 700px) {
  html body:has(#calendarView:not([hidden])) { height: 100dvh; display: flex; flex-direction: column; }
  html body:has(#calendarView:not([hidden])) > .hub-legal-footer { flex: none; padding-block: 0; font-size: 12px; }
  html .app-shell:has(#calendarView:not([hidden])) {
    flex: 1;
    flex-direction: column;
  }
  html .app-shell:has(#calendarView:not([hidden])) > :is(.topbar, .primary-nav) { flex: none; }
  html #mainContent:has(#calendarView:not([hidden])) {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  html #calendarView:not([hidden]) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  html #calendarView > :not(#trainingTimeline) { flex: none; }
  html #calendarView .calendar-toolbar label { align-items: center; gap: 8px; }
  html #trainingTimeline { min-height: 0; }
  html #trainingTimeline:is(.week-view) { display: flex; flex-direction: column; }
  html #trainingTimeline .calendar-weekdays { flex: none; }
  html #trainingTimeline .calendar-days { min-height: 0; grid-auto-rows: minmax(0, 1fr); }
  /* A sparse week follows its entries instead of filling the window.
     Keep flex shrinking so dense days still scroll within the available space. */
  html #trainingTimeline .calendar-day {
    display: flex;
    flex-direction: column;
  }
  html #trainingTimeline .calendar-day-heading { flex: none; font-size: 13px; }
  html #trainingTimeline .calendar-day-units {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
    grid-auto-rows: max-content;
    margin-top: 4px;
    scrollbar-width: thin;
  }
  html #trainingTimeline.year-view { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; }
  html #trainingTimeline .year-month { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}

/* Shared tab heading: the approved calendar arrangement at every desktop width. */


@media screen {
  html #mainContent .view > .page-heading > div:first-child {
    
    max-width: 100%;
    
  }
  html #mainContent .page-heading :is(.planiq-page-brand, .raceiq-page-brand, .hub-page-brand) {
    grid-column: 1;
    grid-row: 1;
  }
  html #mainContent .page-heading h1 {
    
    
    
    max-width: none;
    overflow-wrap: anywhere;
  }
  html #mainContent .page-heading .supporting {
    grid-column: 1 / -1;
    font-size: 14px;
    margin-block: 8px 0;
    line-height: 1.5;
  }
  html #mainContent .page-heading > div:first-child > .status-pill { grid-column: 1 / -1; justify-self: start; }
}
@media screen and (max-width: 980px) {
  html #mainContent .view > .page-heading > div:first-child { width: 100%; }
}
@media screen and (max-width: 620px) {
}
@media print {
  
}
