.fc {
    font-size: inherit;
    margin-top: 1px;
    background: var(--background-color);
}

.fc .fc-cell-shaded, .fc .fc-day-disabled {
    background: var(--component-border-color);
}

.fc-h-event, .fc-v-event, .fc-daygrid-event {
    background-color: var(--focus-color);
    border: none;
    border-radius: 4px;
}

/* padding on the day cell's own events container, rather than margin on each event - gives every event
   the same breathing room from the day cell's border (left/right/bottom - FullCalendar already spaces
   the top) without relying on margin on a per-event wrapper */
.fc-daygrid-day-events {
    padding: 0 3px 8px;
}

.fc-daygrid-block-event .fc-event-time, .fc-daygrid-block-event .fc-event-title, .fc-daygrid-dot-event {
    padding: 2px 4px;
}

/* a box-shadow ring rather than a wider border - a border adds to the element's own box size (which
   shifted/resized the event and its neighbors the moment it got selected), a shadow just paints over
   already-reserved space */
.event-highlight {
    background-color: var(--focus-color);
    box-shadow: 0 0 0 2px var(--text-color);
}

.fc-h-event .fc-event-main, .fc-v-event .fc-event-main {
    color: var(--component-background-color);
    display: flex;
    padding: 2px 6px;
}

/* the event's caption text had no line cap at all - with a long enough title (customer name etc.) its
   height was unbounded and unpredictable, which is exactly what FullCalendar's dayMaxEvents "how many
   events fit this row" measurement can't reliably budget around. Capping it to 3 lines, like we did for
   DayPilot's month view, gives it a fixed, predictable per-event height to measure against instead. */
.fc-h-event .fc-event-main > *, .fc-v-event .fc-event-main > * {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc .fc-daygrid-body {
    overflow: hidden;
}

.fc .fc-timegrid .fc-col-header {
    border-right: 0.5px solid var(--component-border-color);
}

.fc .fc-timegrid .fc-daygrid-body {
    border-right: 0.5px solid var(--component-border-color);
}

.fc .fc-timegrid-body {
    border-right: 0.5px solid var(--component-border-color);
}

.fc .fc-timegrid-divider {
    padding: 0 0 1px;
}

.fc-timegrid-event {
    font-size: inherit;
}

.fc-timegrid-event .fc-event-time {
    font-size: inherit;
}

.fc-timegrid-event .fc-event-main {
    padding: 0 3px;
}

.fc-timegrid-event-harness-inset .fc-timegrid-event, .fc-timegrid-event.fc-event-mirror {
    box-shadow: none;
}

.fc-event:hover {
    filter: brightness(0.92);
}

.fc .fc-scrollgrid {
    background: var(--component-background-color);
    border: 1px solid var(--component-border-color);
    border-radius: var(--table-border-radius);
}

.fc-scrollgrid-section-header {
    background: var(--background-color);
}

.fc-theme-standard th, .fc-theme-standard td {
    border-width: 0.5px 0 0 0.5px;
    border-style: solid;
    border-color: var(--component-border-color);
}

.fc-theme-standard th {
    border-bottom: 0.5px solid var(--component-border-color);
}

.fc-daygrid-dot-event .fc-event-title {
    color: var(--text-color);
    font-weight: normal;
}

.fc .fc-toolbar-title {
    font-weight: 600;
    font-size: 1.15em;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 0.3125rem;
}

.fc table {
    font-size: inherit;
}

.fc .fc-col-header-cell-cushion {
    font-weight: 600;
    padding: 4px 4px;
    color: var(--text-color);
}

.fc .fc-day-today {
    background-color: var(--selection-color);
}

.fc .fc-col-header-cell-cushion:hover {
    text-decoration: none;
}

a.fc-daygrid-day-number, a.fc-daygrid-day-number:hover {
    color: var(--text-color);
}

.fc .fc-button {
    padding: 0 0.75rem;
    font-size: inherit;
    tab-index: 0;
}

.fc .fc-calendar-date-prop {
    vertical-align: middle;
    padding: 0 0.375rem;
    text-align: start;
    font-size: inherit;
    font-family: inherit;
    color: var(--text-color);
    background: var(--component-background-color);
    border: 1px solid var(--component-border-color);
    border-radius: var(--button-border-radius);
    cursor: pointer;
}

.fc .fc-calendar-date-prop:hover {
    border: 1px solid var(--component-hover-border-color);
}

.fc .fc-calendar-date-prop:focus {
    border: 1px solid var(--focus-color);
    outline: none;
}

.fc .fc-button .fc-icon {
    vertical-align: initial;
    font-size: inherit;
}

.fc .fc-button:disabled {
    opacity: 1;
}

.fc .fc-button:focus {
    box-shadow: none;
}

.fc .fc-button-primary {
    background: var(--component-background-color);
    border: 1px solid var(--component-border-color);
    border-radius: var(--button-border-radius);
    cursor: pointer;
    color: var(--text-color);
}

.fc .fc-button-primary:focus {
    background-color: var(--selection-color);
    border: 1px solid var(--focus-color);
}

.fc .fc-button-primary:hover {
    background-color: var(--button-hover-background-color);
    color: var(--text-color);
}

.fc .fc-button-primary:hover:not(focus) { /* we want focus to have higher priority than hover*/
    border: 1px solid var(--component-hover-border-color);
}

.fc .fc-button-primary:active { /* should come after ':hover' and ':focus' */
    background-color: var(--button-active-background-color);
}

.fc .fc-button-primary:disabled {
    cursor: default;
    color: var(--disabled-text-color);
    background: var(--component-background-color);
    border: 1px solid var(--component-border-color);
}

.fc .fc-button-primary:disabled:hover {
    background: var(--background-color);
}

.fc .fc-button-primary:not(:disabled):active, .fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--selection-color);
    color: var(--text-color);
    border-color: var(--component-border-color);
    cursor: default;
}

.fc .fc-button-primary:not(:disabled):active:focus, .fc .fc-button-primary:not(:disabled).fc-button-active:focus {
    box-shadow: none;
}

.fc .fc-button-primary:not(:disabled):active:hover, .fc .fc-button-primary:not(:disabled).fc-button-active:hover {
    background: var(--background-color);
    border: 1px solid var(--focus-color);
}

.fc-daygrid-event {
    font-size: inherit;
}

.fc-daygrid-block-event .fc-event-time {
    font-weight: normal;
}

.fc-direction-ltr .fc-daygrid-event .fc-event-time {
    flex: 0 0 auto;
    margin-right: 0;
}

.fc .fc-daygrid-day-number {
    text-decoration: none;
    padding: 2px 6px;
    font-weight: 500;
}

.fc-direction-ltr .fc-daygrid-event .fc-event-time {
    color: var(--text-color);
}

.fc .fc-daygrid-day-bottom {
    font-size: inherit;
    margin: 2px 3px 0;
}

.fc .fc-daygrid-more-link {
    font-size: inherit;
    font-weight: 600;
    color: var(--focus-color);
    text-decoration: none;
}

.fc .fc-daygrid-more-link:hover {
    text-decoration: underline;
}

.fc .fc-popover {
    background-color: var(--background-color);
    border: 1px solid var(--dialog-outer-border-color);
    border-radius: var(--panel-border-radius);
}

.fc .fc-popover-header {
    color: var(--text-color);
    background-color: var(--dialog-border-color);
    border-bottom: 1px solid var(--dialog-outer-border-color);
    padding: 2px 4px;
}

.fc .fc-more-popover .fc-popover-body {
    min-width: 170px;
}

.fc .panel-renderer-value {
    box-sizing: unset;
}
