/* Round 7 (22 Nov) styles: r7-ui (WP A, global UI). Loaded after earlier CSS. */

/* ---------- header: logo | list-your-property icon | Eurovision shortcut | one language button ---------- */
.tool-btn { display: none; }
.top-tools { gap: 8px; }
.lang { position: relative; display: block; padding: 0; border: 0; border-radius: 0; gap: 0; }
.lang .lang-btn { display: inline-flex; align-items: center; gap: 4px; min-width: 0; min-height: 40px; padding: 0 9px 0 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--ink); font: 700 13.5px/1 var(--body); letter-spacing: .04em; cursor: pointer; }
.lang .lang-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; }
.lang .lang-btn[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lang .lang-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 196px; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 34px -10px rgba(15, 36, 48, .34); outline: none; animation: lang-in .14s ease-out; }
.lang-menu::before { content: ""; position: absolute; right: 22px; top: -6px; width: 11px; height: 11px; background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
@keyframes lang-in { from { opacity: 0; transform: translateY(-4px); } }
.lang-menu li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; padding: 0 14px; border-radius: 12px; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.lang-menu li b { font: 600 15.5px var(--body); }
.lang-menu li span { font: 700 12px var(--body); letter-spacing: .08em; color: var(--ink-3); }
.lang-menu li:hover, .lang-menu li:focus-visible { background: rgba(15, 36, 48, .06); outline: none; }
.lang-menu li.on { background: var(--sea-wash); color: var(--sea-ink); }
.lang-menu li.on b::before { content: "✓"; margin-right: 8px; font-weight: 700; }
.lang-menu li.on span { color: var(--sea-ink); }
@media (max-width: 980px) {
  .top { gap: 10px; }
  .tool-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 40px; border-radius: 999px; text-decoration: none; color: var(--ink); flex: none; }
  .tool-btn::after { content: ""; position: absolute; inset: -4px -2px; }
  .tool-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .tool-list { width: 40px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
  .tool-euro { gap: 4px; padding: 0 12px 0 9px; background: var(--esc-grad); color: #fff; box-shadow: 0 2px 8px -2px rgba(73, 17, 104, .45); }
  .tool-euro svg { width: 17px; height: 17px; stroke-width: 2; }
  .tool-euro b { font: 700 13px/1 var(--display); letter-spacing: -.01em; }
}
@media (max-width: 340px) { .top { gap: 6px; } .top-tools { gap: 6px; } .tool-euro { padding: 0 9px 0 7px; } .lang .lang-btn { padding: 0 7px 0 10px; } }
@media (min-width: 981px) { .lang .lang-btn { min-height: 38px; } }

/* ---------- bottom nav: active tab = softly filled rounded tile behind icon + label ---------- */
@media (max-width: 980px) {
  .tabbar { padding-left: 6px; padding-right: 6px; gap: 2px; }
  .tabbar a, .tabbar button { border-radius: 16px; padding: 6px 0 5px; transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
  .tabbar [aria-current="page"] { color: var(--ink); background: var(--sea-wash); box-shadow: inset 0 0 0 1px rgba(11, 110, 121, .16); font-weight: 800; }
  .tabbar [aria-current="page"] svg { stroke: var(--sea-ink); stroke-width: 2.1; }
  .tabbar .tab-match[aria-current="page"] { background: var(--sun-wash); box-shadow: inset 0 0 0 1px rgba(241, 90, 34, .22); }
  .tabbar .tab-match[aria-current="page"] svg, .tabbar .tab-match svg { fill: var(--sun); stroke: var(--sun); }
}

/* ---------- home hero ---------- */
.hero-actions + .ask { margin-top: 22px; }
.ha-euro { align-items: center; text-align: center; padding: 12px 10px; }
.ha-euro .ha-e1 { letter-spacing: 0; }
.ha-euro b { font-size: clamp(20px, 6.2vw, 23px); letter-spacing: -.04em; white-space: nowrap; }
.ha-e3 { max-width: 100%; }
@media (max-width: 360px) { .ha-euro b { font-size: 20px; } }

/* "How it works": big bold numerals, "1. Tell us what matters" */
.step h3 { align-items: center; gap: 10px; font-weight: 700; }
.step .step-n { font: 800 30px/1 var(--display); color: var(--sun); letter-spacing: -.04em; min-width: 1.05em; }
.step h3 > span { min-width: 0; overflow-wrap: anywhere; }

/* owners free-listing band: keys-and-home illustration + a prominent button */
.band-own .own-side { display: grid; justify-items: center; gap: 16px; }
.band-own .own-art { width: min(220px, 70%); height: auto; display: block; }
.band-own .own-cta { display: inline-flex; align-items: center; justify-content: center; text-align: center; width: 100%; min-height: 58px; font-size: 17px; padding: 0 26px; box-shadow: 0 12px 26px -12px rgba(241, 90, 34, .75); }
@media (max-width: 860px) { .band-own .own-art { width: 132px; } .band-own .own-side { gap: 14px; } }

/* ---------- equal card heights: same photo aspect, price on top, footer pinned to the bottom ---------- */
.grid > .reveal, .rail > .reveal, .rail > .card { display: flex; }
.grid > .reveal > .card, .rail > .reveal > .card { flex: 1 1 auto; min-width: 0; width: 100%; }
.grid .card-media, .rail .card-media { flex: none; }
.grid .card-body, .rail .card-body { display: flex; flex-direction: column; flex: 1 1 auto; gap: 6px; }
.grid .card-foot, .rail .card-foot { margin-top: auto; padding-top: 4px; }
.grid .card-body .tiny, .rail .card-body .tiny { min-height: 1.35em; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid .card-body:not(:has(.tiny)) .card-title, .rail .card-body:not(:has(.tiny)) .card-title { margin-bottom: calc(1.35em + 6px); }
.grid .card-title, .rail .card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-price { min-height: 1.2em; }
/* desktop map side list keeps its compact row cards (rules above are for rails and grids) */
.map-list .grid .card-media { flex: 0 0 150px; }
.map-list .grid .card-body { display: grid; align-content: center; min-width: 0; }
.map-list .grid .card-foot { margin-top: 0; padding-top: 0; }
.map-list .grid .card-title { white-space: normal; }
.map-list .grid .card-body .tiny { white-space: normal; min-height: 0; }
.map-list .grid .card-body:not(:has(.tiny)) .card-title { margin-bottom: 0; }

/* photo placeholder / never a broken glyph */
img.img-ph { object-fit: cover; background: var(--sand); }
img.img-broken { visibility: hidden; }

/* ---------- sheets: scrolling body, docked footer, close button balanced with the title ---------- */
.sheet { bottom: var(--sh-kb, 0px); }
.sheet-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; max-height: min(calc(var(--vh) * 88), calc(var(--sh-h, 100vh) - 16px)); }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px var(--pad) calc(22px + env(safe-area-inset-bottom)); }
.sheet-card.has-foot .sheet-body { padding-bottom: 8px; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; margin: 0; z-index: 5; display: grid; place-items: center; }
.sheet-body > h2:first-child { min-height: 44px; display: flex; align-items: flex-start; margin: 0; padding: 7px 52px 0 0; }
.sheet-actions.is-foot { position: static; flex: none; display: flex; gap: 10px; padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -14px rgba(15, 36, 48, .3); }
@media (min-width: 761px) { .sheet-card { max-height: min(calc(var(--vh) * 88), 720px); } }

/* ---------- listing page ---------- */
#prices .rt-na { color: var(--ink-3); font-size: 13.5px; font-weight: 500; }
.field .fmt { display: inline-block; margin-left: 4px; font: 500 11.5px var(--body); font-style: normal; letter-spacing: .03em; color: var(--ink-3); white-space: nowrap; }
#quote .q-empty { padding: 2px 0 0; border: 0; background: none; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
[data-share] svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- saved: Rent | Buy ---------- */
.sv-seg { display: inline-flex; gap: 2px; margin-top: 16px; padding: 3px; border-radius: 999px; background: var(--line-2); }
.sv-seg button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: none; color: var(--ink); font: 600 15px var(--body); display: inline-flex; align-items: center; gap: 8px; }
.sv-seg button b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center; background: rgba(15, 36, 48, .1); font: 700 12px/1 var(--body); }
.sv-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sv-seg button[aria-pressed="true"] b { background: rgba(255, 255, 255, .22); }

/* ---------- map ---------- */
.poi-pharmacy { background: #1F8A4C; border-color: #fff; color: #fff; }
.poi .poi-cross { width: 17px; height: 17px; fill: currentColor; display: block; }
.poi.on .poi-cross { fill: #fff; }
.chip .poi-cross { width: 13px; height: 13px; fill: #1F8A4C; vertical-align: -2px; }
.chip[aria-pressed="true"] .poi-cross { fill: #7FE0A4; }
@media (max-width: 760px) {
  /* the map sits above the bottom nav (which stays visible); the stage's bottom is set from the real nav height in JS */
  .mapfs { bottom: calc(var(--tabbar) - 6px); }
  .mapfs .map-cards { bottom: 12px; }
  .mf-empty { bottom: 16px; }
  .mf-top { grid-template-columns: 48px minmax(0, 1fr) 44px; }
  /* Filters + Places: compact stack top-right, level with the Rent | Sale row, clear of the notch and of the cards */
  .mf-side { top: calc(10px + env(safe-area-inset-top)); right: 10px; gap: 8px; }
  .mf-side .mf-round { width: 44px; height: 44px; }
  .mf-side .mf-round svg { width: 20px; height: 20px; }
  .mapfs .mf-places { top: calc(66px + env(safe-area-inset-top)); right: 64px; max-height: calc(100% - 150px); }
}

/* Final pass (Opus): touch screens swipe the listing hero — no arrow clutter (desktop/mouse keeps them) */
@media (hover: none) and (pointer: coarse) { .hg-nav { display: none !important; } }
/* licensed town photo credit (CC BY-SA requires attribution) */
.town-card { position: relative; }
.town-card .tc-credit { position: absolute; top: 8px; right: 10px; font-size: 9px; line-height: 1.2; color: rgba(255,255,255,.78); text-shadow: 0 1px 2px rgba(0,0,0,.6); max-width: 60%; text-align: right; pointer-events: none; }

/* Final pass (Opus), RU/BG at 320 px */
.field .fmt { display: block; margin-top: 2px; }                 /* format hint on its own line: both date labels same height */
@media (max-width: 360px) { .row2:has(input[type=date]) { grid-template-columns: 1fr; } }   /* native date inputs need ~150 px */
@media (max-width: 350px) { .tabbar a span, .tabbar button span { font-size: 9.5px; letter-spacing: -.02em; } }  /* "Избранное" fits */
.compare th { -webkit-hyphens: auto; hyphens: auto; word-break: normal; overflow-wrap: normal; }
@media (max-width: 350px) { .tabbar [aria-current] span { letter-spacing: -.04em; text-overflow: clip; overflow: visible; } }
