.stitch-events {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  min-width: 0;
  overflow-wrap: anywhere;
}

.stitch-events :where(h1, h2, h3, p, ul) {
  margin: 0;
}

.agenda-heading,
.agenda-search-context,
.agenda-search-footer,
.agenda-search-footer > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.agenda-search-footer {
  margin-top: 1.125rem;
  justify-content: space-between;
}

.stitch-events .stitch-page-context {
  margin-top: 0.375rem;
}

.agenda-heading h2,
.agenda-search-context > span {
  font: 700 0.75rem/1.4 var(--font-body);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.agenda-search-context {
  color: var(--sage);
}

.agenda-description {
  color: var(--muted);
  font-size: 1rem;
}

.agenda-create {
  position: relative;
  z-index: 2;
}

.agenda-results {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}

.agenda-create summary {
  cursor: pointer;
  list-style: none;
}

.agenda-create summary::-webkit-details-marker {
  display: none;
}

.agenda-create-links {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  display: grid;
  width: max-content;
  padding: 0.375rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
}

.agenda-create-links .filter-pill {
  justify-content: start;
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.agenda-create-links .filter-symbol {
  width: 1.25rem;
  height: 1.25rem;
  flex-basis: 1.25rem;
  background: transparent;
  color: var(--sage);
}

.agenda-create-links .filter-pill::after {
  content: none;
}

:where(.agenda-create-links) a:hover,
.agenda-results {
  background: var(--surface-strong);
}

.agenda-heading {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.agenda-heading h2 {
  margin: 0;
  color: var(--muted);
}

.agenda-heading > :last-child:not(h2, .agenda-status),
.agenda-search-context time {
  margin-inline-start: auto;
}

.agenda-status,
.agenda-favourite {
  display: inline-block;
  padding: 0.14rem 0.55rem;
  border-radius: 1rem;
  background: #f8eae1;
  color: #74462c;
  font: 600 0.6875rem/1.4 var(--font-body);
}

.agenda-list,
.stitch-events .agenda-search,
.agenda-empty {
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.agenda-list {
  overflow: hidden;
}

.agenda-list > .list-entry-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.agenda-list > * + *,
.agenda-list > .list-entry-card + .list-entry-card {
  border-top: 1px solid var(--line);
}

.agenda-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.625rem, 2vw, 1rem);
  padding: clamp(0.875rem, 3vw, 1.25rem);
  color: var(--ink);
  text-decoration: none;
}

.agenda-row:hover {
  background: var(--surface-row-alt);
}

[data-design="stitch"] .agenda-row:focus-visible {
  outline-offset: -3px;
}

.agenda-date,
.agenda-tile {
  display: grid;
  width: 3rem;
  min-height: 3rem;
  align-content: center;
  justify-items: center;
  border-radius: 0.55rem;
  background: #f0f3f4;
  color: var(--ink);
  line-height: 1.2;
}

.agenda-date small {
  font: 700 0.625rem/1.4 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agenda-date b {
  font-size: 1.2rem;
}

.agenda-tile {
  width: 2.5rem;
  min-height: 2.5rem;
}

.agenda-today {
  background: #f8eae1;
  color: #74462c;
}

.agenda-tile svg {
  width: 1.25rem;
  height: 1.25rem;
}

.agenda-copy {
  display: grid;
  gap: 0.15rem;
}

.agenda-copy strong {
  font: 600 1rem/1.45 var(--font-body);
}

.agenda-meta,
.agenda-tally,
.agenda-search-footer,
.agenda-search-context time,
.agenda-all-options {
  color: var(--muted);
  font-size: 0.75rem;
}

.agenda-chevron,
.agenda-row-action {
  color: var(--text-neutral-soft);
}

.agenda-chevron {
  font-size: 1.4rem;
}

.agenda-row-action {
  font-weight: 600;
  font-size: 0.8125rem;
}

.agenda-empty {
  padding: 1rem 1.25rem;
  color: var(--muted);
}

.agenda-searches {
  display: grid;
  gap: 1rem;
}

.stitch-events .agenda-search {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.agenda-search h3 {
  margin: 0.4rem 0;
  font: 700 1.25rem/1.4 var(--font-heading);
}

.agenda-search :where(h3) a {
  color: var(--ink);
  text-decoration: none;
}

:where(.agenda-search h3) a:hover {
  text-decoration: underline;
}

.agenda-options {
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.agenda-options li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.875rem;
  border-radius: 0.55rem;
  background: var(--bg);
  font-size: 0.8125rem;
}

.agenda-options .agenda-selected {
  background: var(--surface-neutral-soft);
}

.agenda-choice-mark {
  display: grid;
  width: 1.3rem;
  height: 1.3rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 700;
}

.agenda-selected .agenda-choice-mark,
.agenda-favourite {
  background: #b5eedf;
  color: #154f45;
}

.agenda-favourite {
  margin-inline-start: 0.3rem;
  border-radius: 0.25rem;
}

.agenda-own-choice {
  display: block;
  color: var(--sage);
}

.agenda-tally {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.agenda-tally meter {
  width: 4rem;
  height: 0.5rem;
  appearance: none;
  border: 0;
  border-radius: 1rem;
  background: var(--line);
}

.agenda-tally meter::-webkit-meter-bar {
  height: 0.5rem;
  border: 0;
  border-radius: 1rem;
  background: var(--line);
}

.agenda-tally meter::-webkit-meter-optimum-value {
  border-radius: 1rem;
  background: var(--sage);
}

.agenda-tally meter::-moz-meter-bar {
  border-radius: 1rem;
  background: var(--sage);
}

.agenda-search-footer a {
  color: var(--primary);
  font: 600 0.8125rem/1.4 var(--font-body);
}

.agenda-search-footer a:hover {
  text-decoration: underline;
}

.stitch-events #events-calendar {
  scroll-margin-top: 7rem;
  padding: clamp(0.625rem, 3vw, 1.5rem);
  border-radius: 0.875rem;
}

.stitch-events .calendar-header a:first-child::before {
  content: "←";
}

@media (width <= 42rem) {
  .agenda-create-links {
    right: auto;
    left: 0;
  }
}

@media (width <= 56rem) {
  .stitch-events .mini-calendar {
    position: relative;
  }

  .stitch-events .mini-calendar :is(td, .calendar-day-popover) {
    position: static;
  }

  .stitch-events .mini-calendar .calendar-popover-card {
    top: auto;
    left: 50%;
    margin-top: 0.25rem;
  }
}

@media (width <= 32rem) {
  .agenda-options li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agenda-tally {
    grid-column: 2;
  }

  .agenda-meta,
  .agenda-row-action {
    font-size: 0.75rem;
  }
}

@media (pointer: coarse) {
  .agenda-search-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
}
