.officehours-section {
    margin-top: 0;
    --officehours-available-green: #03c75a;
    --officehours-day-columns: 7;
}

.officehours-intro-block {
    margin: 0 0 8px 0;
    margin-top: calc(var(--nav-box-height) + var(--nav-border-bottom-thk) - var(--main-padding-top));
    margin-left: calc(-1 * var(--main-padding-left));
    margin-right: calc(-1 * var(--main-padding-right));
    padding: var(--box-content-padding);
    background: transparent;
    color: #000000;
    border-bottom: 1px solid #000000;
}

.officehours-section h5 {
    margin: 0 0 8px 0;
    font-size: calc(var(--main-font-size) * 1.5);
    font-weight: 700;
    line-height: 1.4;
}

.officehours-section > p {
    margin: 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-overview-list {
    margin: 0;
    padding-left: 18px;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-instructions-toggle {
    margin: 0;
}

.officehours-instructions-toggle summary {
    display: inline;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    color: #000000;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-weight: 400;
}

.officehours-instructions-toggle summary::-webkit-details-marker {
    display: none;
}

.officehours-instructions-label-open {
    display: none;
}

.officehours-instructions-label-closed {
    display: inline;
}

.officehours-instructions-toggle[open] .officehours-instructions-label-open {
    display: inline;
}

.officehours-instructions-toggle[open] .officehours-instructions-label-closed {
    display: none;
}

.officehours-instructions-toggle summary strong {
    font-weight: 700;
}

.officehours-instructions-toggle .officehours-overview-list {
    margin-top: 0.65em;
}

.officehours-intro-block h5,
.officehours-intro-block ul,
.officehours-intro-block li,
.officehours-instructions-toggle summary {
    color: #000000;
}

.officehours-overview-list li + li {
    margin-top: 2px;
}

.officehours-messages {
    display: none;
}

.officehours-popup-modal[hidden] {
    display: none;
}

.officehours-popup-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    place-items: center;
    padding: 12px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.2);
}

.officehours-popup-window {
    width: min(520px, calc(100vw - 24px));
    box-sizing: border-box;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    padding: 14px 12px 12px 12px;
}

.officehours-popup-text {
    margin: 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-popup-confirm {
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    padding: 4px 16px;
    cursor: pointer;
}

.officehours-message {
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-message.success {
    background: #d9f4d1;
}

.officehours-message.error {
    background: #ececec;
}

.officehours-message + .officehours-message {
    margin-top: 6px;
}

.officehours-inline-message {
    margin-top: 8px;
}

.officehours-topbar {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 0;
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    transition: column-gap 0.16s ease, padding 0.16s ease;
}

.officehours-month-nav {
    display: grid;
    grid-template-columns: 40px 172px 40px;
    align-items: center;
    column-gap: 2px;
    grid-column: 2;
    justify-self: center;
}

#officehours-month-label {
    margin: 0;
    font-size: clamp(22px, 2.3vw, 24px);
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    width: 172px;
    padding: 0;
}

.officehours-month-arrow {
    border: 0;
    background: transparent;
    color: var(--box-blue);
    width: 24px;
    height: 24px;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.officehours-month-arrow:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.officehours-month-arrow:disabled {
    color: #d4d4d4;
    cursor: not-allowed;
    text-decoration: none;
}

.officehours-legend {
    margin: 0;
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    font-size: clamp(13px, 1.15vw, calc(var(--nav-font-size) * 1.02));
    font-weight: 400;
    line-height: 1.4;
    min-width: 0;
    white-space: nowrap;
    transition: gap 0.16s ease, font-size 0.16s ease;
}

.officehours-legend > span {
    display: inline-flex;
    align-items: center;
}

.officehours-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px dotted #b8b8b8;
    margin-right: 5px;
    vertical-align: baseline;
}

.officehours-dot-unavailable {
    background: #ffffff;
}

.officehours-dot-available {
    background: var(--officehours-available-green);
}

.officehours-dot-booked {
    background: var(--box-blue);
}

.officehours-month-panel {
    display: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

.officehours-month-panel.is-active {
    display: block;
}

.officehours-admin-tools {
    margin: 0 0 8px 0;
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
}

.officehours-admin-menu-item {
    border: 0;
    background: transparent;
    color: #000000;
    font-size: calc(var(--main-font-size) * 0.8) !important;
    line-height: 1.4;
    padding: 0;
    cursor: pointer;
    font-style: italic;
    font-weight: 400;
}

.officehours-admin-menu-item:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.officehours-admin-menu-item.is-active {
    color: #000000;
    font-style: italic;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.officehours-bookings-panel {
    margin: 0 0 10px 0;
}

.officehours-bookings-panel h6 {
    margin: 0 0 4px 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-bookings-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.officehours-bookings-item {
    margin: 0;
    padding: 2px 0;
    border-top: 1px dotted #b8b8b8;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-bookings-item:first-child {
    border-top: 0;
}

.officehours-bookings-slot {
    font-weight: 700;
    margin-right: 8px;
}

#officehours-bookings-empty {
    margin: 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-days-grid {
    display: grid;
    grid-template-columns: repeat(var(--officehours-day-columns), minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1100px) {
    .officehours-topbar {
        column-gap: 8px;
    }

    .officehours-month-nav {
        grid-template-columns: 36px 164px 36px;
    }

    #officehours-month-label {
        width: 164px;
    }

    .officehours-legend {
        gap: 8px;
        font-size: clamp(12px, 1.05vw, 14px);
    }
}

@media (max-width: 1600px) {
    .officehours-section {
        --officehours-day-columns: 6;
    }
}

@media (max-width: 1400px) {
    .officehours-section {
        --officehours-day-columns: 5;
    }
}

@media (max-width: 1200px) {
    .officehours-section {
        --officehours-day-columns: 4;
    }
}

@media (max-width: 960px) {
    .officehours-section {
        --officehours-day-columns: 3;
    }
}

.officehours-day-card {
    padding: 0;
    min-width: 0;
}

.officehours-day-card.is-placeholder {
    visibility: hidden;
}

.officehours-day-empty {
    min-height: 1px;
}

.officehours-day-card h6 {
    margin: 0 0 4px 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-slot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.officehours-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dotted #b8b8b8;
    border-radius: 9px;
    min-height: 30px;
    padding: 2px;
    font-size: calc(var(--main-font-size) * 0.8) !important;
    line-height: 1.3;
    text-align: center;
    color: #000000;
    background: #ffffff;
}

.officehours-slot.is-unavailable {
    background: #ffffff;
    color: #b5b5b5;
}

.officehours-slot.is-booked {
    background: var(--box-blue);
    color: #ffffff;
    font-weight: 700;
}

.officehours-slot.is-available {
    background: var(--officehours-available-green);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.officehours-slot.is-available:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.officehours-slot.is-available.is-selected {
    border: 2px solid #000000;
    font-weight: 700;
}

.officehours-booking-modal[hidden] {
    display: none;
}

.officehours-booking-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
}

.officehours-booking-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.22);
}

.officehours-booking-dialog {
    position: relative;
    width: min(540px, calc(100vw - 24px));
    background: #ffffff;
    border: 0;
    padding: 12px;
    box-sizing: border-box;
}

.officehours-booking-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    color: #000000;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.officehours-booking-dialog h6 {
    margin: 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

#officehours-selected-slot {
    margin: 4px 0 0 0;
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-booking-form {
    margin-top: 8px;
}

.officehours-booking-fields {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    row-gap: 6px;
    column-gap: 10px;
    align-items: center;
}

.officehours-booking-fields label {
    font-size: var(--nav-font-size);
    line-height: 1.4;
}

.officehours-booking-fields input,
.officehours-booking-fields textarea {
    width: 100%;
    border: 0;
    border-bottom: 1px dotted #b8b8b8;
    background: #ffffff;
    color: #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    padding: 2px 0;
    box-sizing: border-box;
}

.officehours-booking-fields textarea {
    resize: vertical;
    min-height: 44px;
}

#officehours-submit-btn {
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    border: 1px solid #8f8f8f;
    background: #dcdcdc;
    color: #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    padding: 4px 16px;
    cursor: pointer;
}

#officehours-cancel-submit-btn {
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    border: 1px solid #8f8f8f;
    background: #dcdcdc;
    color: #000000;
    font-size: var(--nav-font-size);
    line-height: 1.4;
    padding: 4px 16px;
    cursor: pointer;
}

#officehours-submit-btn:hover {
    background: #cfcfcf;
}

#officehours-cancel-submit-btn:hover {
    background: #cfcfcf;
}

#officehours-submit-btn:disabled,
#officehours-cancel-submit-btn:disabled {
    background: #d0d0d0;
    color: #6b6b6b;
    cursor: wait;
}

@media (max-width: 760px) {
    .officehours-section {
        --officehours-day-columns: 2;
    }

    .officehours-topbar {
        grid-template-columns: 1fr;
        row-gap: 8px;
        min-height: 0;
        padding: 8px 0;
        justify-items: center;
    }

    .officehours-month-nav {
        grid-column: 1;
        justify-self: center;
    }

    .officehours-legend {
        grid-column: 1;
        justify-self: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        white-space: normal;
    }
}

@media (max-width: 650px) {
    .officehours-popup-window {
        width: calc(100vw - 20px);
    }

    .officehours-admin-tools {
        margin-top: 8px;
    }

    .officehours-admin-menu-item,
    .officehours-admin-menu-item.is-active {
        font-style: italic;
        font-weight: 400;
    }

    #officehours-month-label {
        font-size: 22px;
    }

    .officehours-booking-fields {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
}
