.wbs-timeline {
  --wbs-label-width: 260px;
  --wbs-day-width: 32px;
  --wbs-rule: #e1e5ef;
  --wbs-header: #f4f5fa;
  width: 100%;
  min-width: 0;
  color: var(--ink, #252c46);
}

.wbs-month-picker:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--second, #56617b);
  font-size: .78rem;
  white-space: nowrap;
}
.wbs-month-picker input[type="month"] {
  min-width: 0;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid #d4dae6;
  border-radius: 5px;
  background: #fff;
  color: var(--ink, #252c46);
}

.wbs-timeline .wbs-timeline-note {
  margin: 0 0 8px;
  color: var(--second, #56617b);
  font-size: .82rem;
}

.wbs-timeline .wbs-timeline-scroll {
  width: 100%;
  max-height: min(68vh, 40rem);
  overflow: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--wbs-rule);
  border-radius: 8px;
  background: #fff;
}

.wbs-timeline .wbs-timeline-scroll:focus-visible {
  outline: 2px solid var(--accent, #5955db);
  outline-offset: 2px;
}

.wbs-timeline .wbs-timeline-table {
  width: calc(var(--wbs-label-width) + var(--wbs-day-width) * var(--wbs-days));
  max-width: none;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.wbs-timeline .wbs-timeline-table col { width: var(--wbs-day-width); }
.wbs-timeline .wbs-timeline-table .wbs-timeline-label-col { width: var(--wbs-label-width); }
.wbs-timeline .wbs-timeline-table th,
.wbs-timeline .wbs-timeline-table td {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--wbs-rule);
  vertical-align: middle;
}
.wbs-timeline .wbs-timeline-table tbody tr:last-child > * { border-bottom: 0; }
.wbs-timeline .wbs-timeline-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 49px;
  color: #47516a;
  background: var(--wbs-header);
}
.wbs-timeline .wbs-timeline-table .wbs-timeline-corner,
.wbs-timeline .wbs-timeline-table .wbs-timeline-row-label {
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid #cdd3e2;
  text-align: left;
}
.wbs-timeline .wbs-timeline-table .wbs-timeline-corner {
  z-index: 3;
  padding: 0 12px;
  font-size: .78rem;
}
.wbs-timeline .wbs-timeline-table .wbs-timeline-row-label { background: #fff; }
.wbs-timeline .wbs-timeline-table .wbs-timeline-date {
  border-right: 1px solid var(--wbs-rule);
  text-align: center;
}
.wbs-timeline .wbs-timeline-date time { display: grid; gap: 2px; }
.wbs-timeline .wbs-timeline-date b { font-size: .76rem; line-height: 1.15; }
.wbs-timeline .wbs-timeline-date small { color: inherit; font-size: .64rem; line-height: 1.2; }
.wbs-timeline .wbs-timeline-table .wbs-timeline-date[data-kind="holiday"] { background: #ffefef; color: #923a4c; }
.wbs-timeline .wbs-timeline-table .wbs-timeline-date[data-kind="saturday"] { background: #eef2fa; color: #405d89; }

.wbs-timeline .wbs-timeline-task {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: inherit;
  text-align: left;
}
.wbs-timeline .wbs-timeline-task small,
.wbs-timeline .wbs-timeline-task strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.wbs-timeline .wbs-timeline-task small { color: var(--muted, #69758c); font-size: .68rem; font-weight: 400; }
.wbs-timeline .wbs-timeline-task strong { font-size: .81rem; font-weight: 600; }
.wbs-timeline button.wbs-timeline-task:hover { background: #f5f5fd; }
.wbs-timeline .wbs-timeline-track { position: relative; height: 58px; }
.wbs-timeline .wbs-timeline-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--wbs-days), minmax(0, 1fr));
  pointer-events: none;
}
.wbs-timeline .wbs-timeline-grid span { border-right: 1px solid var(--wbs-rule); background: #fff; }
.wbs-timeline .wbs-timeline-grid [data-kind="holiday"] { background: #fff4f4; }
.wbs-timeline .wbs-timeline-grid [data-kind="saturday"] { background: #f2f5fb; }
.wbs-timeline .wbs-timeline-bar {
  position: absolute;
  top: 50%;
  left: calc(var(--wbs-offset) * var(--wbs-day-width) + 1px);
  display: grid;
  place-items: center;
  width: calc(var(--wbs-length) * var(--wbs-day-width) - 2px);
  height: 26px;
  overflow: hidden;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: var(--wbs-bar-color, #6255bc);
  color: var(--wbs-bar-text, #fff);
  box-shadow: inset 0 0 0 1px rgb(29 35 59 / 32%);
  font-size: .69rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.wbs-timeline button.wbs-timeline-bar:hover { box-shadow: inset 0 0 0 2px currentColor; }
.wbs-timeline button.wbs-timeline-bar:focus-visible,
.wbs-timeline button.wbs-timeline-task:focus-visible {
  outline: 2px solid var(--accent, #5955db);
  outline-offset: -2px;
}
.wbs-timeline button.wbs-timeline-bar:focus-visible { outline-offset: 2px; }
.wbs-timeline .wbs-timeline-outside {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  padding: 1px 5px;
  border-radius: 3px;
  background: #fff;
  color: var(--muted, #69758c);
  font-size: .7rem;
}

@media (max-width: 700px) {
  .wbs-timeline { --wbs-label-width: clamp(116px, 33vw, 175px); }
  .wbs-timeline .wbs-timeline-table .wbs-timeline-corner,
  .wbs-timeline .wbs-timeline-task { padding-inline: 8px; }
}
@media (forced-colors: active) {
  .wbs-timeline .wbs-timeline-bar { border: 1px solid ButtonText; }
  .wbs-timeline .wbs-timeline-date[data-kind="holiday"] { text-decoration: underline; }
}
