* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); font-size: 15px;
}
.topnav { display: flex; gap: 20px; font-size: 14px; color: var(--ink-2); }
.topnav a { text-decoration: none; }
.topnav a:hover { color: var(--ink); }
.theme-toggle {
  margin-left: auto; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2);
}
.theme-toggle:hover { color: var(--ink); }
.topbar .gh-star { margin-left: auto; }
.topbar .gh-star + .theme-toggle { margin-left: 0; }

/* ── Hero ── */
.hero { text-align: center; padding: 48px 16px 20px; }
.hero h1 {
  font: 700 clamp(36px, 6vw, 60px)/1.02 var(--display);
  letter-spacing: -.035em; margin: 0 0 12px;
}
.lede { margin: 0 0 24px; font-size: clamp(16px, 2vw, 19px); color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 0 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.chip[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .count { color: var(--muted); font-size: 12px; }
.chip[aria-selected="true"] .count { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* ── Toolbar ── */
.toolbar {
  max-width: 1280px; margin: 8px auto 20px; padding: 0 clamp(16px, 4vw, 40px);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.search:focus-within { border-color: var(--focus); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); height: 100%; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle {
  height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, var(--line)); background: transparent;
  font-size: 14px; cursor: pointer; color: var(--ink-2);
}
.toggle[aria-pressed="true"] { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.selects { display: flex; gap: 6px; }
.selects select {
  height: 40px; padding: 0 32px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a7a6c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none; -webkit-appearance: none; cursor: pointer; font-size: 14px;
}

/* ── Explorer ── */
main { padding-bottom: 48px; }
.explorer {
  max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px);
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 24px;
  align-items: start;
}
.map-wrap {
  position: sticky; top: 76px;
  height: calc(100vh - 100px); min-height: 480px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
  box-shadow: var(--shadow);
}
#map { position: absolute; inset: 0; }
.legend {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 7px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
  backdrop-filter: blur(6px);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.side { min-width: 0; }
.list-head { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.item:hover, .item.is-hover { background: var(--surface); border-color: var(--line); }
.item-name { font-weight: 600; font-size: 15px; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.item-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { grid-column: 1; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.item-meta .sep { opacity: .5; }
.item-score {
  grid-row: 1 / span 2; grid-column: 2;
  font: 600 14px/1 var(--font); color: var(--ink-2);
  padding: 6px 9px; border-radius: 8px; background: var(--surface-2);
}
.type-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.open-now { color: var(--good); font-weight: 500; }
.closed-now { color: var(--muted); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.btn-ghost {
  height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
}

.suggest-link {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px;
  border-radius: var(--radius-sm); border: 1px dashed color-mix(in srgb, var(--ink) 20%, var(--line));
  color: var(--ink-2); font-size: 14px; text-decoration: none; transition: border-color .2s, background .2s;
}
.suggest-link:hover { border-color: var(--accent); background: var(--surface); color: var(--ink); }
.suggest-link > span:first-child {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--surface-2); color: var(--accent); font-weight: 700;
}
.suggest-link b { color: var(--ink); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-free { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }

/* ── Detail ── */
.detail { animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; cursor: pointer; padding: 6px 0;
  color: var(--ink-2); font-size: 14px;
}
.back:hover { color: var(--ink); }
.share {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  height: 32px; padding: 0 12px; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.detail h2 { font: 700 clamp(28px, 3vw, 36px)/1.05 var(--display); letter-spacing: -.03em; margin: 0 0 6px; }
.detail .sub { margin: 0 0 18px; color: var(--ink-2); }
.score-card {
  display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center;
  padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px;
}
.score-big { font: 700 42px/1 var(--display); letter-spacing: -.03em; }
.score-big small { font: 500 14px var(--font); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.score-facts { display: grid; gap: 4px; font-size: 14px; }
.score-facts div { display: flex; justify-content: space-between; gap: 12px; }
.score-facts dt { color: var(--muted); }
.score-facts dd { margin: 0; text-align: right; font-weight: 500; }
.map-links { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); flex: 1; }
.btn:hover { filter: brightness(.97); }

.feats { display: grid; gap: 14px; margin: 0 0 22px; padding: 0; list-style: none; }
.feat { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.feat-ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2);
}
.feat b { display: block; font-weight: 600; }
.feat span { color: var(--muted); font-size: 14px; }

.why { margin: 0 0 18px; }
.detail h3 { font: 600 13px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.note {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin: 0 0 12px;
  background: var(--surface-2); color: var(--ink-2);
}
.note-warn { background: var(--warn-bg); color: var(--warn); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 0 0 22px; }
.facts div { background: var(--surface); padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; font-size: 14px; }
.wifi-bars { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 6px; }
.wifi-bars i { width: 4px; height: 10px; border-radius: 2px; background: var(--line); }
.wifi-bars i.on { background: var(--accent); }

.hours { list-style: none; padding: 0; margin: 0 0 22px; font-size: 14px; }
.hours li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hours li.today { font-weight: 600; }
.hours li span:last-child { font-variant-numeric: tabular-nums; }

.nearby { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }

/* ── Map markers ── */
.pin {
  --c: var(--t-kawiarnia);
  width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  display: grid; place-items: center;
  transition: transform .15s;
}
.pin b { transform: rotate(45deg); color: #fff; font: 700 12px/1 var(--font); }
.pin.is-active { transform: rotate(-45deg) scale(1.3); z-index: 1000; }
.pin.is-hover { transform: rotate(-45deg) scale(1.18); }
.pin.is-dim { opacity: .35; }
.pin-wrap { padding: 0; border: 0; background: none; cursor: pointer; width: 28px; height: 34px; display: grid; place-items: start center; }
.pin-wrap:focus-visible { outline: none; }
.pin-wrap:focus-visible .pin { box-shadow: 0 0 0 3px var(--focus); }

.maplibregl-map { font-family: var(--font); background: var(--surface-2); }
/* Ciepły odcień kafelków Positron, żeby pasowały do kremowego tła. */
#map:not(.is-dark) .maplibregl-canvas { filter: sepia(.14) saturate(1.1); }
.maplibregl-ctrl-group { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow) !important; border-radius: 10px; overflow: hidden; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
#map.is-dark .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { font-size: 10px; }
#map.is-dark .maplibregl-ctrl-attrib { background: rgba(30, 25, 21, .85); color: var(--ink-2); }
#map.is-dark .maplibregl-ctrl-attrib a { color: var(--ink-2); }
#map.is-dark .maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-popup.pin-tip .maplibregl-popup-content {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; padding: 4px 9px;
}
.maplibregl-popup.pin-tip .maplibregl-popup-tip { display: none; }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #2f7ae5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 122, 229, .2); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .explorer { grid-template-columns: 1fr; gap: 16px; }
  .map-wrap { position: relative; top: 0; height: 56vh; min-height: 340px; }
  .topnav { display: none; }
}
@media (max-width: 560px) {
  .hero { padding-top: 32px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .toggles { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); scrollbar-width: none; }
  .toggles::-webkit-scrollbar { display: none; }
  .toggle { flex: none; }
  .selects { width: 100%; }
  .selects select { flex: 1; min-width: 0; }
  .facts { grid-template-columns: 1fr; }
  .legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
