/* Shared search, filter dropdown, view pills, and chips.
   Tokens only. Import from actions.css / chrome.css. */

.hub-search,
input.hub-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--glass);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
}

.hub-search:focus-within,
input.hub-search:focus-visible {
  background: var(--paper);
  outline: 2px solid var(--wave);
  outline-offset: 2px;
}

.hub-search__icon {
  flex: none;
  color: var(--muted);
}

.hub-search__input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  color: var(--ink);
}

.hub-search__input::placeholder,
input.hub-search::placeholder {
  color: var(--muted);
}

.hub-search__input:focus-visible {
  outline: none;
}

.hub-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.2rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  cursor: pointer;
}

.hub-filter:hover,
.hub-filter[aria-expanded="true"] {
  background: var(--cotton);
}

.hub-filter__key {
  color: var(--muted);
  font-weight: var(--weight-regular);
}

.hub-filter__chev {
  flex: none;
  opacity: 0.45;
}

.hub-filter[aria-expanded="true"] .hub-filter__chev {
  transform: rotate(180deg);
}

.hub-filter.is-set {
  border-color: color-mix(in srgb, var(--wave) 45%, var(--line));
  background: color-mix(in srgb, var(--pastel-blue) 55%, #fff);
  color: var(--pastel-blue-ink);
  font-weight: var(--weight-medium);
}

.hub-filter.is-set .hub-filter__key {
  color: color-mix(in srgb, var(--pastel-blue-ink) 70%, transparent);
}

/* Exclusive option menus (Day / Week / Month). Sliding paper thumb.
   Independent action rows opt out with .hub-pills--loose. */
.hub-pills {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  isolation: isolate;
  gap: 0;
  padding: var(--space-px);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--shore) 70%, var(--warm-white));
}

.hub-pills__thumb {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: var(--hub-pill-w, 0px);
  height: var(--hub-pill-h, 0px);
  border-radius: calc(var(--radius-xs) - 1px);
  background: var(--paper);
  box-shadow: var(--elev-1);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--hub-pill-x, 0px), var(--hub-pill-y, 0px), 0);
}

.hub-pills.is-ready > .hub-pills__thumb {
  opacity: 1;
}

.hub-pills.is-animated > .hub-pills__thumb {
  transition:
    transform 0.2s ease-in-out,
    width 0.2s ease-in-out,
    height 0.2s ease-in-out;
}

.hub-pills__btn {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  min-height: 2.2rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink);
  cursor: pointer;
}

.hub-pills:not(.hub-pills--loose) > .hub-pills__btn {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 3.25rem;
  border: 0;
  background: transparent;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-weight: var(--weight-medium);
}

.hub-pills:not(.hub-pills--loose) > .hub-pills__btn:active {
  transform: scale(0.98);
}

.hub-pills__btn.is-active,
.hub-pills__btn.is-selected,
.hub-pills__btn[aria-selected="true"],
.hub-pills__btn[aria-checked="true"],
.hub-pills__btn[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--wave) 45%, transparent);
  background: color-mix(in srgb, var(--pastel-blue) 55%, #fff);
  color: var(--pastel-blue-ink);
  font-weight: var(--weight-semibold);
}

.hub-pills:not(.hub-pills--loose) > .hub-pills__btn.is-active,
.hub-pills:not(.hub-pills--loose) > .hub-pills__btn.is-selected,
.hub-pills:not(.hub-pills--loose) > .hub-pills__btn[aria-selected="true"],
.hub-pills:not(.hub-pills--loose) > .hub-pills__btn[aria-checked="true"],
.hub-pills:not(.hub-pills--loose) > .hub-pills__btn[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.hub-pills--loose {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  background: transparent;
  isolation: auto;
}

.hub-pills--loose > .hub-pills__thumb {
  display: none;
}

.hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.hub-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--pastel-lilac);
  color: var(--pastel-lilac-ink);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.hub-chip.is-active {
  background: var(--pastel-blue);
  color: var(--pastel-blue-ink);
}

.hub-menu {
  position: fixed;
  z-index: 60;
  min-width: 12rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: var(--space-1);
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-4);
  font-family: var(--font-ui);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.hub-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.hub-menu__head {
  padding: 0.4rem 0.55rem 0.3rem;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted);
}

.hub-menu__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.hub-menu__opt:hover,
.hub-menu__opt:focus-visible {
  background: var(--cotton);
}

.hub-menu__tick {
  flex: none;
  opacity: 0;
  color: var(--wave);
}

.hub-menu__opt[aria-checked="true"] .hub-menu__tick {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hub-filter__chev,
  .hub-menu,
  .hub-pills.is-animated > .hub-pills__thumb,
  .hub-pills:not(.hub-pills--loose) > .hub-pills__btn {
    transition: none;
  }

  .hub-pills:not(.hub-pills--loose) > .hub-pills__btn:active {
    transform: none;
  }
}
