/* Pantalla del cercador. Tots els colors i mides venen de /ui/tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: var(--r-s); }
.skip { position: absolute; left: var(--s3); top: -100px; padding: var(--s3); background: var(--surface); z-index: 50; }
.skip:focus { top: var(--s2); }
.status { color: var(--muted); padding: var(--s5) 0; }

/* ---- Capçalera ---- */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: var(--s3) var(--s5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
/* Logotip: les dues bombolles a dalt a l'esquerra del nom. Mides en em: creixen amb la lletra. */
.brand { display: inline-block; padding-top: 1.05em; line-height: 1; font-size: 22px; font-weight: 700; letter-spacing: -.6px; color: var(--ink); text-decoration: none; background: url('/assets/bombolles.svg') no-repeat .32em 0 / auto 1.17em; }
.brand span { color: var(--link); }
.actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--touch); padding: 0 var(--s4); border-radius: var(--r-m); font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid transparent; background: none; }
.button.outline { border-color: var(--ink); color: var(--ink); }
.button.primary { background: var(--accent); color: var(--on-accent); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); border: 1px solid var(--border); border-radius: 50%; color: var(--ink); background: none; }

.searchbar { flex: 1 1 520px; order: 0; display: flex; align-items: stretch; margin: 0; border: 1px solid var(--border); border-radius: var(--r-l); background: var(--surface); }
.searchbar:focus-within { border-color: var(--ink); }
.field { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: var(--s2) var(--s3) var(--s2) var(--s4); border-right: 1px solid var(--line); }
.field-label { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.field input, .field-button { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: 15px; text-align: left; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.field input::placeholder { color: var(--muted); opacity: 1; }
.field .has-value, .field-button.has-value { font-weight: 600; }
.go { flex: 0 0 56px; border: 0; border-radius: 0 calc(var(--r-l) - 1px) calc(var(--r-l) - 1px) 0; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

.popover { position: absolute; left: -1px; top: calc(100% + var(--s2)); z-index: 30; min-width: 300px; max-width: min(420px, 92vw); padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow); }
.option { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 48px; padding: var(--s1) var(--s3); border: 0; border-radius: var(--r-s); background: none; text-align: left; color: var(--ink); text-decoration: none; }
.option:hover, .option[aria-selected='true'], .option[aria-current='true'] { background: var(--chip); color: var(--ink); }
.option small { display: block; font-size: 13px; color: var(--muted); }
.option svg { flex: 0 0 auto; color: var(--muted); }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: var(--s2) var(--s1); }
.dates { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s2); padding: var(--s2) var(--s3) var(--s3); }
.dates label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.field .dates input { width: auto; min-height: 40px; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface); }

/* ---- Pàgina ---- */
.page { max-width: 1240px; margin: 0 auto; padding: var(--s4) var(--s5) var(--s7); }
.layout { display: flex; gap: var(--s6); align-items: flex-start; }
.results { flex: 1 1 0; min-width: 0; outline: 0; }
.results[aria-busy='true'] { opacity: .55; transition: opacity .15s; }

/* ---- Dreceres ---- */
.shortcuts { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px 2px var(--s3); margin-bottom: var(--s3); scrollbar-width: thin; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--ink); font-size: 14px; white-space: nowrap; text-decoration: none; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip:visited { background: var(--chip-visited); }
.chip[aria-current='true'], .chip[aria-current='true']:visited { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }
.chip b { font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--time-dot); }
.dot[data-family='price'] { background: var(--price-dot); }
.dot[data-family='age'] { background: var(--age-dot); }
.dot[data-family='space'] { background: var(--space-dot); }
.dot[data-family='reg'] { background: var(--reg-dot); }
.dot[data-family='access'] { background: var(--access-dot); }
.dot[data-family='online'] { background: var(--online-dot); }
.chip[aria-current='true'] .dot { background: currentColor; }
.chip.filters-toggle { display: none; font-weight: 600; }

/* ---- Filtres ---- */
.filters { flex: 0 0 240px; display: flex; flex-direction: column; gap: var(--s5); }
.filters h2 { margin: 0 0 var(--s2); font-size: 13px; font-weight: 700; }
.filters-head, .filters-foot { display: none; }
.check { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 2px 0; color: var(--ink); font-size: 14px; text-decoration: none; }
.check:hover { color: var(--ink); }
.check::before { content: ''; flex: 0 0 16px; height: 16px; border: 1.5px solid var(--border); border-radius: 4px; background: var(--surface); }
.check:hover::before { border-color: var(--ink); }
.check[aria-current='true']::before { border-color: var(--selected-bg); background: var(--selected-bg) center / 12px no-repeat; box-shadow: inset 0 0 0 3px var(--surface); }
.check[aria-current='true'] { font-weight: 600; }
.check b { margin-left: auto; font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font-size: 13px; text-decoration: none; }
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill[aria-current='true'] { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }
.filters details:not(.inline) { border-top: 1px solid var(--line); padding-top: var(--s3); }
.filters summary { font-size: 13px; font-weight: 700; cursor: pointer; min-height: 32px; }
.filters details:not(.inline) > div { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s3); }
.more-link { display: inline-block; margin-top: var(--s1); font-size: 13px; font-weight: 600; background: none; border: 0; padding: 4px 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.age-form { display: flex; align-items: center; gap: var(--s2); font-size: 14px; }
.age-form input { width: 76px; min-height: 36px; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface); }

/* ---- Resultats ---- */
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.results-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.25; }
.sort { display: inline-flex; align-items: center; gap: var(--s2); font-size: 14px; color: var(--muted); }
.sort select { min-height: 40px; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-m); background: var(--surface); font-size: 14px; font-weight: 600; }
.active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s5); }
.active-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: var(--r-s); background: var(--chip); color: var(--ink); font-size: 13px; text-decoration: none; }
.active-tag:hover { color: var(--ink); outline: 1px solid var(--border); }
.clear { font-size: 13px; font-weight: 600; }
.day { margin: var(--s6) 0 var(--s1); font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.day:first-of-type { margin-top: 0; }

.card { display: flex; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.card-time { flex: 0 0 56px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-time small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.card-time.running, .card-time:has(small) { font-size: 14px; line-height: 1.3; }
.thumb { flex: 0 0 72px; height: 72px; border-radius: var(--r-m); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--hue-bg, var(--chip)); color: var(--hue-ink, var(--muted)); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[data-hue='purple'] { --hue-bg: var(--hue-purple-bg); --hue-ink: var(--hue-purple-ink); }
.thumb[data-hue='red'] { --hue-bg: var(--hue-red-bg); --hue-ink: var(--hue-red-ink); }
.thumb[data-hue='yellow'] { --hue-bg: var(--hue-yellow-bg); --hue-ink: var(--hue-yellow-ink); }
.thumb[data-hue='orange'] { --hue-bg: var(--hue-orange-bg); --hue-ink: var(--hue-orange-ink); }
.thumb[data-hue='green'] { --hue-bg: var(--hue-green-bg); --hue-ink: var(--hue-green-ink); }
.thumb[data-hue='blue'] { --hue-bg: var(--hue-blue-bg); --hue-ink: var(--hue-blue-ink); }
.thumb[data-hue='teal'] { --hue-bg: var(--hue-teal-bg); --hue-ink: var(--hue-teal-ink); }
.card-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink); text-decoration: none; }
.card-title:hover { color: var(--ink); text-decoration: underline; }
.card-meta { font-size: 14px; color: var(--muted); }
.card.cancelled .card-title { text-decoration: line-through; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag { padding: 4px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; text-decoration: none; background: var(--chip); color: var(--ink); }
.tag:hover { filter: brightness(.95); }
.tag:visited { background: var(--chip-visited); }
.tag[data-family='price'] { background: var(--price-bg); color: var(--price-ink); font-weight: 600; }
.tag[data-family='price']:visited { background: var(--price-visited); }
.tag[data-family='age'] { background: var(--age-bg); color: var(--age-ink); }
.tag[data-family='age']:visited { background: var(--age-visited); }
.tag[data-family='space'] { background: var(--space-bg); color: var(--space-ink); }
.tag[data-family='space']:visited { background: var(--space-visited); }
.tag[data-family='reg'] { background: var(--reg-bg); color: var(--reg-ink); }
.tag[data-family='reg']:visited { background: var(--reg-visited); }
.tag[data-family='access'] { background: var(--access-bg); color: var(--access-ink); }
.tag[data-family='access']:visited { background: var(--access-visited); }
.tag[data-family='online'] { display: inline-flex; align-items: center; gap: 5px; background: var(--online-bg); color: var(--online-ink); font-weight: 600; }
.tag[data-family='online']:visited { background: var(--online-visited); }
.tag[data-family='danger'] { background: var(--danger-bg); color: var(--danger-ink); font-weight: 600; }

.after { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s5); }
.after a { font-size: 14px; font-weight: 600; }
.strip { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s6); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--soft); color: var(--ink); text-decoration: none; }
.strip:hover { color: var(--ink); border-color: var(--border); }
.strip span { flex: 1 1 0; }
.strip em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--link); white-space: nowrap; }
.empty { padding: var(--s6) var(--s5); border: 1px dashed var(--border); border-radius: var(--r-l); }
.empty h2 { margin: 0 0 var(--s2); font-size: 18px; }
.empty p { margin: 0 0 var(--s3); color: var(--muted); }
.empty .after { margin-top: var(--s2); }

/* ---- Canvi de vista ---- */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.views { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-m); overflow: hidden; }
.views a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; font-size: 14px; color: var(--ink); background: var(--surface); text-decoration: none; }
.views a + a { border-left: 1px solid var(--border); }
.views a[aria-current='true'] { background: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }

/* ---- Mapa ---- */
.map { height: min(70vh, 640px); min-height: 380px; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--soft); z-index: 0; }
.map .leaflet-tile-pane { filter: var(--map-filter); }
.map .leaflet-container, .map.leaflet-container { font-family: var(--font); background: var(--soft); }
.map-note { margin: var(--s3) 0 0; font-size: 13px; color: var(--muted); }
.marker { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface); background: var(--selected-bg); color: var(--selected-ink); font-size: 13px; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / .35); }
.marker[data-approx] { border-style: dashed; }
.marker[data-hue='purple'] { background: var(--hue-purple-ink); color: var(--hue-purple-bg); }
.marker[data-hue='red'] { background: var(--hue-red-ink); color: var(--hue-red-bg); }
.marker[data-hue='yellow'] { background: var(--hue-yellow-ink); color: var(--hue-yellow-bg); }
.marker[data-hue='orange'] { background: var(--hue-orange-ink); color: var(--hue-orange-bg); }
.marker[data-hue='green'] { background: var(--hue-green-ink); color: var(--hue-green-bg); }
.marker[data-hue='blue'] { background: var(--hue-blue-ink); color: var(--hue-blue-bg); }
.marker[data-hue='teal'] { background: var(--hue-teal-ink); color: var(--hue-teal-bg); }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.map .leaflet-popup-content-wrapper { border-radius: var(--r-m); }
.map .leaflet-popup-content { margin: var(--s3) var(--s4); font-size: 14px; line-height: 1.4; max-height: 400px; overflow-y: auto; }
.map .leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.map .leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.map .leaflet-control-attribution { background: var(--surface); color: var(--muted); }
.map .leaflet-control-attribution a { color: var(--link); }
.pop-place { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.map .leaflet-popup-content p.pop-title { margin: 0; font-size: 16px; font-weight: 700; }
.map .leaflet-popup-content p.pop-sub { margin: 0 0 var(--s2); font-size: 13px; color: var(--muted); }
.map .leaflet-popup-content p.pop-near { margin: var(--s3) 0 0; padding-top: var(--s2); border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.map .leaflet-popup-content p.pop-place { margin: 0 0 var(--s2); }
.map a.mini { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.map a.mini:hover strong { text-decoration: underline; }
.mini .thumb { flex: 0 0 40px; height: 40px; border-radius: var(--r-s); }
.mini-text { min-width: 0; display: flex; flex-direction: column; }
.mini-text strong { font-size: 14px; font-weight: 600; line-height: 1.3; }
.mini-text small { font-size: 12px; color: var(--muted); }
.map .pop-more { display: block; width: 100%; margin-top: var(--s2); padding: var(--s2) 0 0; border: 0; border-top: 1px solid var(--line); background: none; font-size: 13px; font-weight: 600; text-align: left; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.marker.venue { position: relative; width: 38px; height: 38px; border-radius: var(--r-m); background: var(--accent); color: var(--on-accent); }
.marker.venue b { position: absolute; right: -8px; top: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-full); border: 2px solid var(--surface); background: var(--selected-bg); color: var(--selected-ink); font-size: 11px; line-height: 16px; text-align: center; }
.meta-link { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.meta-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.pop-item { display: block; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.pop-item:first-of-type { border-top: 0; padding-top: 0; }
.map .pop-item a { font-weight: 600; color: var(--ink); text-decoration: none; }
.map .pop-item a:hover { text-decoration: underline; }
.pop-item small { display: block; color: var(--muted); font-size: 13px; }

/* ---- Calendari ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.cal-head h2 { margin: 0; font-size: 18px; }
.cal-nav { display: flex; gap: var(--s2); }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { padding: var(--s2) 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.cal td { padding: 0; height: 76px; vertical-align: top; }
.cal-day { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-m); color: var(--ink); text-decoration: none; font-size: 14px; }
a.cal-day:not([aria-current='true']):hover { border-color: var(--ink); color: var(--ink); }
a.cal-day[aria-current='true']:hover { color: var(--selected-ink); }
.cal-day.none { color: var(--muted); background: var(--soft); border-color: transparent; }
.cal-day.today { font-weight: 700; border-color: var(--border); }
.cal-day[aria-current='true'] { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-ink); }
.cal-day b { align-self: flex-end; min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700; }
.cal-list { margin-top: var(--s6); }

/* ---- Peu ---- */
.foot { border-top: 1px solid var(--line); }
.foot-inner { max-width: 1240px; margin: 0 auto; padding: var(--s5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); font-size: 13px; color: var(--muted); }
.foot p { margin: 0; flex: 1 1 260px; }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.theme { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-m); overflow: hidden; }
.theme button { min-height: 36px; padding: 0 var(--s3); border: 0; background: var(--surface); font-size: 13px; }
.theme button + button { border-left: 1px solid var(--border); }
.theme button[aria-pressed='true'] { background: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }
.backdrop { position: fixed; inset: 0; z-index: 40; background: var(--backdrop); }

/* ---- Mòbil ---- */
@media (max-width: 860px) {
  .top { position: static; }
  .top-inner { padding: var(--s3) var(--s4); gap: var(--s3); }
  .brand { font-size: 20px; }
  .searchbar { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .field { flex: 1 1 40%; border-bottom: 1px solid var(--line); }
  .field:first-child { flex-basis: 100%; border-right: 0; }
  .field:nth-child(3) { border-bottom: 0; border-right: 0; }
  .field:nth-child(2) { border-bottom: 0; }
  .go { flex: 0 0 52px; border-radius: 0 0 calc(var(--r-l) - 1px) 0; }
  /* Els desplegables del cercador s'obren just sota la barra, a tota l'amplada: a baix de la pantalla els tapava el teclat. */
  .searchbar { position: relative; }
  .searchbar .field { position: static; }
  .searchbar .popover { position: absolute; left: -1px; right: -1px; top: calc(100% + var(--s2)); bottom: auto; min-width: 0; max-width: none; max-height: min(52vh, 360px); overflow-y: auto; z-index: 45; }
  /* «Quan»: les opcions són etiquetes per tocar, i les dates van en una fila. */
  #quan-panel:not([hidden]) { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s3); }
  #quan-panel .option { width: auto; min-height: var(--touch); padding: 0 var(--s4); border: 1px solid var(--border); border-radius: var(--r-full); font-size: 14px; }
  #quan-panel .option[aria-current='true'] { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-ink); font-weight: 600; }
  #quan-panel hr { flex: 0 0 100%; margin: var(--s1) 0; }
  #quan-panel .dates { flex: 0 0 100%; display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: var(--s2); padding: 0; }
  #quan-panel .dates label { min-width: 0; }
  #quan-panel .dates input { width: 100%; min-height: var(--touch); }
  #quan-panel .dates .button { min-height: var(--touch); }
  .page { padding: var(--s3) var(--s4) var(--s7); }
  .chip { min-height: var(--touch); }
  .chip.filters-toggle { display: inline-flex; }
  .results-head h1 { font-size: 19px; }

  /* Els filtres passen a ser un panell que puja des de baix. */
  .filters { display: none; }
  .filters[data-open] { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 88vh; gap: 0; background: var(--surface); border-radius: 18px 18px 0 0; }
  .filters-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s2) var(--s2) var(--s2) var(--s5); border-bottom: 1px solid var(--line); }
  .filters-head strong { font-size: 18px; }
  .filters-body { overflow-y: auto; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s5); }
  .filters-foot { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5) var(--s5); border-top: 1px solid var(--line); }
  .filters-foot .button.primary { flex: 1 1 0; min-height: 52px; font-size: 16px; font-weight: 700; }
  /* Filtres al mòbil: etiquetes per tocar, amb el punt de color de cada família, com les dreceres de dalt. */
  .filters-body > div, .filters-body details:not(.inline) > div > div, .filters-body details.inline[open] { display: flex; flex-wrap: wrap; gap: var(--s2); }
  .filters-body h2 { flex: 0 0 100%; margin-bottom: var(--s1); font-size: 14px; }
  .filters-body details.inline { flex: 0 0 100%; }
  .filters-body details.inline > summary { flex: 0 0 100%; }
  .filters-body .age-form { flex: 0 0 100%; margin-top: var(--s2); }
  .check, .pill { min-height: var(--touch); padding: 0 var(--s4); border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); gap: var(--s2); font-size: 14px; }
  .check::before { flex: 0 0 8px; width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--time-dot); box-shadow: none; }
  .check[data-family='price']::before { background: var(--price-dot); }
  .check[data-family='age']::before { background: var(--age-dot); }
  .check[data-family='space']::before { background: var(--space-dot); }
  .check[data-family='reg']::before { background: var(--reg-dot); }
  .check[data-family='access']::before { background: var(--access-dot); }
  .check[data-family='online']::before { background: var(--online-dot); }
  .check[aria-current='true'], .check[aria-current='true']:hover { background: var(--selected-bg); border-color: var(--selected-bg); color: var(--selected-ink); }
  .check[aria-current='true']::before { background: currentColor; box-shadow: none; }
  .check b { margin-left: 2px; }

  .results-head { align-items: flex-start; }
  .views { position: fixed; left: 50%; bottom: var(--s4); transform: translateX(-50%); z-index: 35; border: 0; border-radius: var(--r-full); box-shadow: 0 6px 20px rgb(0 0 0 / .3); }
  .views a { min-height: 48px; padding: 0 18px; background: var(--selected-bg); color: var(--selected-ink); border: 0; }
  .views a + a { border-left: 0; }
  /* El selector flotant no ha de tapar el peu: quan hi és, el peu deixa espai a sota per poder arribar als enllaços. */
  body:has(.views) .foot { padding-bottom: calc(48px + var(--s4) * 2 + env(safe-area-inset-bottom, 0px)); }
  .views { bottom: calc(var(--s4) + env(safe-area-inset-bottom, 0px)); }
  .views a[aria-current='true'] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
  .page { padding-bottom: 96px; }
  .map { height: 62vh; }
  .cal { border-spacing: 2px; }
  .cal td { height: 62px; }
  .cal-day b { min-width: 26px; height: 26px; font-size: 13px; padding: 0 6px; }
  .cal-day { padding: 4px; font-size: 13px; }

  .card { align-items: flex-start; gap: var(--s3); }
  .card-time { flex-basis: 48px; font-size: 15px; padding-top: 2px; }
  .thumb { flex-basis: 56px; height: 56px; }
  .card-title { font-size: 16px; }
  .card-meta { font-size: 13px; }
}
@media (min-width: 861px) {
  .filters-body { display: contents; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* El cor de favorits */
.heart { flex: 0 0 var(--touch); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); width: var(--touch); height: var(--touch); padding: 0; border: 0; border-radius: var(--r-full); background: none; color: var(--muted); }
.heart:hover { background: var(--chip); color: var(--ink); }
.heart[aria-pressed='true'] { color: var(--accent); }
.heart[aria-pressed='true'] svg { fill: currentColor; }
.heart.with-label { width: auto; min-height: var(--touch); padding: 0 var(--s4); border: 1px solid var(--ink); border-radius: var(--r-m); color: var(--ink); font-weight: 600; }
.heart.with-label[aria-pressed='true'] svg { color: var(--accent); }

/* Fitxa d'un lloc, a dalt de la seva agenda */
.venue-sheet { margin-bottom: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--soft); }
.venue-kind { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.venue-name { margin: 0 0 var(--s2); font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; }
.venue-text { margin: 0 0 var(--s3); line-height: 1.5; max-width: 68ch; }
.venue-facts { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.venue-facts div { display: grid; grid-template-columns: 56px 1fr; gap: var(--s2); }
.venue-facts dt { color: var(--muted); }
.venue-facts dd { margin: 0; overflow-wrap: anywhere; }
.venue-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s3); }

/* «Tot el dia» ocupa més que una hora: lletra més petita i en dues línies */
.card-time.allday { font-size: 12px; line-height: 1.15; white-space: normal; }

/* Ajuda quan «A prop meu» no pot fer servir la ubicació */
.geo-help { margin-bottom: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--soft); font-size: 14px; }
.geo-help p { margin: 0 0 var(--s2); }
.geo-help summary { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--touch); cursor: pointer; font-weight: 600; color: var(--link); list-style: none; }
.geo-help summary::-webkit-details-marker { display: none; }
.geo-help .info { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 700; font-style: italic; font-family: Georgia, serif; }
.geo-help ol { margin: var(--s2) 0; padding-left: var(--s5); display: flex; flex-direction: column; gap: var(--s2); line-height: 1.45; }
