.op-select-header {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.8rem;
    padding: 0.55rem 0.65rem;
    background: #f6f7f7;
    border: 1px solid #dcdcde !important;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    font-size: 14px !important;
    line-height: 1.4;
    vertical-align: middle;
}

.op-select-header-print {
    display: none !important;
}

.op-select-header > tbody {
    display: block;
    width: 100%;
}

.op-select-header > tbody > tr {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.7rem;
    width: 100%;
}

.op-select-header > tbody > tr > td {
    display: block;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    vertical-align: middle;
}

/* the occupancy plan table uses a fixed table layout */
.op-table {
    --op-time-column-width: 7.5rem;
    width: 100%;
    table-layout: fixed;
    border: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Themes frequently style every table and form control. Keep the toolbar
   self-contained while leaving nested calendar tables free to use table layout. */
.op-select-header {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.op-select-header tr,
.op-select-header td,
.op-select-header th {
    box-shadow: none !important;
}

/* Keep fixed time-slot labels readable instead of distributing the first
   column like a regular court column. */
.op-time-column,
.op-time-cell {
    width: var(--op-time-column-width, 7.5rem);
}

.op-time-cell {
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

/* The yearly overview contains compact day labels and four tables per row. */
.op-plan-container[data-plan-mode="yearly"] .op-table {
    --op-time-column-width: 4rem;
}

/* reduce the line height, if the plan uses a half hour layout */
.op-halfhour {
    line-height: 1em;
}

.op-header {
    font-size: 14px !important;
    line-height: 2em;
}

.op-header-row {
}

/* Keep the empty corner above the time column completely unpainted.
   In collapsed-border tables, border: 0 alone can lose to a theme's table/row
   border. border-style: hidden wins that conflict while visibility: hidden
   preserves the column width without drawing a frame. */
.op-plan-container .op-table > thead,
.op-plan-container .op-table > thead > tr {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.op-plan-container .op-table > thead > tr > .op-header-corner {
    background: transparent !important;
    border-color: transparent !important;
    border-style: hidden !important;
    box-shadow: none !important;
    color: transparent !important;
    outline: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}

/* The daily dates are an additional orientation aid for the weekly print view. */
.op-weekly-date-row {
    display: none;
}

.op-header-form {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: auto;
    margin: 0;
}

.op-plan-navigation {
    align-items: center;
    height: auto;
}

.op-navigation-cell {
    flex: 0 0 auto;
}

.op-plan-container .op-select-header .op-nav-button {
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
    box-sizing: border-box;
    margin: 0;
    padding: 0 !important;
    border: 1px solid #c3c4c7 !important;
    border-radius: 5px !important;
    background: #ffffff !important;
    color: #2271b1 !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04) !important;
    cursor: pointer;
    font-size: 1.35rem !important;
    font-weight: 600;
    line-height: 1 !important;
    text-align: center;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.op-plan-container .op-select-header .op-nav-button:hover,
.op-plan-container .op-select-header .op-nav-button:focus {
    background: #f0f6fc !important;
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 1px #2271b1 !important;
    outline: 0;
}

.op-plan-container .op-select-header .weekselect,
.op-plan-container .op-select-header .monthselect,
.op-plan-container .op-select-header .dayselect,
.op-plan-container .op-select-header .yearselect,
.op-plan-container .op-select-header .courtselect {
    box-sizing: border-box;
    height: 2.15rem;
    min-height: 2.15rem;
    margin: 0;
    padding: 0.25rem 0.55rem !important;
    border: 1px solid #8c8f94 !important;
    border-radius: 5px !important;
    background-color: #ffffff !important;
    color: #1d2327 !important;
    box-shadow: none !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.op-plan-container .op-select-header .weekselect:focus,
.op-plan-container .op-select-header .monthselect:focus,
.op-plan-container .op-select-header .dayselect:focus,
.op-plan-container .op-select-header .yearselect:focus,
.op-plan-container .op-select-header .courtselect:focus {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 1px #2271b1 !important;
    outline: 0;
}

.op-plan-container .op-select-header .weekselect {
    min-width: 10.5rem;
}

.op-plan-container .op-select-header .courtselect {
    min-width: 8.5rem;
}

.op-date-range {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    box-sizing: border-box;
    min-height: 2.15rem;
    padding: 0.35rem 1.15rem !important;
    border: 1px solid #dcdcde !important;
    border-radius: 5px;
    background: #ffffff;
    color: #50575e;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

.op-date-range-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
}

.op-date-range-label {
    color: #646970;
}

.op-date-range-value {
    color: #2c3338;
    font-weight: 600;
}

.op-date-range-separator {
    color: #2c3338;
    font-weight: 600;
}

.op-court-cell {
    margin-left: auto;
}

.op-court-form {
    width: auto;
}

.op-month-picker {
    width: min(17rem, 72vw);
    line-height: 1.25;
}

.op-month-picker-heading {
    align-items: center;
    display: grid;
    grid-template-columns: 2rem 1fr 2rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

.op-month-picker-heading button,
.op-month-picker-day {
    border: 0;
    cursor: pointer;
    margin: 0;
    min-width: 0;
    padding: 0.2rem;
}

.op-month-picker-calendar {
    border: 0 !important;
    border-collapse: collapse;
    margin: 0 !important;
    table-layout: fixed;
    width: 100%;
}

.op-select-header .op-month-picker-calendar th,
.op-select-header .op-month-picker-calendar td {
    border: 0 !important;
    display: table-cell;
    padding: 0 !important;
    text-align: center;
}

.op-month-picker-day {
    background: transparent;
    border-radius: 0;
    color: inherit;
    width: 100%;
}

.op-month-picker-week:hover,
.op-month-picker-week:focus-within {
    background: #e8f2fb;
}

.op-month-picker-week.is-selected {
    background: #cfe8ff;
    box-shadow: inset 3px 0 #2271b1;
    font-weight: 700;
}

.op-month-picker .is-outside-month {
    color: #777;
    opacity: 0.55;
}

.op-calendar-actions {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    line-height: 1.35;
    max-width: none;
    vertical-align: middle;
}

.op-calendar-action {
    display: inline-block;
    white-space: nowrap;
}

.op-calendar-reset {
    font-size: 85%;
}

.op-plan-container:not([data-plan-mode="yearly"]) .op-year-column {
    display: block;
    width: 100%;
}

.op-week-title {
    font-size: 1rem;
    margin: 1rem 0 0.35rem;
}

.op-header-form input,
.op-header-form select {
    vertical-align: middle;
}

/* Each header cell can use 13% of the complete width
   => The resit of 9% is used for the first column, which shows the time
*/
.op-header-td {
    text-align: center;
    width: auto;
    padding: 0px 0px 0px 0px !important;
}

.op-header-year {
    text-align: center;
    width: 90%;
}

/* Show the first header cell without border.
   Use !important because themes often style table cells globally. */
.op-header-td:first-child {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.op-body {
    font-size: 14px !important;
}

.op-body-row {
    line-height: 1.2;
}

.op-body-td {
    text-align: center;
    font-size: 90%;
    overflow: hidden;
    text-overflow: clip;
    width: auto;
    padding: 5px !important;
}

.op-body-td-first {
    border-top: dotted 1px grey !important;
    border-right: dotted 1px grey !important;
    border-bottom: dotted 1px grey !important;
    border-left: solid 1px grey !important;
}

.op-body-td-other {
    border: dotted 1px grey !important;
}

/* left align of the time which is in the first column */
.op-body-td:first-child {
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Remove any theme-added frame around the empty top-left header area. */
.op-header-row > .op-header-td:first-child,
.op-header-tr > .op-header-td:first-child {
    border: 0 !important;
    box-shadow: none !important;
}

/* DIV Table layout */
.op-schedule {
    display: table;
    width: 100%;
}

.op-schedule-header {
    display: table-header-group;
}

.op-schedule-body {
    display: table-row-group;
}

.op-schedule-row {
    display: table-row;
    line-height: 1.2;
}

.op-schedule-cell, .op-schedule-head {
    display: table-cell;
}

/* allow the user to click into a bookable or details cell */
.op-editable, .op-bookable, .op-details {
    touch-action: manipulation;
    cursor: pointer !important;
    user-select: none;
}

.op-daily {
    width: 1%;
}

.op-dialog-block-details {
    font-size: 14px !important;
    line-height: 1.2em !important;
}

.op-dialog-block-details-table {
    width: 100%;
}

/* show a grey background for the read-only fields in the detail dialog */
.op-dialog-block-details input:read-only {
    background: #f2f2f2;
}

.op-dialog-block-details textarea:read-only {
    width: 100%;
    background: #f2f2f2;
}

.op-halfsize {
    width: 50%;
}

.op-fullsize {
    width: 100%;
}

/*
.op-dialog-block-details input {
    padding: 1px 1px !important;
    line-height: 16px;
}
  */
.op-dialog-block-booking {
    font-size: 14px !important;
    line-height: 1.2em !important;
}

.op-dialog-block-booking table {
    width: 100%;
    margin:0 !important;
    border: none !important;
}

.op-dialog-block-booking input {
    line-height: 18px;
}

.op-dialog-block-booking table, .op-dialog-block-booking tbody,
.op-dialog-block-booking tr, .op-dialog-block-booking td {
    border: none !important;
}

/*
 * Keep the AJAX booking form visible when a responsive theme rewrites or
 * hides table elements on narrow screens.
 *
 * 1.5.1 - Harden booking and details dialogs for mobile theme styles.
 */
.op-dialog-block-booking table,
.op-dialog-block-details table {
    display: table !important;
    visibility: visible !important;
    width: 100% !important;
}

.op-dialog-block-booking tbody,
.op-dialog-block-details tbody {
    display: table-row-group !important;
    visibility: visible !important;
}

.op-dialog-block-booking tr,
.op-dialog-block-details tr {
    display: table-row !important;
    visibility: visible !important;
}

.op-dialog-block-booking td,
.op-dialog-block-details td {
    display: table-cell !important;
    visibility: visible !important;
}

.op-dialog-block-booking td {
    padding: 2px !important;
}

.op-dialog-block-booking input, .op-dialog-block-booking select {
    padding:2px 2px !important;
}

.op-dialog-block-booking textarea {
    padding:2px 2px !important;
    width: 100%;
}

/* show a grey background for the read-only fields in the booking dialog */
.op-dialog-block-booking input:read-only {
    background: #f2f2f2;
    width: 100%;
}

.op-readonly {
    background: #f2f2f2;
}

.op-dialog-block-booking select {
    width: 100%;
}

.op-year-year {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.op-year-column {
    display: table-cell;
    width: 25%;
    padding: 10px;
}

.xx-responsive {
    margin-bottom: 0;
    overflow: hidden;
    overflow-x: scroll;
    display: block;
    white-space: nowrap;
}

.op-inline-form {
    display: flex;
    justify-content: space-between;
}

.op-inline-form label {

    position: relative;
    padding: 10px 10px 10px 0;
}

/*
 * Layout adjustment for the jquery ui dialogs
 */
.op-plan-container > .ui-dialog {
    box-sizing: border-box;
    width: min(400px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
}

.ui-dialog .ui-dialog-titlebar {
    font-size: 14px;
}

.ui-dialog .ui-dialog-content {
    padding-bottom: 0 !important;
    font-size: 1.0em;
}

.op-plan-container > .ui-dialog .ui-dialog-content {
    box-sizing: border-box;
    max-height: calc(100vh - 140px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

@media only screen and (max-width: 480px) {
    .op-dialog-block-booking td:first-child,
    .op-dialog-block-details td:first-child {
        width: 38%;
        overflow-wrap: anywhere;
    }

    .op-dialog-block-booking input,
    .op-dialog-block-booking select,
    .op-dialog-block-booking textarea,
    .op-dialog-block-details input,
    .op-dialog-block-details select,
    .op-dialog-block-details textarea {
        box-sizing: border-box;
        max-width: 100%;
    }
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
    float: unset !important;
    font-size: 14px;
}

.ui-dialog .ui-dialog-buttonpane button.ui-button {
}

/*
 * Fix the elementor shorcode layout
 */
.elementor-shortcode .wrap {
    width: 100%;
    max-width: 100% !important;
}

/*
.minicolors-theme-default .minicolors-swatch {
    left: unset !important;
    float: right;
    margin-left: 5px;
}

@media only screen and (max-width: 768px) {
    #op-table-mobile{
        display: block;
    }
    #op-table-desktop{
        display: none;
    }
}
@media only screen and (min-width: 769px) {
    #op-table-mobile{
        display: none;
    }
    #op-table-desktop{
        display: block;
    }
}

*/

@media only screen and (max-width: 720px) {
    .op-select-header {
        padding: 0.5rem;
    }

    .op-select-header > tbody > tr {
        gap: 0.45rem;
    }

    .op-navigation-cell {
        flex: 1 1 100%;
    }

    .op-plan-navigation {
        display: flex;
        width: 100%;
    }

    .op-plan-container .op-select-header .weekselect,
    .op-plan-container .op-select-header .monthselect,
    .op-plan-container .op-select-header .dayselect,
    .op-plan-container .op-select-header .yearselect {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
    }

    .op-date-range {
        flex: 1 1 100%;
        justify-content: center;
        white-space: normal;
    }

    .op-court-cell {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .op-court-form,
    .op-plan-container .op-select-header .courtselect {
        width: 100%;
    }

    .op-calendar-actions {
        flex: 1 1 100%;
    }
}

.op-state-highlight {
    background: #eeeeee !important;
}

.op-input-alert {
    border: 1px solid red !important;
    -webkit-box-shadow: 0px 0px 0px 1px rgba(255,0,0,1);
    -moz-box-shadow: 0px 0px 0px 1px rgba(255,0,0,1);
    box-shadow: 0px 0px 0px 1px rgba(255,0,0,1);
}

.wp-picker-clear {
    font-size: 12px !important;
}

.op-booking-conflict {
    color: red;
}

.op-dialog-load-error {
    color: red;
}

.op-plan-container.op-plan-loading {
    opacity: 0.55;
    pointer-events: none;
}

.op-plan-navigation-error {
    color: red;
}
