/* נווה דקלים survey — architectural blueprint ledger.
   Dark ink ground, hairline rules, tabular numerics, one warm signal colour. */

@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@400;500;700;900&family=Assistant:wght@300;400;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #0e1116;
  --panel: #14181f;
  --panel-2: #191e26;
  --rule: #262d38;
  --rule-soft: #1c222b;
  --bone: #e8e3d9;
  --bone-dim: #a8a49c;
  --bone-faint: #6d6f76;

  /* Board identity — validated: lightness band, chroma floor, CVD ΔE, contrast. */
  --b-yad2: #d1732c;
  --b-madlan: #2f9fb8;
  --b-onmap: #8a6ddb;
  --b-adcoil: #5aab4a;

  /* Diverging: cheaper than comparable ← neutral → richer. Always direct-labelled. */
  --under: #2e9d7e;
  --over: #c2544f;
  --neutral: #7d8590;

  --amber: #d99a2b;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 32px -12px rgba(0, 0, 0, 0.8);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 15px/1.55 'Assistant', system-ui, sans-serif;
  /* Blueprint grid + a warm vignette so the ground is never a flat fill. */
  background-image:
    radial-gradient(120% 80% at 82% -10%, rgba(217, 154, 43, 0.07), transparent 60%),
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 100% 100%, 64px 64px, 64px 64px;
  background-attachment: fixed;
}

/* Grain, so large dark areas have tooth. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.he { direction: rtl; unicode-bidi: isolate; text-align: right; }

/* ── shell ─────────────────────────────────────────────────────────── */

.wrap { max-width: 1560px; margin: 0 auto; padding: 0 28px 96px; }

header.masthead {
  padding: 44px 0 26px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.masthead h1 {
  font: 900 clamp(38px, 5.4vw, 68px)/0.92 'Frank Ruhl Libre', serif;
  margin: 0;
  letter-spacing: -0.02em;
  direction: rtl;
}
.masthead h1 small {
  display: block;
  font: 400 15px/1.4 'Assistant', sans-serif;
  color: var(--bone-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
  direction: ltr;
  text-align: left;
}
.masthead .meta { font-size: 12.5px; color: var(--bone-faint); text-align: right; line-height: 1.9; }
.masthead .meta b { color: var(--bone-dim); font-weight: 600; }

/* ── stat tiles: hero numbers, not charts ──────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 0 0 34px;
}
.tile { background: var(--panel); padding: 18px 20px 16px; }
.tile dt {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin: 0 0 8px;
}
.tile dd { margin: 0; font: 500 27px/1 var(--mono); font-variant-numeric: tabular-nums; }
.tile dd .unit { font-size: 13px; color: var(--bone-faint); margin-inline-start: 3px; }
.tile .sub { font-size: 11.5px; color: var(--bone-faint); margin-top: 7px; font-family: 'Assistant', sans-serif; }

/* ── comps strip ───────────────────────────────────────────────────── */

.comps { border: 1px solid var(--rule); margin-bottom: 30px; }
.comps h2, .panel h2, .picks h2 {
  margin: 0;
  padding: 13px 20px;
  font: 600 11.5px/1 'Assistant', sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
  background: var(--panel-2);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.comps h2 em, .picks h2 em { font-style: normal; color: var(--bone-faint); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.comps-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.comp-row { padding: 15px 20px; border-inline-end: 1px solid var(--rule-soft); background: var(--panel); }
.comp-row:last-child { border-inline-end: 0; }
.comp-row .band { font-size: 12px; color: var(--bone-dim); margin-bottom: 6px; }
.comp-row .v { font: 500 21px/1 var(--mono); }
.comp-row .n { font-size: 11px; color: var(--bone-faint); margin-top: 5px; }

/* ── controls ──────────────────────────────────────────────────────── */

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(var(--ink) 72%, transparent);
  backdrop-filter: blur(6px);
}
.controls input[type='search'], .controls select {
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--bone);
  font: 400 13.5px 'Assistant', sans-serif;
  padding: 8px 11px;
  border-radius: 2px;
}
.controls input[type='search'] { min-width: 220px; }
.controls input:focus-visible, .controls select:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}
.chipset { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--bone-dim);
  font: 500 12px 'Assistant', sans-serif;
  padding: 7px 11px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.chip:hover { color: var(--bone); border-color: #38414f; }
.chip[aria-pressed='true'] { color: var(--ink); background: var(--bone); border-color: var(--bone); font-weight: 700; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.count { color: var(--bone-faint); font-size: 12.5px; margin-inline-start: auto; }


/* ── AI top picks ──────────────────────────────────────────────────── */
.picks { border: 1px solid var(--amber); margin-bottom: 30px; }
.picks h2 { border-color: var(--amber); }
.picks-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.pick {
  display: flex; gap: 12px; align-items: flex-start; position: relative;
  padding: 14px 16px; background: none; border: 0; border-inline-start: 1px solid var(--rule-soft);
  color: var(--bone); text-align: start; cursor: pointer; font: inherit;
}
.pick:first-child { border-inline-start: 0; }
.pick:hover, .pick:focus-visible { background: var(--panel-2); }
.pick-rank {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--ink); background: var(--amber);
}
.pick img { flex: none; width: 84px; height: 63px; object-fit: cover; border-radius: 4px; }
.pick-body { display: grid; gap: 3px; min-width: 0; }
.pick-top { display: flex; gap: 8px; align-items: baseline; }
.pick-score { font-size: 12px; color: var(--bone-dim); }
.pick-score b { font-size: 15px; color: var(--amber); font-family: var(--mono); }
.pick-addr { font-weight: 700; font-size: 14px; }
.pick-facts { font-size: 12.5px; color: var(--bone-dim); }
.pick-line { font-size: 12.5px; color: var(--bone-faint); line-height: 1.45; }

/* Latin command names inside RTL prose reorder into gibberish without isolation. */
code[dir='ltr'] {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--bone-dim);
}

/* picks: comparative-ranking additions */
.pick-conf { font-size: 11px; color: var(--bone-faint); }
.pick-watch { font-size: 12px; color: var(--amber); line-height: 1.4; }
.picks-note {
  margin: 0; padding: 12px 20px; font-size: 12.5px; color: var(--bone-dim);
  border-top: 1px solid var(--rule-soft); background: var(--panel); line-height: 1.6;
}

/* second filter row */
.controls-2 { position: static; top: auto; padding-top: 0; background: none; backdrop-filter: none; }
.controls-2 .flt { display: inline-flex; align-items: center; gap: 6px; }
.controls-2 .flt label { font-size: 12px; color: var(--bone-faint); }
.controls-2 input[type='number'] {
  width: 110px; background: var(--panel); border: 1px solid var(--rule); color: var(--bone);
  font: 400 13px var(--mono); padding: 8px 10px; border-radius: 2px;
}

/* City picker: the top level of scope, so it sits above the controls row and stays
   visible while the neighbourhood and street selects cascade beneath it. */
.cities { margin: 0 0 10px; }
.cities .chip { font-size: 13px; }

/* Buy vs rent is the first question, not a filter among many — it changes what every
   number on the page means, so it sits above the city chips and reads as a switch. */
.dealswitch { display: flex; gap: 0; margin: 0 0 10px; }
.dealswitch .chip { border-radius: 0; font-size: 14px; padding: 7px 20px; }
.dealswitch .chip:first-child { border-radius: 0 999px 999px 0; }
.dealswitch .chip:last-child { border-radius: 999px 0 0 999px; border-right: 0; }
