/*
 * Mobilizon UI skin.
 *
 * Loaded after the app's own stylesheet, so normal-specificity rules win. The
 * `!important` flags are limited to upstream utilities that use single-class
 * selectors (Tailwind) or to toggles that Vue would otherwise re-apply.
 *
 * Everything is scoped to #mobilizon / #navbar as much as possible. If an
 * upstream update renames a class, the rule simply stops applying; it must
 * never break the page. See docs/plans/mobilizon_ui_skin.md.
 */

/* ---------------------------------------------------------------------------
 * 1. Mobile parity: upstream hides the whole search results bar below sm
 *    (`hidden sm:flex`), which also removes the Map/List toggle.
 * ------------------------------------------------------------------------- */
@media (max-width: 639px) {
  #results-anchor {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  #results-anchor > p {
    width: 100%;
    margin: 0;
  }

  #results-anchor > div {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* The sort select gets its own row; Subscribe/Map share one. */
  #results-anchor .o-select {
    flex: 1 1 100%;
  }

  #results-anchor .o-button,
  #results-anchor .o-drop {
    flex: 1 1 40%;
  }

  #results-anchor .o-button {
    min-height: 44px;
    justify-content: center;
  }
}

/* ---------------------------------------------------------------------------
 * 2. Search quick buttons: three full-width rows on a phone -> three columns.
 *    Upstream uses min-w-40 (10rem), which cannot fit three across 360px.
 * ------------------------------------------------------------------------- */
@media (max-width: 639px) {
  #search-anchor > div:nth-of-type(2) {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #search-anchor .search-Event,
  #search-anchor .search-Activity,
  #search-anchor .search-Group {
    flex: 1 1 0;
    min-width: 0 !important;
    min-height: 44px;
    padding-inline: 0.35rem;
    white-space: normal;
  }

  #search-anchor .search-Event .o-button__label,
  #search-anchor .search-Activity .o-button__label,
  #search-anchor .search-Group .o-button__label {
    white-space: normal;
    line-height: 1.15;
    font-size: 0.9rem;
  }
}

/* Narrow devices: the address row has two 76 px buttons and a 176 px input,
 * and a geolocation error is squeezed in as a fourth flex item. Make the
 * buttons icon-sized, give the input the remaining row, and put the error on
 * its own full-width line. */
@media (max-width: 639px) {
  #mobilizon main .address-autocomplete .o-field--mobile {
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }

  #mobilizon main .address-autocomplete .o-field--mobile > button {
    flex: 0 0 auto;
    width: 2.75rem !important;
    min-width: 2.75rem !important;
    height: 2.75rem;
    padding-inline: 0 !important;
  }

  #mobilizon main .address-autocomplete .o-field--mobile > [data-oruga="autocomplete"] {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
  }

  #mobilizon main .address-autocomplete .o-field--mobile .o-input,
  #mobilizon main .address-autocomplete .o-field--mobile input {
    width: 100% !important;
    min-width: 0;
  }

  #mobilizon main .address-autocomplete .o-field__message {
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.2;
  }

  /* Preferences: "City or region" and "Radius" are grouped side by side.
   * Stack the city field full-width and keep the radius + reset on row two. */
  #mobilizon main .o-field--grouped {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  #mobilizon main .o-field--grouped > .o-field {
    flex: 1 1 100%;
    width: 100% !important;
    max-width: 100% !important;
  }

  #mobilizon main .o-field--grouped > .o-field:nth-of-type(2) {
    flex: 1 1 0;
  }

  #mobilizon main .o-field--grouped > button.reset-area {
    flex: 0 0 2.75rem;
    width: 2.75rem !important;
    min-width: 2.75rem !important;
    height: 2.75rem;
    padding-inline: 0 !important;
  }

  /* Home horizontal cards: upstream mixes w-[18rem] column cards with
   * full-width participation cards. Use one width on phones. */
  #mobilizon main .mbz-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Match the .mbz-card width (358 px at 390): the participation articles sit
   * in a container with less horizontal padding. */
  #mobilizon main article.rounded-t-lg {
    width: calc(100% - 1rem) !important;
    margin-left: auto;
    margin-right: auto;
  }

  /* The home card grid uses equal (1fr) rows, so a no-image card inherits the
   * height of a poster card and leaves a large empty area. Let rows size to
   * their content on phones. */
  #mobilizon main .mbz-skin-card-grid {
    grid-auto-rows: auto !important;
  }

  #mobilizon main .mbz-skin-no-image {
    align-self: start;
  }

}

/* ---------------------------------------------------------------------------
 * 3. Event title overflow. Upstream places the h1 in a min-w-[300px] flex
 *    child, and long unbroken hashtags run off-screen on a phone.
 * ------------------------------------------------------------------------- */
section.intro > div.flex-wrap > div {
  min-width: 0 !important;
}

section.intro h1 {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
}

/* Event description prose contains long source URLs (the publisher appends
 * one to every description); without wrapping, the link's min-content width
 * pushes the description/sidebar past the viewport. */
#mobilizon main .event-description .prose,
#mobilizon main .event-description .prose * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 639px) {
  /* The intro row places the title and the action section side by side once
   * the title can shrink; force them to stack instead. */
  section.intro > div.flex.flex-wrap.gap-2.justify-end {
    flex-direction: column;
  }

  section.intro > div.flex.flex-wrap.gap-2.justify-end > div {
    width: 100%;
  }

  section.intro h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  /* The start-time badge is oversized and covers the banner. */
  .start-time-icon-wrapper .starttime-container {
    font-size: 1.1rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  /* Stack the participation and action controls instead of right-aligning. */
  section.intro .event-participation > div {
    margin-left: 0 !important;
    width: 100%;
  }

  section.intro .event-participation .o-button {
    width: 100%;
  }

  section.intro div.flex.flex-col.gap-1.mt-1 {
    align-items: stretch;
  }

  section.intro div.flex.flex-col.gap-1.mt-1 > .ml-auto,
  section.intro div.flex.flex-col.gap-1.mt-1 > p {
    margin-left: 0;
  }

  section.intro div.flex.flex-col.gap-1.mt-1 .o-drop,
  section.intro div.flex.flex-col.gap-1.mt-1 .o-button {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
 * 3b. Agenda-style date/time. Hide the floating red/grey badges and show one
 *     compact line with a calendar and a clock. Palette: neutral surfaces with
 *     a teal accent, no red "danger" header.
 * ------------------------------------------------------------------------- */
#mobilizon main .date-calendar-icon-wrapper,
#mobilizon main .start-time-icon-wrapper,
#mobilizon main .mbz-card .datetime-container,
#mobilizon main .mbz-card .starttime-container,
#mobilizon main article.rounded-t-lg .datetime-container {
  display: none !important;
}

.mbz-skin-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  margin: 0.4rem 0 0.55rem;
  font-size: 0.9rem;
  line-height: 1.25;
  color: #3f3f46;
}

.dark .mbz-skin-meta {
  color: #e4e4e7;
}

.mbz-skin-meta-part {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: normal;
}

.mbz-skin-meta svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: #71717a;
}

.dark .mbz-skin-meta svg {
  color: #a1a1aa;
}

.mbz-skin-meta-date {
  color: #1e7d97;
  font-weight: 600;
}

.dark .mbz-skin-meta-date {
  color: #7dd3e0;
}

/* Magazine mode: the same meta node is moved into the image container and
 * turned into a white overlay over a bottom gradient. */
.mbz-skin-magazine-host {
  position: relative;
}

.mbz-skin-magazine {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0 !important;
  padding: 3rem 1rem 0.85rem;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0) 0%, rgba(8, 8, 12, 0.84) 100%);
  color: #fff;
  pointer-events: none;
}

.mbz-skin-magazine .mbz-skin-meta-part {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  color: #fff;
  white-space: normal;
}

.mbz-skin-magazine .mbz-skin-meta-date {
  color: #d4f1f7;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.mbz-skin-magazine .mbz-skin-meta-time {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.mbz-skin-magazine svg {
  width: 1rem;
  height: 1rem;
  color: #fff;
}

.mbz-skin-magazine .mbz-skin-meta-part:last-child svg {
  display: none;
}

.mbz-skin-magazine .mbz-skin-meta-part:last-child {
  margin-top: 0.15rem;
}

@media (max-width: 639px) {
  #mobilizon main .mbz-card .mbz-skin-magazine-host,
  #mobilizon main article.rounded-t-lg .mbz-skin-magazine-host {
    height: 220px !important;
    padding-top: 0 !important;
  }
}

/* No image: hide Mobilizon's large default card and show a short neutral date
 * strip in the content instead. Works in both agenda and magazine mode. */
#mobilizon main .mbz-skin-no-image > div.rounded-lg,
#mobilizon main .mbz-skin-no-image .h-40.relative,
#mobilizon main div.flex.justify-center.max-h-80.mbz-skin-no-image {
  display: none !important;
}

#mobilizon main .mbz-skin-noimage-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin: 0.4rem 0 0.75rem !important;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #f4f4f5;
  color: #3f3f46;
}

.dark #mobilizon main .mbz-skin-noimage-meta {
  background: #27272a;
  color: #e4e4e7;
}

#mobilizon main .mbz-skin-noimage-meta .mbz-skin-meta-part {
  white-space: normal;
}

/* Do not let the card's h-full/justify-between chain stretch the title and
 * organizer apart when the image is gone. */
#mobilizon main .mbz-skin-no-image,
#mobilizon main .mbz-skin-no-image .p-2.flex-auto,
#mobilizon main .mbz-skin-no-image .relative.flex.flex-col.h-full,
#mobilizon main .mbz-skin-no-image .w-full.flex.flex-col.justify-between.h-full {
  height: auto !important;
  min-height: 0 !important;
}

#mobilizon main .mbz-skin-no-image .p-2.flex-auto {
  flex: 0 0 auto !important;
}

#mobilizon main .mbz-skin-no-image .w-full.flex.flex-col.justify-between.h-full {
  justify-content: flex-start !important;
}

/* Neutral + teal card surfaces: softer than the purple blocks, with a thin
 * border and a teal hover edge. */
#mobilizon main .mbz-card,
#mobilizon main article.rounded-t-lg {
  border: 1px solid #e4e4e7;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.dark #mobilizon main .mbz-card,
.dark #mobilizon main article.rounded-t-lg {
  background-color: #27272a !important;
  border-color: #3f3f46;
}

#mobilizon main .mbz-card:hover {
  border-color: #1e7d97;
}

.dark #mobilizon main .mbz-card:hover {
  border-color: #2f9db9;
}

/* ---------------------------------------------------------------------------
 * 4. Contrast: measured 1.60:1 for placeholders and 4.08:1 for the inactive
 *    search tab before this patch.
 * ------------------------------------------------------------------------- */
#search-anchor .disactive,
#search-anchor .disactive .o-button__wrapper {
  color: #fff !important;
  opacity: 0.92;
  font-weight: 500;
  text-decoration: underline dotted;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
  opacity: 1;
}

.dark input::placeholder,
.dark textarea::placeholder,
.dark #search-anchor input::placeholder {
  color: #d4d4d8 !important;
  opacity: 1;
}

/* ---------------------------------------------------------------------------
 * 5. Notification settings table. Scoped to tables so admin checkboxes keep
 *    the upstream styling.
 * ------------------------------------------------------------------------- */
#mobilizon main .table th {
  background: #3f3f46;
  color: #fff;
}

#mobilizon main .table tr:nth-child(odd) {
  background: #27272a;
}

#mobilizon main .table tr:nth-child(even) {
  background: #1f1f23;
}

#mobilizon main .table tr {
  border-color: #52525b;
}

#mobilizon main .table td {
  color: #fafafa;
  vertical-align: middle;
}

#mobilizon main .table .o-checkbox__input {
  width: 1.25rem;
  height: 1.25rem;
  background-color: transparent;
  border: 2px solid #a1a1aa;
}

#mobilizon main .table .o-checkbox__input:checked {
  background-color: #1e7d97;
  border-color: #1e7d97;
}

/* TextEditor / ProseMirror placeholder is #adb5bd (≈2.3:1 on white). */
#mobilizon main .ProseMirror p.is-editor-empty:first-child::before {
  color: #6b7280;
}

.dark #mobilizon main .ProseMirror p.is-editor-empty:first-child::before {
  color: #d4d4d8;
}

/* Home "Tus próximos eventos" cards: EventParticipationCard repeats the
 * participation identity above every card. It is the profile you participate
 * as, not the organizer, and it duplicates the organizer row below. Hide the
 * bar; the event page and the identity picker still expose the identity. */
#mobilizon main article.rounded-t-lg > div.flex.p-2.text-violet-title {
  display: none !important;
}

/* Touch targets for the filter radios/checkboxes and menu links. */
@media (max-width: 767px) {
  #mobilizon main .table .o-checkbox__input,
  #search-anchor input[type="radio"],
  #search-anchor input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  #mobile-menu-2 a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Settings pages: the sidebar and the content are a wrapping flex row.
   * The content's min-width comes from the notification table, so without
   * min-width:0 the page overflows horizontally (measured 762px on a 390px
   * viewport). Stack them and let the table shrink. */
  #mobilizon main .container > div.flex.flex-wrap.gap-4 {
    flex-direction: column;
  }

  #mobilizon main .container > div.flex.flex-wrap.gap-4 > aside {
    max-width: 100% !important;
    width: 100% !important;
  }

  #mobilizon main .container > div.flex.flex-wrap.gap-4 > div.flex-1 {
    min-width: 0 !important;
    width: 100% !important;
  }

  #mobilizon main .table {
    width: 100% !important;
  }

  /* Personal feeds: the RSS/ICS/regenerate buttons are a nowrap flex row and
   * push the page to ~745px. Let them wrap. */
  #mobilizon main .container div.flex.gap-2 {
    flex-wrap: wrap;
  }

  /* Keep the two checkbox columns from collapsing; the description takes
   * the rest and wraps. */
  #mobilizon main .table th:nth-child(1),
  #mobilizon main .table td:nth-child(1),
  #mobilizon main .table th:nth-child(2),
  #mobilizon main .table td:nth-child(2) {
    min-width: 3.5rem;
  }
}

/* ---------------------------------------------------------------------------
 * 5b. About page configuration table. The instance-feeds row contains two
 *     nowrap buttons, which force the table to ~640px on a 390px screen; the
 *     registrations row also renders a third, contradictory "Closed" cell
 *     (upstream v-if/v-else bug). Let it fit and drop the bogus cell.
 * ------------------------------------------------------------------------- */
#mobilizon main section.px-3 > table {
  width: 100% !important;
  table-layout: fixed;
}

#mobilizon main section.px-3 > table td {
  overflow-wrap: anywhere;
}

#mobilizon main section.px-3 > table td:first-child {
  width: 38%;
}

#mobilizon main section.px-3 > table td:nth-child(3) {
  display: none;
}

#mobilizon main section.px-3 > table td.flex {
  flex-wrap: wrap;
}

#mobilizon main section.px-3 > table td.flex .o-button {
  max-width: 100%;
  height: auto;
  white-space: normal;
}

/* ---------------------------------------------------------------------------
 * 5c. Comment editor. Upstream puts avatar + ProseMirror + Send in one
 *     non-wrapping row: on a phone the editor shrinks to ~160px and the Send
 *     button overflows. Keep avatar + editor on the first row, Send below.
 * ------------------------------------------------------------------------- */
@media (max-width: 639px) {
  #mobilizon main form:has(.ProseMirror) > article {
    align-items: flex-start;
  }

  #mobilizon main form:has(.ProseMirror) > article > figure {
    flex: 0 0 auto;
  }

  #mobilizon main form:has(.ProseMirror) > article > div.flex-1 {
    flex: 1 1 calc(100% - 3.5rem);
    min-width: 0;
  }

  #mobilizon main form:has(.ProseMirror) > article > div:last-child {
    flex: 1 0 100%;
    margin-top: 0.5rem;
  }

  #mobilizon main form:has(.ProseMirror) > article > div:last-child .o-button {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
 * 5d. Home introduction for logged-in visitors. Upstream only renders it for
 *     guests, so the skin re-creates it from the public instance config.
 * ------------------------------------------------------------------------- */
.mbz-skin-home-intro p {
  max-width: 42rem;
  white-space: pre-line;
  line-height: 1.5;
}

.mbz-skin-home-intro a {
  display: inline-block;
  margin-top: 0.15rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
 * 6. Home hero: the largest element on a 390px screen.
 * ------------------------------------------------------------------------- */
@media (max-width: 639px) {
  main section.container > h1 {
    font-size: clamp(1.6rem, 7vw, 2.25rem);
    line-height: 1.15;
  }

  /* Upstream logo is w-40 (160px); give the hamburger room. */
  #navbar a[href="/"] svg {
    width: 7rem !important;
    height: auto;
  }
}

/* ---------------------------------------------------------------------------
 * 7. Footer: cramped links and a tiny language select on mobile.
 * ------------------------------------------------------------------------- */
footer > ul {
  gap: 0.75rem 1.25rem;
}

@media (max-width: 639px) {
  footer > ul {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  footer > ul > li {
    margin: 0.25rem 0;
  }

  footer > div {
    width: 100%;
  }

  footer .o-select {
    min-height: 44px;
  }
}

/* ---------------------------------------------------------------------------
 * 8. Skin-owned elements injected by skin.js.
 * ------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------
 * Recent searches (below the filter panel).
 * ------------------------------------------------------------------------- */
.mbz-skin-recent {
  margin-top: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-top: 1px solid #e4e4e7;
}

.dark .mbz-skin-recent {
  border-color: #3f3f46;
}

/* Searches live inside the search card, below the form. */
.mbz-skin-recent-searches {
  margin: 0.8rem 0 0;
  padding: 0.75rem 0 0;
  border: 0;
  border-top: 1px solid #e4e4e7;
  border-radius: 0;
  background: transparent;
}

/* Pull the filter toggle/card up under the recent-searches card. */
#mobilizon main aside.mbz-skin-search-aside {
  margin-top: 0.25rem !important;
}

/* The filter form used mt-4, leaving a white strip between the toggle button
 * and the filter card. The recent-filters block starts the form now. */
#mobilizon main aside.mbz-skin-search-aside > form.mt-4 {
  margin-top: 0 !important;
}

.dark .mbz-skin-recent-searches {
  border-color: #3f3f46;
}

/* Filters sit at the top of the filter form, only visible once it expands. */
.mbz-skin-recent-filters {
  margin: 0 0 0.75rem;
  padding: 0 0 0.75rem;
  border-top: 0;
  border-bottom: 1px solid #e4e4e7;
}

.dark .mbz-skin-recent-filters {
  border-color: #3f3f46;
}

.mbz-skin-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mbz-skin-recent-title {
  color: #71717a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mbz-skin-recent-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #d4d4d8;
  border-radius: 0.4rem;
  background: #fff;
  color: #52525b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.dark .mbz-skin-recent-more {
  background: #27272a;
  border-color: #3f3f46;
  color: #d4d4d8;
}

.mbz-skin-recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.mbz-skin-recent-chip {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  background: #fff;
  color: #3f3f46;
  font-size: 0.75rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mbz-skin-recent-chip.is-active {
  border-color: #1e7d97;
  color: #1e7d97;
}

.dark .mbz-skin-recent-chip {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

.dark .mbz-skin-recent-chip.is-active {
  border-color: #2f9db9;
  color: #7dd3e0;
}

.mbz-skin-recent-menu {
  margin-top: 0.4rem;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  background: #fff;
}

.dark .mbz-skin-recent-menu {
  background: #27272a;
  border-color: #3f3f46;
}

.mbz-skin-recent-menu a {
  display: block;
  padding: 0.45rem 0.6rem;
  color: #3f3f46;
  font-size: 0.78rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mbz-skin-recent-menu a:hover {
  background: #f4f4f5;
}

.dark .mbz-skin-recent-menu a {
  color: #e4e4e7;
}

.dark .mbz-skin-recent-menu a:hover {
  background: #3f3f46;
}

/* ---------------------------------------------------------------------------
 * Search layouts (A compact/labeled, B discovery, C map-first).
 * ------------------------------------------------------------------------- */
#mobilizon main .mbz-skin-search-card {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.dark #mobilizon main .mbz-skin-search-card {
  background: #27272a;
  border-color: #3f3f46;
}

.mbz-skin-search-title {
  margin: 0 0.25rem 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

#mobilizon main .mbz-skin-search-card #search-anchor {
  padding: 0;
}

.mbz-skin-field-label {
  margin: 0.25rem 0.25rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #71717a;
}

@media (min-width: 640px) {
  .mbz-skin-label-where {
    display: none;
  }
}

.mbz-skin-search-submit {
  flex: 1 0 100%;
  min-height: 44px;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: #1e7d97;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.mbz-skin-search-submit:hover {
  filter: brightness(0.96);
}

html[data-mbz-search-layout] #mobilizon main.mbz-skin-search-empty #results-anchor {
  display: none !important;
}

#mobilizon main .mbz-skin-empty-content {
  min-height: 0 !important;
  height: auto !important;
  padding: 1rem 0 !important;
}

/* Upstream pushes the empty state down with mt-80 (20rem), which is the huge
 * blank above it. Drop it once the skin takes over the layout. */
#mobilizon main.mbz-skin-search-empty .mt-80 {
  margin-top: 0 !important;
}

#mobilizon main .mbz-skin-empty-extra {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#mobilizon main:not(.mbz-skin-search-empty) .mbz-skin-empty-extra,
html[data-mbz-search-layout="c"] #mobilizon main .mbz-skin-empty-extra {
  display: none !important;
}

.mbz-skin-empty-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.mbz-skin-empty-tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.6rem;
  background: #fff;
  color: #3f3f46;
  text-decoration: none;
}

.mbz-skin-empty-tile > span {
  color: #1e7d97;
  font-size: 1.1rem;
  line-height: 1;
}

.mbz-skin-empty-tile b {
  font-size: 0.8rem;
}

.mbz-skin-empty-tile small {
  color: #a1a1aa;
  font-size: 0.7rem;
}

.mbz-skin-minimap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 68px;
  padding: 0 0.8rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.6rem;
  background: #e8eef0;
  color: #3f3f46;
  text-decoration: none;
  font-size: 0.78rem;
}

.mbz-skin-minimap svg {
  width: 18px;
  height: 18px;
  color: #1e7d97;
  flex: none;
}

.mbz-skin-minimap b {
  margin-left: auto;
  color: #1e7d97;
  font-size: 0.72rem;
}

.dark #mobilizon main .mbz-skin-empty-tile,
.dark #mobilizon main .mbz-skin-minimap {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

.mbz-skin-popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0.25rem;
  font-size: 0.75rem;
}

.mbz-skin-popular > span {
  margin-right: 0.25rem;
  color: #71717a;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mbz-skin-popular a {
  padding: 4px 8px;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  color: #52525b;
  text-decoration: none;
}

html[data-mbz-search-layout] #mobilizon main aside > button.w-full {
  background: #fff !important;
  color: #1e7d97 !important;
  border: 1px solid #d4d4d8;
  box-shadow: none;
}

.dark html[data-mbz-search-layout] #mobilizon main aside > button.w-full {
  background: #27272a !important;
  color: #7dd3e0 !important;
  border-color: #3f3f46;
}

html[data-mbz-search-layout="b"] #search-anchor .search-Event,
html[data-mbz-search-layout="b"] #search-anchor .search-Activity,
html[data-mbz-search-layout="b"] #search-anchor .search-Group {
  flex: 1;
  min-height: 74px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.78rem;
}

html[data-mbz-search-layout="c"] #mobilizon main .mbz-skin-search-card {
  position: sticky;
  top: 0.5rem;
  z-index: 15;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.12);
}

html[data-mbz-search-layout="c"] #mobilizon main aside {
  display: none !important;
}

html[data-mbz-search-layout="c"] #mobilizon main .leaflet-container {
  height: calc(100vh - 240px) !important;
  min-height: 420px;
  border-radius: 0.75rem;
}

.mbz-skin-map-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  padding: 0.55rem 1rem 1rem;
  border-radius: 1rem 1rem 0 0;
  background: #fff;
  box-shadow: 0 -8px 30px rgba(16, 24, 40, 0.16);
}

.dark .mbz-skin-map-sheet {
  background: #27272a;
}

.mbz-skin-sheet-grab {
  width: 38px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #d4d4d8;
}

.mbz-skin-sheet-head strong {
  font-size: 1rem;
}

.mbz-skin-map-sheet p {
  margin: 0.3rem 0 0.55rem;
  color: #71717a;
  font-size: 0.8rem;
}

.mbz-skin-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.mbz-skin-sheet-chips span {
  padding: 4px 8px;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #52525b;
}

.mbz-skin-sheet-actions {
  display: flex;
  gap: 0.5rem;
}

.mbz-skin-sheet-actions button {
  flex: 1;
  min-height: 40px;
  border-radius: 0.5rem;
  border: 1px solid #d4d4d8;
  background: #fff;
  color: #3f3f46;
  font-weight: 600;
}

.mbz-skin-sheet-actions .mbz-skin-sheet-search {
  border-color: #1e7d97;
  background: #1e7d97;
  color: #fff;
}

.dark .mbz-skin-sheet-actions button {
  background: #3f3f46;
  border-color: #52525b;
  color: #fafafa;
}

/* Appearance panel: search layout thumbnails. */
.mbz-skin-subsection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e4e4e7;
}

.dark .mbz-skin-subsection {
  border-color: #3f3f46;
}

.mbz-skin-subsection h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.mbz-skin-layout-overview {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.5rem 0;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
}

.mbz-skin-layout-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mbz-skin-layout-option {
  display: grid;
  grid-template-columns: auto 1fr 72px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
}

.dark .mbz-skin-layout-option {
  border-color: #3f3f46;
}

.mbz-skin-layout-option input {
  margin-right: 0.25rem;
}

.mbz-skin-layout-option span {
  display: block;
}

.mbz-skin-layout-option strong {
  display: block;
  font-size: 0.9rem;
}

.mbz-skin-layout-option small {
  display: block;
  color: #71717a;
  font-size: 0.75rem;
}

.mbz-skin-layout-option a {
  display: block;
}

.mbz-skin-layout-option img {
  display: block;
  width: 72px;
  height: 100px;
  object-fit: cover;
  object-position: top;
  border: 1px solid #e4e4e7;
  border-radius: 0.35rem;
}

.mbz-skin-layout-option:has(input:checked) {
  border-color: #1e7d97;
  box-shadow: inset 0 0 0 1px #1e7d97;
}

.mbz-skin-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  padding: 0.35rem 0.5rem 0.5rem;
}

.mbz-skin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.4rem;
  background: #fff;
  color: #52525b;
  cursor: pointer;
}

.mbz-skin-action svg {
  width: 1.1rem;
  height: 1.1rem;
}

.mbz-skin-action:hover {
  border-color: #1e7d97;
  color: #1e7d97;
}

.dark .mbz-skin-action {
  background: #27272a;
  border-color: #3f3f46;
  color: #d4d4d8;
}

.dark .mbz-skin-action:hover {
  border-color: #2f9db9;
  color: #7dd3e0;
}

.mbz-skin-action-danger:hover {
  border-color: #cd2026;
  color: #cd2026;
}

.dark .mbz-skin-action-danger:hover {
  border-color: #f87171;
  color: #f87171;
}

.mbz-skin-settings {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0.5rem 0 1rem;
  scroll-margin-top: 5rem;
}

.mbz-skin-active-tab {
  font-weight: 700;
}

.dark .mbz-skin-settings {
  background: #27272a;
  border-color: #3f3f46;
}

.mbz-skin-settings h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.mbz-skin-settings p {
  margin: 0 0 0.75rem;
  color: #52525b;
  font-size: 0.9rem;
}

.dark .mbz-skin-settings p {
  color: #a1a1aa;
}

.mbz-skin-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.4rem;
  cursor: pointer;
}

.dark .mbz-skin-option {
  border-color: #3f3f46;
}

.mbz-skin-option input {
  margin-top: 0.2rem;
}

.mbz-skin-option strong {
  display: block;
  font-size: 0.95rem;
}

.mbz-skin-option small {
  display: block;
  color: #71717a;
  font-size: 0.8rem;
}

.dark .mbz-skin-option small {
  color: #a1a1aa;
}

.mbz-skin-option:has(input:checked) {
  border-color: #1e7d97;
  box-shadow: inset 0 0 0 1px #1e7d97;
}

.mbz-skin-hidden {
  display: none !important;
}

/* One-tap map icon in the mobile header, next to the hamburger. */
.mbz-skin-map-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  color: #71717a;
  text-decoration: none;
  flex: none;
}

.mbz-skin-map-icon:hover {
  background: #f4f4f5;
  color: #3f3f46;
}

.dark .mbz-skin-map-icon {
  color: #a1a1aa;
}

.dark .mbz-skin-map-icon:hover {
  background: #3f3f46;
  color: #fff;
}

.mbz-skin-map-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 767px) {
  .mbz-skin-map-icon {
    display: inline-flex;
  }
}

/* Active state for the injected nav item (desktop and mobile menu). */
.mbz-skin-map-active {
  font-weight: 700;
  text-decoration: underline;
}

/* Visible "Add to my calendar" button on event pages. */
.mbz-skin-calendar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  gap: 0.4rem;
  min-height: 2.25em;
  padding: 0.25em 0.9em;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.mbz-skin-calendar svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.mbz-skin-calendar:hover {
  background: rgba(30, 125, 151, 0.1);
}

@media (max-width: 639px) {
  .mbz-skin-calendar {
    align-self: stretch;
    width: 100%;
  }
}

/* "Calendar (beta)": upstream injects a <br> and an absolutely positioned
 * span; keep the marker inline so the menu line does not break. */
#mobile-menu-2 li a span {
  position: static !important;
  display: inline;
  font-size: 0.75rem;
  line-height: 1;
}

/* Prevent a flash of the guest "Publish" CTA until the user query resolves;
 * skin.js also toggles .mbz-skin-hidden for browsers without :has(). */
body:not(:has(#user-menu-button)) .quick-publish {
  display: none !important;
}

@media (min-width: 768px) {
  /* The desktop nav is shown from md, not only lg. Right-align it and keep
   * the injected "(beta)" suffix inline at tablet widths too. */
  #navbar > .container {
    align-items: center !important;
    gap: 1.5rem !important;
  }

  #navbar > .container > div:has(> ul) {
    display: block !important;
  }

  #navbar > .container > div:has(> ul) > ul {
    width: 100%;
    justify-content: flex-end !important;
    gap: 1.5rem !important;
  }

  #navbar ul a {
    color: #3f3f46;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  #navbar ul a:hover {
    color: #1e7d97;
  }

  #navbar ul a br {
    display: none !important;
  }

  #navbar ul a span {
    position: static !important;
    display: inline !important;
    margin-left: 0.3rem;
    color: #a1a1aa;
    font-size: 0.7rem;
    font-weight: 500;
  }

  .dark #navbar ul a {
    color: #d4d4d8;
  }

  .dark #navbar ul a:hover {
    color: #7dd3e0;
  }
}

.mbz-skin-filter-title {
  display: none;
}

/* The search card and the results/filter container always share the same
 * outer width. Below 1024 the upstream `.container` caps at 768 px while the
 * search card caps at 896 px, which made the card visibly wider on tablets and
 * narrow desktop windows; both now fill the main column up to 1180 px. */
#mobilizon main > .container:not([class*="max-w-"]) {
  width: 100% !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
}

/* Search card, filter aside and result rows share the same visual edges:
 * below sm the result rows are inset 16 px (main + column padding), between
 * 768 and 1023 they are inset 48 px (container + column padding), and on
 * desktop the card spans the filter column plus the result column. */
#mobilizon main > .mbz-skin-search-card {
  width: calc(100% - 1rem) !important;
  max-width: 1180px !important;
  margin-left: 0.5rem !important;
  margin-right: auto !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
  #mobilizon main > .mbz-skin-search-card {
    width: calc(100% - 3rem) !important;
    margin-left: 1.5rem !important;
  }

  /* The aside sits inside the results container, which already has 16 px
   * horizontal padding at md; match the result rows (another 8 px each side). */
  #mobilizon main aside.mbz-skin-search-aside {
    width: calc(100% - 1rem) !important;
    margin-left: 0.5rem !important;
  }
}

@media (max-width: 767px) {
  #mobilizon main aside.mbz-skin-search-aside {
    width: calc(100% - 1rem) !important;
    margin-left: 0.5rem !important;
  }
}

/* ===========================================================================
 * 9. Desktop polish (≥1024 px).
 *
 * The upstream app is built mobile-first: search cards are 896 px wide, the
 * recents strip spans the viewport, result rows use 320 px thumbnails and the
 * event/group pages centre a phone-sized banner in a full-width card. This
 * section gives the desktop layout one page width, one card language and one
 * button hierarchy, closer to the mockups in docs/plans/assets/mobilizon-search.
 * Everything is additive and scoped so the phone layout is unchanged.
 * ========================================================================= */
@media (min-width: 1024px) {
  /* One page width for full-width page sections. Sections that opt into a
   * smaller Tailwind max-width (login, register, password reset) keep it. */
  #mobilizon main > .container:not([class*="max-w-"]) {
    width: min(calc(100% - 3rem), 1180px) !important;
  }

  /* Align the card with the filter card's left edge and the result rows'
   * right edge: width = container width - 40 px, offset by the container
   * gutter + 16 px. */
  #mobilizon main > .mbz-skin-search-card {
    width: calc(min(100% - 3rem, 1180px) - 2.5rem) !important;
    margin-left: calc((100% - min(100% - 3rem, 1180px)) / 2 + 1rem) !important;
    margin-right: 0 !important;
  }

  /* --- Search: one card language ---------------------------------------- */
  #mobilizon main > .mbz-skin-search-card {
    padding: 1rem 1.25rem 1.1rem !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  }

  #mobilizon main > .mbz-skin-search-card .mbz-skin-search-title {
    margin: 0 0 0.65rem 0.1rem;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
  }

  #mobilizon main > .mbz-skin-search-card #search-anchor {
    gap: 0.55rem !important;
  }

  /* Keyword and location share the first row, like the mockup. */
  #mobilizon main > .mbz-skin-search-card #search-anchor > div:first-of-type {
    flex-wrap: nowrap !important;
    align-items: center;
  }

  #mobilizon main > .mbz-skin-search-card #search-anchor > div:first-of-type > .o-input {
    flex: 1 1 auto;
    min-width: 0;
  }

  #mobilizon main > .mbz-skin-search-card #search-anchor .address-autocomplete {
    flex: 0 0 340px;
    min-width: 0;
  }

  #mobilizon main > .mbz-skin-search-card #search-anchor .address-autocomplete .o-field {
    margin-top: 0 !important;
  }

  /* Type tabs + primary action on one compact row. */
  #mobilizon main > .mbz-skin-search-card #search-anchor > div:nth-of-type(2) {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.4rem;
  }

  #mobilizon main > .mbz-skin-search-card #search-anchor .search-Event,
  #mobilizon main > .mbz-skin-search-card #search-anchor .search-Activity,
  #mobilizon main > .mbz-skin-search-card #search-anchor .search-Group {
    flex: 0 0 auto;
    min-width: 0 !important;
    min-height: 38px;
    padding: 0 0.9rem;
    border-radius: 0.5rem;
  }

  #mobilizon main > .mbz-skin-search-card #search-anchor .mbz-skin-search-submit {
    flex: 0 0 auto;
    order: 99;
    width: auto;
    min-width: 10rem;
    min-height: 38px;
    margin: 0 0 0 auto;
    padding: 0 1.25rem;
    border-radius: 0.5rem;
  }

  /* Segmented type control: selected = teal, the others = quiet outline. */
  #search-anchor .search-Event.active,
  #search-anchor .search-Activity.active,
  #search-anchor .search-Group.active {
    background: #1e7d97 !important;
    border: 1px solid #1e7d97 !important;
    color: #fff !important;
    box-shadow: none !important;
  }

  /* With no contentType in the URL upstream leaves all three without
   * active/disactive, which used to render three identical teal buttons. */
  #mobilizon main > .mbz-skin-search-card #search-anchor .search-Event:not(.active),
  #mobilizon main > .mbz-skin-search-card #search-anchor .search-Activity:not(.active),
  #mobilizon main > .mbz-skin-search-card #search-anchor .search-Group:not(.active) {
    background: #fff !important;
    border: 1px solid #d4d4d8 !important;
    color: #3f3f46 !important;
    box-shadow: none !important;
  }

  #search-anchor .search-Event .o-button__wrapper,
  #search-anchor .search-Activity .o-button__wrapper,
  #search-anchor .search-Group .o-button__wrapper {
    color: inherit !important;
  }

  .dark #mobilizon main > .mbz-skin-search-card #search-anchor .search-Event:not(.active),
  .dark #mobilizon main > .mbz-skin-search-card #search-anchor .search-Activity:not(.active),
  .dark #mobilizon main > .mbz-skin-search-card #search-anchor .search-Group:not(.active) {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #e4e4e7 !important;
  }

  /* Address pin/reset: quiet outlined buttons instead of teal slabs. */
  #search-anchor .address-autocomplete .o-field > .o-button {
    width: 2.5rem;
    min-width: 2.5rem;
    padding-inline: 0 !important;
    border: 1px solid #d4d4d8 !important;
    border-radius: 0.5rem;
    background: #fff !important;
    color: #71717a !important;
    box-shadow: none !important;
  }

  #search-anchor .address-autocomplete .o-field > .o-button--disabled {
    background: #f4f4f5 !important;
    color: #a1a1aa !important;
  }

  .dark #search-anchor .address-autocomplete .o-field > .o-button {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
  }

  #search-anchor .address-autocomplete .o-input__input {
    height: 42px;
  }

  #search-anchor .search-Event.disactive,
  #search-anchor .search-Activity.disactive,
  #search-anchor .search-Group.disactive {
    background: #fff !important;
    border: 1px solid #d4d4d8 !important;
    color: #3f3f46 !important;
    opacity: 1;
    text-decoration: none !important;
    box-shadow: none !important;
  }

  #search-anchor .disactive .o-button__wrapper {
    color: #3f3f46 !important;
    text-decoration: none !important;
  }

  .dark #search-anchor .search-Event.disactive,
  .dark #search-anchor .search-Activity.disactive,
  .dark #search-anchor .search-Group.disactive {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #e4e4e7 !important;
  }

  .dark #search-anchor .disactive .o-button__wrapper {
    color: #e4e4e7 !important;
  }

  /* Recents share the search card: a separator, not a second card. */
  #mobilizon main .mbz-skin-search-card .mbz-skin-recent-searches {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
  }

  #mobilizon main .mbz-skin-search-card .mbz-skin-recent-title {
    font-size: 0.65rem;
  }

  /* Filter panel: a real card, not a bare white column with 32 px gutters. */
  #mobilizon main aside.mbz-skin-search-aside {
    top: 5.5rem !important;
    max-height: calc(100vh - 7rem);
    padding: 1.1rem 1.1rem 1.25rem !important;
    border: 1px solid #e4e4e7;
    border-radius: 0.9rem;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  }

  #mobilizon main aside.mbz-skin-search-aside > div.sticky {
    padding: 0 !important;
  }

  .mbz-skin-filter-title {
    display: block;
    margin: 0 0 0.7rem 0.1rem;
    color: #71717a;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dark #mobilizon main aside.mbz-skin-search-aside {
    background: #27272a !important;
    border-color: #3f3f46;
  }

  /* The result column must be allowed to shrink below its content width,
   * otherwise the aside + rows push the page past 1024 px. */
  #mobilizon main .container > div.flex-1 {
    min-width: 0 !important;
  }

  /* Toolbar above the results: quiet controls, no competing teal slabs. */
  #results-anchor {
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #results-anchor > div.flex.gap-2 {
    flex-wrap: wrap;
  }

  #results-anchor .o-select {
    flex: 0 1 280px;
    min-width: 210px;
  }

  #results-anchor p {
    color: #52525b;
    font-size: 0.9rem;
  }

  .dark #results-anchor p {
    color: #d4d4d8;
  }

  #results-anchor .o-button {
    min-height: 38px;
    border: 1px solid #d4d4d8 !important;
    border-radius: 0.5rem;
    background: #fff !important;
    color: #3f3f46 !important;
    box-shadow: none !important;
  }

  #results-anchor .o-button:hover {
    background: #f4f4f5 !important;
    border-color: #a1a1aa !important;
  }

  #results-anchor .o-select {
    min-height: 38px;
  }

  .dark #results-anchor .o-button {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #e4e4e7 !important;
  }

  .dark #results-anchor .o-button:hover {
    background: #3f3f46 !important;
  }

  /* Result rows: consistent 260 px thumbnails and real content padding. */
  #mobilizon main .mbz-card.sm\:flex {
    margin: 0.7rem 0;
    border: 1px solid #e4e4e7;
    border-radius: 0.9rem;
    background: #fff !important;
    overflow: hidden;
  }

  .dark #mobilizon main .mbz-card.sm\:flex {
    background: #27272a !important;
    border-color: #3f3f46;
  }

  #mobilizon main .mbz-card.sm\:flex > div:first-child {
    flex: 0 0 250px;
    max-width: 250px !important;
  }

  #mobilizon main .mbz-card.sm\:flex > div:first-child figure {
    padding-top: 172px !important;
  }

  #mobilizon main .mbz-card.sm\:flex > div:last-child {
    min-width: 0 !important;
    padding: 0.85rem 1.1rem;
    overflow: hidden;
  }

  #mobilizon main .mbz-card.sm\:flex > div:last-child * {
    min-width: 0;
  }

  #mobilizon main .mbz-card.sm\:flex h2 {
    margin-bottom: 0.35rem !important;
    font-size: 1.35rem;
    line-height: 1.28;
    letter-spacing: -0.01em;
  }

  /* Empty state: a card, not a floating paragraph under a 500 px gap. */
  #mobilizon main div[role="note"] {
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 2rem 2.25rem;
    border: 1px solid #e4e4e7;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  }

  .dark #mobilizon main div[role="note"] {
    background: #27272a;
    border-color: #3f3f46;
  }

  #mobilizon main div[role="note"] > .o-icon {
    color: #1e7d97;
  }

  #mobilizon main div[role="note"] h2 {
    font-size: 1.45rem;
    letter-spacing: -0.01em;
  }

  #mobilizon main div[role="note"] ul {
    columns: 2;
    column-gap: 2rem;
    color: #52525b;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .dark #mobilizon main div[role="note"] ul {
    color: #d4d4d8;
  }

  /* --- Auth pages (login/register/reset) ---------------------------------- */
  #mobilizon main > section.container.max-w-screen-sm {
    margin-top: 2rem;
    padding: 2rem 2.25rem 2.25rem;
    border: 1px solid #e4e4e7;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  }

  .dark #mobilizon main > section.container.max-w-screen-sm {
    background: #27272a;
    border-color: #3f3f46;
  }

  #mobilizon main > section.container.max-w-screen-sm > h1 {
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
  }

  #mobilizon main > section.container.max-w-screen-sm .o-field {
    margin-bottom: 0.9rem;
  }

  #mobilizon main > section.container.max-w-screen-sm p.text-center {
    margin-top: 1.1rem;
  }

  #mobilizon main > section.container.max-w-screen-sm p.text-center .o-button {
    width: 100%;
    min-height: 44px;
    border-radius: 0.55rem;
  }

  #mobilizon main > section.container.max-w-screen-sm .flex.flex-wrap.gap-2.mt-3 {
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-top: 1rem;
  }

  #mobilizon main > section.container.max-w-screen-sm .flex.flex-wrap.gap-2.mt-3 .o-button {
    padding-inline: 0;
    font-size: 0.88rem;
  }

  #mobilizon main > section.container.max-w-screen-sm .flex.flex-wrap.gap-2.mt-3 p.control {
    margin: 0;
  }

  /* --- Event page -------------------------------------------------------- */
  /* Banner: full width, fixed height, cropped instead of a 512 px photograph
   * floating inside a 1280 px card. */
  #mobilizon main .container > div > div.flex.justify-center.max-h-80 {
    height: 320px;
    max-height: 320px !important;
    margin-bottom: 1rem;
    border-radius: 0.9rem;
    overflow: hidden;
    background: #18181b;
  }

  #mobilizon main .container > div > div.flex.justify-center.max-h-80 > .flex-1,
  #mobilizon main .container > div > div.flex.justify-center.max-h-80 .h-full.w-full,
  #mobilizon main .container > div > div.flex.justify-center.max-h-80 img {
    width: 100%;
    max-width: none !important;
    height: 100% !important;
    object-fit: cover;
  }

  #mobilizon main .container > div > div.flex.flex-col.relative.bg-white {
    padding: 1.25rem 1.5rem 1.4rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.9rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  }

  .dark #mobilizon main .container > div > div.flex.flex-col.relative.bg-white {
    background: #27272a !important;
    border-color: #3f3f46;
  }

  section.intro {
    padding: 0 !important;
  }

  section.intro > div.flex-wrap {
    align-items: flex-start;
    gap: 1.5rem;
  }

  section.intro h1 {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-transform: none;
  }

  section.intro .organizer {
    margin-top: 0.4rem;
    color: #71717a;
  }

  section.intro .o-button--disabled {
    border: 1px solid #e4e4e7 !important;
    border-radius: 999px;
    background: #f4f4f5 !important;
    color: #71717a !important;
    opacity: 1;
    box-shadow: none !important;
  }

  section.intro .o-button--disabled .o-button__label {
    text-decoration: none;
  }

  section.intro .o-button--disabled .o-button__icon {
    display: none !important;
  }

  section.intro .event-participation p {
    color: #71717a;
    font-size: 0.88rem;
  }

  section.intro .mbz-skin-calendar {
    border-color: #d4d4d8;
    background: #fff;
    color: #3f3f46;
    text-decoration: none !important;
  }

  .dark section.intro .mbz-skin-calendar {
    background: #27272a;
    border-color: #3f3f46;
    color: #e4e4e7;
  }

  .dark section.intro .o-button--disabled {
    background: #3f3f46 !important;
    border-color: #52525b !important;
    color: #d4d4d8 !important;
  }

  section.intro .mbz-skin-calendar:hover {
    background: #f4f4f5;
  }

  section.intro .o-dropdown .o-button {
    border: 1px solid #1e7d97 !important;
    border-radius: 0.5rem;
    background: #1e7d97 !important;
    color: #fff !important;
    box-shadow: none;
  }

  /* Article/sidebar two-column area. */
  #mobilizon main .container > div > div.flex.flex-wrap.flex-col.md\:flex-row-reverse {
    gap: 1.25rem;
  }

  #mobilizon main .container > div > div.flex.flex-wrap.flex-col.md\:flex-row-reverse > aside {
    background: #fff !important;
    border: 1px solid #e4e4e7;
    border-radius: 0.9rem;
    padding: 1.1rem 1.25rem;
    box-shadow: none;
  }

  .dark #mobilizon main .container > div > div.flex.flex-wrap.flex-col.md\:flex-row-reverse > aside {
    background: #27272a !important;
    border-color: #3f3f46;
  }

  #mobilizon main .container > div > div.flex.flex-wrap.flex-col.md\:flex-row-reverse > aside > div.sticky {
    padding: 0 !important;
  }

  #mobilizon main .container > div > div.flex.flex-wrap.flex-col.md\:flex-row-reverse > aside h2 {
    font-size: 1.05rem;
    margin: 0.9rem 0 0.4rem;
  }

  #mobilizon main .container > div > div.flex.flex-wrap.flex-col.md\:flex-row-reverse > aside h2:first-child {
    margin-top: 0;
  }

  #mobilizon main .event-description .prose,
  #mobilizon main .event-description .prose p,
  #mobilizon main .event-description .prose li {
    font-size: 1rem;
    line-height: 1.65;
  }

  #mobilizon main .event-description .prose > h2,
  #mobilizon main .event-description .prose > h3 {
    font-size: 1.35rem;
    letter-spacing: -0.01em;
  }

  /* --- Legal / content pages --------------------------------------------- */
  #mobilizon main aside.w-64 > div {
    padding: 0.65rem 0.5rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    background: #fff;
  }

  .dark #mobilizon main aside.w-64 > div {
    background: #27272a;
    border-color: #3f3f46;
  }

  #mobilizon main .prose {
    max-width: 74ch;
  }

  /* --- Group page -------------------------------------------------------- */
  #mobilizon main .presentation .banner-container {
    height: 260px;
    overflow: hidden;
    border-radius: 0.9rem;
    background: #18181b;
  }

  #mobilizon main .presentation .banner-container img {
    width: 100%;
    height: 260px !important;
    object-fit: cover;
    border-radius: 0.9rem;
  }

  #mobilizon main .presentation h1 {
    font-size: 2rem;
    letter-spacing: -0.015em;
  }

  #mobilizon main .presentation .title-container span {
    color: #71717a;
  }

  /* Tinted theme borders + peach headers made the cards look like a different
   * product. Use the same neutral surface as the rest of the skin. */
  #mobilizon main section.flex.flex-col.border-2 {
    border: 1px solid #e4e4e7 !important;
    border-radius: 0.9rem !important;
    overflow: hidden;
    background: #fff;
  }

  #mobilizon main section.flex.flex-col.border-2 > :first-child {
    background: #fafafa !important;
    color: #3f3f46 !important;
    border-bottom: 1px solid #e4e4e7;
    padding: 0.65rem 0.9rem;
  }

  #mobilizon main section.flex.flex-col.border-2 h2,
  #mobilizon main section.flex.flex-col.border-2 h3 {
    font-size: 1rem;
    letter-spacing: 0;
  }

  #mobilizon main section.flex.flex-col.border-2 .prose {
    font-size: 1rem;
    line-height: 1.6;
  }

  .dark #mobilizon main section.flex.flex-col.border-2 {
    background: #27272a;
    border-color: #3f3f46 !important;
  }

  .dark #mobilizon main section.flex.flex-col.border-2 > :first-child {
    background: #3f3f46 !important;
    color: #fafafa !important;
    border-color: #52525b;
  }

  /* Cards should size to their content in the 3-up group grid. */
  #mobilizon main .container > div.grid {
    align-items: start;
  }

  /* --- Home -------------------------------------------------------------- */
  #mobilizon main section.mt-5 img[src*="shape-"] {
    opacity: 0.28;
    filter: saturate(0.7);
  }

  #mobilizon main section.container > h1 {
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
  }

  #mobilizon main section.container > p {
    max-width: 780px;
    color: #52525b;
    line-height: 1.6;
  }

  .dark #mobilizon main section.container > p {
    color: #d4d4d8;
  }

  #mobilizon main > section.mt-5 {
    margin-top: 0.5rem !important;
  }

  /* Join the two upstream home forms into one search card, aligned with the
   * hero copy instead of floating in the middle of the page. */
  #mobilizon main > #short-search {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: min(calc(100% - 3rem), 760px) !important;
    max-width: 760px !important;
    margin: 1.25rem auto 0 !important;
    padding: 0.9rem 1rem 0.45rem !important;
    border: 1px solid #e4e4e7;
    border-bottom: 0;
    border-radius: 0.9rem 0.9rem 0 0;
    background: #fff;
  }

  #mobilizon main > #short-search > div {
    flex: 1 1 auto;
    max-width: none !important;
    min-width: 0;
  }

  #mobilizon main > #short-search .o-input {
    width: 100%;
  }

  #mobilizon main > #short-search .search-Event {
    flex: 0 0 auto;
    min-width: 8rem;
    border-radius: 0.5rem;
  }

  #mobilizon main > #short-search + #search-anchor {
    width: min(calc(100% - 3rem), 760px) !important;
    max-width: 760px !important;
    margin: 0 auto 1.5rem !important;
    padding: 0.45rem 1rem 1rem !important;
    border: 1px solid #e4e4e7;
    border-top: 0;
    border-radius: 0 0 0.9rem 0.9rem;
    background: #fff;
  }

  #mobilizon main > #short-search + #search-anchor > div:first-of-type {
    flex-wrap: nowrap !important;
    justify-content: stretch;
  }

  #mobilizon main > #short-search + #search-anchor .address-autocomplete {
    flex: 1 1 auto;
    min-width: 0;
  }

  #mobilizon main > #short-search + #search-anchor .address-autocomplete .o-field {
    margin-top: 0 !important;
  }

  #mobilizon main > #short-search + #search-anchor > div:nth-of-type(2) {
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  #mobilizon main > #short-search + #search-anchor .search-Event,
  #mobilizon main > #short-search + #search-anchor .search-Activity,
  #mobilizon main > #short-search + #search-anchor .search-Group {
    flex: 1 1 0;
    min-width: 0 !important;
    min-height: 38px;
    border: 1px solid #d4d4d8 !important;
    border-radius: 0.5rem;
    background: #fff !important;
    color: #3f3f46 !important;
    box-shadow: none !important;
  }

  #mobilizon main > #short-search + #search-anchor .search-Event .o-button__wrapper,
  #mobilizon main > #short-search + #search-anchor .search-Activity .o-button__wrapper,
  #mobilizon main > #short-search + #search-anchor .search-Group .o-button__wrapper {
    color: inherit !important;
  }

  #mobilizon main > #short-search,
  #mobilizon main > #short-search + #search-anchor {
    margin-left: max(1.5rem, calc((100% - 1180px) / 2)) !important;
    margin-right: 0 !important;
  }

  .dark #mobilizon main > #short-search,
  .dark #mobilizon main > #short-search + #search-anchor {
    background: #27272a;
    border-color: #3f3f46;
  }

  .dark #mobilizon main > #short-search + #search-anchor .search-Event,
  .dark #mobilizon main > #short-search + #search-anchor .search-Activity,
  .dark #mobilizon main > #short-search + #search-anchor .search-Group {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #e4e4e7 !important;
  }

  .dark #mobilizon main > #short-search + #search-anchor .o-button__wrapper {
    color: #e4e4e7 !important;
  }
}


/* Search radius: keep the value picker compact so the address gets the room. */
#search-anchor .address-autocomplete .o-field > .o-dropdown:not(.o-autocomplete) {
  flex: 0 0 auto !important;
  width: 5.25rem !important;
  min-width: 0 !important;
}

#search-anchor .address-autocomplete .o-field > .o-dropdown:not(.o-autocomplete) .o-dropdown__trigger,
#search-anchor .address-autocomplete .o-field > .o-dropdown:not(.o-autocomplete) .o-button {
  width: 100% !important;
  min-width: 0 !important;
  padding-inline: 0.35rem !important;
}

/* Event location: a compact place row that opens the existing map modal. */
.mbz-skin-location-compact > .o-icon,
.mbz-skin-location-compact > .content-wrapper {
  display: none !important;
}

.mbz-skin-location-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.6rem;
  background: #fafafa;
  color: #3f3f46;
  text-align: left;
  cursor: pointer;
}

.mbz-skin-location-summary svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  color: #1e7d97;
}

.mbz-skin-location-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mbz-skin-location-action {
  flex: none;
  color: #1e7d97;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.mbz-skin-location-summary:hover {
  border-color: #1e7d97;
}

.dark .mbz-skin-location-summary {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

/* Event detail actions: icon-only trigger, like the card action icons. */
section.intro .o-dropdown.ml-auto .o-button {
  width: 2.5rem !important;
  min-width: 2.5rem !important;
  height: 2.5rem;
  padding: 0 !important;
  border: 1px solid #d4d4d8 !important;
  border-radius: 0.5rem;
  background: #fff !important;
  color: #3f3f46 !important;
  box-shadow: none !important;
  align-self: flex-end;
  margin-left: auto !important;
}

section.intro .o-dropdown.ml-auto .o-button__label {
  display: none !important;
}

section.intro .o-dropdown.ml-auto .o-button__wrapper {
  gap: 0;
}

section.intro .o-dropdown.ml-auto .o-button__icon {
  margin: 0;
}

section.intro .o-dropdown.ml-auto .o-button:hover {
  border-color: #1e7d97 !important;
  color: #1e7d97 !important;
}

.dark section.intro .o-dropdown.ml-auto .o-button {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
}

/* Event detail: expand the actions menu into the card-style icon row. */
.mbz-skin-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
  margin-left: auto;
}

.mbz-skin-detail-actions .mbz-skin-action {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
}

.dark .mbz-skin-detail-actions .mbz-skin-action {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

.dark .mbz-skin-detail-actions .mbz-skin-action:hover {
  border-color: #2f9db9;
  color: #7dd3e0;
}

/* Event page: align the whole content column with the search content width so
 * banners, title, sidebar, about and comments all share the same edges. */
#mobilizon main > .container:has(section.intro) {
  width: calc(100% - 1rem) !important;
  max-width: 1180px !important;
  margin-left: 0.5rem !important;
  margin-right: auto !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
  #mobilizon main > .container:has(section.intro) {
    width: calc(100% - 3rem) !important;
    margin-left: 1.5rem !important;
  }
}

@media (min-width: 1024px) {
  #mobilizon main > .container:has(section.intro) {
    width: calc(min(100% - 3rem, 1180px) - 2.5rem) !important;
    margin-left: calc((100% - min(100% - 3rem, 1180px)) / 2 + 1rem) !important;
    margin-right: 0 !important;
  }
}

/* Date/time metadata: compact inset row, small teal icon, timezone chip. */
.mbz-skin-datetime {
  align-items: flex-start !important;
  gap: 0.55rem !important;
  margin-bottom: 0.85rem !important;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.6rem;
  background: #fafafa;
}

.mbz-skin-datetime > .o-icon,
.mbz-skin-datetime > .material-design-icon {
  flex: none;
  margin-top: 0.15rem;
  color: #1e7d97;
}

.mbz-skin-datetime > .o-icon svg,
.mbz-skin-datetime > .material-design-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.dark .mbz-skin-datetime > .o-icon,
.dark .mbz-skin-datetime > .material-design-icon {
  color: #7dd3e0;
}

.mbz-skin-datetime .content-wrapper {
  min-width: 0;
}

.mbz-skin-datetime .content-wrapper > p {
  margin: 0;
  color: #3f3f46;
  font-size: 0.92rem;
  line-height: 1.45;
}

.mbz-skin-datetime .o-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

/* Turn the switch into a small state chip; the input still toggles via the
 * label, so the timezone behaviour is unchanged. */
.mbz-skin-datetime .o-switch__input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.mbz-skin-datetime .o-switch__label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #eef7f9;
  color: #1e7d97;
  font-size: 0.72rem;
  line-height: 1.4;
}

.mbz-skin-datetime .o-switch--checked .o-switch__label::before {
  content: "✓";
  font-weight: 700;
}

.mbz-skin-datetime .o-switch:not(.o-switch--checked) .o-switch__label {
  background: #f4f4f5;
  color: #71717a;
}

.mbz-skin-datetime .o-switch:not(.o-switch--checked) .o-switch__label::before {
  content: "○";
}

.dark .mbz-skin-datetime {
  background: #1f1f23;
  border-color: #3f3f46;
}

.dark .mbz-skin-datetime .content-wrapper > p {
  color: #e4e4e7;
}

.dark .mbz-skin-datetime .o-switch--checked .o-switch__label {
  background: rgba(30, 125, 151, 0.18);
  color: #7dd3e0;
}

.dark .mbz-skin-datetime .o-switch:not(.o-switch--checked) .o-switch__label {
  background: #3f3f46;
  color: #a1a1aa;
}

/* Publisher block: remove the nested card so it reads at the same width. */
#mobilizon main aside .metadata-organized-by .rounded-lg {
  background: transparent !important;
}

/* Sidebar metadata icons: the upstream 36 px black map/calendar glyphs were
 * oversized next to the inset rows. Keep them small and teal everywhere. */
#mobilizon main aside .eventMetadataBlock > .o-icon,
#mobilizon main aside .eventMetadataBlock > .material-design-icon {
  flex: none;
  color: #1e7d97;
}

#mobilizon main aside .eventMetadataBlock > .o-icon svg,
#mobilizon main aside .eventMetadataBlock > .material-design-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.dark #mobilizon main aside .eventMetadataBlock > .o-icon,
.dark #mobilizon main aside .eventMetadataBlock > .material-design-icon {
  color: #7dd3e0;
}

/* Location without coordinates: use the same inset row as date/time. */
#mobilizon main aside div[icon="map-marker"] .eventMetadataBlock:not(.mbz-skin-location-compact) {
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.6rem;
  background: #fafafa;
}

#mobilizon main aside div[icon="map-marker"] .eventMetadataBlock:not(.mbz-skin-location-compact) > .o-icon,
#mobilizon main aside div[icon="map-marker"] .eventMetadataBlock:not(.mbz-skin-location-compact) > .material-design-icon {
  margin-top: 0.15rem;
}

.dark #mobilizon main aside div[icon="map-marker"] .eventMetadataBlock:not(.mbz-skin-location-compact) {
  background: #1f1f23;
  border-color: #3f3f46;
}

/* Home search groups: give the Search button, the address row and the type
 * tabs clear breathing room. On desktop the two forms are joined into one
 * card, so this only applies below the desktop layout. */
@media (max-width: 1023px) {
  #mobilizon main > #short-search + #search-anchor {
    margin-top: 0.75rem !important;
    row-gap: 1rem !important;
  }
}

/* Address controls: pin, address, radius and clear are four separate controls.
 * Upstream lays them edge-to-edge inside the o-field; add a small gap. */
#search-anchor .address-autocomplete .o-field {
  gap: 0.4rem;
}
