.toan-schedule {
  --toan-purple: var(--wp--preset--color--gator-purple, #5c2879);
  --toan-light: var(--wp--preset--color--light-purple, #e3d3e5);
  --toan-active-left: 100%;
  --toan-active-right: 0px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.toan-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  height: auto;
  max-height: none;
  padding: 0;
  background: transparent;
  scrollbar-width: none;
}

.toan-tabs::-webkit-scrollbar {
  display: none;
}

.toan-tabs button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
  flex: 1 0 auto;
  font: inherit;
  font-weight: 400;
  padding: .7rem .9rem;
}

.toan-tabs button[aria-selected="true"] {
  background: transparent;
  border-bottom: 0;
  border-color: var(--toan-purple);
  border-radius: 12px 12px 0 0;
  color: inherit;
  padding-bottom: calc(.7rem + 1px);
  position: relative;
  z-index: 1;
}

.toan-tabs button:hover {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.toan-tabs button[aria-selected="true"]:hover {
  border-color: var(--toan-purple);
}

.toan-tabs button:focus {
  box-shadow: none;
  outline: none;
}

.toan-tabs button:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}

.toan-day[hidden] { display: none !important; }

.toan-day {
  position: relative;
}

.toan-day thead {
  position: relative;
}

.toan-day thead::before {
  border: 1px solid var(--toan-purple);
  border-radius: var(--toan-header-left-radius, 12px) var(--toan-header-right-radius, 12px) 12px 12px;
  /* Cut only the top border beneath the active tab, keeping the rounded outline. */
  clip-path: polygon(
    0 0,
    max(1px, var(--toan-active-left)) 0,
    max(1px, var(--toan-active-left)) 2px,
    min(calc(100% - 1px), calc(100% - var(--toan-active-right))) 2px,
    min(calc(100% - 1px), calc(100% - var(--toan-active-right))) 0,
    100% 0, 100% 100%, 0 100%
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.toan-schedule:not([data-active-edge]) .toan-day thead::before {
  clip-path: none;
}

.toan-day table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
}

.toan-day th,
.toan-day td {
  border-bottom: 1px solid var(--toan-light);
  padding: .7rem 1rem;
  text-align: left;
  vertical-align: top;
}

.toan-day th {
  background: transparent;
  border-bottom: 1px solid transparent !important;
  border-top: 0 !important;
  color: inherit;
  font-size: var(--wp--preset--font-size--medium, 1rem);
  font-weight: 600;
}

.toan-day th:first-child,
.toan-day th:last-child {
  border-inline: 1px solid transparent !important;
}

.toan-schedule[data-active-edge="first"] {
  --toan-header-left-radius: 0px;
}

.toan-schedule[data-active-edge="last"] {
  --toan-header-right-radius: 0px;
}

.toan-day th:last-child,
.toan-day td:last-child {
  width: 40%;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.toan-day td:first-child a { color: inherit; }
.toan-day .toan-host a { color: inherit; }
.toan-day .toan-host {
  width: 25%;
  overflow-wrap: anywhere;
}
.toan-day .toan-has-hosts th:last-child,
.toan-day .toan-has-hosts td:last-child {
  width: 35%;
}
.toan-empty { padding: 1rem; }
.toan-now { display: flex; flex-direction: column; }

@media (max-width: 47.99rem) {
  .toan-tabs button { flex: 0 0 auto; }
  .toan-day th,
  .toan-day td { padding: .65rem; }
}
