:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d2321;
  --muted: #5f6a66;
  --border: #dedbd2;
  --accent: #4f5d43;          /* deep sage from the logo */
  --accent-soft: #e6ebdf;
  --accent-contrast: #ffffff;
  --ok: #2f6b3a;
  --ok-bg: #dcefdc;
  --ok-soft-bg: #eaf2df;
  --ok-soft: #4a6b14;
  --neutral-bg: #ecebe6;
  --bad: #9b2c1f;
  --bad-bg: #f8e1dc;
  --warn-bg: #fff4d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 14px rgb(0 0 0 / 0.05);
  --tabbar-h: 62px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --surface: #1b201f;
    --text: #e7ece9;
    --muted: #9aa6a1;
    --border: #2e3533;
    --accent: #a9b89a;
    --accent-soft: #263022;
    --accent-contrast: #12160f;
    --ok: #9fdcaa;
    --ok-bg: #1b3a22;
    --ok-soft-bg: #26351a;
    --ok-soft: #b6dc8a;
    --neutral-bg: #2a302e;
    --bad: #f3a597;
    --bad-bg: #44211b;
    --warn-bg: #3a3218;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.45;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { margin: 0 0 0.4rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.85rem; margin-top: 0.6rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.error { color: var(--bad); }
.ok-text { color: var(--ok); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- chrome */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: calc(0.5rem + env(safe-area-inset-top)) 1rem 0.5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.logo { margin: 0; line-height: 0; }
.logo img { display: block; height: 2rem; width: auto; }
.city-pill { font-size: 0.75rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0.2rem 0.6rem; white-space: nowrap; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.7rem; cursor: pointer; padding: 0;
}
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar [aria-selected="true"] { color: var(--accent); font-weight: 600; }

.view { padding: 1rem; max-width: 640px; margin: 0 auto; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.view-head p { margin: 0; font-size: 0.88rem; }

/* ---------------------------------------------------------------- controls */
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 16px; /* no iOS zoom on focus */ color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem 0.65rem; width: 100%; min-width: 0;
}
input[type="checkbox"], input[type="range"] { width: auto; accent-color: var(--accent); }
input[type="range"] { width: 100%; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.7rem; margin: 0; min-width: 0; }
legend { font-size: 0.85rem; color: var(--text); font-weight: 600; padding: 0 0.25rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.5rem; }
.checks label, .declaration { flex-direction: row; align-items: center; gap: 0.4rem; color: var(--text); }
.declaration { align-items: flex-start; font-size: 0.9rem; }

button { font: inherit; cursor: pointer; border-radius: 12px; padding: 0.6rem 1rem; }
.primary { background: var(--accent); color: var(--accent-contrast); border: none; font-weight: 600; }
.ghost { background: none; color: var(--text); border: 1px solid var(--border); }
.wide { width: 100%; padding: 0.8rem; }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: none; color: var(--muted); padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.seg button.on { background: var(--accent); color: var(--accent-contrast); }

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  flex-direction: row; align-items: center; gap: 0.25rem; border: 1px solid var(--border); border-radius: 999px;
  padding: 0.25rem 0.65rem; color: var(--text); font-size: 0.82rem; cursor: pointer;
}
.chip input { display: none; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.stack, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stack { padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1rem; }

/* ---------------------------------------------------------------- chat */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tabbar-h) - 3.5rem); padding-bottom: 0; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1rem; }
.bubble { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--accent-contrast); border-bottom-right-radius: 6px; }
.bubble.typing { color: var(--muted); animation: pulse 1s infinite alternate; }
.bubble.error { color: var(--bad); }
.chat-done { padding-bottom: 0.75rem; }
.composer {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 0.4rem;
  padding: 0.5rem 0 0.75rem; background: var(--bg);
}
.composer textarea { resize: none; border-radius: 22px; padding: 0.6rem 0.9rem; max-height: 140px; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--accent);
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn.send { background: var(--accent); color: var(--accent-contrast); border: 0; }
#mic.recording { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 0.8s infinite alternate; }
#mic.busy { opacity: 0.5; animation: pulse 0.6s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }

/* ---------------------------------------------------------------- cards */
.cards { display: grid; gap: 0.9rem; }
.listing { overflow: hidden; display: flex; flex-direction: column; }
.photo {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' fill-opacity='.55' d='M12 3 2 11h3v9h5v-6h4v6h5v-9h3z'/%3E%3C/svg%3E") center / 22% no-repeat,
    linear-gradient(135deg, hsl(var(--hue, 100) 22% 58%), hsl(calc(var(--hue, 100) + 40) 25% 38%));
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ring {
  position: absolute; top: 0.6rem; inset-inline-end: 0.6rem; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--surface) 60%, transparent) 0);
  box-shadow: var(--shadow);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 0.85rem; }
.photo .badge { position: absolute; bottom: 0.6rem; inset-inline-start: 0.6rem; }
.listing .body { padding: 0.8rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.listing .price { margin: 0; font-weight: 700; font-size: 1.15rem; }
.listing .title { margin: 0; font-size: 0.98rem; font-weight: 600; }
.listing .where { margin: 0; color: var(--muted); font-size: 0.85rem; }
.facts { list-style: none; padding: 0; margin: 0.2rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.facts li { background: var(--neutral-bg); border-radius: 6px; padding: 0.1rem 0.5rem; font-size: 0.78rem; }
.why summary { cursor: pointer; font-size: 0.88rem; color: var(--accent); font-weight: 600; padding: 0.2rem 0; }
.breakdown { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; gap: 0.3rem; }
.breakdown li { display: grid; grid-template-columns: 6.5rem 1fr 2.6rem; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.bar { height: 6px; border-radius: 3px; background: var(--neutral-bg); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--m) * 1%); background: var(--accent); border-radius: 3px; }
.pct { text-align: end; color: var(--muted); }
.reasons { margin: 0.2rem 0 0; padding-inline-start: 1.1rem; font-size: 0.8rem; color: var(--muted); }
.listing .desc { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.listing footer { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.listing footer a { color: var(--accent); font-size: 0.9rem; font-weight: 600; }
.listing footer select { width: auto; font-size: 0.8rem; padding: 0.3rem 0.4rem; }

.badge { font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 0.2rem 0.6rem; white-space: nowrap; }
.badge.ok, .badge.status-enabled { background: var(--ok-bg); color: var(--ok); }
.badge.ok-soft { background: var(--ok-soft-bg); color: var(--ok-soft); }
.badge.neutral, .badge.status-requires_agreement { background: var(--neutral-bg); color: var(--muted); }
.badge.bad, .badge.status-unavailable { background: var(--bad-bg); color: var(--bad); }
.warnings { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.warnings:empty { display: none; }
.warnings li { background: var(--warn-bg); border-radius: 6px; padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; display: grid; gap: 0.8rem; justify-items: center; }

/* ---------------------------------------------------------------- add */
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 0.5rem; }
.platform {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem; border-radius: 12px; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
}
.platform strong { font-size: 0.92rem; }
.file-pick input { display: none; }
.file-btn { border: 1px dashed var(--border); border-radius: 10px; padding: 0.8rem; text-align: center; color: var(--accent); cursor: pointer; }
#image-preview { max-height: 220px; width: 100%; object-fit: contain; border-radius: 10px; margin-top: 0.4rem; }
.hint { margin: 0; font-size: 0.8rem; }
#add-result { margin-top: 1rem; }

/* ---------------------------------------------------------------- profile */
.profile-list { display: grid; gap: 0.6rem; }
.pref { display: grid; gap: 0.4rem; background: var(--surface); }
.pref-head { display: flex; justify-content: space-between; align-items: center; }
.pref-head legend { padding: 0; float: left; }
.req { flex-direction: row; align-items: center; gap: 0.3rem; font-size: 0.8rem; }
.wlabel { font-size: 0.75rem; color: var(--muted); }
.row-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.json pre { font-size: 0.75rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem; }
.json summary { cursor: pointer; color: var(--muted); margin-top: 1rem; }

/* ---------------------------------------------------------------- more */
.more-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem; margin-bottom: 0.8rem; }
.more-section > summary { cursor: pointer; list-style: none; display: grid; gap: 0.1rem; }
.more-section > summary h2 { margin: 0; font-size: 1.05rem; }
.more-section > summary span { font-size: 0.82rem; }
.more-section .stack { box-shadow: none; border: 0; padding: 0; }
.source-card { padding: 0.8rem; display: grid; gap: 0.3rem; justify-items: start; margin-top: 0.6rem; }
.source-card p { margin: 0; }
.notice { background: var(--warn-bg); padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.82rem; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 0.8rem);
  z-index: 20; max-width: min(92vw, 420px); background: var(--text); color: var(--bg); padding: 0.6rem 1rem;
  border-radius: 12px; font-size: 0.88rem; box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- welcome */
.welcome { display: grid; gap: 0.9rem; padding-top: 2rem; }
.welcome h2 { font-size: 1.5rem; margin: 0; }
.role-btn {
  display: grid; gap: 0.25rem; text-align: start; padding: 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
}
.role-btn strong { font-size: 1.05rem; }
.role-icon { font-size: 1.8rem; }
.role-btn:active { transform: scale(0.99); }
body:has(#view-welcome:not([hidden])) .tabbar { display: none; }

/* ---------------------------------------------------------------- game */
.level-chip {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.65rem;
  border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 0.85rem;
}
.lv-icon { font-size: 1rem; }
.game-card {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); display: grid; gap: 0.5rem;
}
.game-card:empty { display: none; }
.game-card p { margin: 0; }
.game-head { display: flex; align-items: center; gap: 0.7rem; }
.game-head div { display: grid; }
.game-icon { font-size: 2.4rem; line-height: 1; }
.xp { height: 10px; border-radius: 5px; background: var(--neutral-bg); overflow: hidden; position: relative; }
.xp::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 1%); border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), #c9a227); transition: width 0.6s ease;
}
.recent, .rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; font-size: 0.82rem; }
.recent li { color: var(--muted); }
.early-banner {
  margin: 0 0 0.8rem; padding: 0.55rem 0.8rem; border-radius: 10px; font-size: 0.82rem;
  background: var(--accent-soft); color: var(--accent);
}
.early-tag {
  position: absolute; top: 0.6rem; inset-inline-start: 0.6rem; background: #c2410c; color: #fff;
  font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.2rem 0.55rem;
}
.toast.points { background: var(--accent); color: var(--accent-contrast); font-weight: 600; animation: pop 0.35s ease; }
@keyframes pop { from { transform: translate(-50%, 8px) scale(0.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

/* ---------------------------------------------------------------- talk */
.listing .fresh { margin: 0; }
.talk summary { cursor: pointer; font-size: 0.88rem; color: var(--accent); font-weight: 600; padding: 0.2rem 0; }
.talk-body { display: grid; gap: 0.5rem; padding-top: 0.3rem; }
.comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.comments p { margin: 0.1rem 0 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.inline-form, .fix-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.inline-form input { flex: 1; }
.fix-form select, .fix-form input { flex: 1 1 8rem; width: auto; }
.fix-value { display: contents; }
.votes { list-style: none; padding: 0; margin: 0; font-size: 0.8rem; color: var(--muted); display: grid; gap: 0.15rem; }
.small-btn { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
.link.small { font-size: 0.8rem; color: var(--muted); text-decoration: underline; justify-self: start; }
.link { background: none; border: none; padding: 0.2rem 0; cursor: pointer; }

/* ---------------------------------------------------------------- landlord */
.owner-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.3rem; }
.owner-actions .badge { margin-inline-end: auto; }
.thumbs { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.4rem; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

/* ---------------------------------------------------------------- stars & links */
.star-particle {
  position: fixed; z-index: 30; font-size: 16px; margin: -8px 0 0 -8px; pointer-events: none; opacity: 0;
}
.link-finder { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.link-finder a { text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
.link-sheet {
  display: grid; gap: 0.45rem; margin-top: 0.5rem; padding: 0.75rem; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent); animation: pop-in 0.3s ease;
}
@keyframes pop-in { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- map thumbnails */
.map-thumb { position: absolute; inset: 0; overflow: hidden; background: #e8e4da; }
.map-canvas { position: absolute; left: 50%; top: 50%; width: 768px; height: 432px; transform: translate(-50%, -50%); }
.map-canvas img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.map-pin {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -22px 0 0 -11px;
  background: var(--accent); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
}
.map-area {
  position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px solid var(--accent);
}
.map-credit {
  position: absolute; right: 0; bottom: 0; font-size: 0.62rem; padding: 0.1rem 0.35rem; color: #333;
  background: rgb(255 255 255 / 0.8); border-top-left-radius: 6px; text-decoration: none;
}
.map-approx {
  position: absolute; left: 0.6rem; top: 0.6rem; font-size: 0.7rem;
  background: rgb(255 255 255 / 0.85); color: #333; border-radius: 999px; padding: 0.1rem 0.5rem;
}
.photo:has(.map-thumb) { background: #e8e4da; }
@media (prefers-color-scheme: dark) {
  .map-canvas { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
}

/* ---------------------------------------------------------------- filters vs preferences */
.filters-box {
  display: grid; gap: 0.6rem; padding: 0.8rem; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent); margin-bottom: 0.6rem;
}
.filters-box h3, .profile-list > h3 { margin: 0.2rem 0 0; }
.filters-box p, .profile-list > p { margin: 0 0 0.2rem; }
.pref.filter { background: var(--surface); }
.breakdown .filters-passed { display: block; color: var(--ok); font-weight: 600; font-size: 0.82rem; }

/* ---------------------------------------------------------------- telegram */
.telegram-box {
  display: grid; gap: 0.4rem; padding: 0.9rem; margin-bottom: 1.2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- Apartman rides by */
.hero-ride {
  position: fixed; left: 0; z-index: 25; pointer-events: none; height: 130px; width: auto;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6rem);  /* rides just above the points toast */
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.25));
}

/* ---------------------------------------------------------------- all-ads feed */
.mode-seg { display: flex; width: 100%; margin-bottom: 0.8rem; }
.mode-seg button { flex: 1; padding: 0.5rem; font-size: 0.92rem; font-weight: 600; }
.outside-tag {
  position: absolute; top: 0.6rem; inset-inline-end: 0.6rem; font-size: 0.72rem; font-weight: 600;
  background: rgb(255 255 255 / 0.9); color: #5f6a66; border-radius: 999px; padding: 0.2rem 0.55rem;
}
.listing.outside .body { opacity: 0.75; }
.feed-more { text-align: center; color: var(--muted); padding: 1rem; font-size: 0.85rem; }

/* ---------------------------------------------------------------- google sign-in */
.google-box { display: grid; gap: 0.5rem; justify-items: start; margin-top: 0.6rem; }
.welcome .google-box { justify-items: center; text-align: center; margin-top: 1rem; }

/* ---------------------------------------------------------------- pasted link detection */
.link-detected { margin: 0; padding: 0.5rem 0.7rem; border-radius: 10px; font-size: 0.85rem; font-weight: 600; }
.link-detected.ok { background: var(--ok-bg); color: var(--ok); }
.link-detected.warn { background: var(--warn-bg); color: var(--text); font-weight: 500; }

/* ---------------------------------------------------------------- map view */
.layout-seg { display: flex; width: 100%; margin-bottom: 0.8rem; }
.layout-seg button { flex: 1; padding: 0.4rem; font-size: 0.85rem; }
.map-wrap { display: grid; gap: 0.4rem; }
#map {
  height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom) - 17rem); min-height: 320px;
  border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; z-index: 0;
}
.price-pin {
  display: inline-block; transform: translate(-50%, -100%); white-space: nowrap; font: 700 0.78rem/1 system-ui, sans-serif;
  padding: 0.32rem 0.5rem; border-radius: 999px; box-shadow: 0 2px 6px rgb(0 0 0 / 0.3); cursor: pointer;
}
.price-pin.fits { background: #4f5d43; color: #fff; border: 2px solid #fff; }
.price-pin.outside { background: #fff; color: #5f6a66; border: 2px solid #b9b7ae; }
.price-pin.approx { border-style: dashed; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.35); display: flex; align-items: flex-end; }
.sheet-panel {
  position: relative; width: 100%; max-width: 640px; margin: 0 auto; max-height: 85dvh; overflow-y: auto;
  background: var(--bg); border-radius: 18px 18px 0 0; padding: 2.2rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom));
  animation: sheet-up 0.22s ease;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close {
  position: absolute; top: 0.5rem; inset-inline-end: 0.6rem; border: 0; background: var(--neutral-bg);
  border-radius: 50%; width: 32px; height: 32px; padding: 0; font-size: 0.9rem;
}
.cluster-pin {
  display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 800 0.8rem/1 system-ui, sans-serif;
  padding: 0.45rem 0.65rem; border-radius: 999px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.35); cursor: pointer;
}
.cluster-pin.fits { background: #4f5d43; color: #fff; border: 3px solid #e6ebdf; }
.cluster-pin.outside { background: #fff; color: #5f6a66; border: 3px solid #d9d6cc; }

/* ---------------------------------------------------------------- unconfirmed link */
.pending-link { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.pending-link a { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.link-sheet textarea { flex: 1; resize: vertical; min-height: 2.6rem; font-size: 16px; direction: ltr; text-align: left; }

/* ------------------------------------------------- broker votes: lives + 🐍…🏠 meter */
.lives { margin-inline-end: auto; font-size: 0.8rem; letter-spacing: 1px; white-space: nowrap; cursor: help; }
.broker-vote { margin: 0.6rem 0 0.2rem; }
.broker-vote .meter { display: flex; align-items: center; gap: 0.5rem; }
.broker-vote .end { font-size: 1.15rem; line-height: 1; }
.broker-vote .track {
  position: relative; flex: 1; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #c0563f 0%, #d9c46a 50%, #5c8f4e 100%);
}
.broker-vote .knob {
  position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 3px solid var(--text); box-shadow: var(--shadow); transition: left 0.4s ease;
}
.broker-vote .vote-row { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.broker-vote .vote-row button { flex: 1; }
.broker-vote .vote-row button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ------------------------------------------------- onboarding form */
.onboard fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.onboard legend { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }

/* ------------------------------------------------- 🔍 search button: flashes until the first search is set */
.title-row { display: flex; align-items: center; gap: 0.6rem; }
.search-btn {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; font-size: 1.2rem; padding: 0;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
}
.search-btn.pulse { animation: search-flash 5s infinite; }
@keyframes search-flash {   /* two quick yellow flashes, then rest; repeats every 5 s */
  0%, 9%, 100% { background: var(--surface); transform: scale(1); }
  3% { background: #ffe066; transform: scale(1.12); }
  6% { background: var(--surface); transform: scale(1); }
  8% { background: #ffe066; transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) { .search-btn.pulse { animation: none; outline: 3px solid #ffe066; } }

/* ------------------------------------------------- right-to-left (Hebrew) */
.broker-vote .meter, #map, .map-thumb { direction: ltr; }   /* physical layouts: 🐍 left … 🏠 right, map tiles */
input[type="number"], input[type="date"], input[type="email"] { text-align: start; }

/* ------------------------------------------------- comment kinds: pastel red / yellow / green */
.comments li.comment-warning, .chip.comment-warning:has(input:checked) { background: #fde4e1; border-color: #e8a49b; color: #7a2e24; }
.comments li.comment-neutral, .chip.comment-neutral:has(input:checked) { background: #fff5cc; border-color: #e6cf6b; color: #5f4c06; }
.comments li.comment-positive, .chip.comment-positive:has(input:checked) { background: #e1f3e1; border-color: #94c995; color: #22562a; }
.comments li { border-radius: 10px; padding: 0.45rem 0.6rem; margin-bottom: 0.35rem; border: 1px solid transparent; }
.comment-kinds { margin: 0.4rem 0; }
.marks { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.marks .mark-save.on { background: #fff5cc; border-color: #e6cf6b; }

/* rooms picker: ends of the range filled, numbers in between lightly tinted */
.rooms-picker button.chip { background: var(--surface); }
.rooms-picker button.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.rooms-picker button.chip.between { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------- first screen: landlord link + Apartman says hello */
.landlord-link {
  display: block; width: 100%; margin: 0 0 0.8rem; padding: 0.7rem 1rem; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 0.95rem;
}
.hello { display: flex; align-items: flex-end; gap: 0.6rem; margin: 0.2rem 0 0.8rem; min-height: 120px; }
.hello canvas { height: 120px; width: auto; flex: none; animation: hello-pop 0.5s ease-out; }
.hello-bubble {
  position: relative; flex: 1; margin: 0 0 1.4rem; padding: 0.7rem 0.9rem; border-radius: 16px; min-height: 2.6rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 0.95rem; line-height: 1.45;
}
.hello-bubble::after {  /* the bubble's tail, pointing at Apartman (who stands at the start side) */
  content: ""; position: absolute; bottom: 10px; inset-inline-start: -8px; width: 14px; height: 14px;
  background: var(--surface); border-inline-start: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
@keyframes hello-pop { from { transform: scale(0.6) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.skip-search { display: block; margin: 0.8rem auto; }
