/* Bogotá Rent: reuses the "Field notebook" system from Boston Builds
   (Newsreader headings, Public Sans UI, warm flat panel). */
:root {
  --surface: #f6f4ef; --surface-raised: #fff; --surface-hover: #eeece5;
  --ink: #242724; --ink-2: #4c524c; --muted: #626660; --rule: #deded6; --control: #858980;
  --fit: #1b8a6b; --stretch: #d08a1c; --over: #8d918a; --liked: #e0457b; --nope: #5f5d57; --new: #2a78d6;
  --focus: #174f91;
  --font-heading: "Newsreader", Georgia, serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px; --radius-sheet: 20px; --pill: 999px;
  --shadow: 0 3px 12px #2427241f; --shadow-sheet: 0 -6px 24px #24272424;
  --panel-w: 410px; --target: 44px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 15px/1.45 var(--font-body); color: var(--ink); background: var(--surface);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; overflow: hidden; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--focus); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

#map { position: fixed; inset: 0 0 0 var(--panel-w); }

/* ---------- Panel ---------- */
.panel { position: fixed; top: 0; left: 0; bottom: 0; width: var(--panel-w); background: var(--surface);
  border-right: 1px solid var(--rule); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; z-index: 30; }
.view { padding: 20px 20px 40px; }
.sheet-handle { display: none; }
.brand h1 { font-size: 30px; }
.brand p { margin: 4px 0 0; font-size: 13px; }
.search { position: relative; margin: 16px 0 12px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface-raised); font-size: 16px; }

.filters { display: grid; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; }
output { font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--ink); margin: 6px 0 0; }
.budget-scale { position: relative; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.budget-scale .mark { position: absolute; left: calc((4 - 1.5) / (7 - 1.5) * 100%); transform: translateX(-50%); color: var(--fit); font-weight: 600; }
.budget-scale .mark::before { content: ""; position: absolute; left: 50%; top: -9px; width: 2px; height: 7px; background: var(--fit); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--control); background: var(--surface-raised); border-radius: var(--pill); padding: 5px 11px; font-size: 13px; cursor: pointer; min-height: 32px; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.toggles { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.toggles input { accent-color: var(--ink); margin-right: 6px; }

.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 6px; }
.summary { margin: 0; font-size: 13px; color: var(--ink-2); }
.sort select { border: 1px solid var(--rule); border-radius: 8px; padding: 4px 6px; background: var(--surface-raised); font-size: 13px; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--rule); cursor: pointer; border-radius: 6px; }
.item:hover, .item.hl { background: var(--surface-hover); }
.item > div { min-width: 0; }  /* lets long titles truncate instead of widening the list */
.item .thumb { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--rule); }
.item .p { font-weight: 700; }
.item .p small { font-weight: 400; color: var(--muted); }
.item .meta { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.nope { opacity: .5; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--pill); vertical-align: 1px; margin-left: 4px; }
.badge.new { background: #e9f1fb; color: var(--new); }
.badge.gone { background: #eeedea; color: var(--nope); }
.badge.core { background: #e4f3ee; color: var(--fit); }
.badge.liked { background: #fbe6ee; color: var(--liked); }
.legend { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; }
.dot.fit { background: var(--fit); } .dot.stretch { background: var(--stretch); } .dot.over { background: var(--over); } .dot.liked { background: var(--liked); }
.empty { color: var(--muted); }
.warn { color: #8a5600; }
.match { float: right; font-size: 12px; font-weight: 700; color: var(--fit); background: #e4f3ee; border-radius: 999px; padding: 1px 7px; }
.amen { font-weight: 600; color: #136a52; }
.match-line { font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.chip.check { display: inline-flex; align-items: center; gap: 4px; }
.chip.check input { margin: 0; accent-color: #fff; }
.chip.check:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn { border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.like { background: var(--liked); border-color: var(--liked); }
.btn.like[aria-pressed=true] { background: #fff; color: var(--liked); }
.btn.nope[aria-pressed=true] { background: var(--nope); border-color: var(--nope); color: #fff; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

/* ---------- Detail ---------- */
.detail-bar { position: sticky; top: -20px; margin: -20px -20px 10px; padding: 12px 20px; background: var(--surface); display: flex; justify-content: space-between; align-items: center; z-index: 2; border-bottom: 1px solid var(--rule); font-size: 13px; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; border-radius: var(--radius); scrollbar-width: thin; }
.gallery img { flex: 0 0 100%; height: 240px; object-fit: cover; scroll-snap-align: start; border-radius: var(--radius); background: var(--rule); }
.nophoto { height: 120px; border-radius: var(--radius); background: var(--surface-hover); display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.d-title { font-size: 23px; margin: 14px 0 4px; }
.d-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 10px; }
.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.price-block .big { font-family: var(--font-heading); font-size: 30px; font-weight: 600; }
.price-block .usd { color: var(--muted); font-size: 13px; }
.fit-line { font-size: 13px; font-weight: 600; }
.fit-line.fit { color: var(--fit); } .fit-line.stretch { color: var(--stretch); } .fit-line.over { color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 14px; }
.facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0 0 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: var(--pill); background: var(--surface-hover); color: var(--ink-2); }
.tag.good { background: #e4f3ee; color: #136a52; } .tag.warn { background: #fdf0e3; color: #8a5600; }
.desc { font-size: 14px; color: var(--ink-2); white-space: pre-line; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.note { width: 100%; min-height: 70px; border: 1px solid var(--rule); border-radius: 8px; padding: 8px; background: var(--surface-raised); font-size: 16px; resize: vertical; }
.small-print { font-size: 12px; color: var(--muted); }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.d-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }

/* ---------- Mode switch ---------- */
.modes { position: fixed; z-index: 40; top: 14px; left: calc(var(--panel-w) + 14px); display: flex; background: var(--surface-raised); border-radius: var(--pill); box-shadow: var(--shadow); padding: 3px; }
.modes button { white-space: nowrap; border: 0; background: transparent; padding: 7px 14px; border-radius: var(--pill); font-weight: 600; font-size: 14px; cursor: pointer; min-height: 36px; }
.modes button[aria-pressed=true] { background: var(--ink); color: #fff; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--liked); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ---------- Map bits ---------- */
.maplibregl-popup-content { font: 600 13px var(--font-body); padding: 6px 9px; border-radius: 8px; box-shadow: var(--shadow); }
.maplibregl-ctrl-group { border-radius: 8px !important; }

/* ---------- Swipe ---------- */
.swipe { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 30%, #fbfaf6, #ebe8df); display: flex; flex-direction: column; align-items: center; padding: env(safe-area-inset-top) 12px calc(env(safe-area-inset-bottom) + 10px); }
.swipe-top { width: min(440px, 100%); display: flex; justify-content: space-between; align-items: center; padding: 12px 4px 8px; font-size: 13px; }
.deck { position: relative; flex: 1; width: min(440px, 100%); min-height: 0; }
.card { position: absolute; inset: 0; background: var(--surface-raised); border-radius: 18px; box-shadow: 0 10px 30px #2427242e; overflow: hidden; display: flex; flex-direction: column; touch-action: pan-y; user-select: none; will-change: transform; }
.card.behind { transform: scale(.96) translateY(10px); filter: brightness(.98); }
.card .photo { position: relative; flex: none; height: 56%; overflow: hidden; background: var(--rule); }
.card .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }  /* tall photos can't grow the card */
.card .info { min-height: 0; }
.card .bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; }
.card .bars i { flex: 1; height: 3px; border-radius: 2px; background: #ffffff70; }
.card .bars i.on { background: #fff; }
.card .shade { position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, #000a); pointer-events: none; }
.card .over { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; }
.card .over .pp { font-family: var(--font-heading); font-size: 30px; font-weight: 600; line-height: 1; }
.card .over .pp small { font: 500 13px var(--font-body); opacity: .9; }
.card .over .hh { font-size: 15px; font-weight: 600; margin-top: 4px; }
.card .info { padding: 12px 16px 16px; overflow-y: auto; flex: 1; font-size: 14px; }
.card .info h2 { font-size: 19px; margin-bottom: 6px; }
.card .mini { position: absolute; top: 18px; right: 10px; width: 36%; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 2px solid #fff; box-shadow: 0 2px 10px #0005; z-index: 2; background: #eceae4; transition: all .2s var(--ease); }
.card .mini canvas { pointer-events: none; }
.card .mini-tag { position: absolute; left: 6px; bottom: 5px; z-index: 3; font-size: 10.5px; font-weight: 600; background: #fffd; color: var(--ink); padding: 0 6px; border-radius: 99px; }
.card.mapbig .mini { top: 0; right: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; border: 0; }
.card.mapbig .over, .card.mapbig .shade { display: none; }
.card .stamp { position: absolute; top: 28px; padding: 4px 12px; border: 4px solid; border-radius: 10px; font: 800 30px var(--font-body); letter-spacing: .06em; opacity: 0; transform: rotate(-14deg); z-index: 3; }
.card .stamp.yes { left: 22px; color: var(--liked); border-color: var(--liked); }
.card .stamp.no { right: 22px; color: var(--nope); border-color: var(--nope); transform: rotate(14deg); }
.swipe-actions { display: flex; gap: 16px; align-items: center; justify-content: center; padding: 14px 0 4px; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 28px; cursor: pointer; display: grid; place-items: center; }
.round.small { width: 46px; height: 46px; font-size: 19px; color: var(--ink-2); font-weight: 700; }
.round.like { color: var(--liked); } .round.nope { color: var(--nope); }
.deck-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast button { margin-left: 10px; background: transparent; border: 0; color: #9fd8c8; font-weight: 700; cursor: pointer; }

/* ---------- Phones: bottom sheet ---------- */
@media (max-width: 760px) {
  :root { --panel-w: 0px; }
  #map { inset: 0; }
  .modes { left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 10px); }
  .panel { top: auto; width: 100%; height: 92vh; height: 92dvh; border-right: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: var(--shadow-sheet);
    transform: translateY(calc(100% - var(--sheet-visible))); transition: transform .26s var(--ease); }
  body[data-sheet=peek] { --sheet-visible: 150px; }
  body[data-sheet=half] { --sheet-visible: 52dvh; }
  body[data-sheet=full] { --sheet-visible: calc(100dvh - env(safe-area-inset-top) - 62px); }  /* stays below the mode bar */
  .sheet-handle { display: block; position: sticky; top: 0; width: 100%; height: 26px; border: 0; background: var(--surface); z-index: 3; cursor: grab; touch-action: none; }
  .sheet-handle span { display: block; width: 42px; height: 5px; border-radius: 3px; background: #c9c8bf; margin: 0 auto; }
  .view { padding: 2px 14px calc(env(safe-area-inset-bottom) + 30px); }
  .modes button { padding: 6px 13px; font-size: 13.5px; min-height: 34px; }
  .search { margin: 10px 0 8px; }
  .filters { gap: 8px; }
  .list-head { margin: 8px 0 2px; }
  .summary { font-size: 12.5px; }
  .item { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; padding: 7px 0; line-height: 1.3; }
  .item .thumb { width: 68px; height: 54px; }
  .item .p { font-size: 15px; }
  .item .meta { font-size: 12.5px; }
  .item .t { font-size: 12px; }
  .brand h1 { font-size: 24px; }
  .detail-bar { top: 26px; margin: -2px -14px 10px; padding: 8px 14px; }
  .gallery img { height: 220px; }
  .chip { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Why not? sheet ---------- */
.why { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 12px); transform: translateX(-50%); z-index: 70;
  width: min(440px, calc(100% - 20px)); background: var(--surface-raised); border-radius: 16px; box-shadow: 0 10px 34px #24272440; padding: 14px 14px 10px; }
.why-q { margin: 0 0 8px; font-weight: 700; }
.why .chip[aria-pressed=true] { background: var(--nope); border-color: var(--nope); color: #fff; }
.why input[type=text] { width: 100%; margin-top: 10px; height: 38px; border: 1px solid var(--rule); border-radius: 8px; padding: 0 10px; font-size: 16px; }
.why .row-actions { margin: 10px 0 0; justify-content: flex-end; }
body[data-view=swipe] .why { bottom: calc(env(safe-area-inset-bottom) + 104px); }  /* keep the swipe buttons usable */
.why .chip { min-height: 32px; padding: 4px 10px; font-size: 13.5px; }
