/* ─── Filters: chip counts, active strip, bottom sheet ─── */

.chip-count {
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  opacity: 0.55;
  margin-left: 0.35em;
  letter-spacing: 0.02em;
}

/* Day chips: calendar-tile look — DOW caps, big date number, dim count */
.day-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.day-chip {
  display: grid !important;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding: 0.45rem 0.35rem 0.45rem !important;
  border-radius: 12px !important;
  min-height: 4.2rem;
  line-height: 1;
  gap: 0.18rem;
  overflow: hidden;
}
.day-chip-dow {
  font: 600 0.66rem/1 "JetBrains Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.day-chip-num {
  font: 700 1.7rem/1 "Instrument Serif", serif;
  font-style: italic;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.92);
}
.day-chip-count {
  font: 500 0.66rem/1 "JetBrains Mono", monospace;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
}
.day-chip.is-empty .day-chip-count { visibility: hidden; }
.day-chip.selectable:has(input:checked) {
  border-color: var(--accent, #ff5d29) !important;
  background: rgba(255,93,41,0.12) !important;
}
.day-chip.selectable:has(input:checked) .day-chip-dow { color: var(--accent, #ff5d29); }
.day-chip.selectable:has(input:checked) .day-chip-num { color: var(--accent, #ff5d29); }
.day-chip.selectable:has(input:checked) .day-chip-count { color: rgba(255,93,41,0.78); }

@media (max-width: 480px) {
  .day-chips { gap: 0.35rem; }
  .day-chip { padding: 0.4rem 0.25rem 0.4rem !important; min-height: 3.8rem; }
  .day-chip-dow { font-size: 0.6rem; letter-spacing: 0.14em; }
  .day-chip-num { font-size: 1.5rem; }
  .day-chip-count { font-size: 0.6rem; }
}
.chip.selectable.is-empty {
  opacity: 0.35;
  pointer-events: none;
}
.chip.selectable.is-empty input { pointer-events: none; }

.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
  position: relative;
}
.filter-trigger .filter-pill {
  display: inline-flex;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.45em;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-orange, #ff5d29);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
}

/* Active filter chip strip above results */
.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1rem 0.8rem;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.active-chip {
  appearance: none;
  background: rgba(255,93,41,0.10);
  color: var(--accent-orange, #ff5d29);
  border: 1px solid rgba(255,93,41,0.35);
  border-radius: 999px;
  padding: 0.28rem 0.55rem 0.28rem 0.8rem;
  font: 600 0.78rem/1 "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.active-chip:hover { background: rgba(255,93,41,0.18); }
.active-chip .x {
  display: inline-flex;
  width: 1.15em;
  height: 1.15em;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,93,41,0.35);
  color: #0a0a0a;
  font-size: 0.9em;
  line-height: 1;
}
.active-chip.clear-all {
  background: transparent;
  color: rgba(255,255,255,0.55);
  border-color: rgba(255,255,255,0.18);
  padding: 0.28rem 0.7rem;
}

/* Bottom sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[aria-hidden="false"] { pointer-events: auto; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sheet[aria-hidden="false"] .sheet-scrim { opacity: 1; }
.sheet-body {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 88dvh;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255,93,41,0.07), transparent 60%),
    linear-gradient(180deg, #161616, #0c0c0c);
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: 0;
  box-shadow: 0 -24px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet[aria-hidden="false"] .sheet-body { transform: translateY(0); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.1rem 0.4rem;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.sheet-title {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.sheet-close {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.sheet-close:hover { background: rgba(255,255,255,0.12); }

.sheet-section {
  padding: 0.9rem 1.1rem 0.4rem;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  overflow: hidden;
  flex: 0 0 auto;
}
.sheet-section:last-of-type { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sheet-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.sheet-section h3 {
  margin: 0;
  font: 700 0.78rem/1 "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.78);
}
.sheet-section h3 .muted { color: rgba(255,255,255,0.4); font-weight: 400; }

.sheet-search {
  flex: 1 1 auto;
  max-width: 60%;
}
.sheet-search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f6f6f6;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font: 400 0.85rem/1.1 "Bricolage Grotesque", system-ui, sans-serif;
}
.sheet-search input:focus {
  outline: 2px solid var(--accent-orange, #ff5d29);
  outline-offset: 0;
}

.opt-list {
  list-style: none;
  padding: 0;
  margin: 0 -0.3rem;
  overflow-y: auto;
  max-height: 44dvh;
  border-radius: 12px;
}
.sheet-section:last-of-type .opt-list { max-height: none; flex: 1 1 auto; }
.opt-row { padding: 0; }
.opt-row.is-hidden { display: none; }
.opt-row label {
  display: grid;
  grid-template-columns: 1.4rem 0.7rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  transition: background 0.1s ease;
}
.opt-row label:hover { background: rgba(255,255,255,0.04); }
.opt-row.is-selected label { background: rgba(255,93,41,0.10); }
.opt-row input[type="checkbox"] {
  accent-color: var(--accent-orange, #ff5d29);
  width: 1.05rem;
  height: 1.05rem;
}
.opt-row .opt-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  display: inline-block;
}
.opt-row .opt-name {
  font-size: 0.92rem;
  color: #ececec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-row .opt-count {
  font: 600 0.74rem/1 "JetBrains Mono", monospace;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.02em;
  padding-left: 0.5rem;
}

.sheet-foot {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  padding: 0.8rem 1.1rem max(0.9rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.35);
  position: sticky;
  bottom: 0;
}
.sheet-foot .btn { flex: 1 1 0; }
.sheet-foot .btn.primary { max-width: 60%; }

/* Hide the inline disclosure that the old browse template used */
.filter-disclosure { display: none !important; }
.hidden-filter-state { display: none; }

/* Attending button: replace .saved / .add visuals */
.btn.attend {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f0f0f0;
}
.btn.attend:hover {
  border-color: var(--accent-orange, #ff5d29);
  color: var(--accent-orange, #ff5d29);
}
.btn.attending {
  background: rgba(93,255,214,0.10);
  border: 1px solid rgba(93,255,214,0.45);
  color: var(--accent-mint, #5dffd6);
}
.btn.attending:hover {
  background: rgba(93,255,214,0.18);
}

@media (max-width: 480px) {
  .sheet-body { border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .sheet-search { max-width: 50%; }
  .opt-row .opt-name { font-size: 0.9rem; }
}
