/* Que Tapa!, con el lenguaje de Xa Vén: el mapa a pantalla completa, una interfaz neutra y limpia,
   y el color lo ponen las fotos. Un solo color propio, el pimentón, para lo que importa: subir una
   tapa y votarla. El amarillo marca tus bares guardados y el azul, el foco y tu posición. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-display: swap; src: url(vendor/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-display: swap; src: url(vendor/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url(vendor/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }

:root {
  --t-time: 30px; --t-title: 21px; --t-big: 17px; --t-body: 16px; --t-action: 15px; --t-note: 14px; --t-label: 13px; --t-foot: 12px;
  --ground: #E7E9E6; --surface: #FFFFFF; --soft: #F0F2F0; --rule: #E6E8E6;
  --ink: #121416; --on-ink: #FFFFFF; --mute: #4A5158; --grab: #C9CDCF;
  --brand: #E4472B; --on-brand: #FFFFFF; --brand-soft: #FCE9E4; --brand-fg: #B5321A;
  --me: #1F5FE0; --star: #FFC53D; --warn-bg: #FFF4D6; --warn-fg: #4A3700; --alert: #C2271D;
  --shadow: rgba(18, 20, 22, .18);
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --sheet-h: 288px;
  --side: 0px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #14171B; --surface: #1B1F24; --soft: #262B31; --rule: #2C3238;
    --ink: #F4F5F2; --on-ink: #121416; --mute: #BCC3CA; --grab: #4A525B;
    --brand: #FF6A4D; --on-brand: #1B0B06; --brand-soft: #3A2019; --brand-fg: #FF9A85;
    --me: #6C9BFF; --warn-bg: #3A2F12; --warn-fg: #FFE7A8; --alert: #FF6B5E;
    --shadow: rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #14171B; --surface: #1B1F24; --soft: #262B31; --rule: #2C3238;
  --ink: #F4F5F2; --on-ink: #121416; --mute: #BCC3CA; --grab: #4A525B;
  --brand: #FF6A4D; --on-brand: #1B0B06; --brand-soft: #3A2019; --brand-fg: #FF9A85;
  --me: #6C9BFF; --warn-bg: #3A2F12; --warn-fg: #FFE7A8; --alert: #FF6B5E;
  --shadow: rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
small { font-size: var(--t-label); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--me); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, p { margin: 0; }
svg { flex: none; }

#map { position: fixed; inset: 0; background: var(--ground); }
#nomap { position: fixed; left: var(--gutter-l); right: var(--gutter-r); top: 30%; text-align: center; color: var(--mute); }

/* La chincheta para colocar un bar nuevo: la punta marca el sitio. */
#aim { position: fixed; z-index: 2; left: calc(var(--side) + (100vw - var(--side)) / 2); top: calc((100dvh - var(--sheet-h)) / 2 + 30px); width: 0; height: 0; pointer-events: none; }
#aim span { position: absolute; left: -11px; top: -40px; width: 22px; height: 22px; border: 6px solid var(--brand); border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 8px var(--shadow); }
#aim span::after { content: ""; position: absolute; left: 50%; top: 16px; width: 2px; height: 20px; margin-left: -1px; background: var(--brand); }

/* ---------- Controles flotantes ---------- */
.side { display: contents; }
.brand { display: none; }
.top { position: fixed; z-index: 3; left: var(--gutter-l); right: var(--gutter-r); top: calc(12px + env(safe-area-inset-top, 0px)); display: flex; gap: 6px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--surface); border-radius: 22px; box-shadow: 0 2px 12px var(--shadow); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::placeholder { color: var(--mute); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search:focus-within { outline: 3px solid var(--me); outline-offset: 1px; }
.round { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 12px var(--shadow); }

#locate { position: fixed; z-index: 2; right: var(--gutter-r); bottom: calc(var(--sheet-h) + 14px); color: var(--me); }
/* La ruta de tapas, como botón del mapa junto al de ubicación (solo en la portada). */
.pill-btn { position: fixed; z-index: 2; right: calc(var(--gutter-r) + 56px); bottom: calc(var(--sheet-h) + 14px); display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 14px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 12px var(--shadow); font-size: var(--t-note); font-weight: 700; }
.pill-btn svg { color: var(--brand-fg); }
body:not([data-view="home"]) .pill-btn { display: none; }
.zoom { display: none; }
#credit { position: fixed; z-index: 2; left: var(--gutter-l); bottom: calc(var(--sheet-h) + 10px); width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--mute); font-size: 13px; font-weight: 700; line-height: 22px; }
#credit::after { content: ""; position: absolute; inset: -11px; }
#toast { position: fixed; z-index: 6; left: 50%; bottom: calc(var(--sheet-h) + 16px); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-weight: 700; box-shadow: 0 6px 20px var(--shadow); }

/* ---------- Panel inferior ---------- */
#sheet { --sheet-room: calc(var(--vvh, 100dvh) - 68px - env(safe-area-inset-top, 0px)); position: fixed; z-index: 4; left: 0; right: 0; bottom: var(--kb, 0px); display: flex; flex-direction: column; max-height: min(58dvh, var(--sheet-room)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px var(--shadow); }
#sheet[data-size="peek"] { max-height: 112px; }
#sheet[data-size="tall"] { max-height: var(--sheet-room); }
body[data-view="search"] #sheet[data-size="tall"] { height: var(--sheet-room); }
#sheet.dragging { will-change: transform; user-select: none; -webkit-user-select: none; }
#sheet.settling { will-change: transform; transition: transform .22s cubic-bezier(.22, .8, .3, 1); }
#grab { flex: none; display: grid; place-items: center; width: 100%; height: 32px; cursor: grab; padding: 0; border: 0; background: transparent; touch-action: none; }
#grab span { width: 40px; height: 4px; border-radius: 2px; background: var(--grab); }
#sheet-body > * { flex-shrink: 0; }
#sheet-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0 max(20px, env(safe-area-inset-right, 0px)) 12px max(20px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; }

.eyebrow { display: flex; align-items: center; gap: 7px; font-size: var(--t-note); color: var(--mute); margin-bottom: -4px; }
.eyebrow img { border-radius: 6px; }
.eyebrow span { font-family: var(--display); font-size: var(--t-action); font-weight: 700; color: var(--ink); }
.head { display: flex; align-items: center; gap: 10px; touch-action: none; }
.head > div { flex: 1; min-width: 0; }
.head h1 { font-family: var(--display); font-size: var(--t-title); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
.head small { display: block; margin-top: 2px; font-size: var(--t-note); line-height: 1.3; color: var(--mute); }
.back, .icon-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); }
.icon-btn.on svg { fill: var(--brand); stroke: var(--brand); }

.notice-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-fg); font-size: var(--t-note); line-height: 1.35; }

/* Filtros */
.filters { display: flex; overscroll-behavior-x: contain; gap: 6px; margin: 0 calc(-1 * max(20px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(20px, env(safe-area-inset-left, 0px))); padding: 0 max(20px, env(safe-area-inset-left, 0px)); overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 0; border-radius: 20px; background: var(--soft); font-size: var(--t-note); font-weight: 700; white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.filters .n { font-weight: 400; opacity: .7; }

/* Tapas en fila: la foto grande y el nombre debajo */
.votes { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px 0 6px; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 700; }
.votes svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }

/* Filas */
/* ---------- Red social: avatares, historias, pestañas, muro y perfil ---------- */
.avatar { flex: none; display: grid; place-items: center; width: var(--av, 40px); height: var(--av, 40px); border-radius: 50%; font-family: var(--display); font-size: calc(var(--av, 40px) * .38); font-weight: 700; letter-spacing: -.02em; line-height: 1; user-select: none; }


.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); margin-bottom: -6px; }
.tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--mute); font-size: var(--t-action); font-weight: 700; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); }
.tabs .n, .cta .n { font-weight: 400; opacity: .7; }

.home-head img { flex: none; border-radius: 11px; }
.demo-line { display: flex; align-items: center; gap: 8px; margin-top: -6px; font-size: var(--t-label); color: var(--mute); }
.demo-line svg { flex: none; width: 16px; height: 16px; color: var(--warn-fg); }

.hero { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--soft); text-align: left; color: #FFFFFF; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .66)); }
.hero-badge { position: absolute; z-index: 1; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: #FFC400; color: #3B2A00; font-size: 13px; font-weight: 700; }
.hero-badge svg { width: 16px; height: 16px; }
.hero-text { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 2px; }
.hero-text strong { font-family: var(--display); font-size: 26px; line-height: 1.1; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.hero-text small { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-note); opacity: .95; }
.hero-text small svg { width: 13px; height: 13px; fill: #FFC400; stroke: #B07F00; stroke-width: 1.2; }

.top-week { display: flex; flex-direction: column; padding: 14px 14px 6px; margin-top: 4px; border-radius: 18px; background: var(--soft); }
.top-week h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-family: var(--display); font-size: var(--t-big); }
.top-week h2 svg { width: 20px; height: 20px; color: #C99400; }
.top-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 0; border: 0; border-top: 1px solid var(--rule); background: transparent; text-align: left; color: inherit; }
.top-row:first-of-type { border-top: 0; }
.top-row img { flex: none; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--surface); }
.top-row .to { flex: 1; min-width: 0; line-height: 1.25; }
.top-row .to strong, .top-row .to small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-row .to small { margin-top: 2px; font-size: var(--t-note); color: var(--mute); }
.top-row .score { flex: none; display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.top-row .score svg { width: 14px; height: 14px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; }
.medal { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--mute); font-family: var(--display); font-size: 15px; font-weight: 700; }
.medal.m1 { background: #FFC400; color: #3B2A00; }
.medal.m2 { background: #CDD3D9; color: #2B3138; }
.medal.m3 { background: #E3A46B; color: #3E2208; }

.avatar.logo { background: var(--soft); overflow: hidden; }
.avatar.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-box { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--soft); }
.logo-box > div { flex: 1; min-width: 0; }
.logo-box strong { display: block; font-size: var(--t-body); }
.logo-box small { display: block; margin-top: 2px; font-size: var(--t-note); line-height: 1.35; color: var(--mute); }
.logo-actions { display: flex; gap: 8px; margin-top: 6px; }
.logo-actions .ghost { height: 38px; }

.tour-num { display: grid; place-items: center; width: 26px; height: 26px; border: 3px solid #FFFFFF; border-radius: 50%; background: var(--focus, #1F5FE0); color: #FFFFFF; font: 700 13px/1 var(--display); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); pointer-events: none; }
.tour-list { display: flex; flex-direction: column; }
.tour-stop { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; color: inherit; }
.tour-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--focus, #1F5FE0); color: #FFFFFF; font: 700 14px/1 var(--display); }
.tour-stop img { flex: none; width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--soft); }
.tour-stop .to { flex: 1; min-width: 0; line-height: 1.25; }
.tour-stop strong, .tour-stop small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-stop small { margin-top: 2px; font-size: var(--t-note); color: var(--mute); }
.tour-stop small svg { width: 13px; height: 13px; vertical-align: -2px; }
.tour-stop small:not(.leg) svg { fill: var(--star); stroke: #B07F00; stroke-width: 1.2; }
.tour-stop .leg { color: var(--ink); font-weight: 700; }

.feed { display: flex; flex-direction: column; gap: 26px; }
.post { display: flex; flex-direction: column; gap: 10px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; text-align: left; }
.post-head .who > span:last-child { min-width: 0; }
.post-head strong { display: block; font-size: var(--t-action); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-head small { display: block; margin-top: 1px; font-size: var(--t-label); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow { flex: none; height: 40px; padding: 0 4px 0 12px; border: 0; background: transparent; color: var(--brand-fg); font-size: var(--t-note); font-weight: 700; }
.follow.on { color: var(--mute); font-weight: 400; }
.post-photo { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--soft); }
.post-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-photo .tags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.post-photo .tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: rgba(18, 20, 22, .62); color: #FFFFFF; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); }
.post-photo .tag svg { width: 14px; height: 14px; }
.post-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.post-line strong { min-width: 0; font-family: var(--display); font-size: var(--t-big); line-height: 1.2; }
.post-score { flex: none; display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.post-score svg { width: 15px; height: 15px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; }
.post-note { margin-top: -4px; font-size: var(--t-note); line-height: 1.4; color: var(--mute); }
.feed-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border-radius: 16px; background: var(--soft); text-align: center; color: var(--mute); font-size: var(--t-note); line-height: 1.4; }
.feed-empty svg { width: 30px; height: 30px; color: var(--ink); }
.feed-empty strong { color: var(--ink); font-size: var(--t-body); }

.profile { display: flex; align-items: center; gap: 18px; }
.profile-stats { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; text-align: center; }
.profile-stats b { display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-family: var(--display); font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.profile-stats b svg { width: 16px; height: 16px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; }
.profile-stats small { display: block; font-size: var(--t-label); color: var(--mute); }

.rows { display: flex; flex-direction: column; }
.rows h2 { padding-bottom: 4px; font-size: var(--t-note); font-weight: 700; color: var(--mute); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; color: inherit; text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row .thumb { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--soft); color: var(--mute); }
.row .avatar { margin-right: 2px; }
.row .rank { flex: none; width: 18px; font-family: var(--display); font-size: var(--t-big); font-weight: 700; color: var(--mute); text-align: center; }
.row .rank.first { color: var(--brand); }
.row .to { flex: 1; min-width: 0; line-height: 1.25; }
.row .to strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .to small { display: block; margin-top: 2px; font-size: var(--t-note); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .score { flex: none; display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: var(--t-big); font-weight: 700; font-variant-numeric: tabular-nums; }
.row .score svg { width: 15px; height: 15px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; }
.follow-row { min-height: 72px; }
.follow-row .to small { display: flex; align-items: center; gap: 4px; }
.follow-row .to small svg { width: 12px; height: 12px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; flex: none; }
.follow-row .today { color: var(--brand-fg); font-weight: 700; }
.follow-row .pic { flex: none; width: 52px; height: 52px; padding: 2px; border-radius: 14px; background: transparent; }
.follow-row .pic.fresh { background: conic-gradient(from 210deg, #FFC400, var(--brand), #FF8A3C, #FFC400); }
.follow-row .pic img { display: block; width: 100%; height: 100%; border: 2px solid var(--surface); border-radius: 12px; object-fit: cover; background: var(--soft); }
.row .more { flex: none; font-size: 22px; color: var(--mute); }

/* Tarjetas y botones */
.now { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: var(--soft); text-align: left; color: inherit; text-decoration: none; }
.now.line { background: transparent; border: 1px solid var(--rule); }
.now-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); }
.now.line .now-icon { background: var(--brand-soft); color: var(--brand-fg); }
.now-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.now-label { font-size: var(--t-label); font-weight: 700; color: var(--mute); }
.now strong { font-size: var(--t-body); line-height: 1.2; }
.now small { font-size: var(--t-note); line-height: 1.3; color: var(--mute); }
.now-go { flex: none; font-size: 22px; line-height: 1; color: var(--mute); }
.cta { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-size: var(--t-action); font-weight: 700; text-decoration: none; }
.cta.brand-btn { background: var(--brand); color: var(--on-brand); }
.cta.second { background: var(--soft); color: var(--ink); }
.cta:disabled { opacity: .45; cursor: default; }
.ghost { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 12px; background: transparent; font-size: var(--t-action); font-weight: 700; }
.buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.buttons.one { grid-template-columns: minmax(0, 1fr); }
.empty { line-height: 1.4; color: var(--mute); }
.ride-hero { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--soft); }
.ride-hero small { font-size: var(--t-note); line-height: 1.4; color: var(--mute); }
.ride-hero .ok-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 50%; background: var(--brand); color: var(--on-brand); }
.big-line { font-family: var(--display); font-size: var(--t-title); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
.note { font-size: var(--t-note); line-height: 1.4; color: var(--mute); }

/* Ficha del bar */
.photo { position: relative; border-radius: 16px; overflow: hidden; background: var(--soft); aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .tags { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.photo .tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: rgba(18, 20, 22, .62); color: #FFFFFF; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.photo .tag.today { background: #FFFFFF; color: #121416; }
.photo .tag svg { width: 14px; height: 14px; }
.photo.none { display: grid; place-items: center; aspect-ratio: 16 / 7; padding: 16px; text-align: center; color: var(--mute); font-size: var(--t-note); line-height: 1.4; }
.photo.none > div { display: grid; justify-items: center; gap: 6px; max-width: 280px; }
.photo.none svg { width: 28px; height: 28px; }
.photo.none strong { color: var(--ink); font-size: var(--t-body); }
.tapa-meta { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.tapa-meta small { font-size: var(--t-note); color: var(--mute); }
.nota { padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-fg); font-size: var(--t-note); line-height: 1.35; }
.rate { display: grid; gap: 10px; padding: 14px 14px 12px; border-radius: 14px; background: var(--soft); }
.rate-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.rate-head strong { font-size: var(--t-body); }
.rate-head small, .rate-note { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-note); color: var(--mute); font-variant-numeric: tabular-nums; }
.rate-head small svg { width: 13px; height: 13px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; }
.stars { display: flex; justify-content: space-between; gap: 4px; }
.stars button { flex: 1; display: grid; place-items: center; height: 52px; border: 0; border-radius: 12px; background: var(--surface); color: var(--mute); }
.stars button svg { width: 30px; height: 30px; stroke-width: 1.6; transition: transform .15s; }
.stars button.on svg { fill: var(--star); stroke: #B07F00; }
.stars button[aria-pressed="true"] svg { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@media (hover: hover) { .stars:hover button svg { fill: var(--star); stroke: #B07F00; } .stars button:hover ~ button svg { fill: none; stroke: currentColor; } }
.stars button:active svg { transform: scale(.85); }
.bar-rating { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.bar-rating b { color: var(--ink); font-weight: 700; }
.bar-rating svg, .note svg { width: 13px; height: 13px; fill: var(--star); stroke: #B07F00; stroke-width: 1.2; vertical-align: -1px; }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: none; } }
.addr { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-note); color: var(--mute); line-height: 1.35; }
.addr svg { margin-top: 1px; }
.addr a { font-weight: 700; text-underline-offset: 3px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.grid button { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--soft); }
.grid button[aria-current="true"] { outline: 3px solid var(--brand); outline-offset: -3px; }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section > h2 { font-size: var(--t-note); font-weight: 700; color: var(--mute); }

/* Formularios (como «¿Algo no cuadra?» en Xa Vén) */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: var(--t-note); font-weight: 700; }
.field small { font-size: var(--t-label); font-weight: 400; color: var(--mute); }
.field textarea, .field input { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: max(16px, var(--t-body)); font-weight: 400; resize: vertical; }
.field textarea { min-height: 88px; }
.field textarea:focus, .field input:focus { border-color: var(--me); outline: 2px solid var(--me); outline-offset: -1px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 22px; background: var(--soft); font-size: var(--t-action); font-weight: 700; line-height: 1.2; }
.chips button[aria-pressed="true"], .chip input:checked + span { background: var(--ink); color: var(--on-ink); }
.chips.small { gap: 6px; }
.chips.small button { min-height: 36px; padding: 6px 12px; font-size: var(--t-note); }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip input:focus-visible + span { outline: 3px solid var(--me); outline-offset: 2px; }
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picker button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 112px; border: 1px dashed var(--grab); border-radius: 16px; background: var(--soft); font-size: var(--t-action); font-weight: 700; }
.picker button.main { border: 0; background: var(--brand); color: var(--on-brand); }
.picker svg { width: 26px; height: 26px; }
.preview { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--soft); }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview button { position: absolute; right: 10px; bottom: 10px; height: 36px; padding: 0 12px; border: 0; border-radius: 18px; background: rgba(18, 20, 22, .7); color: #FFFFFF; font-size: var(--t-note); font-weight: 700; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.picked .now-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picked .ghost { flex: none; height: 36px; padding: 0 12px; font-size: var(--t-note); background: var(--surface); }
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: var(--t-note); line-height: 1.35; color: var(--mute); }
.tips li { display: flex; align-items: flex-start; gap: 10px; }
.tips li > span:last-child { padding-top: 5px; }
.tip-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--ink); }
.tip-icon svg { width: 16px; height: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats .stat { padding: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--soft); }
.stat b { font-family: var(--display); font-size: var(--t-time); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { font-size: var(--t-note); color: var(--mute); }
.stat.hot { background: var(--brand-soft); }
.stat.hot b { color: var(--brand-fg); }
.mine { display: flex; align-items: center; gap: 12px; }
.mine img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.mine div { flex: 1; min-width: 0; }
.mine small { display: block; color: var(--mute); font-size: var(--t-note); }
.mine .ghost { flex: none; color: var(--alert); }

.lang { display: flex; gap: 6px; }
.lang button { flex: 1; height: 44px; border: 1px solid var(--rule); border-radius: 10px; background: transparent; font-size: var(--t-note); font-weight: 700; color: var(--mute); }
.lang button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.end { display: grid; justify-items: center; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--rule); text-align: center; }
.end-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 24px; }
.end .foot { max-width: 34em; }
.end-links a, .end-links button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--mute); font-size: var(--t-note); font-weight: 700; text-decoration: none; }
.foot { font-size: var(--t-foot); line-height: 1.4; color: var(--mute); }
@media (hover: hover) { .end-links a:hover, .end-links button:hover { color: var(--ink); } }

/* ---------- Marcadores: la foto de la tapa en un círculo ---------- */
.maplibregl-marker { will-change: transform; }
.pin-wrap { z-index: 2; }
.pin-wrap.today { z-index: 3; }
.pin-wrap.sel { z-index: 6; }
.pin { --size: 46px; --edge: #FFFFFF; position: relative; display: block; width: var(--size); height: calc(var(--size) + 7px); padding: 0; border: 0; background: transparent; cursor: pointer; transform-origin: 50% 100%; transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); }
.pin .ring { position: absolute; left: 0; top: 0; width: var(--size); height: var(--size); border: 3px solid var(--edge); border-radius: 50%; overflow: hidden; background: #F0F2F0; box-shadow: 0 2px 8px rgba(18, 20, 22, .35); }
.pin::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 10px; height: 10px; margin-left: -5px; background: var(--edge); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.pin img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin .emo { display: grid; place-items: center; width: 100%; height: 100%; background: var(--brand); }
.pin .emo::after { content: ""; width: 30%; height: 30%; border-radius: 50%; background: #FFFFFF; }
.pin .fl { position: absolute; top: -4px; right: -9px; display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px 0 4px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font: 700 12px/20px var(--body); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.pin .fl svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.pin.old { --size: 34px; }
.pin.old .ring { opacity: .85; }
.pin.old img { filter: grayscale(.5); }
.pin.sel { --edge: var(--brand); transform: scale(1.2); }
.pin.ghost { --size: 30px; --edge: var(--brand); }
.pin-name { position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); display: none; max-width: 150px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface); color: var(--ink); font: 700 12px/22px var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 5px rgba(18, 20, 22, .25); pointer-events: none; }
body[data-labels] .pin-name { display: block; }
.me { width: 16px; height: 16px; border: 3px solid #FFFFFF; border-radius: 50%; background: var(--me); box-shadow: 0 0 0 7px color-mix(in srgb, var(--me) 22%, transparent); }

/* ---------- Tablet: el panel flota ---------- */
@media (min-width: 640px) and (max-width: 999.98px) {
  .top { left: max(24px, calc(50% - 300px)); right: max(24px, calc(50% - 300px)); top: calc(20px + env(safe-area-inset-top, 0px)); }
  #sheet { left: max(24px, calc(50% - 300px)); right: max(24px, calc(50% - 300px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--kb, 0px)); padding-bottom: 0; border-radius: 22px; --sheet-room: calc(var(--vvh, 100dvh) - 100px - env(safe-area-inset-top, 0px)); max-height: min(46dvh, var(--sheet-room)); }
  #sheet[data-size="tall"] { max-height: min(76dvh, var(--sheet-room)); }
  #locate { right: max(24px, calc(50% - 300px)); bottom: calc(var(--sheet-h) + 40px); }
  .pill-btn { right: calc(max(24px, calc(50% - 300px)) + 56px); bottom: calc(var(--sheet-h) + 40px); }
  #credit { left: max(24px, calc(50% - 300px)); bottom: calc(var(--sheet-h) + 34px); }
  #toast { bottom: calc(var(--sheet-h) + 40px); }
}
@media (max-width: 359.98px) {
  :root { --t-time: 28px; --t-title: 19px; }
}

/* ---------- Ordenador: panel fijo a la izquierda ---------- */
@media (min-width: 1000px), (min-width: 600px) and (max-height: 540px) and (orientation: landscape) {
  :root { --side: 408px; --sheet-h: 0px; }
  .side { position: fixed; z-index: 4; left: 0; top: 0; bottom: 0; width: var(--side); display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 16px; background: var(--surface); box-shadow: 4px 0 24px var(--shadow); }
  .eyebrow { display: none; }
  .brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
  .brand img { border-radius: 8px; }
  .top { position: static; }
  .search { height: 44px; padding: 0 12px; background: var(--soft); border-radius: 12px; box-shadow: none; }
  .search input { font-size: 15px; }
  .top .round { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); box-shadow: none; }
  #sheet { position: static; flex: 1; min-height: 0; max-height: none !important; height: auto !important; background: transparent; border-radius: 0; box-shadow: none; padding: 0; }
  #grab { display: none; }
  #sheet-body { padding: 0; }
  .filters { margin: 0 -24px; padding-left: 24px; padding-right: 24px; scroll-padding: 0 24px; }
  #locate { right: 20px; bottom: 144px; }
  .pill-btn { right: 76px; bottom: 144px; }
  .zoom { position: fixed; z-index: 2; right: 20px; bottom: 44px; display: flex; flex-direction: column; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 10px var(--shadow); }
  .zoom button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; line-height: 1; }
  .zoom button + button { border-top: 1px solid var(--rule); }
  #credit { left: auto; right: 20px; bottom: 14px; }
  #toast { left: calc(var(--side) + (100vw - var(--side)) / 2); bottom: 32px; }
  #aim { top: 50%; }
}
@media (max-width: 999.98px) and (min-width: 600px) and (max-height: 540px) and (orientation: landscape) {
  :root { --side: min(400px, 50vw); }
  .side { gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(8px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px)); }
  .brand { display: none; }
  #locate { bottom: 116px; }
  .pill-btn { bottom: 116px; }
  .zoom { bottom: 16px; }
  #credit { bottom: 16px; right: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .pin { transition: none; }
  .stars button[aria-pressed="true"] svg { animation: none; }
}
/* En el ordenador el logo ya está arriba, en la marca. */
@media (min-width: 1000px) { .home-head img { display: none; } }
