/* ap. — design system
   Dark é o tema principal; claro é secundário (prefers-color-scheme). */
:root {
  /* cor */
  --bg: #11120f; --surface: #191a16; --surface-2: #22231e; --surface-3: #2c2d27;
  --line: #2e2f28; --line-strong: #44453b;
  --text: #f0ede4; --muted: #a8a598; --faint: #7d7b70;
  --accent: #e4b95f; --accent-ink: #1b1405; --accent-soft: rgba(228,185,95,.14);
  --up: #62c68c; --up-ink: #05210f;
  --down: #f08072; --down-ink: #2b0904;
  --focus: #f6d68d;
  --scrim: rgba(10,10,8,.72);
  /* tipografia */
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: .78rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.2rem; --fs-xl: 1.7rem; --fs-2xl: 2.2rem;
  /* espaço (base 4) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* forma */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  /* elevação */
  --shadow-1: 0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 10px 30px -10px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.04) inset;
  --pop-bg: #2a2b24; --pop-line: #55564a; --shadow-pop: 0 18px 44px -14px rgba(0,0,0,.75), 0 2px 8px rgba(0,0,0,.35);
  --ease: cubic-bezier(.2,.7,.2,1);
  --appbar-h: 56px; --dock-h: 0px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f0e8; --surface: #fffdf8; --surface-2: #ebe7dc; --surface-3: #ded9ca;
    --line: #dcd7c8; --line-strong: #bdb7a4;
    --text: #1c1b15; --muted: #5d5a4e; --faint: #84806f;
    --accent: #8a5700; --accent-ink: #fff; --accent-soft: rgba(138,87,0,.1);
    --up: #1d7545; --up-ink: #fff; --down: #b0372a; --down-ink: #fff; --focus: #8a5700;
    --scrim: rgba(243,240,232,.8);
    --shadow-1: 0 1px 2px rgba(60,50,20,.1);
    --shadow-2: 0 12px 28px -12px rgba(60,50,20,.3);
    --pop-bg: #ffffff; --pop-line: #bdb7a4; --shadow-pop: 0 16px 36px -12px rgba(60,50,20,.4), 0 2px 6px rgba(60,50,20,.12);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--appbar-h) + 8px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: var(--fs-xl); } h2 { font-size: var(--fs-lg); margin-bottom: var(--s3); }
h3 { font-size: var(--fs-md); margin: var(--s4) 0 var(--s2); }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
svg.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.btn svg.ico, .pill svg.ico, .menu-btn svg.ico { width: 18px; height: 18px; }
.btn { gap: var(--s2); } kbd { font: 600 .7rem/1 var(--font-body); padding: 3px 6px; border-radius: 5px; border: 1px solid currentColor;
  opacity: .6; margin-left: var(--s2); display: none; }
@media (hover: hover) and (min-width: 900px) { kbd { display: inline-block; } }

/* ---------- app bar ---------- */
.appbar { position: sticky; top: 0; z-index: 30; height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--s4) 0; display: flex; align-items: center; gap: var(--s4);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font: 700 1.5rem/1 var(--font-display); letter-spacing: -.04em; color: var(--text); text-decoration: none;
  display: inline-flex; align-items: baseline; min-height: 44px; align-items: center; }
.brand i { color: var(--accent); font-style: normal; }
.brand.big { font-size: 3.2rem; min-height: 0; margin-bottom: var(--s2); }
.tabs { display: flex; gap: var(--s1); margin-right: auto; }
.tabs a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); min-height: 44px;
  display: inline-flex; align-items: center; padding: 0 var(--s3); border-radius: var(--r-pill);
  transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current] { color: var(--accent); background: var(--accent-soft); }
.appbar form { margin: 0; }
.btn-ghost { background: none; border: 0; color: var(--muted); font: 600 var(--fs-sm) var(--font-body);
  min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-pill); cursor: pointer; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }


/* ---------- layout ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: var(--s4) var(--s4) var(--s7); }
.page.narrow { max-width: 860px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3);
  margin-bottom: var(--s4); }
.count { font: 600 var(--fs-sm) var(--font-body); color: var(--muted); background: var(--surface-2);
  padding: 2px 10px; border-radius: var(--r-pill); vertical-align: middle; margin-left: var(--s2);
  font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.seg label { position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.seg label span { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 0 var(--s4);
  border-radius: var(--r-pill); color: var(--muted); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; transition: background .15s, color .15s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg.eq { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: var(--r-md); }
.seg.eq label span { padding: 0 4px; border-radius: var(--r-sm); }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-height: 52px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: 650 var(--fs-md) var(--font-body); text-decoration: none; cursor: pointer; padding: 0 var(--s5);
  transition: background .15s, transform .1s, border-color .15s, filter .15s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.up { background: var(--up); border-color: var(--up); color: var(--up-ink); }
.btn.down { background: var(--down); border-color: var(--down); color: var(--down-ink); }
.btn.up:hover, .btn.down:hover, .btn.primary:hover { filter: brightness(1.08); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); min-height: 44px; font-weight: 600; font-size: var(--fs-sm); }
.btn.quiet:hover { color: var(--text); background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  background: var(--surface); transition: border-color .15s, background .15s; }
.pill:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line-strong); font-size: var(--fs-sm); font-weight: 550;
  user-select: none; transition: background .12s, border-color .12s; }
.chip:hover span { border-color: var(--muted); }
.chip input:checked + span { background: var(--down); border-color: var(--down); color: var(--down-ink); font-weight: 700; }
.chip input:checked + span::before { content: "✓"; margin-right: 6px; }
.chip.alt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.txt, input[type=password] { width: 100%; font: inherit; font-size: 16px; min-height: 48px; padding: 0 var(--s3);
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); margin-bottom: var(--s4); }
.txt:focus-visible, input[type=password]:focus-visible { outline: 2px solid var(--focus); border-color: transparent; }
.txt::placeholder { color: var(--faint); }

/* ---------- selos / tags ---------- */
.badge { display: inline-flex; align-items: center; font: 700 var(--fs-xs)/1 var(--font-body); letter-spacing: .02em;
  padding: 6px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong); }
.badge.ia { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge.new { background: var(--scrim); backdrop-filter: blur(6px); border-color: rgba(255,255,255,.18); color: var(--text); }
.badge.off { color: var(--down); border-color: var(--down); }
.v-enviar { color: var(--up); } .v-descartar { color: var(--down); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s2) 0; align-items: center; }
.tag { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 11px; font-size: var(--fs-sm); }

/* ---------- faixa de fotos (cards da lista) ---------- */
.strip { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  width: 100%; outline-offset: -3px; }
.strip::-webkit-scrollbar { display: none; }
.noimg { flex: 1; display: grid; place-items: center; color: var(--faint); background: var(--surface-2); min-height: 120px; border-radius: var(--r-lg); }
.round { border: 0; background: var(--scrim); color: var(--text); cursor: pointer; backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center;
  padding: 0; transition: background .15s, color .15s, opacity .2s, transform .1s; flex: none; }
.round:hover { background: var(--accent); color: var(--accent-ink); } .round:active { transform: scale(.94); }
.round.flat { background: transparent; color: var(--muted); } .round.flat:hover { background: var(--surface-2); color: var(--text); }
/* faixas laterais clicáveis (anterior/próxima), altura inteira da foto; a seta é só indicador */
.arrow { position: absolute; top: 0; bottom: 0; width: 56px; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.arrow.prev { left: 0; } .arrow.next { right: 0; }
.arrow .round { pointer-events: none; opacity: 0; transition: opacity .2s, background .15s; }
.arrow:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; border-radius: 0; }
.lphoto .arrow { width: 44px; }
@media (hover: hover) and (min-width: 700px) {
  .lphoto:hover .arrow .round, .lb-stage .arrow .round, .arrow:focus-visible .round { opacity: 1; }
  .arrow:hover .round { background: rgba(12,12,10,.8); color: #fff; }
}
.lb-thumbs button { flex: 0 0 72px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm);
  overflow: hidden; background: var(--surface-2); cursor: pointer; opacity: .6; transition: opacity .15s, border-color .15s; }
.lb-thumbs button:hover { opacity: 1; } .lb-thumbs button.on { border-color: var(--accent); opacity: 1; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* lightbox (top layer via <dialog>) */
.lb-stage .arrow { width: 72px; } .lb-stage .arrow .round { background: rgba(40,40,34,.8); }
.lightbox { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100dvh; background: transparent; color: var(--text); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: lbin .18s var(--ease); }
.lightbox::backdrop { background: rgba(6,6,5,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes lbin { from { opacity: 0; } }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: max(var(--s3), env(safe-area-inset-top)) var(--s4) var(--s2); }
.lb-count { font: 600 var(--fs-sm) var(--font-body); font-variant-numeric: tabular-nums; color: var(--muted); }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 var(--s4); touch-action: pan-y; }
.lb-stage img { max-width: min(100%, 1280px); max-height: 100%; object-fit: contain; border-radius: var(--r-md); box-shadow: var(--shadow-2); user-select: none; }
@media (max-width: 700px) { .lb-stage { padding: 0 var(--s3); } .lb-stage img { max-width: 100%; } }
.lb-thumbs { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s3) var(--s4) max(var(--s4), env(safe-area-inset-bottom));
  scrollbar-width: none; justify-content: safe center; }
.lb-thumbs::-webkit-scrollbar { display: none; }
.peek .lb-thumbs { display: none; }   /* espiada (Espaço segurado): só a foto */
.lb-thumbs button { flex-basis: 72px; height: 54px; }


/* ---------- ficha do imóvel ---------- */
.info { padding: var(--s4) 0 var(--s2); }
.price { display: flex; align-items: baseline; gap: var(--s2); }
.total { font: 700 var(--fs-2xl)/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.per { color: var(--muted); font-size: var(--fs-sm); }
.price-sub { margin: 6px 0 var(--s3); color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.facts { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 11px;
  font-size: var(--fs-sm); color: var(--muted); }
.facts b { color: var(--text); font-weight: 700; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.where { margin: 0 0 var(--s3); font-size: var(--fs-md); color: var(--muted); }
.where b { color: var(--accent); font-weight: 700; }
.where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s3); }
.where .kind { font: 650 var(--fs-xs)/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em; padding: 5px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); align-self: center; }

.back { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; text-decoration: none; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--accent); }
.vote { display: inline-flex; vertical-align: middle; } .vote.up { color: var(--up); } .vote.down { color: var(--down); }
.links { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

/* ---------- detalhe ---------- */
.detail { max-width: 1320px; margin: 0 auto; padding: 0 var(--s4) var(--s7); }
.crumb { margin: var(--s2) 0; font-size: var(--fs-sm); display: flex; gap: var(--s3); align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s4);
  margin-top: var(--s4); box-shadow: var(--shadow-1); }
.panel > h2 { display: flex; align-items: center; gap: var(--s3); }
.prose { white-space: pre-line; margin: 0; }
.ia-line { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin: 0 0 var(--s3); }
.sheet-title { margin: 0 0 var(--s3); font: 650 var(--fs-md) var(--font-display); }
.row { display: flex; gap: var(--s2); } .grow { flex: 1; }
.htmx-request.rate { opacity: .6; pointer-events: none; }
.fold { padding: 0; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); min-height: 56px; padding: 0 var(--s4);
  font: 650 var(--fs-lg) var(--font-display); letter-spacing: -.01em; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .chev { margin-left: auto; color: var(--muted); transition: rotate .2s; }
.fold[open] > summary .chev { rotate: 180deg; }
.fold > :not(summary) { margin-left: var(--s4); margin-right: var(--s4); }
.fold > :last-child { margin-bottom: var(--s4); }
.fold > summary:focus-visible { outline-offset: -3px; }
.fold .count { margin-left: 0; }

.hist { list-style: none; padding: 0; margin: 0 0 var(--s3); }
.hist li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; margin: 0; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-sm); padding-right: var(--s5); }
.kv dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bullets { padding-left: 1.1em; margin: 0; } .bullets li { margin: 4px 0; }
.check { list-style: none; padding: 0; margin: 0; } .check li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.check .val { float: right; font-weight: 600; } .check .v-sim .val { color: var(--accent); }
.check .v-nv { color: var(--muted); } .check b { color: var(--accent); margin-right: 6px; }
.rate-panel .scale { margin-bottom: 0; }

/* mosaico: 1 foto grande, depois linhas de 2 (estilo portal) */
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.ph { position: relative; padding: 0; border: 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); cursor: pointer;
  aspect-ratio: 4 / 3; display: block; -webkit-tap-highlight-color: transparent; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease), filter .2s; }
.ph:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mosaic .hero, .mosaic .solo { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
.mosaic .solo { aspect-ratio: 16 / 9; }


/* mobile: resumo, depois mosaico, depois o resto (o .side some do fluxo) */
.detail-grid { display: flex; flex-direction: column; gap: var(--s4); }
.side { display: contents; }
.d-top { order: 1; } .media { order: 2; } .d-rest { order: 3; }
.d-top .info { padding-top: var(--s2); }
.d-top .panel { margin-top: var(--s3); }
.d-rest > .panel:first-child { margin-top: 0; }
@media (min-width: 960px) {
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr); gap: var(--s6); align-items: start; margin-top: var(--s2); }
  .media { order: 0; grid-column: 1; grid-row: 1; }
  .side { display: block; grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--appbar-h) + var(--s4));
    max-height: calc(100dvh - var(--appbar-h) - 2 * var(--s4)); overflow-y: auto; padding-right: var(--s2); margin-right: calc(-1 * var(--s2));
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .d-top .info { padding-top: 0; }
  .mosaic { gap: var(--s3); }
  .mosaic .hero { aspect-ratio: 16 / 10; }
}

/* ---------- lista ---------- */
.cards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.lcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; color: inherit; box-shadow: var(--shadow-1); transition: background .2s; }
.lcard:hover { background: color-mix(in srgb, var(--surface) 80%, var(--surface-3)); }
.lphoto { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.lphoto .strip { overflow-y: hidden; aspect-ratio: auto; height: 100%; max-height: none; overscroll-behavior-x: contain; }
.lphoto .slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: block; border-radius: 0; outline-offset: -4px; }
.lphoto .slide img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer;}
.lphoto .noimg { height: 100%; }
.dots { position: absolute; left: 50%; bottom: var(--s3); translate: -50% 0; display: flex; gap: 5px; pointer-events: none; padding: 5px 8px;
  border-radius: var(--r-pill); background: var(--scrim); backdrop-filter: blur(6px); }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text); opacity: .4; transition: opacity .15s, width .15s; }
.dots i.on { opacity: 1; width: 14px; border-radius: 3px; }
/* setas dos cards: discretas */
.lphoto .arrow .round { width: 34px; height: 34px; background: rgba(12,12,10,.4); color: #fff; }
.lphoto .arrow .round svg.ico { width: 18px; height: 18px; }
a.lbody { text-decoration: none; color: inherit; outline-offset: -3px; }
.badges { pointer-events: none; z-index: 1; position: absolute; top: var(--s3); left: var(--s3); display: flex; gap: 6px; flex-wrap: wrap; }
.nfotos { display: inline-flex; align-items: center; gap: 5px; pointer-events: none; position: absolute; right: var(--s3); bottom: var(--s3); background: var(--scrim); backdrop-filter: blur(6px);
  font: 600 var(--fs-xs) var(--font-body); padding: 5px 10px; border-radius: var(--r-pill); }
.nfotos svg.ico { width: 14px; height: 14px; }
.lbody { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.lprice { display: flex; flex-direction: column; gap: 4px; }
.lprice .total { font-size: 1.75rem; }
.lwhere { margin: 0; font-size: var(--fs-sm); color: var(--muted); display: flex; flex-direction: column; }
.lwhere b { color: var(--accent); font-size: var(--fs-md); }
.lwhere span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts.compact { margin: 2px 0 0; } .facts.compact li { background: transparent; padding: 0 var(--s3) 0 0; border: 0; border-radius: 0; }
.facts.compact li + li { border-left: 1px solid var(--line-strong); padding-left: var(--s3); }
.sentinel { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: var(--s2);
  padding: var(--s5); color: var(--muted); font-size: var(--fs-sm); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.endlist { grid-column: 1 / -1; text-align: center; color: var(--faint); font-size: var(--fs-sm); margin: var(--s5) 0 0; }
.empty { padding: var(--s7) var(--s5); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.empty.wide { grid-column: 1 / -1; } .empty h2 { margin: 0; }
.empty p { margin: 0; max-width: 34ch; }
.empty-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem;
  color: var(--accent); background: var(--accent-soft); margin-bottom: var(--s2); }

/* ---------- escala de nota 1-5 ---------- */
.scale-title { margin: 0 0 var(--s2); font: 650 var(--fs-sm) var(--font-body); } .scale-title .muted { margin-left: var(--s2); font-weight: 500; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); margin-bottom: var(--s2); }
.nota { --c: var(--faint); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 6px 2px; border-radius: var(--r-md); cursor: pointer; color: var(--text);
  border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 18%, var(--surface-2));
  transition: background .15s, transform .1s, color .15s; font-family: var(--font-body); }
.nota b { font: 700 1.5rem/1 var(--font-display); } .nota small { font-size: .68rem; font-weight: 600; letter-spacing: .02em; opacity: .85; }
.nota:hover, .nota[aria-pressed=true] { background: var(--c); color: var(--ink-n, #17110a); } .nota:active { transform: scale(.96); }
.nota:hover small, .nota[aria-pressed=true] small { opacity: 1; }
.nota kbd { position: absolute; top: 3px; right: 4px; margin: 0; font-size: .6rem; padding: 1px 4px; }
.nota[data-n="1"] { --c: #e2574a; } .nota[data-n="2"] { --c: #ea8a63; } .nota[data-n="3"] { --c: #a3a193; }
.nota[data-n="4"] { --c: #86c58c; } .nota[data-n="5"] { --c: #4fc487; }
.vote-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #17110a; background: var(--faint); font-family: var(--font-display); }
.vote-n.n1 { background: #e2574a; } .vote-n.n2 { background: #ea8a63; } .vote-n.n3 { background: #a3a193; } .vote-n.n4 { background: #86c58c; } .vote-n.n5 { background: #4fc487; }
.badge.you { background: var(--scrim); backdrop-filter: blur(6px); border-color: rgba(255,255,255,.18); color: var(--text); font-weight: 600; }
.actions .skip, .skip { width: 100%; }

/* ---------- filtros ---------- */
.head-tools { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
/* menu (dropdown de ordenação) */
.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3) 0 var(--s4); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 var(--fs-sm) var(--font-body); cursor: pointer;
  transition: background .15s; }
.menu-btn:hover { background: var(--surface-2); } .menu-btn .chev { color: var(--muted); transition: rotate .2s; }
.menu-btn[aria-expanded=true] .chev { rotate: 180deg; }
.menu-btn > .ico:first-child { color: var(--accent); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 35; min-width: 230px; margin: 0; padding: var(--s1); list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-2); animation: lbin .12s var(--ease); }
.menu-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 44px; padding: 0 var(--s3);
  border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); font-weight: 550; }
.menu-list li:hover, .menu-list li:focus { background: var(--surface-2); outline: none; }
.menu-list li:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.menu-list li .ico { opacity: 0; color: var(--accent); } .menu-list li[aria-selected=true] { color: var(--accent); } .menu-list li[aria-selected=true] .ico { opacity: 1; }
.count.on { background: var(--accent); color: var(--accent-ink); margin-left: 4px; }
.count.on:empty, #nfiltros[data-zero] { display: none; }
.filter-open { min-height: 44px; padding: 0 var(--s4); font-size: var(--fs-sm); border-radius: var(--r-pill); }
.rescount { margin: 0 0 var(--s4); color: var(--muted); font-size: var(--fs-sm); } .rescount b { color: var(--text); font-size: var(--fs-md); }
.filters fieldset { border: 0; padding: 0; margin: 0 0 var(--s5); min-width: 0; }
.filters legend { font: 650 var(--fs-sm) var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: var(--s2); padding: 0; display: flex; justify-content: space-between; width: 100%; }
.filters .range-val { color: var(--accent); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.filters-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.filters-head h2 { margin: 0; margin-right: auto; } .clear { font-size: var(--fs-sm); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.clear svg.ico { width: 16px; height: 16px; }
.close-sheet { display: none; }
.chips.tight { margin-bottom: 0; } .chip.wide { display: block; margin-bottom: var(--s3); } .chip.wide span { display: flex; justify-content: center; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; --track: var(--line-strong); --fill: var(--accent); }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--fill) var(--p), var(--track) var(--p)); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--fill) var(--p), var(--track) var(--p)); }
.range.rev::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--track) var(--p), var(--fill) var(--p)); }
.range.rev::-moz-range-track { background: linear-gradient(to right, var(--track) var(--p), var(--fill) var(--p)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--text);
  border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }
.range:focus-visible { outline: none; } .range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--focus); outline-offset: 3px; }
.range:focus-visible::-moz-range-thumb { outline: 2px solid var(--focus); outline-offset: 3px; }
.range-hint { margin: -6px 0 0; }
.bairros { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.brow { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); cursor: pointer; font-size: var(--fs-sm);
  border-bottom: 1px solid var(--line); }
.brow:last-child { border-bottom: 0; } .brow:hover { background: var(--surface-2); }
.brow .bn { flex: 1; } .brow i { font-style: normal; color: var(--faint); font-variant-numeric: tabular-nums; }
.cbox { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border-radius: 6px; border: 2px solid var(--line-strong);
  background: transparent center / 14px no-repeat; cursor: pointer; transition: background-color .12s, border-color .12s; }
.cbox:checked { background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1405' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.cbox:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle { display: block; position: relative; margin-bottom: var(--s3); }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.toggle span { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface-2); font-weight: 650; font-size: var(--fs-sm); transition: background .15s, color .15s; }
.toggle:hover span { background: var(--surface-3); }
.toggle input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toggle input:checked + span svg { fill: currentColor; }
.toggle input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.searchbox { position: relative; margin-bottom: var(--s2); }
.searchbox svg { position: absolute; left: 12px; top: 15px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.searchbox .txt { padding-left: 38px; margin: 0; }
.subseg { margin-top: var(--s3); display: grid; gap: 6px; }
.brow[hidden] { display: none; }
.sheet-foot { display: none; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
#resultado.htmx-request { opacity: .55; transition: opacity .15s; }

@media (max-width: 959px) {
  .filters { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 88dvh; overflow-y: auto; background: var(--surface);
    border-top: 1px solid var(--line-strong); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s4); box-shadow: var(--shadow-2);
    transform: translateY(105%); transition: transform .28s var(--ease); visibility: hidden; }
  .filters.open { transform: none; visibility: visible; }
  .filters-head { position: sticky; top: calc(-1 * var(--s4)); background: var(--surface); margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); padding: var(--s3) var(--s4); z-index: 2; }
  .close-sheet { display: inline-grid; }
  .sheet-foot { display: block; position: sticky; bottom: calc(-1 * var(--s4)); margin: 0 calc(-1 * var(--s4)); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line); }
  .sheet-foot .btn { width: 100%; }
}
@media (min-width: 960px) {
  .filter-open, .scrim { display: none !important; }
  .lista-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .filters { position: sticky; top: calc(var(--appbar-h) + var(--s4)); max-height: calc(100dvh - var(--appbar-h) - 2 * var(--s4)); overflow-y: auto;
    padding-right: var(--s2); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
}

/* ---------- saúde / login ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.stats b { display: block; font: 700 2rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent); }
.stats span { color: var(--muted); font-size: var(--fs-sm); }
.page.narrow h2 { margin-top: var(--s6); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  background: var(--surface); border-radius: var(--r-md); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr.bad td { color: var(--down); }
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--s5); }
.login form { width: 100%; max-width: 340px; }
.login label { display: block; margin: var(--s5) 0 var(--s2); color: var(--muted); font-size: var(--fs-sm); }
.login p { margin: 0; } .erro { color: var(--down); margin-bottom: var(--s3) !important; }
.login .btn { width: 100%; }

@media (max-width: 520px) {
  .head-tools { width: 100%; } .head-tools .menu { margin-left: auto; }
  .total { font-size: 2rem; }
  .tabs a { padding: 0 var(--s2); }
  .appbar { gap: var(--s2); padding-inline: var(--s3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .filters { transition: none; }
}

/* ---------- rodada v6 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nota kbd { display: none !important; }
.scale-title { font-size: var(--fs-md); } .scale-title .muted { font-size: var(--fs-xs); }

/* nota no card: linha discreta */
.lrate { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; margin: 0 var(--s4) var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.lr-label { font-size: var(--fs-sm); color: var(--muted); } .lr-label b { color: var(--text); font-family: var(--font-display); }
.lr-seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 2px; }
.lr-n { --c: var(--accent); min-width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
  font: 650 var(--fs-sm) var(--font-display); transition: background .12s, color .12s; }
.lr-n[data-n="1"] { --c: #e2574a; } .lr-n[data-n="2"] { --c: #ea8a63; } .lr-n[data-n="3"] { --c: #a3a193; } .lr-n[data-n="4"] { --c: #86c58c; } .lr-n[data-n="5"] { --c: #4fc487; }
.lr-n:hover, .lr-n:focus-visible, .lr-n[aria-pressed=true] { background: var(--c); color: #17110a; }
.lr-n:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.lr-n.htmx-request { opacity: .6; }
.lr-done, .lr-change { display: none; }
.lrate[data-rated]:not([data-editing]) .lr-done { display: inline-flex; align-items: center; gap: 6px; }
.lrate[data-rated]:not([data-editing]) .lr-ask, .lrate[data-rated]:not([data-editing]) .lr-seg { display: none; }
.lr-change { display: inline; background: none; border: 0; color: var(--accent); font: 600 var(--fs-sm) var(--font-body); cursor: pointer; min-height: 40px; padding: 0 var(--s2); }
.lr-done .lr-change { display: inline; }
.lcard[data-leaving] { animation: lout .4s .5s var(--ease) forwards; pointer-events: none; }
@keyframes lout { to { opacity: 0; transform: scale(.96); } }
.notapop { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: var(--s4); max-height: 78dvh; overflow-y: auto; animation: lbin .14s var(--ease); }
.notapop .chips { margin-bottom: var(--s3); } .notapop .sheet-title { margin-bottom: var(--s2); }

/* segmentado com toggle */
.seg.eq button { background: transparent; border: 0; min-height: 40px; padding: 0 4px; border-radius: var(--r-sm); color: var(--muted);
  font: 600 var(--fs-sm) var(--font-body); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.seg.eq button:hover { color: var(--text); }
.seg.eq button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.seg.eq button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* faixa de valores */
.filters legend .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--s2); }
.pair i { color: var(--faint); font-style: normal; padding-bottom: 14px; }
.numfield { display: block; } .numfield span { display: block; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; }
.numfield input { width: 100%; min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font: 600 16px var(--font-body); font-variant-numeric: tabular-nums; }
.numfield input::placeholder { color: var(--faint); font-weight: 400; }
.numfield input:focus-visible { outline: 2px solid var(--focus); border-color: transparent; }
.dual { position: relative; height: 36px; margin: 0 11px var(--s2); --a: 0%; --b: 100%; }
.dual-track { position: absolute; left: -11px; right: -11px; top: 15px; height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--line-strong) 0 var(--a), var(--accent) var(--a) var(--b), var(--line-strong) var(--b) 100%); }
.dual .rng { position: absolute; left: -11px; width: calc(100% + 22px); top: 0; height: 36px; margin: 0; background: transparent; pointer-events: none;
  -webkit-appearance: none; appearance: none; }
.dual .rng::-webkit-slider-runnable-track { background: transparent; height: 36px; }
.dual .rng::-moz-range-track { background: transparent; }
.dual .rng::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 7px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: grab; }
.dual .rng::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); cursor: grab; }
.dual .rng:focus-visible { outline: none; }
.dual .rng:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--focus); outline-offset: 3px; }

.seg.eq button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg.eq button svg.ico { width: 16px; height: 16px; }
.where .kind { display: inline-flex; align-items: center; gap: 6px; } .where .kind svg.ico { width: 13px; height: 13px; }
.badge svg.ico { width: 13px; height: 13px; margin-right: 4px; }

/* anéis de foco não podem ser cortados pelo contêiner rolável */
@media (min-width: 960px) { .filters { padding: 6px 8px 6px 6px; margin: -6px 0 0 -6px; } }
.numfield input:focus-visible, .txt:focus-visible { outline-offset: -2px; }
.seg.eq button:focus-visible, .lr-n:focus-visible, .seg input:focus-visible + span, .toggle input:focus-visible + span { outline-offset: -2px; }
.brow:focus-within { box-shadow: inset 0 0 0 2px var(--focus); border-radius: 4px; }

.lote { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s3); color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; margin: var(--s7) 0; }
.lote::before, .lote::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- alertas ---------- */
.alertmenu { flex: 0 1 auto; min-width: 0; }
.alertmenu .menu-btn { max-width: 100%; }
.alertmenu .menu-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.alertmenu .menu-list { min-width: 250px; max-width: calc(100vw - 24px); }
.menu-list li .paused { font-style: normal; color: var(--faint); font-size: var(--fs-xs); margin-left: 4px; }
.menu-list li.menu-manage { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); margin-top: var(--s1); color: var(--muted); }
.menu-list li.menu-manage .ico { opacity: 1; color: var(--muted); }
.menu-list li > span { display: inline-flex; align-items: center; gap: var(--s3); }
.menu-list li > span svg.ico { width: 18px; height: 18px; color: var(--muted); opacity: 1; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost svg.ico { width: 18px; height: 18px; }
.ah1 { font-weight: 500; font-size: var(--fs-lg); }
.badge.pend { background: var(--scrim); backdrop-filter: blur(6px); border-color: rgba(255,255,255,.18); color: var(--muted); font-weight: 600; }
.alert-note { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--muted); font-size: var(--fs-sm); }
.subhead { margin: var(--s1) 0 0; max-width: 60ch; }

.acards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
.acard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s4); transition: border-color .15s, background .15s, transform .15s var(--ease); }
.acard:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 92%, var(--surface-2)); }
.acard.cur { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 55%), var(--surface); }
.acard[data-saved] { animation: lbin .35s var(--ease); box-shadow: 0 0 0 3px var(--accent-soft); }
.acard.off > :not(.ahead) { opacity: .55; }
.acard:has(.acover:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ahead { display: flex; align-items: center; gap: var(--s2); }
.ahead h2 { margin: 0; margin-right: auto; font-size: var(--fs-lg); min-width: 0; overflow-wrap: anywhere; }
.acover { color: var(--text); text-decoration: none; }
.acover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.acover:focus-visible { outline: none; }
.ahead .switch, .ahead .amenu, .abairros { position: relative; z-index: 2; }
.amenu .menu-list { min-width: 190px; }
.icon-btn { width: 44px; height: 44px; margin-right: -8px; display: grid; place-items: center; border-radius: var(--r-pill); border: 0; background: none;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover, .icon-btn[aria-expanded=true] { background: var(--surface-2); color: var(--text); }
.acrit { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.acrit li { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-sm); min-height: 24px; }
.acrit svg.ico, .abairros summary svg.ico:first-child { width: 18px; height: 18px; color: var(--accent); }
.abairros { font-size: var(--fs-sm); }
.abairros summary { display: flex; align-items: center; gap: var(--s3); min-height: 32px; cursor: pointer; list-style: none; }
.abairros summary::-webkit-details-marker { display: none; }
.abairros summary > span { flex: 0 1 auto; }
.abairros summary .chev { color: var(--muted); transition: rotate .2s; width: 16px; height: 16px; }
.abairros[open] summary .chev { rotate: 180deg; }
.abairros summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.abairros .blabel { margin: var(--s3) 0 var(--s1); color: var(--faint); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.abairros .tags { margin: 0; }
.tag.pref { border-color: var(--accent); color: var(--accent); }
.ametrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: auto 0 0; padding-top: var(--s4); border-top: 1px solid var(--line); }
.ametrics div { display: flex; flex-direction: column-reverse; gap: 2px; }
.ametrics dd { margin: 0; font: 700 var(--fs-xl)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ametrics dt { color: var(--muted); font-size: var(--fs-xs); }
.ametrics div:first-child dd { color: var(--accent); }
.afoot { margin: calc(var(--s2) * -1) 0 0; }
.acard.new { border-style: dashed; border-color: var(--line-strong); background: transparent; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 180px; color: var(--muted); text-decoration: none; font-weight: 650; }
.acard.new svg.ico { width: 28px; height: 28px; color: var(--accent); }
.acard.new:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.switch { flex: none; position: relative; width: 52px; height: 32px; padding: 0; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface-3); cursor: pointer; transition: background .2s, border-color .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.switch[aria-checked=true] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked=true] i { transform: translateX(20px); background: var(--accent-ink); }
.switch::after { content: ""; position: absolute; inset: -6px -2px; }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch.htmx-request { opacity: .6; }

.alertform h1 { margin-bottom: var(--s4); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s4); margin-bottom: var(--s4); }
.page .step h2 { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s4); }
.stepn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font: 700 var(--fs-sm) var(--font-display); }
.step .txt { margin-bottom: 0; }
.step fieldset { border: 0; padding: 0; margin: 0 0 var(--s5); min-width: 0; }
.step fieldset:last-child { margin-bottom: 0; }
.step legend { font: 650 var(--fs-sm) var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--s2); padding: 0; width: 100%; }
.step legend .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.step .hint { margin: var(--s2) 0 0; } .picker .hint { margin: 0 0 var(--s3); }
.step .chip span { gap: 0; } .step .chip svg.ico { width: 18px; height: 18px; }
.two { display: grid; gap: var(--s5); margin-bottom: var(--s5); } .two:last-child { margin-bottom: 0; } .two > fieldset { margin: 0; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } .step { padding: var(--s5); } }
.selchips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.selchips:empty { display: none; }
.selchips { max-height: 132px; overflow-y: auto; }
.selchip { min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-pill); border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text);
  font: 600 var(--fs-sm) var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.selchip span { color: var(--accent); font-size: 1.1rem; line-height: 1; }
.selchip:hover { background: var(--accent); color: var(--accent-ink); } .selchip:hover span { color: inherit; }
.picker .bairros { max-height: 260px; }
.formerr { background: color-mix(in srgb, var(--down) 14%, transparent); border: 1px solid var(--down); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.formerr p { margin: 0; }
.formbar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; justify-content: space-between;
  margin: 0 calc(var(--s4) * -1); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.previa { margin: 0; display: flex; align-items: baseline; gap: var(--s2); flex: 1 1 200px; min-width: 0; font-size: var(--fs-sm); line-height: 1.3; }
.previa-n { font: 700 var(--fs-xl)/1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.formbtns { display: flex; gap: var(--s2); } .formbtns .btn { min-height: 48px; padding: 0 var(--s5); }
@media (max-width: 520px) { .formbtns { flex: 1; } .formbtns .btn.primary { flex: 1; } }

.appbar .alertmenu { margin-left: 0; }
@media (max-width: 720px) {
  :root { --appbar-h: 100px; }
  .appbar { height: auto; flex-wrap: wrap; align-content: flex-start; gap: 0 var(--s2); padding: env(safe-area-inset-top) var(--s3) 0; }
  .appbar .brand { min-height: 52px; }
  .tabs { gap: 0; } .tabs a { padding: 0 var(--s3); }
  .appbar form .btn-ghost { padding: 0 var(--s2); } .btn-ghost span { display: none; }
  .alertmenu { order: 5; flex: 1 0 100%; padding-bottom: var(--s2); }
  .alertmenu .menu-btn { width: 100%; justify-content: flex-start; min-height: 40px; background: var(--surface-2); }
  .alertmenu .menu-label { flex: 1; text-align: left; max-width: none; }
  .alertmenu .menu-list { left: 0; right: 0; min-width: 0; max-width: none; }
}


/* ---------- lista: entrada da triagem ---------- */
.btn.seq { min-height: 44px; padding: 0 var(--s4); font-size: var(--fs-sm); border-radius: var(--r-pill); background: var(--accent);
  border-color: var(--accent); color: var(--accent-ink); }
.btn.seq:hover { background: var(--accent); filter: brightness(1.08); }
.btn.seq svg.ico { width: 18px; height: 18px; }

/* ---------- avaliar: triagem imersiva ---------- */
.page-avaliar { --bar-h: 176px; overscroll-behavior-y: contain; }
.triage-top { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s3);
  height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--s3) 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); }
.triage-top .back { justify-self: start; padding-right: var(--s3); }
.triage-count { margin: 0; font: 600 var(--fs-sm) var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.triage-count b { color: var(--accent); font: 700 var(--fs-md) var(--font-display); }
.triage-alert { justify-self: end; display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: var(--fs-xs); font-weight: 600;
  min-width: 0; max-width: 100%; }
.triage-alert span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.triage-alert svg.ico { width: 14px; height: 14px; color: var(--accent); }
@media (max-width: 480px) { .triage-alert span { display: none; } .triage-top { grid-template-columns: 1fr auto 1fr; } }

.triage { max-width: 2400px; margin: 0 auto; padding: var(--s3) var(--s3) calc(var(--bar-h) + var(--s5) + env(safe-area-inset-bottom)); }
.tinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s5); margin-bottom: var(--s2); }
.trest { display: flex; align-items: center; gap: var(--s3); flex: 1 1 280px; min-width: 0; }
.trest .tfacts { flex: 1; }
.tprice { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.tprice .total { font-size: 1.75rem; }
.tfacts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); font-size: var(--fs-sm); color: var(--muted); }
.tfacts b { color: var(--text); font-variant-numeric: tabular-nums; }
.tfacts .tbairro { color: var(--accent); font-weight: 700; font-size: var(--fs-md); }
.tfacts .tkind { display: inline-flex; align-items: center; gap: 5px; font: 650 var(--fs-xs)/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em;
  padding: 5px 9px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong); }
.tfacts .tkind svg.ico { width: 14px; height: 14px; }
.tlink { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: var(--muted); font-size: var(--fs-sm);
  font-weight: 600; text-decoration: none; }
.tlink:hover { color: var(--accent); } .tlink svg.ico { width: 15px; height: 15px; }

.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 640px) { .contact { grid-template-columns: repeat(3, 1fr); gap: var(--s2); } }
@media (min-width: 900px) { .contact { grid-template-columns: repeat(4, 1fr); } .triage { padding-left: var(--s5); padding-right: var(--s5); } }
@media (min-width: 1360px) { .contact { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1800px) { .contact { grid-template-columns: repeat(6, 1fr); } }
.contact .ph { border-radius: var(--r-sm); }
.phn { position: absolute; right: 4px; bottom: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--scrim); color: var(--text); font: 650 .66rem/1 var(--font-body); font-variant-numeric: tabular-nums; pointer-events: none; }
.selos { position: absolute; left: 4px; top: 4px; right: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; pointer-events: none; }
.selo { font: 700 .66rem/1 var(--font-body); font-style: normal; letter-spacing: .01em; padding: 4px 7px; border-radius: var(--r-pill);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.selo.neg { background: var(--down); color: var(--down-ink); } .selo.pos { background: var(--up); color: var(--up-ink); }

.ratebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line-strong);
  padding: var(--s3) var(--s3) max(var(--s3), env(safe-area-inset-bottom)); }
.bar-rate { max-width: 760px; margin: 0 auto; }
.bar-rate [data-sheet] { max-height: min(64dvh, 480px); overflow-y: auto; overscroll-behavior: contain; }
.bar-rate .scale { margin-bottom: var(--s1); gap: 6px; }
.bar-rate .nota { min-height: 58px; }
.bar-rate .nota small { font-size: .64rem; }
.bar-rate .skip { width: 100%; min-height: 40px; }
.bar-rate .skip kbd { margin-left: var(--s2); }
.bar-rate .nota kbd { display: none; }
@media (hover: hover) and (min-width: 900px) {
  :root { --bar-h: 100px; } .page-avaliar { --bar-h: 100px; }
  .bar-rate [data-actions] { display: flex; align-items: stretch; gap: var(--s3); }
  .bar-rate .scale { flex: 1; margin: 0; }
  .bar-rate .nota { min-height: 64px; }
  .bar-rate .nota kbd { display: block; }
  .bar-rate .skip { width: auto; min-height: 64px; padding: 0 var(--s4); border-color: var(--line-strong); }
}
.triage-done { min-height: 70dvh; display: grid; place-items: center; padding: var(--s5); }

.toast { position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--bar-h) + var(--s3) + env(safe-area-inset-bottom)); z-index: 24;
  display: flex; align-items: center; gap: var(--s4); padding: 6px 6px 6px var(--s4); border-radius: var(--r-pill); overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); font-size: var(--fs-sm); font-weight: 600;
  white-space: nowrap; animation: toastin .25s var(--ease); }
.toast.out { opacity: 0; transition: opacity .25s; }
.toast form { margin: 0; }
.toast .n1 { color: #e2574a; } .toast .n2 { color: #ea8a63; } .toast .n3 { color: #a3a193; } .toast .n4 { color: #86c58c; } .toast .n5 { color: #4fc487; }
.toast b { font: 700 var(--fs-md) var(--font-display); }
.undo { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink); font: 700 var(--fs-sm) var(--font-body); cursor: pointer; }
.undo:hover { filter: brightness(1.08); } .undo svg.ico { width: 16px; height: 16px; }
.undo kbd { margin-left: 2px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: toastbar 6s linear forwards; }
@keyframes toastin { from { opacity: 0; translate: -50% 10px; } }
@keyframes toastbar { to { transform: scaleX(0); } }
body:has(.ratebar [data-sheet]:not([hidden])) .toast { display: none; }

@media (prefers-reduced-motion: reduce) { .toast, .toast-bar { animation: none; } .ph img { transition: none; } }

.tfacts .tbath, .facts .bath, .facts.compact .bath { display: inline-flex; align-items: center; gap: 5px; }
.tfacts .tbath svg.ico, .facts .bath svg.ico { width: 16px; height: 16px; color: var(--muted); }
.toast.err { border-color: var(--down); color: var(--down); padding: 12px var(--s4); white-space: normal; max-width: calc(100vw - 32px); z-index: 70; }
:root { --bar-h: 16px; }

/* avaliar: faixa de dados em destaque, navegação, legenda do interior */
.triage-nav { display: flex; align-items: center; gap: var(--s1); }
.triage-nav .round { width: 40px; height: 40px; }
.triage-nav .round[disabled] { opacity: .3; pointer-events: none; }
.tinfo { gap: var(--s2) var(--s6); margin-bottom: var(--s3); }
.tprice { flex-direction: column; align-items: flex-start; gap: 4px; }
.tprice .total { font-size: 2.5rem; }
.tprice .muted { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.tbairro-box { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.tbairro-box .tbairro { font: 700 1.6rem/1.1 var(--font-display); color: var(--accent); letter-spacing: -.02em; }
.tbairro-box .tkind { display: inline-flex; align-items: center; gap: 5px; font: 650 var(--fs-xs)/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); }
.tbairro-box .tkind svg.ico { width: 14px; height: 14px; }
.tkind.mine { color: var(--text); border-color: var(--accent); } .tkind.mine b { font-size: var(--fs-md); }
.tkind.mine .n1 { color: #e2574a; } .tkind.mine .n2 { color: #ea8a63; } .tkind.mine .n3 { color: #a3a193; } .tkind.mine .n4 { color: #86c58c; } .tkind.mine .n5 { color: #4fc487; }
.tinfo .tfacts { gap: var(--s2); flex: 0 1 auto; }
.tinfo .tfacts li { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.tinfo .tfacts li svg.ico { width: 22px; height: 22px; color: var(--accent); align-self: center; }
.tinfo .tfacts li b { font: 700 1.5rem/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.tinfo .tfacts li.na { border-style: dashed; } .tinfo .tfacts li.na b { color: var(--faint); } .tinfo .tfacts li.na svg.ico { color: var(--faint); }
.facts .bath.na b, .facts.compact .bath.na b { color: var(--faint); } .facts .bath.na { border-style: dashed; }
.tinfo .tlink { margin-left: auto; }
@media (max-width: 899px) {
  .tinfo { gap: var(--s3) var(--s4); }
  .tprice .total { font-size: 2.1rem; }
  .tinfo .tfacts li { padding: 6px 10px; } .tinfo .tfacts li b { font-size: 1.25rem; } .tinfo .tfacts li svg.ico { width: 18px; height: 18px; }
  .tinfo .tfacts { flex-wrap: wrap; }
}
.scale-int { margin: 0 0 var(--s2); text-align: center; font: 500 var(--fs-xs)/1.3 var(--font-body); color: var(--muted); }
.scale-int b { color: var(--accent); font: 700 var(--fs-sm) var(--font-body); text-transform: uppercase; letter-spacing: .06em; }
.scale-int .wide { display: none; }
@media (min-width: 640px) { .scale-int .wide { display: inline; } .scale-int { font-size: var(--fs-sm); } }
@media (hover: hover) and (min-width: 900px) {
  .bar-rate [data-actions] { flex-wrap: wrap; }
  .bar-rate .scale-int { flex: 0 0 100%; margin-bottom: 0; }
  :root { --bar-h: 130px; } .page-avaliar { --bar-h: 130px; }
}
.triage-nav .round.flat { color: var(--text); background: var(--surface-2); }

/* avaliar: fotos grandes (2 / 2 / 3 colunas), sem prévia */
.contact { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
@media (min-width: 640px) { .contact { grid-template-columns: repeat(2, 1fr); gap: var(--s3); } }
@media (min-width: 1100px) { .contact { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1360px) { .contact { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1800px) { .contact { grid-template-columns: repeat(3, 1fr); } }
.contact .ph { aspect-ratio: 4 / 3; }
.phn { min-width: 24px; height: 24px; font-size: .75rem; right: 8px; bottom: 8px; }
.selos { left: 8px; top: 8px; gap: 4px; } .selo { font-size: .75rem; padding: 5px 9px; }

/* legenda da nota */
.scale-int { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); text-align: left; margin: 0 0 var(--s2); }
.scale-int b { font: 650 var(--fs-md) var(--font-display); color: var(--text); text-transform: none; letter-spacing: 0; }
.scale-int span { font: 400 var(--fs-xs)/1.35 var(--font-body); color: var(--muted); }
@media (min-width: 640px) { .scale-int span { font-size: var(--fs-sm); } }
.page-avaliar { --bar-h: 188px; }
@media (hover: hover) and (min-width: 900px) { :root { --bar-h: 132px; } .page-avaliar { --bar-h: 132px; } }

/* quero visitar */
.int { display: flex; flex-direction: column; gap: var(--s2); margin: 0; }
.intbtn { display: inline-flex; align-items: center; gap: var(--s2); align-self: flex-start; min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 650 var(--fs-sm) var(--font-body); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; }
.intbtn:hover { border-color: var(--accent); background: var(--accent-soft); }
.intbtn svg.ico { width: 18px; height: 18px; }
.intbtn[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.intbtn[aria-pressed=true] svg.ico { fill: currentColor; }
.intnote textarea, .lint textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.4; resize: vertical; min-height: 64px; padding: var(--s3);
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }
.intnote textarea::placeholder, .lint textarea::placeholder { color: var(--faint); }
.intnote textarea:focus-visible, .lint textarea:focus-visible { outline: 2px solid var(--focus); border-color: transparent; }
.int-avaliar { flex: 0 1 320px; min-width: 240px; }
.int-avaliar .intnote textarea { min-height: 52px; }
.int-detalhe .intstatus { width: 100%; } .int-detalhe .intstatus button { min-height: 40px; }
.int-panel { padding: var(--s4); margin-top: var(--s3); }
.lstar { position: absolute; top: var(--s3); right: var(--s3); z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(12,12,10,.55); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .15s, color .15s, transform .1s; }
.lstar svg.ico { width: 18px; height: 18px; } .lstar:hover { background: var(--accent); color: var(--accent-ink); } .lstar:active { transform: scale(.92); }
.lstar.on { background: var(--accent); color: var(--accent-ink); } .lstar.on svg.ico { fill: currentColor; }
.lstar::after { content: ""; position: absolute; inset: -4px; }
.badge.int { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); gap: 4px; }
.badge.int svg.ico { width: 12px; height: 12px; fill: currentColor; }
.lint { padding: 0 var(--s4) var(--s3); } .lint textarea { min-height: 56px; font-size: 14px; padding: var(--s2) var(--s3); }
.badge { white-space: nowrap; }

/* avaliar: barra de nota em pílulas compactas (uma linha) */
.page-avaliar, :root .page-avaliar { --bar-h: 72px; }
@media (hover: hover) and (min-width: 900px) { :root { --bar-h: 72px; } .page-avaliar { --bar-h: 72px; } }
.ratebar { padding: 8px var(--s2) max(8px, env(safe-area-inset-bottom)); }
.bar-rate { position: relative; max-width: 760px; margin: 0 auto; }
.pillbar { display: flex; align-items: center; justify-content: center; gap: var(--s3); min-height: 40px; }
.navbtn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; display: inline-grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--muted); text-decoration: none; position: relative; transition: background .15s, color .15s; }
.navbtn::after { content: ""; position: absolute; inset: -4px; }
.navbtn:hover { background: var(--surface-3); color: var(--text); }
.navbtn:disabled { opacity: .28; pointer-events: none; }
.navbtn svg.ico { width: 22px; height: 22px; }
.pl-label { flex: none; display: inline-flex; align-items: center; gap: 4px; font: 650 var(--fs-sm) var(--font-body); color: var(--muted); }
.infowrap { position: relative; display: inline-flex; }
.infotip { width: 24px; height: 24px; border: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: pointer; display: inline-grid; place-items: center; position: relative; }
.infotip::after { content: ""; position: absolute; inset: -10px; }
.infotip:hover, .infowrap.open .infotip { color: var(--accent); } .infotip svg.ico { width: 16px; height: 16px; }
.tip { display: none; position: absolute; bottom: calc(100% + 20px); left: -44px; width: 250px; max-width: calc(100vw - 24px); z-index: 6; padding: var(--s3) var(--s4);
  border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
  font: 400 var(--fs-xs)/1.4 var(--font-body); color: var(--muted); text-transform: none; letter-spacing: 0; }
.tip b { display: block; color: var(--text); font: 650 var(--fs-sm) var(--font-display); margin-bottom: 2px; }
.infowrap:hover .tip, .infowrap:focus-within .tip, .infowrap.open .tip { display: block; }
.pills { display: flex; gap: 6px; }
.pills .nota { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; flex: none; background: var(--surface-3); border: 1.5px solid var(--line-strong);
  color: var(--text); display: grid; place-items: center; }
.pills .nota b { font: 700 1rem/1 var(--font-display); }
.pills .nota:hover, .pills .nota:focus-visible, .pills .nota[aria-pressed=true] { background: var(--c); border-color: var(--c); color: #17110a; }
.pills .nota:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pl-val { flex: none; min-width: 92px; font: 650 var(--fs-sm) var(--font-body); font-variant-numeric: tabular-nums; color: var(--text); }
.pl-val.hov { color: var(--muted); }
.bar-rate [data-sheet] { position: absolute; left: 0; right: 0; bottom: calc(100% + 12px); z-index: 5; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-2); max-height: min(64dvh, 480px); overflow-y: auto; overscroll-behavior: contain; animation: lbin .12s var(--ease); }
@media (max-width: 639px) {
  .ratebar .pillbar { gap: 4px; justify-content: space-between; }
  .navbtn { width: 32px; } .pills { gap: 4px; }
  .ratebar .pl-label { font-size: var(--fs-xs); gap: 2px; }
  .ratebar .pl-val { position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0; min-width: 0; padding: 5px 12px; border-radius: var(--r-pill);
    background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow-1); white-space: nowrap; }
  .pl-val:empty { display: none; }
  .tip { left: -60px; }
}
.bar-rate .pillbar { align-items: center; flex-wrap: nowrap; }
.bar-rate [data-sheet] .row { position: sticky; bottom: calc(-1 * var(--s4)); margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: var(--s3) var(--s4) var(--s4);
  background: var(--surface); border-top: 1px solid var(--line); }

/* avaliar: topo fino rola junto; a faixa de dados é que fica fixa */
.triage-top { position: static; }
.triage { --tpad: var(--s3); padding-left: var(--tpad); padding-right: var(--tpad); padding-top: 0; }
@media (min-width: 900px) { .triage { --tpad: var(--s5); } }
.tsent { display: block; height: 0; }
.tinfo { position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * var(--tpad)) var(--s3); padding: var(--s3) var(--tpad);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: padding .15s var(--ease), border-color .15s; }

/* quero visitar + dúvidas (barra de baixo, detalhe, card) */
.vdiv { flex: none; width: 1px; align-self: stretch; margin: 6px var(--s1); background: var(--line-strong); }
.int-barra { display: contents; }
.int-barra .intbtn { align-self: center; min-height: 40px; background: transparent; border-radius: var(--r-pill); }
.int-barra .intbtn[aria-pressed=true] { background: var(--accent); }
.int-barra .intbtn.pencil { padding: 0; width: 40px; justify-content: center; position: relative; }
.int-barra .intbtn.pencil span, .int .pencil span { display: none; }
.pencil.has::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.pencil.has { color: var(--accent); }
.dpop { margin-top: var(--s2); }
.dlabel { display: block; font: 650 var(--fs-sm) var(--font-body); margin-bottom: var(--s2); }
.dpop textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.4; resize: vertical; min-height: 76px; padding: var(--s3);
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }
.dpop textarea:focus-visible { outline: 2px solid var(--focus); border-color: transparent; }
.int-barra .dpop { position: absolute; left: 0; right: 0; bottom: calc(100% + 12px); z-index: 5; margin: 0; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-2); animation: lbin .12s var(--ease); }
.int-detalhe { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.int-detalhe .intstatus, .int-detalhe .dpop { flex-basis: 100%; }
.int-detalhe .intbtn.pencil { padding: 0 var(--s4); gap: var(--s2); position: relative; } .int-detalhe .intbtn.pencil span { display: inline; }
.int-detalhe .pencil.has::after { top: 8px; right: auto; left: 30px; }
@media (min-width: 900px) { .bar-rate { max-width: 960px; } .pl-val { min-width: 70px; } }
@media (max-width: 899px) { .int-barra .intbtn:not(.pencil) { width: 40px; padding: 0; justify-content: center; } .int-barra .intbtn:not(.pencil) span { display: none; } }
@media (max-width: 639px) {
  .int-barra .intbtn { width: 38px !important; min-height: 38px; }
  .ratebar .pillbar { gap: 3px; }
  .navbtn { width: 26px; } .navbtn svg.ico { width: 20px; height: 20px; }
  .ratebar .pills .nota { width: 38px; height: 38px; } .pills { gap: 3px; }
  .ratebar .pl-label { font-size: 0; gap: 0; } .ratebar .pl-label .infowrap { font-size: var(--fs-xs); }
  .vdiv { margin: 8px 0; }
}
@media (max-width: 380px) { .ratebar .pills .nota { width: 33px; height: 33px; } .int-barra .intbtn { width: 34px !important; } }
.lpen { right: calc(var(--s3) + 42px); }
.lint { padding: 0; }
.ldv { display: flex; align-items: center; gap: 6px; width: 100%; padding: 0 var(--s4) var(--s3); border: 0; background: none; cursor: pointer; text-align: left;
  color: var(--muted); font: 400 var(--fs-sm) var(--font-body); }
.ldv svg.ico { width: 14px; height: 14px; flex: none; color: var(--accent); } .ldv span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lint-edit { padding: 0 var(--s4) var(--s3); } .lint-edit textarea { width: 100%; font: inherit; font-size: 14px; resize: vertical; min-height: 56px; padding: var(--s2) var(--s3);
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }

/* detalhe: o mesmo componente, em painel baixo */
.rate-panel { padding: var(--s3) var(--s4); }
.bar-rate.inline { max-width: none; margin: 0; }
.bar-rate.inline .pillbar { flex-wrap: wrap; justify-content: flex-start; gap: var(--s2) var(--s3); }
.bar-rate.inline .vdiv { flex: 0 0 100%; height: 0; width: auto; margin: 0; background: none; }
.bar-rate.inline .int-detalhe { display: contents; }
.bar-rate.inline .pl-val { min-width: 70px; }
.bar-rate.inline .pl-val:empty { display: none; }
.bar-rate.inline .intbtn { min-height: 40px; background: transparent; border-radius: var(--r-pill); }
.bar-rate.inline .intbtn[aria-pressed=true] { background: var(--accent); }
.bar-rate.inline .intbtn.pencil { padding: 0 var(--s4); width: auto; }
.bar-rate.inline .intbtn.pencil.has::after { top: 8px; right: 8px; left: auto; }
.bar-rate.inline .intstatus, .bar-rate.inline .dpop { flex: 0 0 100%; margin: 0; }
.bar-rate.inline [data-sheet] { bottom: auto; top: calc(100% + 8px); }
.bar-rate.inline .tip { left: -20px; }
@media (max-width: 639px) { .bar-rate.inline .intbtn span { display: none; } .bar-rate.inline .intbtn { width: 40px; padding: 0 !important; justify-content: center; } }
/* card: nota com o mesmo visual das pílulas */
.lr-seg { background: transparent; padding: 0; gap: 4px; }
.lr-n { min-width: 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); border: 1.5px solid var(--line-strong); color: var(--text); font-weight: 700; }
.lr-n:hover, .lr-n:focus-visible, .lr-n[aria-pressed=true] { border-color: var(--c); }

/* detalhe: espaçamento vertical único entre painéis (gap, não margens soltas) */
.detail .panel { margin: 0; }
.d-top, .d-rest { display: flex; flex-direction: column; gap: var(--s4); }
.d-top .info { padding-bottom: 0; }
@media (min-width: 960px) { .side { display: flex; flex-direction: column; gap: var(--s4); } }
.bar-rate.inline .intbtn { flex: none; } @media (max-width: 639px) { .bar-rate.inline .intbtn { min-width: 40px; } }

/* avaliar: faixa de dados fixa no topo, de tamanho único (sem estado "grudou": nada muda de altura ao rolar) */
.tinfo { gap: 2px var(--s4); margin-bottom: var(--s3); padding-top: var(--s2); padding-bottom: var(--s2); transition: none; align-items: center; }
.tprice { flex-direction: row; align-items: baseline; gap: var(--s3); }
.tprice .total { font-size: 1.6rem; } .tprice .muted { font-size: var(--fs-sm); }
.tbairro-box .tbairro { font-size: 1.2rem; }
.tinfo .tfacts { gap: 6px; flex-wrap: nowrap; }
.tinfo .tfacts li { padding: 4px 10px; } .tinfo .tfacts li b { font-size: 1.15rem; } .tinfo .tfacts li svg.ico { width: 18px; height: 18px; }
.tinfo .tlink { min-height: 36px; }
@media (max-width: 899px) {
  .tinfo { column-gap: var(--s3); }
  .tprice .muted, .tbairro-box .tkind { display: none; }
  .tinfo .tfacts { order: 3; flex: 1 1 100%; min-width: 0; }
  .tinfo .tfacts li { padding: 3px 7px; gap: 4px; font-size: 11px; } .tinfo .tfacts li b { font-size: 1.05rem; } .tinfo .tfacts li svg.ico { width: 16px; height: 16px; }
  .tinfo .tlink { order: 2; font-size: 0; gap: 0; min-width: 36px; justify-content: center; margin-left: auto; }
  .tinfo .tlink svg.ico { width: 20px; height: 20px; }
  .tbairro-box { min-width: 0; } .tbairro-box .tbairro { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
  .tprice { flex: 0 0 auto; }
}
html, body { overflow-anchor: none; }

/* nunca deixa a página ficar mais larga que a tela (o navegador mobile afastaria o zoom e a barra fixa sairia do lugar) */
.page-avaliar { overflow-x: clip; max-width: 100vw; }
.triage { min-width: 0; overflow-x: clip; }
.tinfo > * { min-width: 0; }

/* rótulo da nota ocupa o lugar de "Avalie o interior" (slot de largura fixa) */
.pl-text { display: inline-block; width: 8.8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pl-text.has-v { color: var(--text); } .pl-text.hov { color: var(--muted); }
.pl-val, .bar-rate.inline .pl-val { display: none; min-width: 0; }
@media (max-width: 639px) {
  .ratebar .pl-text { display: none; }
  .ratebar .pl-val { display: block; }
  .ratebar .pl-val:empty { display: none; }
}

/* mobile: uma foto por linha, largura total (Avaliar e Detalhe) */
@media (max-width: 639px) {
  .mosaic, .contact { grid-template-columns: 1fr; gap: var(--s2); }
  .mosaic .ph, .contact .ph, .mosaic .hero, .mosaic .solo { grid-column: auto; aspect-ratio: 3 / 2; }
}

/* saúde: medição da IA */
.ia-nota { margin: var(--s5) 0 var(--s2); }
.stats div.bad b { color: var(--down); }
.ia-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); margin-top: var(--s3); }
.ia-card h3 { margin: 0 0 var(--s3); font: 650 var(--fs-md) var(--font-body); }
.ia-card h3 .muted { font-weight: 500; }
.ia-card dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4) var(--s3); }
.ia-card dt { color: var(--muted); font-size: var(--fs-xs); margin-bottom: 2px; }
.ia-card dd { margin: 0; font: 700 1.25rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.ia-card dd .muted { font: 500 var(--fs-sm) var(--font-body); }

/* ---------- nota e descarte: painéis compactos, ancorados, sem rolagem interna ---------- */
.chips.compact { gap: 6px; margin-bottom: var(--s3); }
.chips.compact .chip span { min-height: 32px; padding: 0 11px; font-size: 13px; }
.sheet .txt, .notapop .txt { min-height: 40px; font-size: 16px; margin: 0 0 var(--s3); }
.sheet .txt[hidden], .notapop .txt[hidden] { display: none; }
.notapop { width: 360px; max-height: none; overflow: visible; padding: var(--s3) var(--s4) var(--s4); }
.notapop .btn, .sheet .btn { min-height: 44px; }
.notapop .sheet-title, .sheet .sheet-title { font-size: var(--fs-sm); margin-bottom: var(--s3); }
.bar-rate [data-sheet] { max-height: none; overflow: visible; padding: var(--s3) var(--s4) var(--s4); }
.bar-rate [data-sheet] .row { position: static; margin: 0; padding: 0; border: 0; background: none; }
.bar-rate [data-sheet][hidden] { display: none; }
.notapop[hidden] { display: none; }
.descpop .row .btn[hidden] { display: none; }
.descpop .row { flex-wrap: wrap; }
@media (min-width: 900px) { .bar-rate .chips.compact { max-width: 640px; } }
#historico { display: contents; }

/* descartar */
.intbtn.ban[aria-pressed=true] { background: var(--down); border-color: var(--down); color: var(--down-ink); }
.intbtn.ban[aria-pressed=true] svg.ico { fill: none; }
.lstar.ldesc { right: calc(var(--s3) + 84px); }
.lstar.ldesc.on { background: var(--down); color: var(--down-ink); } .lstar.ldesc.on svg.ico { fill: none; }
.ldesc-line { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 var(--s4) var(--s3); font-size: var(--fs-sm); color: var(--down); }
.ldesc-line svg.ico { width: 14px; height: 14px; flex: none; } .ldesc-line span { min-width: 0; }

/* avaliar: uma linha só (desktop: ícone + texto curto; celular: só ícone). detalhe: sempre com texto */
.bar-rate .intbtn { flex: none; font-size: 13px; background: transparent; }
.bar-rate .intbtn svg.ico { width: 17px; height: 17px; }
.bar-rate .intbtn[aria-pressed=true] { background: var(--accent); }
.bar-rate .intbtn.ban[aria-pressed=true] { background: var(--down); }
.bar-rate.inline .intbtn { width: auto !important; min-width: 0 !important; min-height: 40px; padding: 0 12px !important; gap: 6px; justify-content: center; }
.bar-rate.inline .intbtn span { display: inline !important; }
.bar-rate.inline .intbtn.pencil.has::after { top: 8px; right: 8px; left: auto; }
.bar-rate.inline .intbtn.pencil.has { padding-right: 22px !important; }
@media (max-width: 639px) { .bar-rate.inline .intbtn { padding: 0 9px !important; gap: 5px; } .bar-rate.inline .intbtn.pencil.has { padding-right: 20px !important; } }
.ratebar .bar-rate .pillbar { flex-wrap: nowrap; }
.ratebar .int-barra .intbtn { width: 40px !important; min-width: 0 !important; padding: 0 !important; gap: 0; justify-content: center; min-height: 40px; }
.ratebar .int-barra .intbtn span { display: none !important; }
@media (min-width: 1280px) {
  .ratebar .bar-rate { max-width: 1040px; }
  .ratebar .int-barra .intbtn { width: auto !important; padding: 0 11px !important; gap: 6px; }
  .ratebar .int-barra .intbtn span { display: inline !important; }
  .ratebar .int-barra .intbtn.pencil.has { padding-right: 22px !important; }
  .ratebar .int-barra .intbtn.pencil.has::after { top: 8px; right: 8px; }
}
@media (max-width: 639px) {
  .ratebar .pillbar { gap: 2px; }
  .ratebar .pills { gap: 2px; } .ratebar .pills .nota { width: 34px; height: 34px; }
  .ratebar .int-barra .intbtn { width: 34px !important; min-height: 34px; }
  .navbtn { width: 22px; } .navbtn svg.ico { width: 18px; height: 18px; }
  .ratebar .vdiv { margin: 8px 1px; }
}
.saved { margin-left: 8px; font: 600 12px var(--font-body); color: var(--up); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.saved.on { opacity: 1; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--muted); font: 500 13px var(--font-body); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--text); } .linkbtn[hidden] { display: none; }
.pop-actions { margin-top: var(--s2); }

/* painel de nota: grupos por área, largura limitada; celular: folha inferior compacta */
.mgrupos { display: grid; gap: var(--s2); margin-bottom: var(--s3); }
.mgrupo { display: grid; grid-template-columns: 72px 1fr; align-items: start; gap: var(--s2); }
.mg-nome { padding-top: 7px; font: 650 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.mgrupo .chips.compact { margin: 0; }
.sheet-title b { font-family: var(--font-display); }
.notapop { width: 520px; }
.bar-rate [data-sheet] { left: auto; right: auto; width: min(540px, 100%); }
.pop-x { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; z-index: 2; }
.pop-x svg.ico { width: 18px; height: 18px; }
.notapop .sheet-title, .bar-rate [data-sheet] .sheet-title { padding-right: 36px; }

/* bolha de motivos: colada no número clicado, com setinha; superfície elevada */
.notapop, .bar-rate [data-sheet] { position: absolute; background: var(--pop-bg); border: 1px solid var(--pop-line); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); --ax: 50%; left: 0; right: auto; bottom: auto; translate: none; z-index: 60; }
.notapop { position: fixed; }
.notapop::before, .bar-rate [data-sheet]::before { content: ""; position: absolute; left: calc(var(--ax) - 7px); width: 14px; height: 14px;
  background: var(--pop-bg); border: 1px solid var(--pop-line); transform: rotate(45deg); }
.notapop.below::before, .bar-rate [data-sheet].below::before { top: -8px; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.notapop.above::before, .bar-rate [data-sheet].above::before { bottom: -8px; border-left: 0; border-top: 0; border-radius: 0 0 3px 0; }
.notapop[hidden], .bar-rate [data-sheet][hidden] { display: none; }
.chip span { background: var(--surface-3); }
.kbd-hint { display: none; margin-top: 6px; }
.kbd-hint kbd { font: 600 11px var(--font-body); padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); color: var(--text); }
@media (hover: hover) and (min-width: 900px) { .kbd-hint { display: block; } }

.ratebar .pl-text { width: 8.2em; }
.mgrupos[data-tipo=pos] .chip input:checked + span { background: var(--up); border-color: var(--up); color: var(--up-ink); }

/* atalhos de letra nos chips (só com teclado físico) */
.chip-key { display: none; position: absolute; top: -6px; right: -2px; z-index: 2; pointer-events: none; font: 700 9.5px/1 var(--font-body);
  padding: 2px 4px; border-radius: 4px; color: var(--muted); background: var(--pop-bg); border: 1px solid var(--pop-line); }
@media (hover: hover) and (min-width: 900px) { .chip-key { display: block; } }
.chip input:checked ~ .chip-key { color: var(--text); }
