/* ==========================================================================
   Apartamente București — design system
   Pattern: Marketplace/Directory · Style: Data-Dense Dashboard
   Wordmark: Cinzel · UI: Inter (tabular numerals for all figures)
   ========================================================================== */

/* The webfonts are <link>ed from index.html instead: an @import here is only
   discovered after this file has been fetched and parsed, which puts the font
   download in series behind it and delays first paint. */

/* --- Tokens -------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Brand — trust teal + professional blue */
  --brand-50:  #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-200: #99f6e4;
  --brand-400: #2dd4bf;
  --brand-500: #14b8a6;
  --brand-600: #0f766e;
  --brand-700: #115e59;
  --brand-900: #134e4a;
  --accent-600: #0369a1;

  /* Neutrals */
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #fbfcfd;
  --surface-sunken:#eef1f4;
  --text:          #0f172a;
  --text-muted:    #55637a;
  /* was #78849b: 3,32-3,77:1 on the three light surfaces, below the 4,5:1 that
     WCAG 1.4.3 AA requires for body text. #5c6980 gives 4,89-5,54:1. The dark
     value at the bottom of this file already passes and is left alone. */
  --text-subtle:   #5c6980;
  --border:        #e2e6ec;
  --border-strong: #c9d0da;

  --primary:       var(--brand-600);
  --primary-hover: var(--brand-700);
  --on-primary:    #ffffff;
  --primary-soft:  var(--brand-50);
  --ring:          color-mix(in srgb, var(--brand-600) 45%, transparent);

  --positive:      #047857;
  --positive-soft: #ecfdf5;
  --negative:      #b91c1c;
  --negative-soft: #fef2f2;
  --warning:       #b45309;

  /* Elevation — layered, low-opacity, premium rather than heavy */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 8px 16px -4px rgba(16, 24, 40, .08);
  --shadow-lg: 0 4px 8px rgba(16, 24, 40, .04), 0 24px 48px -12px rgba(16, 24, 40, .18);

  /* Geometry */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Motion */
  --dur-fast: 120ms;
  --dur: 180ms;
  --ease: cubic-bezier(.2, .8, .3, 1);

  --header-h: 64px;
  --sidebar-w: 312px;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg:            #0b0f14;
  --surface:       #131920;
  --surface-2:     #172029;
  --surface-sunken:#0f151b;
  --text:          #e8edf4;
  --text-muted:    #9fb0c3;
  --text-subtle:   #7b8ba0;
  --border:        #232d39;
  --border-strong: #33404f;

  --primary:       var(--brand-500);
  --primary-hover: var(--brand-400);
  --on-primary:    #04211f;
  --primary-soft:  rgba(20, 184, 166, .12);
  --ring:          color-mix(in srgb, var(--brand-400) 55%, transparent);

  --positive:      #34d399;
  --positive-soft: rgba(52, 211, 153, .12);
  --negative:      #f87171;
  --negative-soft: rgba(248, 113, 113, .12);
  --warning:       #fbbf24;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Every figure in the UI is compared column-wise — tabular avoids jitter. */
.num, .price, input[type='number'] { font-variant-numeric: tabular-nums; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The skip link must become visible when a keyboard user reaches it. */
a.visually-hidden:focus {
  position: fixed; top: 10px; left: 10px; z-index: 999;
  width: auto; height: auto; margin: 0; padding: 10px 16px;
  clip: auto; overflow: visible;
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-weight: 600;
}

/* --- Header -------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
/* Row one: brand, the query, the per-visitor actions. Row two (desktop): the
   site navigation shared with every other page, sign-in included. On a phone
   row two folds into the drawer and the sign-in moves up into row one. */
.app-header-row { display: flex; align-items: center; gap: 16px; height: var(--header-h); padding: 0 20px; }
/* A shell cached before the nav row existed (the homepage allows an hour of
   stale-while-revalidate) has brand, query and actions as direct children:
   lay them out as before rather than stacking them. */
.app-header:not(:has(.app-header-row)) { display: flex; align-items: center; gap: 16px; height: var(--header-h); padding: 0 20px; }
.app-nav-row { padding: 0 20px; border-top: 1px solid var(--border); }
.app-nav-row .site-nav { padding: 4px 0; }
.mobile-only { display: none !important; }
.brand { text-decoration: none; color: inherit; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  color: #fff;
}
.brand-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}
.brand-sub { display: block; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-subtle); }

.header-search { flex: 1; min-width: 0; max-width: 720px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* --- Controls ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--surface-sunken); border-color: var(--text-subtle); }
.btn:active { transform: translateY(1px); }
.btn[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.btn-primary {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-sunken); border-color: transparent; }

.btn-icon { width: 40px; padding: 0; }

.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }

input[type='text'], input[type='number'], input[type='search'], select {
  width: 100%; min-height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
select { padding-right: 30px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378849b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder { color: var(--text-subtle); }

/* --- Smart search -------------------------------------------------------- */
.smart {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 4px 4px 4px 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.smart:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.smart svg { flex-shrink: 0; color: var(--text-subtle); }
.smart input {
  flex: 1; min-width: 0; min-height: 36px;
  border: none; background: transparent; padding: 0;
}
.smart input:focus { box-shadow: none; }
.smart .btn { min-height: 36px; border-radius: var(--r-pill); }

/* --- Layout -------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 24px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
  align-items: start;
}

.sidebar {
  position: sticky; top: calc(var(--header-h) + var(--nav-row-h, 44px) + 20px);
  max-height: calc(100vh - var(--header-h) - var(--nav-row-h, 44px) - 40px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.sidebar-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sidebar-title { font-size: 14px; font-weight: 600; }

/* --- Filter groups ------------------------------------------------------- */
.fgroup { border-bottom: 1px solid var(--border); }
.fgroup:last-child { border-bottom: none; }
.fgroup > summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 13px 16px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  cursor: pointer; list-style: none;
  transition: background var(--dur) var(--ease);
}
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary:hover { background: var(--surface-sunken); }
.fgroup > summary .chev { color: var(--text-subtle); transition: transform var(--dur) var(--ease); }
.fgroup[open] > summary .chev { transform: rotate(180deg); }
.fgroup-body { padding: 4px 16px 16px; display: grid; gap: 12px; }

.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Segmented control — rooms, tri-state toggles */
.seg { display: flex; background: var(--surface-sunken); border-radius: var(--r-md); padding: 3px; gap: 3px; }
.seg button {
  flex: 1; min-height: 34px; padding: 0 6px;
  border: none; border-radius: 7px; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.seg-yes[aria-pressed='true'] { color: var(--positive); }
.seg-no[aria-pressed='true'] { color: var(--negative); }

/* Checkbox rows with counts */
/* The label is the real touch target — the 17px box inside it is only the
   visual. Kept at 44px on coarse pointers per Apple HIG / Material. */
.check {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 6px; margin: 0 -6px;
  border-radius: var(--r-sm); cursor: pointer;
  font-size: 14px;
  transition: background var(--dur) var(--ease);
}
.check:hover { background: var(--surface-sunken); }
.check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.check .count { margin-left: auto; font-size: 12px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.check.is-empty { opacity: .45; }

.scroll-list { max-height: 232px; overflow-y: auto; padding-right: 4px; }

/* Price histogram behind the range inputs */
.histogram { display: flex; align-items: flex-end; gap: 2px; height: 40px; margin-bottom: 2px; }
.histogram span {
  flex: 1; min-height: 2px; border-radius: 2px 2px 0 0;
  background: var(--brand-200); transition: background var(--dur) var(--ease);
}
[data-theme='dark'] .histogram span { background: color-mix(in srgb, var(--brand-500) 35%, transparent); }
.histogram span.in { background: var(--primary); }

/* --- Toolbar ------------------------------------------------------------- */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.result-count { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.result-count small { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toolbar-right select { width: auto; min-width: 176px; }

.viewtoggle { display: flex; gap: 2px; background: var(--surface-sunken); padding: 3px; border-radius: var(--r-md); }
.viewtoggle button {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: none; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.viewtoggle button[aria-pressed='true'] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* Active filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 6px 0 11px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
}
.chip button {
  display: grid; place-items: center; width: 20px; height: 20px;
  border: none; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.chip button:hover { background: color-mix(in srgb, var(--primary) 20%, transparent); }
.chip-understood { background: var(--surface); color: var(--text-muted); border-color: var(--border); }

/* --- Result grid --------------------------------------------------------- */
.results { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.results[data-view='list'] { grid-template-columns: 1fr; }

.card {
  /* 200 cards per page would otherwise mean 200 laid-out, painted subtrees.
     content-visibility skips both for anything off-screen; the intrinsic size
     keeps the scrollbar length and scroll position stable while they realise.
     Paired with loading="lazy" on the images, an unscrolled page of 200 costs
     little more than a page of 24. */
  content-visibility: auto;
  contain-intrinsic-size: auto 380px;
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-sunken); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-media .placeholder { display: grid; place-items: center; height: 100%; color: var(--text-subtle); }

.card-price {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 11px; border-radius: var(--r-md);
  background: rgba(9, 14, 20, .82);
  color: #fff; backdrop-filter: blur(6px);
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.card-price small { font-size: 11px; font-weight: 500; opacity: .8; }

.card-fav {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(9, 14, 20, .55); color: #fff; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.card-fav:hover { background: rgba(9, 14, 20, .8); }
.card-fav[aria-pressed='true'] { color: #fb7185; }
.card-fav[aria-pressed='true'] svg { fill: currentColor; }

.card-dup {
  position: absolute; top: 8px; left: 8px;
  padding: 4px 9px; border-radius: var(--r-pill);
  background: rgba(9, 14, 20, .68); color: #fff;
  font-size: 11px; font-weight: 600; backdrop-filter: blur(6px);
}

/* Count bubble on the header favourites button */
#btn-favs { position: relative; }
#btn-favs[aria-pressed='true'] { color: #fb7185; }
#btn-favs[aria-pressed='true'] svg { fill: currentColor; }
.fav-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700; line-height: 1;
}
/* Author display rules beat the UA's [hidden] { display:none } — restate it. */
.fav-badge[hidden] { display: none; }

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.card-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-loc { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-muted); }
.card-loc svg { flex-shrink: 0; color: var(--text-subtle); }

.specs { display: flex; flex-wrap: wrap; gap: 5px; }
.spec {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-sm);
  background: var(--surface-sunken); color: var(--text-muted);
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.spec-yes { background: var(--positive-soft); color: var(--positive); }
.spec-no  { background: var(--negative-soft); color: var(--negative); }

.card-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-subtle);
}
.source-tag {
  padding: 2px 7px; border-radius: var(--r-sm);
  background: var(--surface-sunken); color: var(--text-muted);
  font-weight: 600; font-size: 11px; letter-spacing: .02em;
}
.sqm { margin-left: auto; font-variant-numeric: tabular-nums; }

/* List view */
.results[data-view='list'] .card { flex-direction: row; }
.results[data-view='list'] .card-media { width: 260px; flex-shrink: 0; aspect-ratio: auto; }
.results[data-view='list'] .card-body { padding: 14px 16px; }
.results[data-view='list'] .card-title { -webkit-line-clamp: 1; font-size: 15.5px; }

/* Compact table view */
.results[data-view='table'] { gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.results[data-view='table'] .card {
  flex-direction: row; align-items: center; gap: 12px;
  border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  padding: 8px 12px; transform: none !important;
}
.results[data-view='table'] .card:hover { background: var(--surface-sunken); box-shadow: none; }
.results[data-view='table'] .card-media { width: 64px; height: 48px; aspect-ratio: auto; border-radius: var(--r-sm); }
.results[data-view='table'] .card-price { position: static; background: none; color: var(--text); backdrop-filter: none; padding: 0; font-size: 15px; }
.results[data-view='table'] .card-fav, .results[data-view='table'] .card-dup { position: static; }
.results[data-view='table'] .card-body { flex-direction: row; align-items: center; gap: 12px; padding: 0; }
.results[data-view='table'] .card-foot { border: none; padding: 0; margin: 0; }
.results[data-view='table'] .card-title { -webkit-line-clamp: 1; }

/* --- Skeletons ----------------------------------------------------------- */
.sk { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.sk-media { aspect-ratio: 4 / 3; }
.sk-line { height: 12px; border-radius: var(--r-sm); margin: 10px 14px; }
.sk-line.short { width: 55%; }
.shimmer {
  background: linear-gradient(90deg, var(--surface-sunken) 25%, color-mix(in srgb, var(--surface-sunken) 60%, var(--surface)) 37%, var(--surface-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --- Empty / error states ------------------------------------------------ */
.state {
  grid-column: 1 / -1;
  display: grid; place-items: center; gap: 14px;
  padding: 64px 24px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
}
.state h3 { font-size: 17px; }
.state p { margin: 0; color: var(--text-muted); max-width: 46ch; }
.state-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Zero-result previews: what each escape route actually returns.
   The block is one big button — the cards inside are a picture of the result,
   not separate targets, so there is exactly one thing to click per option. */
.state-previews { display: grid; gap: 10px; margin-top: 16px; width: 100%; max-width: 620px; }
.preview {
  display: grid; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: inherit; font: inherit;
}
.preview:hover, .preview:focus-visible { border-color: var(--primary); }
.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.preview-head b { font-size: 14.5px; }
.preview-head span { color: var(--primary); font-size: 13px; font-weight: 600; white-space: nowrap; }
.preview-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pcard { display: grid; gap: 3px; min-width: 0; }
.pcard-img {
  display: block; aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden;
  background: var(--surface-2, rgba(128,128,128,.12));
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-price { font-weight: 700; font-size: 13px; }
.pcard-meta {
  font-size: 11.5px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.preview-zones { display: grid; gap: 7px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; }
.preview-zones > b { font-size: 14.5px; }
.zone-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.zone-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: inherit; font: inherit; font-size: 13px;
}
.zone-chip:hover, .zone-chip:focus-visible { border-color: var(--primary); color: var(--primary); }
.zone-chip i { font-style: normal; color: var(--text-muted); font-size: 12px; }
@media (max-width: 460px) { .preview-cards { grid-template-columns: repeat(2, 1fr); } .pcard:nth-child(3) { display: none; } }

/* --- Pagination ---------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 8px; }
.page-info { font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pagination { flex-wrap: wrap; }
.page-nums { display: flex; align-items: center; gap: 4px; }
/* Tabular figures so the row does not reflow as the digit count changes. */
.page-num { min-width: 36px; justify-content: center; font-variant-numeric: tabular-nums; }
/* --accent / --accent-contrast are not defined in this file (only --accent-600
   is), so both resolved to unset: the CURRENT page marker was transparent on the
   page background at about 1,04:1 — invisible in the light theme, and an
   accidental white outline in dark. */
.page-num.is-current {
  background: var(--primary); color: var(--on-primary);
  border-color: var(--primary); font-weight: 600;
}
.page-capped { color: var(--text-muted); }
.page-gap { padding: 0 2px; color: var(--text-muted); user-select: none; }
/* The range reads first on a phone, where the buttons wrap below it. */
@media (max-width: 560px) {
  .pagination { gap: 8px; }
  .page-info { order: -1; width: 100%; text-align: center; }
}

/* --- Modal --------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(9, 14, 20, .55);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.modal.open { opacity: 1; visibility: visible; }
.modal-panel {
  width: min(980px, 100%); max-height: min(88vh, 900px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(.97) translateY(8px);
  transition: transform var(--dur) var(--ease);
}
.modal.open .modal-panel { transform: none; }
.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 17px; }
/* grid-template-columns must be minmax(0,1fr) and children min-width:0, or a
   wide child (gallery, table, long chip row) pushes past the panel and clips. */
.modal-body {
  overflow-y: auto; padding: 18px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px;
}
.modal-body > * { min-width: 0; }
.modal-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* Fixed height + min-height:0 on the children: without it a tall source photo
   keeps its intrinsic size and pushes through the rest of the modal. */
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; height: 340px; overflow: hidden; }
.gallery.is-single { grid-template-columns: 1fr; }
.gallery img {
  width: 100%; height: 100%; min-height: 0; min-width: 0;
  object-fit: cover; display: block;
  border-radius: var(--r-md); background: var(--surface-sunken);
}
.gallery-side { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; min-height: 0; }
.gallery-side:has(img:only-child) { grid-template-rows: 1fr; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.kv div { padding: 10px 12px; background: var(--surface-sunken); border-radius: var(--r-md); }
.kv dt { font-size: 11px; font-weight: 500; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .05em; }
.kv dd { margin: 3px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.section-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.desc { font-size: 14.5px; line-height: 1.65; color: var(--text-muted); white-space: pre-wrap; max-height: 260px; overflow-y: auto; }

/* Source spec values can be a single very long unbroken string (URLs, JSON);
   fixed layout + wrapping keeps them inside the panel instead of stretching it. */
.attr-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13.5px; }
.attr-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere; word-break: break-word;
}
.attr-table tr:last-child td { border-bottom: none; }
.attr-table td:first-child { color: var(--text-subtle); width: 45%; }
.attr-table td:last-child { font-weight: 500; }

/* --- Drawer (mobile filters) --------------------------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(9, 14, 20, .5); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.scrim.open { opacity: 1; visibility: visible; }

.mobile-bar { display: none; }

/* --- Toast --------------------------------------------------------------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r-md);
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: toast-in var(--dur) var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --- Compare bar --------------------------------------------------------- */
.compare-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 70; display: none; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-pill); box-shadow: var(--shadow-lg);
}
.compare-bar.show { display: flex; }
.compare-count { font-size: 14px; font-weight: 600; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1180px) {
  :root { --sidebar-w: 280px; }
}

@media (max-width: 980px) {
  .app-nav-row { display: none; }
  .mobile-only { display: inline-flex !important; }
  .header-actions [data-auth-slot] .auth-menu summary { padding: 3px; border: 0; background: transparent; }
  .header-actions [data-auth-slot] .auth-btn { min-height: 36px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }

  /* Filters become a bottom sheet on touch layouts. */
  .sidebar {
    position: fixed; inset: auto 0 0 0; z-index: 70;
    max-height: 86vh; border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(101%);
    transition: transform 240ms var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar::before {
    content: ''; display: block; width: 40px; height: 4px; margin: 10px auto 0;
    background: var(--border-strong); border-radius: var(--r-pill);
  }
  .sidebar-head { top: 14px; }

  .mobile-bar {
    position: sticky; top: var(--header-h); z-index: 40;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .mobile-bar .btn { flex: 1; }
  .mobile-bar select { flex: 1; }

  .brand-sub { display: none; }
  .toolbar-right .desktop-only { display: none; }
  .results[data-view='list'] .card { flex-direction: column; }
  .results[data-view='list'] .card-media { width: 100%; aspect-ratio: 4 / 3; }
  .gallery { grid-template-columns: 1fr; max-height: none; }
  .gallery-side { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
}

.btn-only-icon { display: none; }

@media (max-width: 640px) {
  .app-header-row { padding: 0 10px; gap: 8px; }
  .brand-name { display: none; }
  /* Room for the query: saved searches and the theme live in the drawer on a
     phone, and the sign-in shrinks to its icon. */
  #btn-saved, #btn-theme { display: none; }
  .header-actions { gap: 4px; }
  .header-actions .auth-btn { padding: 0 10px; min-height: 36px; }
  .header-actions .auth-btn-label { display: none; }
  .header-search { min-width: 0; }
  .feature-strip .feature-strip-hide { position: static; display: block; margin: 2px 0 0 auto; }
  /* Give the query the full width; the submit button becomes an arrow. */
  .smart .btn-label { display: none; }
  .smart .btn-only-icon { display: block; }
  .smart .btn { width: 40px; padding: 0; }
  .layout { padding: 12px; }
  .results { grid-template-columns: 1fr; gap: 12px; }
  .modal { padding: 0; }
  .modal-panel { width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .result-count { font-size: 17px; }
  .toolbar { gap: 8px; }
  /* Keep the filter sheet clear of the home indicator / browser chrome. */
  .sidebar { padding-bottom: env(safe-area-inset-bottom, 0); }
  .compare-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; }
}

/* --- Reduced motion ------------------------------------------------------ */
@media (pointer: coarse) {
  .check { min-height: 44px; }
  .seg button { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
}

@media print {
  .app-header, .sidebar, .toolbar-right, .pagination, .compare-bar { display: none; }
  .layout { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   In-feed sponsored slots.
   Shaped like a listing card so the grid keeps its rhythm, but deliberately
   NOT disguised as one: a dashed border, a muted surface and an explicit
   "Sponsorizat" badge. Google requires ads to be distinguishable from content,
   and on a site where every card is an "anunț" a generic label would hide it.
   All of this is dead weight until public/ads.js has an AdSense client id.
--------------------------------------------------------------------------- */
.ad-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 28px 12px 12px;
  border-style: dashed;
  background: var(--sunken, rgba(127, 127, 127, .06));
  /* The slot has no intrinsic height until AdSense fills it; reserving space
     stops the grid reflowing under the reader mid-scroll. */
  contain: layout paint;
}

.ad-card .ad-badge {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-subtle, #6b7280);
  background: var(--surface, rgba(127, 127, 127, .12));
  /* Above the ad iframe, so the label can never be painted over. */
  z-index: 2;
  pointer-events: none;
}

.ad-card ins.adsbygoogle { display: block; width: 100%; }

/* An unfilled slot collapses instead of leaving a dashed hole in the grid. */
.ad-card ins.adsbygoogle[data-ad-status="unfilled"] { display: none; }
.ad-card:has(ins[data-ad-status="unfilled"]) { display: none; }

/* --- site footer -----------------------------------------------------------
   Carries the links to the information pages. It is not decoration: a privacy
   policy that nothing links to is, for a reviewer or a visitor, a policy that
   does not exist — and the results grid is rendered client-side, so this prose
   is a meaningful share of what a crawler actually receives in the HTML. */
.site-foot {
  margin-top: 48px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.foot-about {
  margin: 0;
  max-width: 68ch;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.65;
  text-wrap: pretty;
}
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.foot-nav a {
  color: var(--text-subtle);
  font-size: 13px;
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.foot-nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.foot-nav a:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 3px; }

/* --- price history --------------------------------------------------------
   The only data on this site that is ours: source portals publish today's
   price and nothing else, so a series over time exists here and nowhere they
   can see it. Most listings still have a single observation, and the panel
   says so rather than drawing a chart of one point. */
.ph-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.spark { flex: 0 0 auto; border-radius: var(--r-sm); background: var(--surface-sunken); }
.ph-facts { min-width: 0; }
.ph-delta { font-weight: 650; font-size: 15px; }
.ph-delta.spec-yes { color: var(--positive); }
.ph-delta.spec-no  { color: var(--negative); }
.ph-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.ph-table { border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.ph-table td { padding: 3px 14px 3px 0; color: var(--text-muted); }
.ph-table .ph-p { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.ph-single, .ph-market {
  margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; color: var(--text-muted);
}
.ph-market strong { color: var(--text); }

/* Attribution under the description extract. The full text stays with whoever
   wrote it, on the portal that published it. */
.desc-src { margin: 6px 0 0; font-size: 12px; color: var(--text-subtle); }

/* A hot-linked image that fails leaves a tidy hole, not a broken icon.
   Every photo comes from a source portal's CDN, so any of the 18 can stop
   serving us at any moment — the failure mode to avoid is a grid of broken
   images with advertising around it. Same box, same aspect ratio, no shift. */
.card-media.media-missing,
.media-missing {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg,
      var(--surface-sunken) 0 10px,
      color-mix(in srgb, var(--surface-sunken) 60%, var(--surface)) 10px 20px);
}
.card-media.media-missing::after {
  content: "fotografie indisponibilă";
  font-size: 11.5px;
  color: var(--text-subtle);
  letter-spacing: .01em;
  padding: 0 10px;
  text-align: center;
}


/* ---- consent banner ---- */
#ap-consent{position:fixed;left:0;right:0;bottom:0;z-index:9999;background:var(--card,#fff);
  border-top:1px solid var(--line,#e3e7ee);box-shadow:0 -6px 24px rgba(0,0,0,.10)}
.ap-consent-inner{max-width:960px;margin:0 auto;padding:8px 14px;display:flex;gap:10px;
  align-items:center;flex-wrap:wrap}
.ap-consent-text{margin:0;flex:1 1 260px;font-size:13px;line-height:1.35;color:var(--text,#0f172a)}
.ap-consent-actions{display:flex;gap:10px;flex:0 0 auto}
/* Both buttons are the SAME. That is the point. */
/* --fg, --bg, --line, --card and --accent are the CITY PAGES' token names; this
   file uses --text/--surface/--border/--primary. --fg was simply undefined here
   so the text fell back to #0f172a, while --bg IS defined and dark-swaps — which
   put near-black text on a near-black button at 1,08:1 for every visitor whose
   OS is in dark mode, which is also this app's default. */
.ap-consent-btn{font:inherit;font-size:13px;font-weight:600;padding:6px 14px;min-width:80px;
  border:1px solid var(--border,#cbd5e1);border-radius:8px;background:var(--surface,#fff);
  color:var(--text,#0f172a);cursor:pointer}
.ap-consent-btn:hover{background:var(--surface-2,var(--surface,#fff));border-color:var(--primary)}
.ap-consent-btn:focus-visible{outline:2px solid var(--primary,#0f766e);outline-offset:2px}
@media (max-width:520px){.ap-consent-actions{width:100%}.ap-consent-btn{flex:1}}

/* ---- feature strip (home) ---- */
.feature-strip{position:relative;margin:0 0 14px}
.feature-strip .tools{margin:0}
.feature-strip[hidden]{display:none}
.feature-strip-hide{position:absolute;top:-4px;right:0;font:inherit;font-size:12px;color:var(--text-subtle);background:transparent;border:0;cursor:pointer;padding:4px 6px}
.feature-strip-hide:hover{color:var(--primary)}

/* ---- modal: the full page as a first-class action, and the value summary ---- */
.modal-head{align-items:center}
.modal-page-link{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;margin-left:auto;min-height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--primary);color:var(--primary);background:var(--primary-soft);font-size:13px;font-weight:600;text-decoration:none;white-space:nowrap}
.modal-page-link:hover{background:var(--primary);color:var(--on-primary)}
.modal-head #modal-close{margin-left:8px!important}
.val-strip{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:baseline;padding:10px 14px;border:1px solid var(--border);border-left:4px solid var(--primary);border-radius:var(--r-md);background:var(--surface-sunken,var(--surface))}
.val-strip b{font-size:18px;font-variant-numeric:tabular-nums}
.val-strip span{font-size:13px;color:var(--text-muted)}
.val-strip .card-deal{position:static;font-size:12px}
@media (max-width:640px){.modal-page-link span{display:none}.modal-page-link{padding:0 10px}}

/* ---- in-modal section jumps ---- */
.modal-nav{display:flex;gap:6px;flex-wrap:wrap;position:sticky;top:-18px;z-index:3;background:var(--surface);padding:10px 0 8px;margin:-10px 0 -8px;border-bottom:1px solid var(--border)}
.modal-nav button{font:inherit;font-size:12.5px;font-weight:600;padding:5px 11px;border-radius:999px;border:1px solid var(--border);background:var(--surface-sunken,var(--surface));color:var(--text-muted);cursor:pointer}
.modal-nav button:hover{color:var(--primary);border-color:var(--primary)}
.saved-row{display:flex;gap:6px;align-items:stretch}
.saved-row .btn{flex:1;justify-content:space-between}
.saved-del{flex:0 0 auto;width:40px;padding:0}

/* ---- e-mail alert dialog ---- */
.alert-dialog{border:1px solid var(--border);border-radius:var(--r-lg,12px);background:var(--surface);color:var(--text);padding:0;max-width:440px;width:calc(100% - 32px)}
.alert-dialog::backdrop{background:rgba(15,23,42,.45)}
.alert-dialog form{padding:18px 20px;display:grid;gap:10px}
.alert-dialog h2{margin:0;font-size:18px}
.alert-what{margin:0;font-size:14px;color:var(--text-muted)}
.alert-dialog label{font-size:12.5px;font-weight:600;color:var(--text-subtle)}
.alert-dialog input[type=email]{font:inherit;font-size:15px;padding:9px 11px;border:1px solid var(--border);border-radius:8px;background:var(--surface-sunken,var(--surface));color:var(--text)}
.alert-note{margin:0;font-size:12.5px;color:var(--text-subtle);line-height:1.45}
.alert-msg{margin:0;font-size:13px;color:var(--warn-ink,#8a2f2f);min-height:1em}
.alert-actions{display:flex;gap:8px;justify-content:flex-end}

/* ---------------------------------------------------------------------------
   De-duplication notice.

   The server has always reported when a result set was too wide to group, and
   nothing rendered it — so on the default screen the site's whole differentiator
   was simply absent, and the result count silently changed meaning between
   "anunturi" and "apartamente distincte" with no explanation.
   --------------------------------------------------------------------------- */
.grouping-note{
  margin:6px 0 0;
  font-size:12.5px;
  line-height:1.4;
  color:var(--text-subtle);
  max-width:62ch;
}
.linklike{
  font:inherit;
  color:var(--primary);
  background:none;
  border:0;
  padding:0;
  cursor:pointer;
  text-decoration:underline;
}
.linklike:hover{text-decoration:none}

/* ===========================================================================
   MOBILE DENSITY AND INPUT ZOOM
   Appended last so these win over the earlier @media block without editing it.
   =========================================================================== */
@media (max-width: 980px) {
  /* iOS Safari zooms the whole page whenever a focused control is under 16px,
     and there is no maximum-scale to stop it — so it zooms in on every filter
     tap and never zooms back out. Everything here inherited 15px. */
  input, select, textarea, .smart input { font-size: 16px; }

  /* One card filled almost the entire 844px viewport: a 4/3 photo on a 390px
     screen is 293px of image before any text, so a person scrolled a full
     screen per listing. 16/10 shows the photo clearly and fits two cards. */
  .card-media { aspect-ratio: 16 / 10; }
  .results[data-view='grid'] { gap: 12px; }
  .card-title { font-size: 15px; }
  .card-body { padding: 12px 13px; }

  /* The view toggle was desktop-only, so the compact modes that actually solve
     density on a phone were unreachable on a phone. Sorting stays in the
     dedicated mobile control; only the density switch comes back. */
  .toolbar-right .viewtoggle.desktop-only { display: inline-flex; }
  .viewtoggle button { min-width: 40px; min-height: 40px; }
  /* Sit the density switch on the count's own row. Given a row to itself it
     cost ~90px of a 844px screen, which is most of a card. */
  .toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .toolbar-right { margin-left: auto; flex: 0 0 auto; }

  /* In the compact table mode the thumbnail must stay small, or the mobile
     aspect-ratio override above undoes the compactness. */
  .results[data-view='table'] .card-media { aspect-ratio: auto; }
  .results[data-view='list'] .card-media { aspect-ratio: auto; width: 128px; }
}

/* The chip's remove button was 20x20, under the 24px minimum in WCAG 2.5.8.
   Everything else on the page already cleared it. */
.chip button { min-width: 24px; min-height: 24px; }

/* ---------------------------------------------------------------------------
   "Caută în:" — server-rendered city strip above the results.
   The one question the app never asked a first-time visitor. Horizontal scroll
   on phones; hidden by the app once a city filter is active.
   --------------------------------------------------------------------------- */
.city-strip{display:flex;align-items:center;gap:8px;overflow-x:auto;padding:2px 0 10px;margin:0 0 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.city-strip::-webkit-scrollbar{display:none}
.city-strip-label{font-size:13px;color:var(--text-subtle);white-space:nowrap;flex:0 0 auto}
.city-strip a{flex:0 0 auto;white-space:nowrap;font-size:13.5px;padding:6px 12px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text);text-decoration:none;min-height:32px;display:inline-flex;align-items:center}
.city-strip a:hover{border-color:var(--primary);color:var(--primary)}
.city-strip a.city-strip-all{color:var(--primary);border-style:dashed}

/* ---------------------------------------------------------------------------
   "Cât valorează" — the market estimate in the detail panel, and the
   under-zone badge on cards. Both read the nightly Comps table.
   --------------------------------------------------------------------------- */
.val{background:var(--surface-sunken,var(--surface));border:1px solid var(--border);border-radius:var(--r-lg,12px);padding:14px 16px;margin:6px 0 10px}
.val-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}
.val-label{font-size:12.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-subtle);font-weight:600}
.val-num{font-size:26px;font-weight:700;line-height:1.15;margin-top:2px;font-variant-numeric:tabular-nums}
.val-num small{font-size:14px;font-weight:500;color:var(--text-subtle);margin-left:2px}
.val-range{font-size:13.5px;color:var(--text-subtle);margin-top:2px}
.val-dev{display:flex;flex-direction:column;align-items:flex-end;text-align:right;padding:8px 12px;border-radius:10px;min-width:150px}
.val-dev b{font-size:15px;line-height:1.2}
.val-dev span{font-size:12px;opacity:.85;margin-top:2px}
.val-good{background:var(--good-bg,#e6f4ea);color:var(--good-ink,#1e6b34)}
.val-fair{background:var(--surface);color:var(--text);border:1px solid var(--border)}
.val-high{background:var(--warn-bg,#fbeaea);color:var(--warn-ink,#8a2f2f)}
.val-note{font-size:12.5px;color:var(--text-subtle);margin-top:10px;line-height:1.45}
.val-note a{color:var(--primary)}
.val-rent{margin-top:0}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--good-bg:#173224;--good-ink:#8fdcab;--warn-bg:#3a1c1c;--warn-ink:#f0a3a3}}
:root[data-theme="dark"]{--good-bg:#173224;--good-ink:#8fdcab;--warn-bg:#3a1c1c;--warn-ink:#f0a3a3}
.card-deal{position:absolute;left:10px;top:10px;background:var(--good-ink,#1e6b34);color:#fff;font-size:12px;font-weight:700;padding:4px 9px;border-radius:999px;letter-spacing:.02em;box-shadow:0 1px 4px rgba(0,0,0,.25)}
.results[data-view='table'] .card-deal{position:static;margin-left:8px}

/* ---------------------------------------------------------------------------
   "Unde este" — map, address line, Street View — and "Alternative în apropiere".
   --------------------------------------------------------------------------- */
.map-addr{font-size:14.5px;margin:0 0 8px;line-height:1.45}
.map-approx{color:var(--text-subtle)}
.map-box{height:260px;border-radius:var(--r-lg,12px);overflow:hidden;border:1px solid var(--border);background:var(--surface-sunken,var(--surface))}
.map-box .leaflet-container{font:inherit}
.map-links{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 16px}
.around{border:1px solid var(--border);border-radius:var(--r-lg,12px);background:var(--surface);padding:12px 16px 12px;margin:6px 0 16px;display:grid;gap:10px}
.around-row{display:grid;grid-template-columns:150px 1fr 52px;grid-template-areas:"label bar num" "detail detail detail";align-items:center;column-gap:12px;row-gap:2px}
.around-label{grid-area:label;font-size:13.5px;font-weight:600}
.around-bar{grid-area:bar;height:8px;border-radius:99px;background:var(--surface-sunken,var(--border));overflow:hidden}
.around-bar i{display:block;height:100%;border-radius:99px;background:var(--text-subtle)}
.around-good .around-bar i{background:var(--good-ink,#1e6b34)}
.around-fair .around-bar i{background:var(--primary)}
.around-low .around-bar i{background:var(--text-subtle)}
.around-num{grid-area:num;text-align:right;font-weight:700;font-size:15px;font-variant-numeric:tabular-nums}
.around-num small{font-weight:500;color:var(--text-subtle);font-size:11.5px}
.around-detail{grid-area:detail;font-size:12.5px;color:var(--text-subtle);line-height:1.4}
.around .val-note{margin-top:2px}
@media (max-width:520px){.around-row{grid-template-columns:1fr 52px;grid-template-areas:"label num" "bar bar" "detail detail"}}
.nearby{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;margin:6px 0 16px}
.nearby-card{display:block;text-align:left;padding:0;border:1px solid var(--border);border-radius:var(--r-lg,12px);background:var(--surface);overflow:hidden;cursor:pointer;font:inherit;color:inherit}
.nearby-card:hover{border-color:var(--primary)}
.nearby-card:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.nearby-media{position:relative;aspect-ratio:16/10;background:var(--surface-sunken,var(--border))}
.nearby-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.nearby-media .card-deal{font-size:11px;padding:3px 7px}
.nearby-body{padding:8px 10px 10px}
.nearby-price{font-weight:700;font-size:15px;font-variant-numeric:tabular-nums}
.nearby-price small{font-weight:500;color:var(--text-subtle);font-size:12px}
.nearby-meta{font-size:12.5px;color:var(--text-subtle);margin-top:2px}
.nearby-title{font-size:12.5px;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.35}
@media(max-width:640px){.map-box{height:210px}}

/* ---------------------------------------------------------------------------
   "Cât costă să-l ții" — the cost-of-ownership calculator in the detail panel.
   --------------------------------------------------------------------------- */
.calc{border:1px solid var(--border);border-radius:var(--r-lg,12px);background:var(--surface);padding:14px 16px;margin:6px 0 16px}
.calc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 14px;margin-bottom:12px}
.calc-in{display:flex;flex-direction:column;gap:4px;font-size:12.5px;color:var(--text-subtle);text-transform:uppercase;letter-spacing:.05em;font-weight:600;position:relative}
.calc-in input{font:inherit;font-size:15px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--text);background:var(--surface-sunken,var(--surface));border:1px solid var(--border);border-radius:8px;padding:8px 44px 8px 10px;width:100%;font-variant-numeric:tabular-nums}
.calc-in input:focus-visible{outline:2px solid var(--primary);outline-offset:1px}
.calc-in i{position:absolute;right:10px;bottom:9px;font-style:normal;font-size:12px;color:var(--text-subtle);text-transform:none;letter-spacing:0;font-weight:500;pointer-events:none}
.calc-total{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;background:var(--surface-sunken,var(--border));margin-bottom:10px}
.calc-total span{font-size:13px;color:var(--text-subtle);text-transform:uppercase;letter-spacing:.05em;font-weight:600}
.calc-total b{font-size:24px;font-variant-numeric:tabular-nums}
.calc-lines{display:grid;gap:6px;margin:0}
.calc-lines>div{display:grid;grid-template-columns:1fr auto;gap:2px 12px;align-items:baseline;padding:6px 0;border-bottom:1px solid var(--border)}
.calc-lines>div:last-child{border-bottom:0}
.calc-lines dt{font-size:14px;color:var(--text)}
.calc-lines dd{margin:0;text-align:right;font-weight:600;font-variant-numeric:tabular-nums}
.calc-lines dd small{display:block;font-weight:400;font-size:12px;color:var(--text-subtle);margin-top:1px;max-width:34ch;margin-left:auto}
.calc-note{font-size:12.5px;color:var(--text-subtle);margin:10px 0 0;line-height:1.45}
@media(max-width:640px){.calc-lines>div{grid-template-columns:1fr}.calc-lines dd{text-align:left}.calc-lines dd small{margin-left:0}}
/* Unit suffix anchored to the input, not the label (whose caption may wrap). */
.calc-in{justify-content:flex-end}
.calc-wrap{position:relative;display:block}
.calc-in i{bottom:auto;top:50%;transform:translateY(-50%)}
