.schedule-board-widget.fi-wi-widget {
    --fi-wi-widget-gap: 0;
}

.schedule-board {
    display: grid;
    gap: 1rem;
}

.schedule-board__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.schedule-board__tabs {
    flex: 1 1 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.375rem;
    width: 100%;
}

.schedule-board__tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 2.5rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.45rem 0.375rem;
    color: #3f3f46;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
}

.schedule-board__tab-short {
    display: block;
    width: 100%;
    color: #18181b;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.schedule-board__tab-label {
    display: none;
    width: 100%;
    overflow: hidden;
    color: #18181b;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.schedule-board__today-dot {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: #0d9488;
}

.schedule-board__tab--today {
    border-color: #5eead4;
    box-shadow: inset 0 0 0 1px #99f6e4;
}

.schedule-board__tab--active {
    border-color: #0d9488;
    background: #f0fdfa;
    color: #0f766e;
}

.schedule-board__tab--active .schedule-board__tab-short,
.schedule-board__tab--active .schedule-board__tab-label {
    color: #0f766e;
}

.schedule-board__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.625rem;
}

.schedule-board__filters label {
    display: grid;
    gap: 0.2rem;
    color: #71717a;
    font-size: 0.6875rem;
    font-weight: 600;
}

.schedule-board__filters select {
    min-width: 11rem;
    border: 1px solid #d4d4d8;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.4rem 0.6rem;
    color: #18181b;
    font-size: 0.8125rem;
}

.schedule-board__layout {
    display: inline-flex;
    border: 1px solid #e4e4e7;
    border-radius: 0.6rem;
    overflow: hidden;
}

.schedule-board__chip {
    border: 0;
    background: #fff;
    padding: 0.4rem 0.7rem;
    color: #52525b;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.schedule-board__chip--active {
    background: #0d9488;
    color: #fff;
}

.schedule-board__block {
    overflow: hidden;
    border: 1px solid #e4e4e7;
    border-radius: 0.9rem;
    background: #fff;
}

.schedule-board__block--a {
    border-color: #bfdbfe;
}

.schedule-board__block--b {
    border-color: #fde68a;
}

.schedule-board__block--outside,
.schedule-board__block--o {
    border-color: #d4d4d8;
}

.schedule-board__block-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f4f4f5;
}

.schedule-board__block--a .schedule-board__block-head {
    background: #eff6ff;
}

.schedule-board__block--b .schedule-board__block-head {
    background: #fffbeb;
}

.schedule-board__block--outside .schedule-board__block-head,
.schedule-board__block--o .schedule-board__block-head {
    background: #f4f4f5;
}

.schedule-board__outside-note {
    margin-left: 0.4rem;
    color: #71717a;
    font-size: 0.6875rem;
    font-weight: 500;
}

.schedule-board__block-head h3 {
    margin: 0;
    color: #18181b;
    font-size: 0.9375rem;
    font-weight: 700;
}

.schedule-board__block-head p {
    margin: 0.1rem 0 0;
    color: #71717a;
    font-size: 0.75rem;
}

.schedule-board__block-head em {
    margin-left: 0.4rem;
    color: #b45309;
    font-style: normal;
    font-weight: 650;
}

.schedule-board__empty {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    color: #a1a1aa;
    font-size: 0.8125rem;
}

.schedule-grid {
    --time-col: 3.5rem;
}

.schedule-grid__head {
    display: grid;
    grid-template-columns: var(--time-col) repeat(var(--cols), minmax(0, 1fr));
    border-bottom: 1px solid #e4e4e7;
    background: #fafafa;
}

.schedule-grid__gutter {
    border-right: 1px solid #f4f4f5;
}

.schedule-grid__th {
    min-width: 0;
    padding: 0.6rem 0.5rem;
    border-left: 1px solid #f4f4f5;
    color: #27272a;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-grid__body {
    display: grid;
    grid-template-columns: var(--time-col) minmax(0, 1fr);
}

.schedule-grid__times {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #f4f4f5;
    background: #fcfcfd;
}

.schedule-grid__times span {
    color: #a1a1aa;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem 0;
}

.schedule-grid__lanes {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}

.schedule-grid__lanes--closed {
    background: repeating-linear-gradient(
        -45deg,
        rgba(148, 163, 184, 0.1),
        rgba(148, 163, 184, 0.1) 7px,
        rgba(244, 244, 245, 0.4) 7px,
        rgba(244, 244, 245, 0.4) 14px
    );
}

.schedule-grid__hour-line,
.schedule-grid__half-line {
    position: absolute;
    right: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.schedule-grid__hour-line {
    border-top: 1px solid #e4e4e7;
}

.schedule-grid__half-line {
    border-top: 1px dashed #d4d4d8;
}

.schedule-grid__lane {
    position: relative;
    min-width: 0;
    border-left: 1px solid #f4f4f5;
}

.schedule-card {
    position: absolute;
    right: 0.3rem;
    left: 0.3rem;
    z-index: 2;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    gap: 0.05rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent);
    background: var(--bg, rgb(255 255 255 / 0.92));
    padding: 0.25rem 0.45rem;
    color: #1f2937;
    text-decoration: none;
}

.schedule-card--probe {
    --probe-accent: #ea580c;

    border: 1.5px solid rgb(234 88 12 / 0.42);
    border-left: 4px dashed var(--probe-accent);
    background-color: rgb(255 251 247 / 0.72);
    background-image: repeating-linear-gradient(
        -45deg,
        rgb(234 88 12 / 0.07),
        rgb(234 88 12 / 0.07) 5px,
        rgb(234 88 12 / 0.015) 5px,
        rgb(234 88 12 / 0.015) 10px
    );
    box-shadow: inset 0 0 0 1px rgb(234 88 12 / 0.06);
}

.schedule-card--probe:hover,
.schedule-card--probe:focus-visible {
    border-color: rgb(234 88 12 / 0.62);
    box-shadow:
        inset 0 0 0 1px rgb(234 88 12 / 0.1),
        0 8px 22px rgb(234 88 12 / 0.14);
}

.schedule-card--probe.schedule-card--completed {
    opacity: 0.72;
}

.schedule-card--probe.schedule-card--completed:hover,
.schedule-card--probe.schedule-card--completed:focus-visible {
    opacity: 1;
}

.schedule-card__probe-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border-radius: 0 0.45rem 0 0.35rem;
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 1px 3px rgb(234 88 12 / 0.35);
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0.12rem 0.34rem 0.12rem 0.28rem;
    text-transform: uppercase;
}

.schedule-card__probe-badge-icon {
    flex-shrink: 0;
    width: 0.55rem;
    height: 0.55rem;
}

.schedule-card--probe .schedule-card__row {
    padding-right: 2.4rem;
}

.schedule-card--probe .schedule-card__time {
    background: rgb(255 255 255 / 0.88);
    color: #9a3412;
}

.schedule-card:hover,
.schedule-card:focus-visible {
    z-index: 6;
    box-shadow: 0 8px 22px rgb(15 23 42 / 0.12);
}

.schedule-card--completed {
    opacity: 0.65;
    filter: saturate(0.5);
}

.schedule-card--completed:hover,
.schedule-card--completed:focus-visible {
    opacity: 1;
    filter: none;
}

.schedule-card__done {
    flex-shrink: 0;
    width: 0.85rem;
    height: 0.85rem;
    color: #059669;
}

.schedule-card__tip .schedule-card__tip-done {
    color: #047857;
    font-weight: 700;
}

.schedule-card__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    min-width: 0;
}

.schedule-card__title {
    min-width: 0;
    overflow: hidden;
    color: #111827;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-card__time {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.72);
    padding: 0.05rem 0.35rem;
    color: #3f3f46;
    font-size: 0.5625rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.schedule-card__date {
    color: #52525b;
    font-weight: 800;
}

.schedule-card--outside {
    border-left-color: #a1a1aa;
    background: rgb(244 244 245 / 0.92);
}

.schedule-card__meta {
    overflow: hidden;
    color: rgb(82 82 91 / 0.8);
    font-size: 0.625rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-card__tip {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 0;
    z-index: 8;
    display: none;
    min-width: 13rem;
    max-width: 16rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: 0 12px 30px rgb(15 23 42 / 0.14);
    padding: 0.55rem 0.65rem;
}

.schedule-card__tip strong,
.schedule-card__tip span {
    display: block;
    white-space: normal;
}

.schedule-card__tip span {
    color: #52525b;
    font-size: 0.6875rem;
}

.schedule-card:hover .schedule-card__tip,
.schedule-card:focus-visible .schedule-card__tip {
    display: grid;
    gap: 0.15rem;
}

@media (min-width: 768px) {
    .schedule-board__tabs {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .schedule-board__tab {
        min-height: 2.75rem;
        padding: 0.5rem 0.5rem;
    }

    .schedule-board__tab-short {
        display: none;
    }

    .schedule-board__tab-label {
        display: block;
    }
}

@media (max-width: 900px) {
    .schedule-grid {
        overflow-x: auto;
    }

    .schedule-grid__head,
    .schedule-grid__body {
        min-width: calc(var(--time-col) + (var(--cols) * 11rem));
    }

    .schedule-grid__head {
        grid-template-columns: var(--time-col) repeat(var(--cols), minmax(11rem, 1fr));
    }

    .schedule-grid__lanes {
        grid-template-columns: repeat(var(--cols), minmax(11rem, 1fr));
    }
}
