/* ==========================================================================
   Metruj — warstwa wizualna
   --------------------------------------------------------------------------
   Założenie: to nie jest panel administracyjny, tylko narzędzie do czytania
   ofert. Stąd górna nawigacja zamiast ciemnego paska z boku, dużo światła
   i typografia, w której cena jest pierwszą rzeczą, jaką widać.
   ========================================================================== */

:root {
  /* Zieleń zamiast korporacyjnego błękitu — kolor się nie kojarzy z panelem
     administracyjnym, a przy okazji zostawia błękit na linki. */
  --brand:        #15654a;
  --brand-soft:   #e7f2ec;
  --brand-ink:    #0d4433;

  --bg:           #f7f6f3;   /* ciepła biel, nie zimny szary */
  --surface:      #ffffff;
  --surface-alt:  #fbfaf8;
  --line:         #e4e1da;
  --line-strong:  #cfcabf;

  --ink:          #1b1a17;
  --ink-soft:     #5c574e;
  --ink-faint:    #8b857a;

  --link:         #1d4ed8;
  --ok:           #15654a;
  --warn:         #a8630a;
  --alert:        #b3261e;
  --auction:      #5b3fa8;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 2px rgba(27,26,23,.05), 0 2px 10px rgba(27,26,23,.04);
  --shadow-lift:  0 2px 6px rgba(27,26,23,.07), 0 10px 28px rgba(27,26,23,.07);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }

/* ----------------------------------------------------------- nawigacja --- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__inner {
  max-width: 1360px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 22px; min-height: 60px;
}
.brand {
  display: flex; align-items: baseline; gap: 9px;
  font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 11px; height: 11px; border-radius: 3px; background: var(--brand);
  display: inline-block; transform: rotate(45deg);
}
.brand__where { font-size: 12.5px; font-weight: 500; color: var(--ink-faint); }

.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  padding: 8px 13px; border-radius: var(--radius-sm); color: var(--ink-soft);
  font-size: 14.5px; font-weight: 500; white-space: nowrap;
}
.mainnav a:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.mainnav a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.topbar__meta { margin-left: auto; font-size: 13px; color: var(--ink-faint); white-space: nowrap; }

.burger {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); width: 38px; height: 38px; font-size: 17px;
  cursor: pointer; color: var(--ink);
}

/* -------------------------------------------------------------- układ --- */
.page { max-width: 1360px; margin: 0 auto; padding: 22px 20px 72px; }
.page__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page__head h1 { font-size: 24px; }
.page__count { color: var(--ink-faint); font-size: 14.5px; }
.page__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card--pad { padding: 18px 20px; }
.card + .card { margin-top: 14px; }

/* --------------------------------------------------------------- liczby --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow);
}
.stat__label {
  font-size: 12px; font-weight: 600; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .06em;
}
.stat__value { font-size: 27px; font-weight: 680; margin-top: 5px; letter-spacing: -.02em; }
.stat__hint { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

/* -------------------------------------------------------------- filtry --- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
           padding: 16px 18px; box-shadow: var(--shadow); }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  width: 100%; padding: 9px 11px; font-size: 14.5px; font-family: inherit;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field__pair { display: flex; gap: 7px; }
.filters__actions { display: flex; align-items: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  border-radius: var(--radius-sm); border: 1px solid var(--brand);
  background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
.btn--ghost { background: var(--surface); color: var(--brand-ink); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--quiet { background: var(--surface); color: var(--ink-soft); border-color: var(--line-strong); }
.btn--quiet:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--line-strong); }
.btn--sm { padding: 6px 12px; font-size: 13.5px; }

.toggle {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 13.5px; color: var(--ink-soft); user-select: none;
}
.toggle:hover { border-color: var(--ink-faint); }
.toggle.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* -------------------------------------------------------------- oferta --- */
.offer {
  display: grid; grid-template-columns: 196px minmax(0, 1fr) 208px; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius); padding: 15px; margin-bottom: 13px;
  box-shadow: var(--shadow); transition: box-shadow .14s ease, border-color .14s ease;
}
.offer:hover { box-shadow: var(--shadow-lift); }
.offer--fresh { border-left-color: var(--ok); }
.offer--copy { border-left-color: var(--line-strong); background: var(--surface-alt); }
.offer--auction { border-left-color: var(--auction); }
.offer--tender { border-left-color: var(--warn); }

.offer__media { min-width: 0; }
.offer__photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-alt); display: block;
}
.offer__photo--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 12.5px; border: 1px dashed var(--line-strong);
}
.offer__age { margin-top: 7px; font-size: 12.5px; color: var(--ink-faint); text-align: center; }

.offer__body { min-width: 0; }
.offer__title { font-size: 16.5px; margin-bottom: 4px; }
.offer__title a { color: var(--ink); }
.offer__title a:hover { color: var(--brand-ink); }
.offer__out { color: var(--ink-faint); font-size: 14px; margin-left: 4px; }

.offer__where { font-size: 14px; color: var(--ink-soft); margin-bottom: 9px; }
.offer__where strong { color: var(--ink); font-weight: 600; }

.offer__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.offer__amount { font-size: 23px; font-weight: 700; letter-spacing: -.025em; }
.offer__perm2 { font-size: 14px; color: var(--ink-soft); }
.offer__was { font-size: 13.5px; color: var(--ink-faint); text-decoration: line-through; }

.specs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.spec {
  font-size: 13.5px; color: var(--ink-soft); background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px;
}
.spec strong { color: var(--ink); font-weight: 600; }

.offer__excerpt {
  font-size: 14px; color: var(--ink-soft); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.offer__seller { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

.offer__aside { display: flex; flex-direction: column; gap: 8px; }

/* Kontakt: numer plus skąd pochodzi. Bez tej etykiety podsuwalibyśmy numer
   centrali biura, sugerując, że stoi w ogłoszeniu. */
.contact { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.contact__number {
  display: block; width: 100%; padding: 9px 10px; border: 0; background: var(--surface-alt);
  font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--ink);
  text-align: center; cursor: pointer;
}
.contact__number:hover { background: var(--brand-soft); }
.contact__number.is-open { background: var(--brand-soft); color: var(--brand-ink); }
.contact__origin {
  display: block; padding: 4px 8px; font-size: 11.5px; text-align: center;
  color: var(--ink-faint); background: var(--surface); border-top: 1px solid var(--line);
}
.contact--none { padding: 9px; text-align: center; font-size: 13px; color: var(--ink-faint);
                 border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.offer__added { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: 2px; }

/* --------------------------------------------------------------- znaczniki --- */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 5px;
  border: 1px solid transparent; letter-spacing: .01em; white-space: nowrap;
}
.tag--original { background: var(--brand-soft); color: var(--brand-ink); border-color: #c4e0d2; }
.tag--copy     { background: #f1efeb; color: var(--ink-faint); border-color: var(--line); }
.tag--agent    { background: #edeaf7; color: #4a3490; border-color: #d9d2ef; }
.tag--private  { background: #e8f1fd; color: #1c4f9c; border-color: #cfe0f7; }
.tag--dev      { background: #fdf0e6; color: #8f4c11; border-color: #f5ddc6; }
.tag--auction  { background: #efeafa; color: var(--auction); border-color: #ddd3f5; }
.tag--tender   { background: #fdf3e2; color: var(--warn); border-color: #f2e0bd; }
.tag--source   { background: var(--surface); color: var(--ink-faint); border-color: var(--line-strong); }
.tag--new      { background: var(--ok); color: #fff; }
.tag--drop     { background: #fdeceb; color: var(--alert); border-color: #f6cfcc; }
.tag--gone     { background: #f1efeb; color: var(--alert); border-color: #f0d3d1; }
.tag--age      { background: var(--surface); color: var(--ink-faint); border-color: var(--line); }

/* --------------------------------------------------------------- tabela --- */
.table { width: 100%; border-collapse: collapse; background: var(--surface);
         border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.table th { background: var(--surface-alt); font-size: 12px; font-weight: 650;
            text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-alt); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); }
.dot--err { background: var(--alert); } .dot--off { background: var(--line-strong); }

/* --------------------------------------------------------------- reszta --- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 26px 0; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; text-align: center; padding: 8px 13px; font-size: 14.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft);
}
.pager a:hover { border-color: var(--brand); color: var(--brand-ink); text-decoration: none; }
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.empty { text-align: center; padding: 56px 24px; color: var(--ink-soft);
         background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty strong { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }

.note { border-radius: var(--radius); padding: 13px 16px; font-size: 14.5px; margin-bottom: 16px;
        background: var(--brand-soft); border: 1px solid #c4e0d2; color: var(--brand-ink); }
.note--plain { background: var(--surface-alt); border-color: var(--line); color: var(--ink-soft); }
.note code { font-family: var(--mono); font-size: 13px; background: rgba(0,0,0,.05);
             padding: 1px 5px; border-radius: 4px; }

.section-title { font-size: 15px; font-weight: 650; margin: 26px 0 11px; color: var(--ink); }
.muted { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------------------------------------------------------- responsywność --- */
@media (max-width: 1080px) {
  .offer { grid-template-columns: 150px minmax(0, 1fr); }
  .offer__aside { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .offer__aside > * { flex: 1 1 150px; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .page { padding: 16px 14px 56px; }
  .topbar__inner { padding: 0 14px; gap: 12px; }
  .mainnav {
    position: fixed; inset: 60px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px 14px 14px; display: none; box-shadow: var(--shadow-lift);
  }
  .mainnav.is-open { display: flex; }
  .mainnav a { padding: 11px 12px; font-size: 16px; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .topbar__meta { display: none; }
  .offer { grid-template-columns: 1fr; }
  .offer__photo { max-height: 210px; }
  .offer__amount { font-size: 21px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --surface: #1c1f25; --surface-alt: #22262d;
    --line: #2e333c; --line-strong: #3d434e;
    --ink: #e8e6e1; --ink-soft: #a9a59c; --ink-faint: #7d7a72;
    --brand: #3f9b78; --brand-soft: #1b2d27; --brand-ink: #8fd4b6;
    --link: #7aa7ff;
    --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-lift: 0 4px 20px rgba(0,0,0,.45);
  }
  .tag--agent   { background: #272138; color: #b9a8f0; border-color: #3a3054; }
  .tag--private { background: #1a2433; color: #8cb6f0; border-color: #2a3a52; }
  .tag--dev     { background: #2e2318; color: #e0a86a; border-color: #45341f; }
  .tag--drop    { background: #2e1b1a; color: #f0938c; border-color: #472625; }
  .tag--gone    { background: #2a2422; color: #f0938c; border-color: #43302e; }
  .note code { background: rgba(255,255,255,.08); }
}

/* ==========================================================================
   Strona główna
   --------------------------------------------------------------------------
   Kto wchodzi na serwis po mieszkanie, ma od razu zobaczyć pole wyszukiwania,
   a nie tabelę z przebiegami zbierania. Stąd wyszukiwarka nad zgięciem,
   skróty do najczęstszych zapytań i dopiero potem liczby.
   ========================================================================== */

.lede {
  margin: 6px 0 0;
  max-width: 62ch;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero-search {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.hero-search__row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.1fr 1fr 1.4fr 1fr auto;
  align-items: end;
}

@media (max-width: 900px) {
  .hero-search__row { grid-template-columns: 1fr 1fr; }
  .hero-search__row .btn--lg { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .hero-search__row { grid-template-columns: 1fr; }
}

.btn--lg { padding: 11px 24px; font-size: 15.5px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.chips__label { color: var(--ink-faint); font-size: 14px; }

.chip {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
}

.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.cols-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }

@media (max-width: 860px) { .cols-3 { grid-template-columns: 1fr; } }

.card--link { text-decoration: none; color: inherit; display: block; transition: box-shadow .15s; }
.card--link:hover { box-shadow: var(--shadow-lift); border-color: var(--line-strong); }

.card__num { font-size: 30px; font-weight: 650; color: var(--brand); line-height: 1.1; }

.card__head {
  margin-top: 2px;
  font-weight: 600;
  color: var(--ink);
}

.card__text {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.more { margin: 14px 0 0; font-size: 15px; }

/* Filtry rzadziej używane chowamy. Szesnaście pól naraz to ściana, przez którą
   nie widać ofert; te pięć na wierzchu załatwia większość zapytań. Sekcja
   otwiera się sama, gdy któryś ze schowanych filtrów jest ustawiony — inaczej
   po odświeżeniu strony nie byłoby widać, czemu wyników jest tak mało. */
.filters__more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

.filters__more > summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 14.5px;
  font-weight: 550;
  list-style: none;
  user-select: none;
}

.filters__more > summary::-webkit-details-marker { display: none; }
.filters__more > summary::before { content: "▸ "; display: inline-block; transition: transform .15s; }
.filters__more[open] > summary::before { content: "▾ "; }
.filters__more > summary:hover { color: var(--brand-ink); }
.filters__more .filters__grid { margin-top: 14px; }

/* ==========================================================================
   Metruj — znak, stopka, okazje i przebudowany panel filtrów
   --------------------------------------------------------------------------
   Serwis obejmuje całą Polskę, więc filtrów musi być więcej niż wcześniej,
   a jednocześnie mają być czytelne. Rozwiązanie: cztery pola zawsze na
   wierzchu, reszta w rozwijanej sekcji, a **nad wynikami pasek z aktywnymi
   filtrami**, z którego każdy da się zdjąć jednym kliknięciem. Bez tego przy
   pół milionie ofert nie da się dojść, dlaczego wyników jest sto zamiast stu
   tysięcy.
   ========================================================================== */

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

.brand__mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 700; line-height: 26px; text-align: center;
  transform: none; letter-spacing: -.03em; flex: 0 0 auto;
}
.brand { align-items: center; gap: 8px; }
.brand__name { font-size: 19px; }
.brand__where { align-self: center; }

.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer__inner {
  max-width: 1360px; margin: 0 auto; padding: 22px 20px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  font-size: 14px; color: var(--ink-soft);
}
.footer__links { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }

.page__head { align-items: flex-start; }
.page__title { min-width: 0; }

/* ------------------------------------------------------------- okazje --- */
/* Stosunek ceny za metr do mediany okolicy. Kolor nie jest ozdobą: zielony
   znaczy „taniej niż w okolicy", czerwony „drożej", a podpis zawsze mówi,
   z czym porównujemy — mieszkanie ze wsi porównane z medianą województwa
   wygląda na okazję życia i nigdy nią nie jest. */
.deal {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  border: 1px solid transparent; white-space: nowrap;
}
.deal--great { background: #e2f3ea; color: #0d5c3d; border-color: #b6ddc9; }
.deal--good  { background: #edf5e9; color: #3b6b28; border-color: #cfe3c5; }
.deal--fair  { background: var(--surface-alt); color: var(--ink-soft); border-color: var(--line); }
.deal--high  { background: #fdeeec; color: #9b2c22; border-color: #f4cec9; }
.deal__scope { font-weight: 500; opacity: .8; }

.deal-legend { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; max-width: 70ch; }

/* ------------------------------------------------- pasek nad wynikami --- */
.resultbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px 0 12px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.resultbar__count { font-size: 15px; font-weight: 600; }
.resultbar__count span { color: var(--ink-faint); font-weight: 500; }
.resultbar__sort { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.resultbar__sort label { font-size: 13.5px; color: var(--ink-faint); }
.resultbar__sort select {
  padding: 7px 11px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.activefilters { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.activefilters__label { font-size: 13px; color: var(--ink-faint); }
.filterchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 11px; border-radius: 999px; font-size: 13px;
  background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #c4e0d2;
}
.filterchip:hover { text-decoration: none; }
.filterchip__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; background: rgba(0,0,0,.08);
  font-size: 12px; line-height: 1;
}
.filterchip:hover .filterchip__x { background: rgba(0,0,0,.18); }

/* ------------------------------------------------------------ formularz --- */
.filters__group {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px 14px;
}
.filters__legend {
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); margin: 16px 0 9px;
}
.filters__legend:first-child { margin-top: 0; }

.field__hint { font-size: 12px; color: var(--ink-faint); }

/* --------------------------------------------------------------- okazje --- */
.dealgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.dealstat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow);
}
.dealstat__label { font-size: 12px; font-weight: 650; text-transform: uppercase;
                   letter-spacing: .06em; color: var(--ink-faint); }
.dealstat__value { font-size: 25px; font-weight: 680; margin-top: 4px; letter-spacing: -.02em; }
.dealstat__hint { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }

@media (max-width: 720px) {
  .resultbar__sort { margin-left: 0; width: 100%; }
  .resultbar__sort select { flex: 1; }
  .footer__links { margin-left: 0; }
}

@media (prefers-color-scheme: dark) {
  .deal--great { background: #142b21; color: #7fd3aa; border-color: #22483a; }
  .deal--good  { background: #1a2a17; color: #a3cf8f; border-color: #2c4626; }
  .deal--high  { background: #2e1b1a; color: #f0938c; border-color: #472625; }
  .filterchip  { background: var(--brand-soft); color: var(--brand-ink); border-color: #23463a; }
  .filterchip__x { background: rgba(255,255,255,.12); }
}

/* Główny rząd panelu wyszukiwania ma sześć pól: rodzaj, transakcja,
   województwo, miejscowość, cena, powierzchnia. Automatyczne dopasowanie
   kolumn zrzucało przy typowej szerokości laptopa ostatnie pole do drugiego
   rzędu, gdzie stało samo i wyglądało jak błąd układu. Na szerokim ekranie
   dostają więc równo sześć kolumn, a węższe schodzą na trzy i dwie. */
.filters > .filters__grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .filters > .filters__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .filters > .filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .filters > .filters__grid { grid-template-columns: 1fr; }
}
.field__pair input { min-width: 0; }

/* Etykieta pod numerem: najwyżej dwa wiersze, pełna nazwa w dymku. */
.contact__origin {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.small { font-size: 13px; }
.up   { color: var(--alert); font-weight: 600; }
.down { color: var(--ok); font-weight: 600; }
.btn--block { display: flex; width: 100%; justify-content: center; }

/* ==========================================================================
   Strona oferty
   --------------------------------------------------------------------------
   Po lewej to, co się czyta (zdjęcia, parametry, opis), po prawej to, po co
   się przyszło: cena, telefon i przejście do ogłoszenia. Panel z prawej
   jedzie razem z przewijaniem, więc telefon jest pod ręką także przy opisie.
   ========================================================================== */
.detail__where { margin: 5px 0 0; color: var(--ink-soft); font-size: 15px; }
.detail__where strong { color: var(--ink); font-weight: 600; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.detail__main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.detail__main > .card + .card { margin-top: 0; }
.detail__aside { position: sticky; top: 76px; }
.detail__h { font-size: 17px; margin: 24px 0 10px; }
.detail__text { white-space: pre-wrap; font-size: 15px; color: var(--ink-soft); max-width: 78ch; }
.detail__meta { margin-top: 24px; }
.detail__meta > summary { cursor: pointer; color: var(--ink-faint); font-size: 14px; margin-bottom: 8px; }

.gallery {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; box-shadow: var(--shadow);
}
.gallery__main {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  border-radius: var(--radius-sm); background: var(--surface-alt);
}
.gallery--broken .gallery__main { display: none; }
.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; scrollbar-width: thin; }
.gallery__thumb {
  flex: 0 0 92px; height: 68px; padding: 0; background: none; cursor: pointer;
  border: 2px solid transparent; border-radius: 7px; overflow: hidden; opacity: .75;
}
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-on { border-color: var(--brand); opacity: 1; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tag--type { background: var(--surface-alt); color: var(--ink); border: 1px solid var(--line-strong); font-weight: 600; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px 18px; margin: 10px 0 0;
}
.facts > div { border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt {
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint);
}
.facts dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; }

.buybox { display: flex; flex-direction: column; gap: 10px; }
.buybox__price { font-size: 30px; font-weight: 720; letter-spacing: -.03em; line-height: 1.1; }
.buybox__sub { display: flex; gap: 10px; flex-wrap: wrap; color: var(--ink-soft); font-size: 14.5px; }
.buybox__contacts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.buybox__seller {
  display: flex; flex-direction: column; gap: 2px; font-size: 14px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.buybox__date { font-size: 12.5px; text-align: center; }

/* ------------------------------------------------------ podobne oferty --- */
.similar { margin-top: 30px; }
.similar__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.similar__head h2 { font-size: 20px; }
.similar__more { margin-left: auto; font-weight: 600; }
.similar__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }

.simcard {
  display: flex; flex-direction: column; overflow: hidden; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: box-shadow .14s ease, transform .14s ease;
}
.simcard:hover { text-decoration: none; box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.simcard__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-alt); }
.simcard__photo--empty { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 12.5px; }
.simcard__body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; }
.simcard__price { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.simcard__perm2 { font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 8px; align-items: baseline; }
.simcard__specs { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.simcard__where { font-size: 13.5px; color: var(--ink-soft); }
.simcard__title {
  font-size: 13px; color: var(--ink-faint);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 960px) {
  .detail { grid-template-columns: 1fr; }
  .detail__aside { position: static; order: -1; }
  .similar__more { margin-left: 0; }
}

/* Na telefonie i tablecie szerokie tabele (biura, alerty, źródła) przewijają
   się w poziomie we własnej ramce — nie rozpychają całej strony. */
.cols-2 > *, .cols-3 > * { min-width: 0; }
@media (max-width: 900px) {
  .table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }
}
@media (max-width: 760px) {
  .page { padding: 16px 14px 56px; }
  .page__head h1 { font-size: 21px; }
  .buybox__price { font-size: 26px; }
}

.filters-open { display: none; }
.filters-open__count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px;
}
@media (max-width: 760px) {
  .filters-open { display: flex; width: 100%; justify-content: center; margin-bottom: 10px; }
  .filters:not(.is-open) { display: none; }
  .filters > .filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer__photo { aspect-ratio: 16 / 9; }
}

@media (max-width: 400px) {
  .filters > .filters__grid { grid-template-columns: 1fr; }
}

/* Na tle rynku — mediana ceny za metr w miejscowości, powiecie, województwie. */
.detail__aside { display: flex; flex-direction: column; gap: 14px; }
.detail__aside > .card + .card { margin-top: 0; }
.marketbox__h { font-size: 16px; margin-bottom: 2px; }
.marketbox .muted.small { margin: 0 0 8px; }
.marketbox__row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.marketbox__place { font-weight: 600; font-size: 14.5px; }
.marketbox__val { text-align: right; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.marketbox > a { display: inline-block; margin-top: 8px; }

/* Na telefonie podobne oferty to pas przewijany palcem — osiem kart jedna
   pod drugą zajmowało trzy i pół tysiąca pikseli. */
@media (max-width: 760px) {
  .similar__grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .simcard { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .facts dd { font-size: 15px; }
}

/* Stopka: linki do miast — dla ludzi skrót, dla wyszukiwarki droga do stron
   miejscowości, do których z formularza nie prowadzi żaden zwykły odnośnik. */
.footer__inner--places { display: block; padding-bottom: 0; }
.footer__places { font-size: 13.5px; color: var(--ink-soft); line-height: 2; }
.footer__places strong { margin-right: 6px; }
.footer__places a { color: var(--ink-soft); text-decoration: none; margin-right: 12px;
                    border-bottom: 1px solid transparent; }
.footer__places a:hover { color: var(--brand); border-bottom-color: currentColor; }
