/* Fixed chips (Book a call, Availability) and the availability panel. */
.status-bar {
  position: fixed;
  top: calc(52px + env(safe-area-inset-top, 0px));
  right: max(var(--side-r), calc((100% - 1240px) / 2));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--chip-solid);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  line-height: normal;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.status[aria-expanded="true"] {
  background: var(--paper);
  color: var(--ink);
}

.status.book {
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

/* White chips carry a black outline so they stay visible over white sections. */
.status.book,
.status[aria-expanded="true"] {
  box-shadow: 0 0 0 1.5px var(--ink);
}
/* The outline must not swallow the focus ring: keep both, the ring outside. */
.status.book:focus-visible,
.status[aria-expanded="true"]:focus-visible {
  box-shadow:
    0 0 0 1.5px var(--ink),
    0 0 0 4.5px var(--ring-gap),
    0 0 0 6.5px var(--signal);
}

.status.book svg {
  width: 16px;
  height: 16px;
  display: block;
}

.status.book:hover {
  background: var(--chip-solid);
  color: var(--fg);
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  display: block;
}

.avail-panel {
  position: fixed;
  z-index: 40;
  box-sizing: border-box;
  top: calc(107px + env(safe-area-inset-top, 0px));
  left: max(var(--side), calc((100% - 1240px) / 2));
  right: max(var(--side-r), calc((100% - 1240px) / 2));
  max-height: calc(100dvh - 131px - env(safe-area-inset-top, 0px));
  overflow: auto;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.985);
  transition:
    opacity 0.3s ease,
    transform 0.5s var(--ease),
    visibility 0s linear 0.5s;
}

.avail-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.3s ease,
    transform 0.5s var(--ease),
    visibility 0s;
}

.avail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.avail-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.avail-head {
  align-self: stretch;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.avail-row h3 {
  margin: 0;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.4;
  font-family: var(--font-display);
}

.avail-row .count,
.avail-row .next {
  font-family: var(--font-utility);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre;
}

.pills {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pills.quarters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(164px, 45%), 1fr));
  gap: 12px 8px;
}

.pill {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-size: 14px;
  line-height: normal;
  white-space: nowrap;
}

.pill i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill {
  transition: background-color 0.2s ease;
}

.pill.open:hover {
  background: #ececec;
}

.pill.booked {
  background: var(--ink);
  color: var(--paper);
}

.pill.booked:hover {
  background: #2a2a2a;
}

.pill.booked i {
  background: var(--booked);
}

.pill.open {
  background: var(--paper);
  color: var(--ink);
}

.pill.open i {
  background: var(--free);
}

.pill.q {
  gap: 8px;
  padding: 8px 12px;
}

.pill .dots {
  flex: none;
  display: flex;
  gap: 4px;
}

.pill .dots i.taken {
  background: var(--booked);
}

.pill .dots i.free {
  background: var(--free);
}

.avail-book {
  margin: 0 -6px;
  padding: 2px 6px 4px;
  color: var(--ink);
  font-family: var(--font-utility);
  font-size: 14px;
  line-height: normal;
  text-decoration: none;
  white-space: nowrap;
  /* At rest: a plain underline just under the text. On hover its bottom edge stays put and it grows
     up behind the text and out to the sides into a block. */
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-size: calc(100% - 12px) 1px;
  background-position: center calc(100% - 2px);
  transition:
    background-size 0.3s ease-out,
    color 0.3s ease;
}

.avail-book:hover,
.avail-book:focus-visible {
  color: var(--paper);
  background-size: 100% calc(100% - 2px);
}

.avail-full {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.avail-note {
  margin: 0;
  width: calc((100% - 80px) * 2 / 3 + 40px);
  max-width: 100%;
  font-family: var(--font-utility);
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .avail-note {
    width: 100%;
  }

  .avail-list {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 700px) {
  .avail-panel {
    padding: 24px;
    gap: 40px;
  }

  .avail-list {
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pill,
  .avail-book {
    transition: none;
  }

  .avail-panel {
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}
