/* Katalog firm – motyw publiczny. Kolory zmienisz w sekcji :root poniżej. */
:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --text: #17212b;
  --muted: #5b6776;
  --line: #dde3ea;
  --brand: #0e6e8c;
  --brand-ink: #ffffff;
  --brand-soft: #e2f1f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c;
    --surface: #171f29;
    --text: #e8edf3;
    --muted: #9ba7b7;
    --line: #27313d;
    --brand: #4db4d6;
    --brand-ink: #06232d;
    --brand-soft: #15323d;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h2 { font-size: 1.3rem; margin-top: 1.8em; }
h3 { font-size: 1.05rem; }
.small-h { font-size: .95rem; color: var(--muted); font-weight: 600; margin-top: 1.2em; }
.wrap { width: 100%; max-width: none; margin: 0 auto; padding: 0 clamp(16px, 3vw, 48px); }
.page { padding-top: 24px; padding-bottom: 48px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Nagłówek */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.logo { height: 36px; width: auto; }
.ver { font-size: .78rem; font-weight: 600; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.ver:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* Okno z listą zmian */
dialog#changelog { width: min(640px, calc(100% - 32px)); max-height: 80vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
dialog#changelog[open] { display: flex; flex-direction: column; }
dialog#changelog::backdrop { background: rgba(10, 18, 26, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 1.15rem; }
.dlg-head form { margin: 0; }
.dlg-x { padding: 2px 12px; font-size: 1.4rem; line-height: 1.3; background: transparent; color: var(--text); }
.dlg-body { padding: 4px 20px 20px; overflow-y: auto; }
.dlg-body h3 { margin-top: 1.3em; color: var(--brand); }
.dlg-body ul { padding-left: 20px; }
.dlg-body code { background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.search { display: flex; flex: 1 1 260px; max-width: 520px; gap: 8px; }
.search input, .hero-search input { flex: 1; min-width: 0; }
.menu { margin-left: auto; display: flex; gap: 16px; font-weight: 600; }

/* Pola i przyciski */
input, select, textarea, button { font: inherit; }
input[type=search], input[type=text], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
button, .btn {
  display: inline-block; padding: 10px 18px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font-weight: 600; text-align: center;
}
.btn:hover, button:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

/* Strona główna */
.hero { background: linear-gradient(135deg, var(--brand-soft), var(--bg)); border-bottom: 1px solid var(--line); padding: 44px 0 40px; }
.hero--foto { position: relative; min-height: clamp(380px, 52vh, 620px); padding: 32px 0 0; background-size: cover; background-position: center bottom; background-repeat: no-repeat; }
.hero--foto .hero-panel {
  display: inline-block; max-width: 720px; padding: 22px 26px 26px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
}
.hero--foto .lead { color: var(--text); }
.hero-podpis { position: absolute; right: 12px; bottom: 8px; margin: 0; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.45); color: #fff; font-size: .75rem; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.hero-search { display: flex; gap: 8px; max-width: 640px; margin-top: 18px; }
.hero-search input { padding: 14px 16px; font-size: 1.05rem; }
.hero-search button { padding: 0 24px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile {
  --a: var(--brand);
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 18px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--a); }
.tile::after {
  content: ""; position: absolute; right: -28px; top: -28px; width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--a) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.tile:hover { border-color: var(--a); text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, .12); }
.tile-ico {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: color-mix(in srgb, var(--a) 16%, var(--surface)); color: var(--a); font-weight: 800; font-size: 1.15rem;
}
.tile-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tile-txt small { color: var(--muted); font-size: .88rem; }
.tile-go { margin-left: auto; color: var(--a); font-weight: 700; opacity: 0; transform: translateX(-4px); transition: .15s ease; position: relative; z-index: 1; }
.tile:hover .tile-go { opacity: 1; transform: none; }
.tiles li:nth-child(6n+2) .tile { --a: #d98a1f; }
.tiles li:nth-child(6n+3) .tile { --a: #d4584b; }
.tiles li:nth-child(6n+4) .tile { --a: #7a5bc7; }
.tiles li:nth-child(6n+5) .tile { --a: #2f9a63; }
.tiles li:nth-child(6n+6) .tile { --a: #3b78d8; }
.more { margin-top: 20px; text-align: center; }

/* Chipy, okruszki, paginacja */
.chips { list-style: none; margin: 8px 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .92rem; }
.chips a:hover { border-color: var(--brand); text-decoration: none; }
.chips span { color: var(--muted); margin-left: 4px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.crumbs .sep { margin: 0 4px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 28px; color: var(--muted); }

/* Karty firm */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 12px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); box-shadow: var(--shadow); }
.card:hover { border-color: var(--brand); text-decoration: none; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--brand-soft); }
.card-b { padding: 12px 14px 14px; }
.card-b h3 { margin: 0 0 4px; }
.card .meta { margin: 0; color: var(--brand); font-size: .88rem; font-weight: 600; }
.card .adr { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }

/* Strona firmy */
.firm-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.hero-img { width: 100%; aspect-ratio: 4 / 3; max-height: 460px; object-fit: cover; border-radius: var(--radius); background: var(--brand-soft); margin-bottom: 18px; }
.info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: sticky; top: 84px; }
.info h2 { margin-top: 0; font-size: 1.1rem; }
.info dl { margin: 0 0 14px; }
.info dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; }
.info dd { margin: 2px 0 0; word-break: break-word; }
.info .links { display: flex; gap: 8px; flex-wrap: wrap; }
.small { color: var(--muted); font-size: .88rem; }

.mapa-hero { display: block; width: 100%; height: clamp(320px, 46vh, 540px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-soft); margin-bottom: 18px; z-index: 0; }
.foto-firmy { width: 100%; max-width: 640px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.pin { background: none; border: 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border-radius: 12px; }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; font: 14px/1.45 var(--font); }
.leaflet-container a { color: var(--brand); }
.pop-h { display: block; font-size: 1.02rem; padding-right: 14px; }
.pop-k { color: var(--muted); margin: 2px 0 8px; }
.pop-row { display: grid; grid-template-columns: 52px 1fr; gap: 6px; margin-top: 3px; }
.pop-l { color: var(--muted); }
.pop-trasa { display: inline-block; margin-top: 10px; font-weight: 600; }
.hm { display: grid; gap: 28px; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); align-items: start; }
.hm h2 { margin-top: 1.4em; }
.mapa { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-soft); }

/* Dane z Google: oceny, status, udogodnienia */
.ocena { margin: 4px 0 0; font-size: 1.05rem; }
.ocena-mala { margin: 4px 0 0; font-size: .9rem; color: var(--text); }
.ocena-mala span:not(.gwiazdka) { color: var(--muted); }
.gwiazdka { color: #e0a100; }
.zrodlo { color: var(--muted); font-size: .85rem; }
.cena { color: var(--muted); }
.tag-zamkniete { display: inline-block; margin: 8px 0 0; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.tag-zamkniete.tymcz { background: #fdebc8; color: #7a4b00; }
.tag-zamkniete.stale { background: #f8d7d3; color: #8e1b10; }
@media (prefers-color-scheme: dark) {
  .tag-zamkniete.tymcz { background: #4a3714; color: #f3cf86; }
  .tag-zamkniete.stale { background: #4a1f1b; color: #f5a79d; }
}
.chips.udog span { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .92rem; }

/* Komunikaty i formularze */
.notice { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); background: var(--surface); border-radius: 10px; }
.notice.ok { border-left-color: #1e8449; }
.notice.err { border-left-color: #c0392b; }
.form-simple { display: grid; gap: 14px; margin-top: 16px; }
.form-simple label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.prose h2 { font-size: 1.15rem; }
.prose p { max-width: 70ch; }

/* Stopka */
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .92rem; }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }
.foot p { margin: 0; }

@media (max-width: 860px) {
  .firm-grid { grid-template-columns: 1fr; }
  .info { position: static; }
  .hm { grid-template-columns: 1fr; }
  .menu { margin-left: 0; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }