@layer ys-calendar-team-fills {
  #root .native-calendar button.native-event {
    background: var(--calendar-team-fill) !important;
    color: var(--calendar-team-ink) !important;
    border: 2px solid var(--calendar-kind-edge) !important;
  }
  #root .native-calendar button.native-event > :is(b, span, strong) {
    color: inherit !important;
  }
  #root .native-calendar .calendar-shared-teams > span {
    background: var(--calendar-team-fill) !important;
    color: var(--calendar-team-ink) !important;
  }
}

@layer ys-calendar-team-fills {
  :root[data-ys-theme=light] #root .calendar-entry-detail,
  :root[data-ys-theme=light] #root .calendar-entry-detail :is(section,article,header,footer,.panel,.table-wrap,table,tbody,tr,td) {
    background: #e4dfd7 !important;
    color: #101410 !important;
    border-color: #acb6a8 !important;
  }
  :root[data-ys-theme=light] #root .calendar-entry-detail :is(h1,h2,h3,h4,p,span,strong,b,label,small,th,td,button) {
    color: #101410 !important;
  }
  :root[data-ys-theme=light] #root .calendar-entry-detail :is(button,select,input,.game-detail-summary > div,thead th) {
    background: #d4e1ce !important;
    color: #101410 !important;
    border-color: #9baa95 !important;
  }
}
@layer ys-calendar-team-fills {
  #root .native-calendar { container-type: inline-size; }
  #root .native-calendar .calendar-period-controls {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 44px auto 44px minmax(0,1fr);
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    gap: 6px;
    text-align: center;
  }
  #root .calendar-period-controls > :first-child { grid-column: 2; }
  #root .calendar-period-controls > :last-child { justify-self: start; }
  @container (max-width: 460px) {
    #root .native-calendar .calendar-period-controls > :last-child {
      grid-column: 1 / -1;
      justify-self: center;
    }
  }
}

@layer ys-calendar-team-fills {
  #root .native-calendar .calendar-teams,
  #root .native-calendar .calendar-management-tools > label {
    display: block;
    box-sizing: border-box;
    width: 50% !important;
    min-width: 0;
  }
  #root .native-calendar .calendar-teams-toggle,
  #root .native-calendar .calendar-management-tools > label select {
    width: 100% !important;
    box-sizing: border-box;
  }
  #root .native-calendar .calendar-teams-toggle {display:flex;gap:8px;align-items:center}
  #root .native-calendar .calendar-teams-toggle b {white-space:nowrap}
  #root .native-calendar #calendar-selected-team-names {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #root .native-calendar .native-segment[role=tablist] {
    display:flex !important;
    width:fit-content !important;
    max-width:100%;
    justify-self:start;
    flex-wrap:wrap;
    gap:4px;
  }
  #root .native-calendar .native-segment[role=tablist] > button {
    flex:0 0 auto !important;width:auto !important;min-width:0 !important;
    padding:5px 12px !important;min-height:32px !important;
  }
  @container (max-width: 520px) {
    #root .native-calendar .calendar-teams,
    #root .native-calendar .calendar-management-tools > label {width:100% !important}
    #root .native-calendar .native-segment[role=tablist] > button {min-height:40px !important}
  }
}
@layer ys-calendar-team-fills {
  :root[data-ys-theme=light] #root .native-calendar :is(.calendar-teams-toggle,#calendar-team-options,#calendar-team-options label,#calendar-team-options p,#calendar-team-options button,.calendar-management-tools select,.calendar-management-tools option) {
    background-color:#d4e1ce !important;color:#101410 !important;border-color:#99aa94 !important;
  }
  :root[data-ys-theme=light] #root .native-calendar #calendar-team-options input[type=checkbox] {accent-color:#285935;color-scheme:light}
}

@layer ys-calendar-team-fills {
  #root .native-calendar .calendar-management-tools:has(> .actions) {
    display:grid !important;
    width:max-content !important;
    max-width:100% !important;
    min-width:0;
    justify-self:start;
    box-sizing:border-box;
  }
  #root .native-calendar .calendar-management-tools:has(> .actions) > label {
    width:100% !important;
    contain:inline-size;
  }
  #root .native-calendar .calendar-management-tools > .actions {
    display:flex !important;
    flex-wrap:wrap;
    justify-content:flex-start;
  }
  @container (max-width:520px) {
    #root .native-calendar .calendar-management-tools > .actions > button:last-child {flex-grow:1}
  }
}
@layer ys-calendar-team-fills {
  #root .native-calendar button.native-event:is([aria-label^="Game,"],[aria-label^="Practice,"]) {
    border-width:3px !important;
  }
  #root .native-calendar button.native-event[aria-label^="Game,"] > b {
    font-weight:800 !important;
  }
  #root .native-calendar button.native-event[aria-label^="Game,"] > b + span {
    font-weight:700 !important;
  }
}
