/* 027 calendar legend and Night Shift A integration */

.page-calendar-2026{
  --cal-bank:#ef3f49;
  --cal-bank-soft:#fff0f1;
  --cal-return:#2398d0;
  --cal-return-soft:#eaf7fd;
  --cal-down:#cfeaf3;
  --cal-down-soft:#f0f8fb;
  --cal-weekend:#ffd617;
  --cal-weekend-soft:#fff9d7;
  --cal-annual:#d56618;
  --cal-annual-soft:#fff1e6;
  --cal-move:#ef8087;
  --cal-move-soft:#fff0f1;
  --cal-pattern:#6c3598;
  --cal-pattern-soft:#f4edfa;
  --cal-work:#b9e99e;
  --cal-line:#d4dee7;
  --cal-ink:#172233;
  --cal-muted:#657184;
}

/* Keep the selector clearly visible and usable. */
.page-calendar-2026 .screen-help{
  position:sticky;
  top:0;
  z-index:20;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  padding:9px 10px!important;
  background:rgba(255,255,255,.96)!important;
  backdrop-filter:blur(8px);
  box-shadow:0 7px 18px rgba(22,35,50,.07)!important;
}

.page-calendar-2026 .screen-help a,
.page-calendar-2026 .screen-help button{
  display:inline-flex!important;
  min-height:38px!important;
  align-items:center!important;
  justify-content:center!important;
  padding:8px 12px!important;
  border:1px solid #c8d2dc!important;
  border-radius:10px!important;
  color:#263348!important;
  background:#fff!important;
  font-weight:750!important;
  text-decoration:none!important;
}

.page-calendar-2026 .screen-help a:hover,
.page-calendar-2026 .screen-help a:focus-visible,
.page-calendar-2026 .screen-help button:hover,
.page-calendar-2026 .screen-help button:focus-visible{
  border-color:#df151d!important;
  color:#fff!important;
  background:#df151d!important;
  outline:none!important;
}

/* Repair all existing Team 1 / Team 2 legends. */
.page-calendar-2026 .cal-legend{
  padding:10px 14px 12px!important;
  border-top:1px solid var(--cal-line)!important;
  background:#fff!important;
}

.page-calendar-2026 .cal-legend .key-label{
  display:block!important;
  margin-bottom:6px!important;
  color:var(--cal-ink)!important;
  font-size:11px!important;
  font-weight:900!important;
}

.page-calendar-2026 .cal-legend .legend-row{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}

.page-calendar-2026 .cal-legend .legend-item{
  --legend-colour:#64748b;
  --legend-soft:#f4f6f8;
  display:inline-flex!important;
  min-height:20px!important;
  align-items:center!important;
  gap:5px!important;
  padding:3px 7px!important;
  border:1px solid color-mix(in srgb,var(--legend-colour) 30%,#dbe3ea)!important;
  border-radius:7px!important;
  color:#273448!important;
  background:linear-gradient(135deg,#fff,var(--legend-soft))!important;
  box-shadow:
    inset 2px 0 0 var(--legend-colour),
    0 1px 4px rgba(22,35,50,.03)!important;
  font-size:9px!important;
  font-weight:720!important;
  line-height:1.15!important;
}

.page-calendar-2026 .cal-legend .swatch{
  display:inline-block!important;
  width:11px!important;
  height:11px!important;
  flex:0 0 11px!important;
  border:1.5px solid #fff!important;
  border-radius:3.5px!important;
  background:var(--legend-colour)!important;
  box-shadow:
    0 0 0 1px color-mix(in srgb,var(--legend-colour) 75%,#263348),
    0 1px 4px color-mix(in srgb,var(--legend-colour) 22%,transparent)!important;
}

.page-calendar-2026 .cal-legend .legend-item:has(.swatch.work){
  --legend-colour:var(--cal-work);
  --legend-soft:#f2fbee;
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.bank){
  --legend-colour:var(--cal-bank);
  --legend-soft:var(--cal-bank-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.rtw){
  --legend-colour:var(--cal-return);
  --legend-soft:var(--cal-return-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.down){
  --legend-colour:#8ac6da;
  --legend-soft:var(--cal-down-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.weekend){
  --legend-colour:#e5bd00;
  --legend-soft:var(--cal-weekend-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.annual){
  --legend-colour:var(--cal-annual);
  --legend-soft:var(--cal-annual-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.xmasmove){
  --legend-colour:var(--cal-move);
  --legend-soft:var(--cal-move-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.pattern){
  --legend-colour:var(--cal-pattern);
  --legend-soft:var(--cal-pattern-soft);
}
.page-calendar-2026 .cal-legend .legend-item:has(.swatch.outside){
  --legend-colour:#9aa3b0;
  --legend-soft:#f4f5f7;
}

/* Direct fallbacks for browsers without :has(). */
.page-calendar-2026 .cal-legend .swatch.work{
  background:var(--cal-work)!important;
}
.page-calendar-2026 .cal-legend .swatch.bank{
  background:var(--cal-bank)!important;
}
.page-calendar-2026 .cal-legend .swatch.rtw{
  background:var(--cal-return)!important;
}
.page-calendar-2026 .cal-legend .swatch.down{
  background:#8ac6da!important;
}
.page-calendar-2026 .cal-legend .swatch.weekend{
  background:#e5bd00!important;
}
.page-calendar-2026 .cal-legend .swatch.annual{
  background:var(--cal-annual)!important;
}
.page-calendar-2026 .cal-legend .swatch.xmasmove{
  background:
    repeating-linear-gradient(
      45deg,
      #c8101d 0 2px,
      #ffffff 2px 4px
    )!important;
}
.page-calendar-2026 .cal-legend .swatch.pattern{
  background:var(--cal-pattern)!important;
}
.page-calendar-2026 .cal-legend .swatch.outside{
  background:#c3c9d1!important;
}

@media(max-width:620px){
  .page-calendar-2026 .screen-help{
    position:relative;
  }

  .page-calendar-2026 .screen-help .hint{
    width:100%;
  }

  .page-calendar-2026 .screen-help a,
  .page-calendar-2026 .screen-help button{
    flex:1 1 calc(50% - 8px);
  }

}

@media print{
  .page-calendar-2026 .screen-help{
    display:none!important;
  }

  .page-calendar-2026 .cal-legend .legend-item,
  .page-calendar-2026 .cal-legend .swatch{
    print-color-adjust:exact!important;
    -webkit-print-color-adjust:exact!important;
  }
}
