/* Leikkipuistot PWA — styles. Mobile-first, dark mode via prefers-color-scheme. */

:root {
  --bg: #f3f6f3;
  --surface: #ffffff;
  --surface-2: #e8efe9;
  --surface-3: #dbe5dd;
  --text: #16211b;
  --muted: #5b6a61;
  --border: #d3ddd6;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 4px 14px rgba(0, 0, 0, .06);
  --primary: #1f7a4e;
  --primary-strong: #175f3c;
  --on-primary: #ffffff;
  --accent: #f2b731;
  --danger: #c0392b;
  --park: #1f7a4e;
  --school: #2f6fd6;
  --daycare: #e0842b;
  --yard: #7a4fbf;
  --other: #6b7280;
  --topbar-h: 52px;
  --tabbar-h: 58px;
  --sa-top: env(safe-area-inset-top, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left: env(safe-area-inset-left, 0px);
  --sa-right: env(safe-area-inset-right, 0px);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a14;
    --surface: #17241c;
    --surface-2: #1f3026;
    --surface-3: #2a3d31;
    --text: #e6ede8;
    --muted: #9fb0a6;
    --border: #2e4237;
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .35);
    --primary: #3fae78;
    --primary-strong: #2f8f61;
    --on-primary: #06140c;
    --accent: #f2b731;
    --park: #3fae78;
    --school: #6a9cf0;
    --daycare: #f0a050;
    --yard: #a98af0;
    --other: #9aa3b2;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: calc(var(--topbar-h) + var(--sa-top));
  padding: var(--sa-top) calc(12px + var(--sa-right)) 0 calc(12px + var(--sa-left));
  background: var(--primary);
  color: #fff;
  z-index: 500;
}
.topbar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .01em;
}
.topbar-title img { border-radius: 7px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.net-status {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(0, 0, 0, .25);
  padding: 2px 8px;
  border-radius: 999px;
}
.count-pill {
  border: 0;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}
.count-pill.active { background: var(--accent); color: #2a1e00; }

/* ---------- Main / views ---------- */
#main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
}
.view-map { overflow: hidden; }
.map { width: 100%; height: 100%; background: var(--surface-2); }
.view-list, .view-filters {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 calc(12px + var(--sa-right)) calc(var(--tabbar-h) + var(--sa-bottom) + 16px) calc(12px + var(--sa-left));
}

/* ---------- Bottom tab bar ---------- */
.tabbar {
  flex: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  height: calc(var(--tabbar-h) + var(--sa-bottom));
  padding: 0 var(--sa-right) var(--sa-bottom) var(--sa-left);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 600;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: .72rem;
  position: relative;
  user-select: none;
}
.tab-icon { font-size: 1.35rem; line-height: 1; }
.tab.active { color: var(--primary); font-weight: 700; }
.tab-badge {
  position: absolute;
  top: 6px;
  left: calc(50% + 8px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #2a1e00;
  font-size: .7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ---------- Buttons, chips, fields ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-small { padding: 6px 10px; min-height: 32px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn {
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.icon-btn:active { background: rgba(127, 127, 127, .18); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  white-space: nowrap;
}
.chip .chip-count { color: var(--muted); font-size: .8rem; }
.chip[data-on="true"], .chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.chip[data-on="true"] .chip-count, .chip.on .chip-count { color: inherit; opacity: .8; }
.chip.chip-mini {
  padding: 2px 8px;
  min-height: 24px;
  font-size: .78rem;
  cursor: default;
  background: var(--surface-2);
  border-color: transparent;
}
.chip-kind::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--kind-color, var(--other));
  display: inline-block;
}

.field { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 8px;
  padding: 0;
}
legend.field-label { width: 100%; }
input[type="search"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}
input[type="search"]:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  font-weight: 500;
  font-size: .8rem;
}
.seg-btn {
  border: 0;
  background: var(--surface);
  padding: 5px 10px;
  cursor: pointer;
}
.seg-btn[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Filters view ---------- */
.filters { max-width: 760px; margin: 0 auto; padding-top: 12px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filters-count { font-weight: 700; font-size: 1.05rem; }
.filters-foot { display: flex; gap: 8px; margin-top: 20px; }
.filters-foot .btn { flex: 1; }
.about { margin-top: 28px; font-size: .8rem; }
.about p { margin: 4px 0; }

/* ---------- List view ---------- */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
.sort-label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.sort-label select { width: auto; min-height: 36px; padding: 6px 28px 6px 10px; font-size: .9rem; }
.list-count { margin-left: auto; color: var(--muted); font-size: .9rem; }
.list-hint {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: .9rem;
}
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 96px;
}
.card:active { background: var(--surface-2); }
.card-thumb {
  width: 96px;
  height: 100%;
  min-height: 96px;
  object-fit: cover;
  background: var(--surface-3);
}
.card-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.card-body { padding: 8px 10px 8px 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-name { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.card-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.card-meta .dist { font-weight: 600; color: var(--text); }
.card-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.kind-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--kind-color, var(--other));
  margin-right: 2px;
  vertical-align: -1px;
}
.empty {
  text-align: center;
  padding: 40px 12px;
  color: var(--muted);
}

/* ---------- Map ---------- */
.leaflet-container { font-family: var(--font); }
.leaflet-container .leaflet-control-attribution { font-size: .65rem; background: rgba(255, 255, 255, .7); }
.leaflet-bar a, .leaflet-control-layers { color: #222; }
.leaflet-touch .leaflet-bar a { width: 36px; height: 36px; line-height: 36px; }
.leaflet-control-locate a {
  font-size: 1.3rem;
  cursor: pointer;
}
.leaflet-control-locate a.loading { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.leaflet-bottom.leaflet-left, .leaflet-bottom.leaflet-right { margin-bottom: calc(var(--tabbar-h) + var(--sa-bottom)); }

/* Site markers: colour + shape by kind */
.mk-wrap { background: none; border: 0; }
.mk {
  display: block;
  width: 18px; height: 18px;
  background: var(--kind-color, var(--other));
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  border-radius: 50%;
  box-sizing: border-box;
}
.mk-park { --kind-color: var(--park); border-radius: 50%; }
.mk-school { --kind-color: var(--school); border-radius: 3px; }
.mk-daycare { --kind-color: var(--daycare); border-radius: 3px; transform: rotate(45deg) scale(.9); }
.mk-yard { --kind-color: var(--yard); border-radius: 3px 3px 50% 50%; }
.mk-other { --kind-color: var(--other); border-radius: 50%; opacity: .85; }
.mk.dim { opacity: .35; }

.marker-cluster {
  background-clip: padding-box;
  border-radius: 50%;
}
.marker-cluster div {
  width: 32px; height: 32px;
  margin: 4px;
  border-radius: 50%;
  text-align: center;
  font: 700 13px/32px var(--font);
  color: #fff;
}
.marker-cluster-small { background: rgba(31, 122, 78, .35); }
.marker-cluster-small div { background: rgba(31, 122, 78, .95); }
.marker-cluster-medium { background: rgba(31, 122, 78, .4); }
.marker-cluster-medium div { background: rgba(23, 95, 60, .95); }
.marker-cluster-large { background: rgba(31, 122, 78, .45); }
.marker-cluster-large div { background: rgba(17, 71, 45, .95); }

/* Playground polygons (SVG paths; CSS overrides Leaflet's presentation attributes) */
.poly { stroke-width: 2; }
.poly-park { stroke: var(--park); fill: var(--park); }
.poly-school { stroke: var(--school); fill: var(--school); }
.poly-daycare { stroke: var(--daycare); fill: var(--daycare); }
.poly-yard { stroke: var(--yard); fill: var(--yard); }
.poly-other { stroke: var(--other); fill: var(--other); }

.user-pos {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #2f6fd6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(47, 111, 214, .5), 0 1px 5px rgba(0, 0, 0, .4);
}

.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 10px 12px; font-size: .9rem; line-height: 1.35; min-width: 180px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); font-size: 20px; padding: 6px 6px 0 0; }
.pp { display: flex; flex-direction: column; gap: 6px; }
.pp-img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.pp-name { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.pp-meta { color: var(--muted); font-size: .8rem; }
.pp .btn { align-self: flex-start; }
.leaflet-container a.btn { color: var(--text); }
.leaflet-container a.btn-primary { color: var(--on-primary); }

@media (prefers-color-scheme: dark) {
  .leaflet-layer.osm-tiles { filter: brightness(.82) saturate(.85); }
  .leaflet-container .leaflet-control-attribution { background: rgba(0, 0, 0, .55); color: #ccc; }
  .leaflet-container .leaflet-control-attribution a { color: #9fc8ff; }
  .leaflet-bar a, .leaflet-control-layers { background: #223328; color: #e6ede8; border-color: #2e4237; }
  .leaflet-bar a.leaflet-disabled { background: #1a271f; color: #666; }
  .leaflet-control-layers-expanded { background: #223328; color: #e6ede8; }
  .leaflet-bar { border-color: rgba(0, 0, 0, .5); }
}

/* ---------- Detail view ---------- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.detail-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(var(--topbar-h) + var(--sa-top));
  padding: var(--sa-top) calc(4px + var(--sa-right)) 0 calc(4px + var(--sa-left));
  background: var(--primary);
  color: #fff;
}
.detail-title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 calc(12px + var(--sa-right)) calc(24px + var(--sa-bottom)) calc(12px + var(--sa-left));
}
.detail-inner { max-width: 900px; margin: 0 auto; }
.detail-kind { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: .9rem; }
.section { margin-top: 20px; }
.section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.section p { margin: 0 0 8px; }
.source-line { font-size: .85rem; color: var(--muted); }
.source-line a { word-break: break-all; }

.gallery-tabs { display: flex; gap: 6px; margin: 12px 0 8px; }
.gallery-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
}
.gallery-tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.gallery-wrap { position: relative; }
.gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--radius);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  background: var(--surface-3);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}
.gallery-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  color: #fff;
  font-size: .8rem;
}
.gallery-item figcaption a { color: #ffd76a; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-wrap.multi .gallery-nav { display: flex; }
.gallery-dots { display: flex; justify-content: center; gap: 5px; margin-top: 6px; }
.gallery-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.gallery-dots span.on { background: var(--primary); }
.gallery-empty {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.equip { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.equip li {
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 10px;
  align-items: center;
}
.equip .eq-icon { font-size: 1.4rem; grid-row: span 2; width: 32px; text-align: center; }
.equip .eq-name { font-weight: 700; }
.equip .eq-detail { grid-column: 2 / span 2; color: var(--muted); font-size: .85rem; }
.equip .eq-detail a { word-break: break-all; }
.eq-right { display: flex; align-items: center; gap: 6px; justify-self: end; }
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--surface-3);
  color: var(--text);
}
.badge-survey { background: #d9f0e3; color: #0f4a2c; }
.badge-osm { background: #dbe8ff; color: #163e8a; }
.badge-blog { background: #ffe7c7; color: #6b3a00; }
.badge-ortho { background: #ece0ff; color: #3d1d80; }
.badge-register { background: #e5e7eb; color: #1f2937; }
@media (prefers-color-scheme: dark) {
  .badge-survey { background: #1a4a30; color: #b8f0d0; }
  .badge-osm { background: #1d3868; color: #c7dbff; }
  .badge-blog { background: #5a3300; color: #ffd9a8; }
  .badge-ortho { background: #3a2470; color: #e3d3ff; }
  .badge-register { background: #374151; color: #e5e7eb; }
}
.conf { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); }
.conf-bar { width: 36px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.conf-bar i { display: block; height: 100%; background: var(--primary); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
details.raw { margin-top: 8px; font-size: .85rem; }
details.raw summary { cursor: pointer; color: var(--primary); }
details.raw .facts { margin-top: 8px; font-size: .82rem; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links .btn { flex: 1 1 auto; }

/* ---------- Banners, toast ---------- */
.banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--sa-bottom) + 12px);
  z-index: 650;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 6px 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
}
.banner span { flex: 1; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--sa-bottom) + 16px);
  transform: translateX(-50%);
  z-index: 800;
  background: #222;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: .9rem;
  max-width: calc(100% - 32px);
  box-shadow: var(--shadow);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, .95);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-close { position: absolute; top: calc(6px + var(--sa-top)); right: calc(6px + var(--sa-right)); color: #fff; z-index: 2; font-size: 2rem; }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 64px;
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 2;
}
.lb-prev { left: 0; border-radius: 0 10px 10px 0; }
.lb-next { right: 0; border-radius: 10px 0 0 10px; }
.lb-caption {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + var(--sa-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
  color: #fff;
  font-size: .85rem;
  text-align: center;
}
.lb-caption a { color: #ffd76a; }

/* ---------- Desktop ---------- */
@media (min-width: 700px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .gallery-item img { height: 380px; }
  .list-toolbar, .cards { max-width: 1100px; margin-left: auto; margin-right: auto; }
  .tab { flex-direction: row; gap: 8px; font-size: .9rem; }
  .tab-badge { top: 10px; left: auto; right: calc(50% - 60px); }
}
@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

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