/* RadarFlat — Prague enamel street plates (red: street, blue: house number) on cool limestone grey. */
:root {
  --paper: #eef1f4;
  --surface: #ffffff;
  --ink: #172231;
  --muted: #5a6577;
  --line: #d5dbe3;
  --red: #b5122b;
  --blue: #1d4f91;
  --green: #1f7a4d;
  --focus: #1d4f91;
  --shadow: 0 1px 0 rgba(23, 34, 49, .06), 0 6px 18px -10px rgba(23, 34, 49, .25);
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1620; --surface: #17212d; --ink: #e6ebf1; --muted: #9aa6b6; --line: #2a3644;
    --red: #c8213a; --blue: #2b62ad; --green: #3fae73; --focus: #8fb4ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1620; --surface: #17212d; --ink: #e6ebf1; --muted: #9aa6b6; --line: #2a3644;
  --red: #c8213a; --blue: #2b62ad; --green: #3fae73; --focus: #8fb4ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--body); font-feature-settings: "tnum" 1;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- enamel plates ---------- */
.plate {
  display: inline-flex; align-items: center; color: #fff;
  font: 600 15px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase;
  padding: 3px; border-radius: 5px; white-space: nowrap;
}
.plate > span { display: block; padding: 4px 9px 3px; border: 1.5px solid rgba(255, 255, 255, .92); border-radius: 3px; }
.plate--street { background: var(--red); }
.plate--number { background: var(--blue); min-width: 34px; justify-content: center; }
.plate--number > span { padding: 4px 7px 3px; min-width: 26px; text-align: center; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 32px); background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; margin-right: auto; }
.brand .plate { font-size: 22px; letter-spacing: .06em; padding: 4px; border-radius: 6px; }
.brand .plate > span { padding: 5px 14px 4px; border-width: 2px; }
.offer-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.offer-switch button {
  border: 0; background: transparent; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  font: 600 16px/1.2 var(--cond); letter-spacing: .02em; color: var(--muted);
}
.offer-switch button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.langs { display: flex; gap: 2px; }
.langs a { text-decoration: none; font: 500 14px/1 var(--cond); padding: 6px 7px; color: var(--muted); border-radius: 4px; }
.langs a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }

/* ---------- intro ---------- */
.app { padding: 0 clamp(16px, 3vw, 32px) 40px; }
.intro { padding: 26px 0 14px; max-width: 60ch; }
.intro h1 { font: 700 clamp(30px, 4.4vw, 46px)/1.02 var(--cond); margin: 0; letter-spacing: -.005em; }
.sub { color: var(--muted); margin: 6px 0 0; }

/* ---------- filters ---------- */
.filters-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; }
.filters-wrap > summary {
  cursor: pointer; padding: 12px 16px; font: 600 18px/1 var(--cond); list-style: none; display: none;
}
.filters-wrap > summary::-webkit-details-marker { display: none; }
.filters {
  display: grid; gap: 14px 22px; padding: 16px;
  grid-template-columns: repeat(2, minmax(150px, 220px)) minmax(260px, 1fr) minmax(200px, 260px);
  align-items: start;
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font: 600 15px/1.2 var(--cond); padding: 0; margin-bottom: 6px; letter-spacing: .01em; }
.unit { color: var(--muted); font-weight: 500; }
.f-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.f-range legend { width: 100%; }
.f-range input { width: calc(50% - 12px); }
input[type="number"], select {
  border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 7px 9px; min-height: 38px; width: 100%;
}
.f-where { display: grid; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  font: 500 15px/1.1 var(--cond); background: var(--paper);
}
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.f-extras { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.checks input { accent-color: var(--blue); width: 16px; height: 16px; }
.f-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.sort { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--cond); }
.sort select { width: auto; font-family: var(--body); font-weight: 400; }
.link { background: none; border: 0; padding: 4px 0; color: var(--red); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- results + map ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 40%); gap: 22px; align-items: start; }
.count { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.card a:hover { border-color: var(--muted); }
.card .ph { position: relative; aspect-ratio: 4 / 3; background: var(--line); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.d-head .badges { position: static; flex-wrap: wrap; align-items: center; }
.badge { font: 600 13px/1 var(--cond); padding: 5px 8px; border-radius: 4px; color: #fff; letter-spacing: .02em; }
.badge--new { background: var(--blue); }
.badge--drop { background: var(--green); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card p { margin: 0; }
.price { font: 700 25px/1.05 var(--cond); }
.per { font: 500 15px var(--cond); color: var(--muted); margin-left: 2px; }
.spec { font-weight: 600; }
.subprice { color: var(--muted); font-size: 14px; }
.plates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px !important; }
.plates .plate { font-size: 13px; }
.street { color: var(--muted); font-size: 14px; }
.dev { font-size: 14px; font-weight: 600; }
.dev.below { color: var(--green); }
.dev.above { color: var(--muted); font-weight: 500; }
.feat { font-size: 14px; color: var(--muted); }
.src { margin-top: auto !important; padding-top: 6px; font-size: 13px; color: var(--muted); }
.empty { padding: 30px 0; color: var(--muted); max-width: 52ch; }
.more {
  display: block; margin: 22px auto 0; padding: 10px 26px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--surface); cursor: pointer; font: 600 17px/1 var(--cond);
}
.mapwrap { position: sticky; top: 12px; height: calc(100vh - 24px); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
#map { width: 100%; height: 100%; background: var(--line); }
.fab { display: none; }

/* map pins */
.pin { background: transparent; border: 0; }
.pin span {
  display: inline-block; transform: translate(-50%, -100%); white-space: nowrap;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 5px;
  font: 600 13px/1 var(--cond); padding: 3px 5px; box-shadow: var(--shadow);
}
.pin--deal span { background: var(--green); border-color: var(--green); color: #fff; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(29, 79, 145, .22) !important; }
.marker-cluster div { background: var(--blue) !important; color: #fff !important; font: 600 13px/30px var(--cond) !important; }
.pop { display: grid; gap: 3px; text-decoration: none; color: var(--ink); min-width: 190px; }
.pop img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; margin-bottom: 4px; }
.pop strong { font: 700 19px/1.1 var(--cond); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }

/* ---------- footer ---------- */
.foot { padding: 26px clamp(16px, 3vw, 32px) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { max-width: 75ch; margin: 0 0 6px; }

/* ---------- detail ---------- */
.detail { padding: 0 clamp(16px, 3vw, 32px) 40px; max-width: 1240px; margin: 0 auto; }
.back { margin: 18px 0 8px; }
.back a { color: var(--muted); text-underline-offset: 3px; }
.d-head { margin-bottom: 16px; }
.d-plates { display: flex; gap: 6px; margin-bottom: 8px; }
.d-plates .plate { font-size: 17px; }
.d-head h1 { font: 700 clamp(28px, 4vw, 42px)/1.05 var(--cond); margin: 0 0 6px; }
.d-price { margin: 0; font: 700 32px/1.1 var(--cond); }
.d-price .sub { font: 400 16px var(--body); color: var(--muted); margin-left: 8px; }
.d-head .badges { margin-top: 10px; display: flex; gap: 10px; }
.gallery { margin-bottom: 26px; }
.g-main { position: relative; margin: 0; background: #0d131b; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; max-height: 70vh; width: 100%; }
.g-main img { width: 100%; height: 100%; object-fit: contain; }
.g-main figcaption { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff; font: 600 14px/1 var(--cond); padding: 5px 8px; border-radius: 4px; }
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .9); color: #172231; font-size: 28px; line-height: 1; cursor: pointer;
}
.g-prev { left: 10px; } .g-next { right: 10px; }
.g-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.g-thumbs button { flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; }
.g-thumbs button[aria-current="true"] { border-color: var(--red); }
.g-thumbs img { width: 96px; height: 68px; object-fit: cover; }
.d-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 34px; }
.d-cols h2 { font: 700 24px/1.1 var(--cond); margin: 26px 0 10px; }
.d-cols h2:first-child { margin-top: 0; }
#d-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 26px; margin: 0; }
#d-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
#d-facts dt { color: var(--muted); }
#d-facts dd { margin: 0; font-weight: 600; text-align: right; }
.note { color: var(--muted); font-size: 14px; margin: -4px 0 8px; }
.d-desc { max-width: 72ch; }
.d-desc p { margin: 0 0 .8em; }
.btn {
  display: block; text-align: center; background: var(--ink); color: var(--surface); text-decoration: none;
  padding: 13px 16px; border-radius: 8px; font: 600 19px/1.1 var(--cond);
}
.also { list-style: none; padding: 0; margin: 0; }
.also li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.d-map { height: 280px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.history li span { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-disp { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .filters-wrap > summary { display: block; }
  .filters { grid-template-columns: 1fr; padding-top: 4px; }
  .split { grid-template-columns: 1fr; }
  .mapwrap { display: none; position: fixed; inset: 0; top: 0; height: 100dvh; border-radius: 0; border: 0; z-index: 900; }
  body.map-open .mapwrap { display: block; }
  body.map-open { overflow: hidden; }
  .only-map { display: none !important; }
  .fab {
    display: block; position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 1000;
    background: var(--ink); color: var(--surface); border: 0; border-radius: 999px; padding: 12px 26px;
    font: 600 18px/1 var(--cond); box-shadow: var(--shadow); cursor: pointer;
  }
  .d-cols { grid-template-columns: 1fr; }
  .top { gap: 10px; }
  .brand .plate { font-size: 19px; }
}
@media (max-width: 520px) {
  .offer-switch { order: 3; width: 100%; justify-content: stretch; }
  .offer-switch button { flex: 1; }
  .cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
