/* cuadra. Celeste sky band with a Sol de Mayo, then a quiet white catalogue. Upright type only:
   Red Hat Display for headings and prices, Hanken Grotesk for everything else. */
/* tokens live in tokens.css */
/* ------------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------- header and the sky band */
.skip { position: absolute; left: 12px; top: -48px; z-index: 90; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; transition: top .15s var(--ease); }
.skip:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--celeste); color: #0F2A43; }
.top { background: var(--sky-from); color: var(--ink); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.top :focus-visible, .hero :focus-visible { outline-color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo { width: 34px; height: 34px; fill: var(--sun); stroke: var(--sun); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.brand b { font: 800 25px/1 var(--display); letter-spacing: -.02em; }
.brand span { font-size: var(--fs-base); padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; min-height: 28px; border-radius: var(--r-pill); font-size: var(--fs-base); font-weight: 500; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 600; }
.top .seg { background: color-mix(in srgb, var(--bg) 55%, transparent); border-color: transparent; }
.top .seg button { color: var(--ink); }
.top .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.status { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: var(--fs-base); color: var(--ink); }
.status .txt { display: none; }          /* the freshness line lives in the list head now */
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill);
       border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: var(--fs-base); font-weight: 500;
       transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.top .btn { background: transparent; border-color: color-mix(in srgb, var(--ink) 50%, transparent); }
.top .btn:hover { background: color-mix(in srgb, var(--bg) 45%, transparent); }
.iconbtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r-pill);
           border: 1px solid transparent; background: transparent; color: var(--ink-2); transition: background-color .18s var(--ease), color .18s var(--ease); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.themebtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--ink) 55%, transparent); background: transparent; color: var(--ink);
            border-radius: var(--r-pill); padding: 0 14px; min-height: 32px; font-size: var(--fs-base); font-weight: 500; }
.themebtn:hover { background: color-mix(in srgb, var(--bg) 45%, transparent); }
.themebtn svg.i { width: 15px; height: 15px; }
.top .iconbtn { color: var(--ink); }
.top .iconbtn:hover { background: color-mix(in srgb, var(--bg) 45%, transparent); }

/* the hero: headline, your saved criteria and the free-text search, under a half-risen sun */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--sky-from), var(--sky-to)); }
.hero .sunrise { position: absolute; right: max(-50px, calc((100vw - 1440px) / 2 - 50px)); top: -70px; width: 340px; height: 340px; opacity: .85; pointer-events: none;
                 fill: none; stroke: var(--sun-line); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hero-in { position: relative; padding: 18px 24px 30px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hero-in h1 { font: 700 clamp(26px, 3.4vw, 38px)/1.08 var(--display); letter-spacing: -.025em; margin: 0; text-wrap: balance; font-variant-numeric: tabular-nums; }
.heroRow { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; min-width: 0; }
.mine { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 420px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
        background: color-mix(in srgb, var(--bg) 72%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
        font-size: var(--fs-base); font-weight: 500; white-space: nowrap; }
.pill.edit { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--ink) 60%, transparent); min-height: 30px; cursor: pointer; }
.pill.edit:hover, .pill.edit[aria-expanded="true"] { background: color-mix(in srgb, var(--bg) 60%, transparent); border-style: solid; }
.pill.ghost { background: transparent; color: var(--ink); border: 1px dashed color-mix(in srgb, var(--ink) 60%, transparent); font-weight: 500; }
.ask { display: flex; align-items: center; gap: 10px; flex: 1 1 340px; max-width: 460px; height: 46px; padding: 0 10px 0 16px;
       background: var(--surface); border: 0; border-radius: 14px; box-shadow: 0 10px 30px -14px rgba(0,0,0,.4); }
.ask:focus-within { outline: 2px solid var(--accent); }
.ask > .i { color: var(--muted); }
.ask input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); min-width: 0; }
.ask input::placeholder { color: var(--muted); }
.ask:focus-within kbd { visibility: hidden; }
.qnote { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; font-size: var(--fs-base); color: var(--ink-2); }
.qnote .qtag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
               background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; }
.qnote .qtag svg.i { width: 13px; height: 13px; }
.qnote.literal .qtag { border-style: dashed; }
.qnote .qtxt { color: var(--muted); }
.qnote .meta { flex-basis: 100%; margin: 0; }
kbd { font: 600 12px var(--sans); color: var(--ink-2); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-2xs); padding: 1px 7px; background: var(--bg); }

/* ------------------------------------------- the sticky bar: tabs, criteria, shortcuts */
.bar { position: sticky; top: 0; z-index: 15; background: var(--bg); display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 24px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 15px 0 13px; font-size: var(--fs-xl); color: var(--ink-2); font-weight: 500;
       border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .18s var(--ease); }
.tab:hover { color: var(--ink); }
.tab b { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: var(--fs-sm); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tab[aria-selected="true"] b { color: var(--ink-2); }
.crit { flex: none; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line-strong);
        background: var(--surface-2); border-radius: var(--r-pill); padding: 0 14px; height: 34px; font-size: var(--fs-base); color: var(--ink); }
.crit:hover { border-color: var(--accent); }
.crit[hidden] { display: none; }
.view { display: flex; gap: 4px; align-items: center; flex: none; }
.view button { border: 1px solid var(--line-strong); background: none; border-radius: var(--r-pill); padding: 5px 14px; min-height: 34px; font-size: var(--fs-base); font-weight: 500; color: var(--ink); }
.view button:hover { border-color: var(--accent); }
.view button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters { display: flex; gap: 6px; align-items: center; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: var(--r-pill);
        border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-sm); white-space: nowrap; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip svg.i { width: 13px; height: 13px; }
.filters .sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; flex: none; }
.filters .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
select.chip { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px; background-size: 4px 4px; background-repeat: no-repeat; font: inherit; font-size: var(--fs-sm); }

/* --------------------------------------------------------------- list head */
.listhead { position: relative; display: flex; align-items: center; gap: 8px 16px; padding: 10px 0 2px; flex-wrap: wrap; }
.fresh { margin: 0; font-size: var(--fs-lg); color: var(--ink-2); }
.lh-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.sortlbl { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--fs-lg); }
.sortlbl select.chip { height: 36px; border-radius: var(--r-sm); color: var(--ink); }
.listhead .btn.more-btn { height: 36px; border-radius: var(--r-pill); padding: 0 14px; }
.keys { flex: 0 0 auto; font-size: var(--fs-lg); color: var(--ink-2); }
.keys[open] { flex-basis: 100%; order: 3; }
.keys summary { cursor: pointer; width: max-content; padding: 4px 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0 4px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-lg); max-width: 460px; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; }

/* --------------------------------------------------------------- notice */
.notice { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-lg); margin: 4px 0 14px;
          background: var(--warn-soft); color: var(--warn); font-size: var(--fs-base); }
.notice b { font-weight: 600; }
.notice button { margin-left: auto; border: 0; background: none; color: inherit; text-decoration: underline; font-size: var(--fs-sm); }

/* ----------------------------------------------------------------- rows
   A result is a catalogue line, not a box: a 176px photo, then title and price on one line,
   a facts line, chips, one line of the description, and the verdict with three text actions.
   A hairline separates rows; the hover fill bleeds 12px past the text edge. */
.grid { display: block; padding-bottom: 40px; }
.card { position: relative; min-width: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 20px; padding: 14px 12px; margin-inline: -12px;
        background: transparent; border-bottom: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
        transition: background-color .2s var(--ease); }
.card:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.card:focus { outline: none; }
.card:focus-visible, .kbd .card.is-current { outline: 2px solid var(--accent); outline-offset: -2px; }
.card.saved { background: color-mix(in srgb, var(--accent-soft) 60%, var(--bg)); }
.card.saved .tag:not(.k):not(.fresh) { background: var(--bg); }
.card.dismissed { opacity: .6; }

/* The photo slot. A hotlinked photo fills it and removes itself if the CDN fails, which
   leaves the cuadra-grid tile with the barrio on it. The count shows only with 2+ photos. */
.c-photo { position: relative; align-self: start; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column;
           justify-content: flex-end; padding: 12px;
  background:
    linear-gradient(color-mix(in srgb, var(--ink) 11%, transparent) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 11%, transparent) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(160deg, color-mix(in srgb, var(--a) var(--photo-mix), var(--bg)), color-mix(in srgb, var(--b) var(--photo-mix), var(--bg))); }
.c-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--img-filter); }
.c-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); pointer-events: none; }
.c-photo .barrio { font: 700 17px/1.05 var(--display); letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.c-photo .nofoto { font-size: var(--fs-xs); font-weight: 500; color: var(--ink); opacity: .75; margin-top: 4px; }
.c-photo:has(img) .barrio, .c-photo:has(img) .nofoto { display: none; }
.c-photo .count { position: absolute; top: 7px; right: 7px; z-index: 1; font-size: var(--fs-xs); background: #0F2A43; color: #fff; padding: 1px 8px;
                  border-radius: var(--r-pill); box-shadow: 0 0 0 1px rgba(255,255,255,.45); }
.c-photo:not(:has(img)) .count { display: none; }
.p1 { --a: #A9CDEC; --b: #8DBDE6; } .p2 { --a: #C3DCF1; --b: #98C2E8; } .p3 { --a: #9CC6EA; --b: #7FB1DC; }
.p4 { --a: #CFE3F5; --b: #A6CBEC; } .p5 { --a: #B3D3EE; --b: #8DBDE6; }

.c-main { min-width: 0; display: flex; flex-direction: column; }
.c-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.c-addr { min-width: 0; }
.c-addr h3 { font: 700 20px/1.25 var(--display); letter-spacing: -.01em; margin: 0 0 2px; overflow: hidden;
             display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-wrap: balance; }
.c-addr .where { margin: 0; color: var(--ink-2); font-size: var(--fs-lg); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.c-addr .where strong { color: var(--ink-2); font-weight: 500; }
.c-addr .where .adtag { font-size: var(--fs-xs); border: 1px dashed var(--line-strong); border-radius: var(--r-2xs); padding: 0 5px; }
.price { flex: none; text-align: right; max-width: 52%; }
.price .total { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.price .total b { font: 700 28px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price .total small { color: var(--ink-2); font-size: var(--fs-lg); }
.price .total .approx { color: var(--ink-2); font: 600 22px var(--display); margin-right: -2px; }
.price .split { color: var(--ink-2); font-size: var(--fs-lg); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price .split .unk { color: var(--warn); }
.specs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--fs-lg); color: var(--ink); font-variant-numeric: tabular-nums; }
.specs b { font-weight: 600; }
.specs .unk { color: var(--muted); }
.specs .src { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); }
.ring { position: relative; width: 34px; height: 34px; flex: none; }
.ring svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .t { stroke: var(--bar-track); }
.ring .v { stroke: var(--accent); stroke-linecap: round; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-xs); }
.tags { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 8px; overflow: hidden; flex: none; height: 26px; }
.tag { flex: none; line-height: 1.45; font-size: var(--fs-base); font-weight: 500; padding: 2px 9px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--accent); white-space: nowrap; }
.tag.k { background: var(--sun); color: #3A2800; font-weight: 600; }
.tag.gone { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.card.unavailable .c-photo { filter: grayscale(1); opacity: .7; }
.tag.fresh { color: var(--muted); background: var(--surface-2); font-size: var(--fs-sm); padding-block: 1px; margin-left: 4px; }
.tag.fresh { background: none; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }
.tag.fresh.old { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.tag.fresh.none { color: var(--muted); }
.row .tag.fresh { padding: 0 6px; font-size: var(--fs-xs); margin-left: 2px; }
.d-read { margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tag.more { color: var(--muted); background: none; padding-inline: 2px; }
.c-desc { margin: 8px 0 0; max-width: 72ch; font-size: var(--fs-lg); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-base { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: auto; padding-top: 10px; min-width: 0; }
.why { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-lg); font-weight: 600; border-radius: var(--r-sm); padding: 3px 0; }
.why { flex: 0 1 auto; align-items: flex-start; line-height: 1.25; }
.why svg.i { margin-top: 1px; flex: none; }
.why > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.why svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.why.ok { color: var(--ok); }
.why.q { color: var(--ink); background: color-mix(in srgb, var(--sun) 24%, transparent); padding: 3px 10px 3px 8px; }
.why.q svg.i { color: var(--warn); }
.why.bad { color: var(--bad); background: var(--bad-soft); padding: 3px 10px 3px 8px; }
.foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; flex: none; }
.foot .iconbtn { width: 32px; height: 32px; }
.foot .iconbtn.on { color: var(--accent); }
.foot .iconbtn.on svg { fill: currentColor; }
.foot .iconbtn.yes { color: var(--ok); background: var(--ok-soft); }
.foot .iconbtn.no { color: var(--bad); background: var(--bad-soft); }
.pillbtn, .foot .go { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill);
                      font-size: var(--fs-base); font-weight: 500; text-decoration: none;
                      transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); }
.pillbtn { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); }
.pillbtn:hover { border-color: var(--accent); }
.pillbtn:active, .foot .go:active { transform: translateY(1px); }
.pillbtn svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.foot .go { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); }
.foot .go:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.foot .go svg.i { width: 12px; height: 12px; }
.contact-choice { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; }

/* ----------------------------------------------------------------- list */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-bottom: 40px; }
.row { display: grid; grid-template-columns: 44px minmax(220px, 2.2fr) 120px 1.3fr 1.6fr auto; gap: 14px; align-items: center;
       padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row:focus { outline: none; }
.row:focus-visible, .kbd .row.is-current { outline: 2px solid var(--accent); outline-offset: -2px; }
.row .ring, .row .ring svg { width: 36px; height: 36px; }
.row .ring span { font-size: var(--fs-xs); }
.row h3 { font: 700 16px/1.2 var(--display); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .hood { color: var(--muted); font-size: var(--fs-sm); }
.row .mini { font-size: var(--fs-base); color: var(--ink-2); }
.row .mini b { font: 700 16px var(--display); color: var(--ink); }
.row .tags { margin: 0; height: auto; }

/* ------------------------------------------------------------------ map */
.fab { display: none; }
.seg .lbltxt { font-size: var(--fs-sm); margin-left: 5px; }
.seg button[data-view] { display: inline-flex; align-items: center; }
.mapview { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; height: calc(100vh - 72px);
           min-height: 520px; margin-bottom: 30px; }
.mapview[hidden] { display: none; }
.maplist { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line);
           border-radius: var(--radius); overflow: hidden; }
.ml-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: var(--fs-base); }
.ml-sum { margin: 0; padding: 6px 14px; color: var(--muted); font-size: var(--fs-sm); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ml-sum:empty { display: none; }
.ml-sync { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.ml-sync input { accent-color: var(--accent); margin: 0; }
#maplist { overflow-y: auto; flex: 1; }
.mi { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line);
      cursor: pointer; border-left: 3px solid transparent; }
.mi:hover, .mi.hot { background: var(--surface-2); border-left-color: var(--accent); }
.mi.is-current { border-left-color: var(--accent); }
.mi.has-img { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; }
.mi-img { width: 64px; height: 48px; object-fit: cover; border-radius: var(--r-xs); background: var(--line); grid-row: 1 / span 2; filter: var(--img-filter); }
.d-photos img { filter: var(--img-filter); }
.mi h3 { font: 700 15.5px/1.25 var(--display); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi .hood { color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi .px { text-align: right; font: 700 16px var(--display); white-space: nowrap; }
.mi .sp { text-align: right; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.mi .nopin { grid-column: 1 / -1; font-size: var(--fs-2xs); color: var(--warn); }
.ml-off { padding: 14px 14px 4px; font: 700 14px var(--display); color: var(--ink); }
.mapbox { position: relative; isolation: isolate; z-index: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
#map { position: absolute; inset: 0; background: var(--surface-2); font-family: var(--sans); }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; gap: 12px; flex-wrap: wrap; padding: 7px 10px;
          background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); font-size: var(--fs-2xs); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg.exact { background: var(--accent); border: 1.5px solid var(--accent); border-radius: 50%; }
.lg.block { background: var(--surface); border: 1.5px dashed var(--accent); border-radius: 50%; }
.lg.zone { background: color-mix(in srgb, var(--celeste) 30%, transparent); border: 1.5px solid var(--accent); }
/* price pins */
.pin { background: none; border: 0; }
.pin b { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 3px;
         padding: 4px 8px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent);
         font: 700 12px/1 var(--sans); white-space: nowrap; box-shadow: 0 2px 6px rgba(15,42,67,.28); transition: transform .12s var(--ease), background .12s;
         font-feature-settings: "tnum" 1; margin-top: -6px; }
.pin b::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 8px; height: 8px; background: inherit;
                border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: translateX(-50%) rotate(45deg); border-radius: 0 0 2px 0; }
.pin.block b { background: var(--surface); border-style: dashed; border-color: var(--accent); color: var(--accent); }
.pin.block b::after { border-color: var(--accent); border-style: dashed; }
.pin.saved b { box-shadow: 0 0 0 2.5px var(--sun), 0 2px 6px rgba(15,42,67,.28); }
.pin.hot b, .pin b:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: translate(-50%, -100%) scale(1.08); z-index: 2; }
.pin.hot b::after, .pin b:hover::after { border-color: var(--ink); }
.pin.dim b { opacity: .45; }
/* A pin that would collide with a better-ranked one shrinks to a dot; zoom in or hover to read it. */
.pin.dot b { font-size: 0; gap: 0; padding: 0; width: 13px; height: 13px; margin-top: 0; transform: translate(-50%, -50%); }
.pin.dot b::after { display: none; }
.pin.dot.hot b { font-size: var(--fs-xs); gap: 3px; padding: 4px 8px; width: auto; height: auto; margin-top: -6px; transform: translate(-50%, -100%) scale(1.08); }
.pin.dot.hot b::after { display: block; }
.leaflet-tooltip.peek { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hover);
                        padding: 10px 12px; font: 13px/1.35 var(--sans); min-width: 200px; }
.leaflet-tooltip.peek::before { display: none; }
.peek h4 { font: 700 16px/1.2 var(--display); margin: 0 0 2px; }
.peek .m { color: var(--muted); font-size: var(--fs-xs); }
.peek .p { font: 700 17px var(--display); margin-top: 6px; }
.leaflet-container a { color: var(--ink-2); }
.leaflet-control-attribution { font-size: 11px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; border-radius: var(--r-lg) !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--surface-2); color: var(--ink); }
.minimap { height: 180px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); margin-top: 8px; }

/* --------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(10,26,43,.38); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 41;
          transform: translateX(102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column;
          border-left: 1px solid var(--line); }
.drawer.open { box-shadow: -12px 0 40px rgba(0,0,0,.18); }
.drawer.open { transform: none; }
.d-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.d-head .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--ink-2); font-size: var(--fs-sm); }
.d-head .row1 > span:not(.d-score) { min-width: 0; }
.d-score { margin-left: auto; flex: none; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 9px; }
.d-title { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.d-addr { flex: 1; min-width: 0; }
.d-title .price .total b { font-size: 26px; }
.d-head .row1 .iconbtn:first-child { margin-left: -8px; }
.d-head h2 { font: 700 24px/1.15 var(--display); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.d-head .hood { color: var(--ink-2); margin-top: 4px; font-size: var(--fs-lg); }
.d-head .hood strong { color: var(--ink-2); }
.d-head .acts { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.d-body { overflow-y: auto; padding: 4px 20px 30px; flex: 1; }
.d-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.d-sec:last-child { border-bottom: 0; }
.d-sec h4 { margin: 0 0 10px; font: 700 15px var(--display); color: var(--ink); }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kv div { background: var(--surface-2); border-radius: var(--r-lg); padding: 8px 10px; }
.kv small { display: block; color: var(--ink-2); font-size: var(--fs-xs); }
.kv b { font: 700 16px var(--display); }
.money { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.money td { padding: 5px 0; }
.money td:last-child { text-align: right; font-weight: 500; }
.money tr.tot td { border-top: 1px solid var(--line); padding-top: 8px; font: 700 16px var(--display); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-md); }
.checks .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: var(--fs-xs); font-weight: 700; margin-top: 1px; }
.checks .pass .ic { background: var(--ok-soft); color: var(--ok); }
.checks .unknown .ic { background: var(--warn-soft); color: var(--warn); }
.checks .fail .ic { background: var(--bad-soft); color: var(--bad); }
.checks small { display: block; color: var(--muted); }
.comp { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; font-size: var(--fs-base); margin-bottom: 7px; }
.comp .track { height: 6px; background: var(--bar-track); border-radius: 99px; overflow: hidden; }
.comp .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.comp small { color: var(--muted); text-align: right; }
.desc { white-space: pre-wrap; font-size: var(--fs-lg); line-height: 1.55; color: var(--ink-2); max-height: 260px; overflow: auto; background: var(--surface-2);
        border: 0; border-radius: var(--r-lg); padding: 12px; margin: 0; font-family: var(--sans); }
.allfeat { display: flex; flex-wrap: wrap; gap: 5px; }
.meta { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.meta code { font-size: 11px; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
         background: var(--ink); color: var(--bg); padding: 8px 8px 8px 16px; min-height: 44px; border-radius: var(--radius); font-size: var(--fs-lg); display: flex; gap: 12px;
         align-items: center; transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 60; box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); }
/* The toast floats over the page bottom, where "Ver 24 más" lives: only its own button takes
   clicks, so a click on the toast's text falls through to whatever is underneath. */
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: none; }
.toast.show button { pointer-events: auto; }
.toast button { border: 0; border-radius: var(--r-sm); padding: 6px 12px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font-weight: 600; white-space: nowrap; }
.toast button:hover { background: color-mix(in srgb, var(--bg) 30%, transparent); }
.toast :focus-visible { outline-color: var(--bg); }
.empty { text-align: center; padding: 70px 20px; color: var(--ink-2); }
.empty h3 { font: 700 20px var(--display); color: var(--ink); margin: 0 0 6px; }
.loadmore { display: flex; justify-content: center; padding: 0 0 96px; }   /* clears the toast band */
.mocknote { font-size: var(--fs-2xs); color: var(--muted); text-align: center; padding: 0 0 30px; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .top .wrap { gap: 8px; height: 56px; }
  .brand span, .status .txt, .seg { display: none; }
  .brand b { font-size: 22px; }
  .brand .logo { width: 30px; height: 30px; }
  .hero .sunrise { width: 220px; height: 220px; right: -80px; top: -60px; }
  .hero-in { padding: 14px 16px 22px; gap: 12px; }
  .hero-in h1 { font-size: 24px; }
  .ask { flex: 1 1 100%; max-width: none; }
  .ask kbd { display: none; }
  .mine { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px;
          -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .mine > * { flex: none; }
  .mine::-webkit-scrollbar { display: none; }
  .tabs { gap: 20px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tab { padding: 14px 0 12px; }
  .crit { max-width: 130px; }
  .view button { min-height: 40px; padding-inline: 12px; }
  .keys { display: none; }
  .themebtn .lbl { display: none; }
  .themebtn { min-width: 32px; justify-content: center; padding: 0 8px; }
  .notice { font-size: var(--fs-sm); }
  .notice .long { display: none; }
  /* phone card: a 4:3 thumbnail beside title and price, everything else full width */
  .card { grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; margin-inline: 0; padding: 14px 0; border-radius: 0; }
  .c-main, .c-top { display: contents; }
  .c-photo { grid-column: 1; grid-row: 1 / span 2; padding: 8px; }
  .c-photo .barrio { font-size: 14px; }
  .c-photo .nofoto { display: none; }
  .c-addr { grid-column: 2; grid-row: 1; }
  .c-addr h3 { font-size: 17px; }
  .c-addr .where { font-size: var(--fs-base); }
  .price { grid-column: 2; grid-row: 2; text-align: left; max-width: none; align-self: end; }
  .price .total { justify-content: flex-start; }
  .price .total b { font-size: 24px; }
  .price .split, .price .total small { font-size: var(--fs-base); }
  .specs, .tags, .c-desc, .c-base { grid-column: 1 / -1; margin: 0; }
  .c-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .specs .src { margin-left: 0; flex-basis: 100%; }
  .c-base { flex-wrap: wrap; padding-top: 2px; }
  .foot { width: 100%; margin-left: 0; justify-content: flex-start; }
  .foot .iconbtn { width: 44px; height: 44px; }
  .pillbtn, .foot .go { min-height: 44px; padding-inline: 16px; }
  .foot .go { margin-left: auto; }
  .row { grid-template-columns: 36px 1fr auto; }
  .row > :nth-child(3), .row > :nth-child(5) { display: none; }
  .kv { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; }
  .d-title { flex-direction: column; gap: 8px; }
  .d-title .price { text-align: left; }
  .mapview { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58vh auto; height: auto; }
  .mapview .mapbox { order: -1; }
  .maplist { max-height: none; }
  .seg .lbltxt { display: none; }
  .fab { display: none !important; }   /* Lista / Mapa live in the sticky tab bar now; a floating button would cover the row actions */
  .fab-old { display: inline-flex; align-items: center; gap: 7px; position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
         z-index: 30; height: 46px; padding: 0 20px; border-radius: var(--r-pill); border: 0; background: var(--ink); color: var(--bg);
         font-weight: 600; font-size: var(--fs-lg); box-shadow: var(--shadow-hover); }
  .drawer.open ~ .fab { display: none; }
  .legend { display: none; }
  /* the toast sits under the top of the screen so it never covers the card you just acted on */
  .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); max-width: calc(100vw - 32px); }
  .toast.show { transform: translate(-50%, 0); }
  .toast button { min-height: 40px; }
}

/* ------------------------------------------------- additions for the live app */
.morepanel { position: absolute; right: 0; top: calc(100% - 8px); z-index: 25; width: min(420px, 100%); padding: 14px 16px 16px;
             background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-hover); }
.morepanel[hidden] { display: none; }
.fgroup { margin-bottom: 14px; }
.fgroup > label, .fgroup > h5 { display: block; margin: 0 0 6px; font-size: var(--fs-base); color: var(--ink-2); font-weight: 600; }
.fgroup select, .fgroup input[type=number] { width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
             background: var(--surface); color: var(--ink); font: inherit; }
.fgroup input:disabled { opacity: .5; }
.fgroup .hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }
.arealist { max-height: 168px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 8px; background: var(--surface-2); }
.arealist label { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: var(--fs-base); cursor: pointer; }
.arealist small { color: var(--muted); }
.arealist input, .check input { accent-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--fs-md); cursor: pointer; }
.morepanel .foot2 { display: flex; justify-content: space-between; gap: 8px; }
.notice { align-items: flex-start; flex-wrap: wrap; }
.notice[hidden] { display: none; }
.notice .ntxt { flex: 1; min-width: 200px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; width: 100%; }
.notice.hist { background: var(--accent-soft); color: var(--accent); }
.err { margin: 40px auto; max-width: 520px; padding: 18px; border: 1px solid var(--bad); background: var(--bad-soft); color: var(--bad); border-radius: var(--radius); }
.err button { margin-top: 10px; }
.skel { height: 150px; margin: 16px 0; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); border: 1px solid var(--line); }
.who { color: var(--muted); font-size: var(--fs-xs); }
.foot .tagmini { font-size: var(--fs-xs); color: var(--ok); display: inline-flex; gap: 4px; align-items: center; margin-right: 4px; }
.foot .tagmini.on { color: var(--accent); }
.foot .tagmini svg { fill: currentColor; }
.foot .tagmini.no { color: var(--bad); }
details.dsec { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.dsec > summary { cursor: pointer; font: 700 15px var(--display); color: var(--ink); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: 10px; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px 4px 0; }
table.t td { padding: 4px 8px 4px 0; border-top: 1px solid var(--line); vertical-align: top; }
.dwarn { background: var(--warn-soft); color: var(--warn); border-radius: var(--r-lg); padding: 9px 12px; font-size: var(--fs-base); margin-top: 10px; }
.dbad { background: var(--bad-soft); color: var(--bad); border-radius: var(--r-lg); padding: 9px 12px; font-size: var(--fs-base); margin-top: 10px; }
.members { display: grid; gap: 6px; }
.members button { text-align: left; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-lg); font-size: var(--fs-base); }
.members button:hover { border-color: var(--ink-2); }
.d-loading { padding: 40px 20px; color: var(--muted); }
@media (max-width: 720px) { .morepanel { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 80vh; overflow: auto; z-index: 56; border-radius: 20px 20px 0 0; border-width: 1px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0,0,0,.22); } }
/* The mockup hides every .seg on phones because the map FAB replaced the view switch. Until that
   exists (Phase 4) the inventory toggle and the grid/list switch have to stay reachable. */
@media (max-width: 720px) {
  .top .seg, .filters .seg { display: inline-flex; }
  .top .seg button { padding: 4px 8px; font-size: var(--fs-xs); }
  .top .wrap { gap: 6px; }
  .brand { gap: 6px; flex: none; }
  .status { gap: 2px; min-width: 0; white-space: nowrap; }
  .top .seg button { white-space: nowrap; }
  .refresh-btn { padding: 0 8px; }
  .data-trigger { padding: 0 2px; gap: 4px; font-size: var(--fs-xs); }
  .data-trigger .dot { display: none; }
  .top .brand b { font-size: 20px; }
  .top .brand .logo { width: 26px; height: 26px; }
}
/* Reduced motion: nothing slides, grows or loops, but state changes still read: colour, fill and opacity keep a short fade. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important;
      transition-property: color, background-color, border-color, opacity, visibility !important; transition-duration: .12s !important; }
}

/* Phase 4 (1/3): lazy text similarity, separate from duplicate candidates. */
.similar-section[hidden] { display: none; }
.similar-section { min-width: 0; }
.similar-section h4 { text-transform: none; letter-spacing: normal; }
.similar-content { min-width: 0; }
.similar-strip { display: flex; gap: 10px; max-width: 100%; min-width: 0; overflow-x: auto;
  list-style: none; margin: 0; padding: 2px 0 10px; scroll-snap-type: x proximity; }
.similar-strip > li { flex: 0 0 220px; min-width: 0; scroll-snap-align: start; }
.similar-mini { width: 100%; height: 100%; padding: 12px; display: flex; flex-direction: column;
  gap: 6px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.similar-mini:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.similar-mini .hood { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.similar-address { font: 700 18px/1.2 var(--display); overflow-wrap: anywhere; }
.similar-specs, .similar-split { font-size: var(--fs-xs); color: var(--muted); }
.similar-price { font-size: var(--fs-xl); font-weight: 600; }
.similar-bucket { align-self: flex-start; margin-top: auto; padding: 3px 6px; border-radius: var(--r-2xs);
  font-size: 11px; color: var(--muted); background: var(--surface-2); }
.similar-bucket.matches { color: var(--ok); background: var(--ok-soft); }
.similar-bucket.needs_review { color: var(--warn); background: var(--warn-soft); }
.similar-bucket.excluded { color: var(--bad); background: var(--bad-soft); }
.similar-coverage, .similar-note { margin: 8px 0 0; }
@media (max-width: 720px) {
  .similar-strip { scroll-snap-type: x mandatory; }
  .similar-strip > li { flex-basis: min(240px, 80vw); }
}

/* Phase 3 (3/3): header Datos popover. Existing action/editor styles stay separate. */
.data-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 32px;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-pill); color: var(--muted); padding: 4px 10px; }
.top .data-trigger { color: var(--ink); }
.data-trigger:hover, .data-trigger[aria-expanded="true"] { border-color: transparent; background: color-mix(in srgb, var(--bg) 45%, transparent); color: var(--ink); }
.data-popover[hidden] { display: none; }
.data-popover { position: fixed; top: 68px; right: max(8px, calc((100vw - 1440px) / 2 + 24px));
  z-index: 70; width: min(560px, calc(100vw - 16px)); max-height: calc(100dvh - 80px); overflow: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-hover); }
.data-popover > header { display: flex; align-items: center; justify-content: space-between; position: sticky;
  top: 0; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.data-popover h2 { margin: 0; font: 700 23px var(--display); }
.data-popover section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.data-popover section:last-child { border-bottom: 0; }
.data-popover h3 { margin: 0 0 8px; font-size: var(--fs-lg); }
.data-popover p { margin: 8px 0; }
.data-popover ul { padding-left: 18px; }
.data-popover li { margin: 6px 0; overflow-wrap: anywhere; }
.data-popover details { margin-top: 12px; }
.data-popover summary { cursor: pointer; color: var(--muted); font-size: var(--fs-xs); }
.data-popover pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-xs); }
.data-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 6px 12px; font-size: var(--fs-xs); }
.data-facts dt { color: var(--muted); }
.data-facts dd { margin: 0; overflow-wrap: anywhere; }
#dataRollback { display: grid; gap: 10px; }
#dataRollback label { display: grid; gap: 6px; }
#dataRollback select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit; padding: 8px; }
#dataRollback .btn { justify-self: start; }
#dataBody > p { margin: 18px; }
.data-error { margin: 12px 18px; color: var(--bad); }
.data-command { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }

/* Phase 3 (1/3): local decisions, corrections and Mis juicios. */
.feedback-controls, .drawer-feedback { display: inline-flex; align-items: center; gap: 2px; }
.feedback-btn.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.feedback-btn[data-feedback="saved"].on svg { fill: currentColor; }
.feedback-btn:disabled { cursor: wait; opacity: .7; }
.feedback-btn[data-choice="yes"].on { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.feedback-btn[data-choice="no"].on { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.feedback-btn[data-choice].on svg { fill: currentColor; }
.refresh-btn.running svg { animation: spin 1s linear infinite; }
@media (max-width: 720px) { .refresh-btn { padding: 0 9px; } .refresh-btn .lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { .refresh-btn.running svg { animation: none; } }
.notice .nlink { margin-left: 6px; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.d-head .acts { flex-wrap: wrap; }
.drawer-feedback { gap: 6px; flex-wrap: wrap; }
.judgement-controls { display: grid; gap: 14px; }
.stage-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.stage-filter .pillbtn.on { background: var(--ink); color: var(--surface); }
.tag.stage { font-weight: 600; }
.stage-select { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.stage-select select, .stage-date input { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; padding: 6px 8px; }
.stage-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.stage-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.stage-date { display: inline-flex; gap: 8px; align-items: center; margin-left: 10px; font-size: var(--fs-base); }
.contact-draft-label { display: grid; gap: 6px; }
.contact-draft { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; padding: 8px 10px; resize: vertical; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sent-prompt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding: 9px 12px; background: var(--warn-soft); border-radius: var(--r-lg); }
.sent-prompt[hidden] { display: none; }
.judgement-choice { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.judgement-choice small { width: 100%; color: var(--muted); }
.judgement-controls .seg { display: inline-flex; }
.note-form, .correction-form, #usageForm { display: grid; gap: 10px; }
.note-form label, .correction-form label, #usageForm label { display: grid; gap: 5px; min-width: 0; }
.judgement-choice select, .note-form textarea, .correction-form input, .correction-form textarea,
#usageForm input, #usageForm select, #usageForm textarea { width: 100%; min-width: 0; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; padding: 8px 10px; }
.judgement-choice select { width: auto; }
.note-form textarea, .correction-form textarea, #usageForm textarea { resize: vertical; }
.note-form .btn, .correction-form .btn, #usageForm .btn { justify-self: start; }
.judgements-page { max-width: 950px; margin: 18px auto 40px; }
.judgements-page h2 { font: 700 26px var(--display); }
.judgements-page section { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin: 14px 0; background: var(--surface); }
.judgements-page h3 { margin: 0 0 14px; font: 700 20px var(--display); }
.judgement-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.judgement-stats small { display: block; color: var(--muted); }
.judgement-stats strong { display: block; font-size: 24px; margin-top: 4px; }
.usage-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.judgement-export { display: flex; flex-wrap: wrap; gap: 8px; }
.export-counts { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: var(--fs-xs); }
.export-counts dd { margin: 0; color: var(--ink); font-weight: 600; }
.provenance { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-xs); margin: 0; }
@media (max-width: 720px) {
  .usage-fields { grid-template-columns: minmax(0, 1fr); }
  .judgement-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .judgements-page section { padding: 16px; }
  .feedback-controls .iconbtn { width: 30px; }
}

/* ======================================================= Phase 2.5: the search bar
   Tokens only. Controls are inputs, not chips: 40px (48px on phones), same radius and border as .ask. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
body.noscroll { overflow: hidden; }

/* One panel at every width. Desktop: inline under the tab bar, closed until "Editar requisitos" opens it (or an unsaved edit does).
   Phone: the same fields as a bottom sheet (see the phone block below). */
.sbar-wrap { position: relative; padding: 0; }
.sbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; flex: 1 1 auto; min-width: 0; }
.sheet-head { display: none; }
@media (min-width: 721px) {
  .sbar-wrap { display: none; margin: 12px 0 4px; padding: 14px 16px 16px; background: var(--surface-2); border-radius: var(--radius); }
  body.sbar-open .sbar-wrap { display: block; }
}
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.f-area { flex: 1 1 170px; min-width: 150px; max-width: 270px; }
.f-amb { flex: 0 1 116px; min-width: 104px; }
.f-money { flex: 0 1 262px; min-width: 236px; }
.f-m2 { flex: 0 1 124px; min-width: 112px; }
.cap { display: flex; align-items: center; gap: 6px; height: 14px; font-size: 11px; line-height: 1; color: var(--muted); font-weight: 500; }
.fld.dirty .cap::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ctl { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px; min-width: 0;
       background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
       font: inherit; font-size: var(--fs-lg); text-align: left; cursor: pointer; }
.ctl:hover { border-color: var(--ink-2); }
.ctl:focus-visible, .ctl:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.ctl .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl .val.ph, .ctl input::placeholder { color: var(--muted); }
.ctl > .i:first-child { color: var(--muted); }
.ctl .chev { width: 14px; height: 14px; color: var(--muted); flex: none; transition: transform .15s; }
.ctl[aria-expanded="true"] .chev { transform: rotate(180deg); }
.ctl input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; }
.ctl.money, .ctl.num { cursor: text; }
.ctl .pre { color: var(--muted); font-weight: 600; }
.ctl .suf { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.ctl:disabled, .ctl.disabled { opacity: .6; cursor: not-allowed; }
/* Unsaved: the changed control gets a 2px accent border (1px border + 1px ring, so nothing shifts) and a dot in its caption. */
.fld.dirty .ctl { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow);
                  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.fld.invalid .ctl { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad), var(--shadow); }
.ferr { font-size: var(--fs-2xs); line-height: 1.35; color: var(--bad); max-width: 300px; }
.ferr:empty { display: none; }
.help { font-size: var(--fs-2xs); line-height: 1.35; color: var(--muted); max-width: 300px; }
.focus-help { display: none; }
.f-m2:focus-within .focus-help { display: block; }

.joined { display: flex; width: 100%; }
.joined .sel { flex: 0 0 96px; min-width: 0; }
.joined .sel .ctl { border-radius: var(--radius) 0 0 12px; border-right-width: 0; }
.joined .ctl.money { border-radius: 0 12px 12px 0; }
.fld.dirty .joined .ctl.money { border-left-color: var(--accent); }

.fx { display: grid; gap: 6px; max-width: 330px; margin-top: 4px; }
.fx[hidden], .fx-fields[hidden] { display: none; }
.fx-line { font-size: var(--fs-2xs); line-height: 1.4; }
.fx-line.warn { background: var(--warn-soft); color: var(--warn); border-radius: var(--r-sm); padding: 7px 9px; }
.fx-line.ok { color: var(--muted); }
.fx-fields { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px; }
.fx-fields > div:last-child { grid-column: 1 / -1; }
.fx-fields > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cap2 { font-size: 10.5px; color: var(--muted); }
.fx-fields .ctl { height: 34px; font-size: var(--fs-base); padding: 0 8px; box-shadow: none; }
.fx-date { color-scheme: light dark; }

.f-save { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; }
.save-row { display: flex; align-items: center; gap: 6px; }
.btn.save { height: 40px; min-width: 108px; padding: 0 16px; border-radius: var(--radius); font-weight: 600; justify-content: center; }
.btn.save:disabled { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); cursor: default; opacity: 1; }
.btn.save.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.save.saved { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn .tick, .tick { width: 14px; height: 14px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.linkbtn { border: 0; background: none; padding: 0 4px; font: inherit; font-size: var(--fs-base); font-weight: 500; color: var(--accent); text-decoration: underline; cursor: pointer; white-space: nowrap; }
.linkbtn[hidden] { display: none; }
.linkbtn.disabled { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: not-allowed; }
.bar-err { max-width: 220px; }
.dot-dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Más filtros: a button, "Limpiar", and the panel */
.btn.more-btn { height: 40px; border-radius: var(--radius); padding: 0 14px; }
.btn.more-btn.on { border-color: var(--ink); background: var(--surface-2); }
.morepanel { z-index: 30; padding: 14px 16px 16px; }
.mfhead { display: grid; gap: 2px; margin-bottom: 8px; }
.mfhead b { font-size: var(--fs-lg); }
.mfhead span { font-size: var(--fs-xs); color: var(--muted); }
.mfrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-lg); }
.mfrow.col { flex-direction: column; align-items: stretch; gap: 8px; }
.swt { position: relative; width: 40px; height: 24px; flex: none; border: 0; border-radius: var(--r-pill); background: var(--bar-track); cursor: pointer; transition: background .15s; }
.swt i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.swt[aria-checked="true"] { background: var(--accent); }
.swt[aria-checked="true"] i { transform: translateX(16px); }
.swt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; white-space: nowrap; }

/* Pills: purple = the saved search (with ×), neutral = Más filtros (with ×) */
.pill { padding: 0 4px 0 10px; }
.pill .pbtn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0 2px; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.pill .px { width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: var(--fs-xl); line-height: 1; opacity: .65; cursor: pointer; }
.pill .px:hover, .pill .px:focus-visible { opacity: 1; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pill.ghost { padding: 0 10px; }
.pill.neutral { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); font-weight: 500; }
.pill.neutral .px:hover { background: var(--surface-2); }
.mine.swap .pill { animation: fadein .15s ease; }
.mine { gap: 6px; }

/* the combobox and select popups: position: fixed, so no sticky or scrolling parent can clip them */
.pop { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 6px; }
.pop[hidden] { display: none; }
.pop-list { list-style: none; margin: 0; max-height: min(280px, 45vh); overflow: auto; }
.opt { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-lg); }
.opt .o-l { flex: 1; }
.opt .o-h { color: var(--muted); font-size: var(--fs-xs); }
.opt.active, .opt:hover { background: var(--surface-2); }
.opt[aria-selected="true"] { font-weight: 600; }
.opt .tick { color: var(--accent); }
.cb-pop { width: 372px; max-width: calc(100vw - 16px); padding: 8px; }
.cb-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; margin-bottom: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); }
.cb-field:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.cb-chips { display: contents; }
.chip2 { display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 9px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); font-size: var(--fs-sm); font-weight: 600; }
.chip2 button { border: 0; background: none; color: inherit; font-size: var(--fs-xl); line-height: 1; padding: 0 5px; cursor: pointer; border-radius: 50%; }
.cb-input { flex: 1 1 110px; min-width: 90px; height: 26px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-lg); }
.cb-list { list-style: none; margin: 0; padding: 0; max-height: min(300px, 45vh); overflow: auto; }
.cbo { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 8px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; }
.cbo.active, .cbo:hover { background: var(--surface-2); }
.cbo .chk { width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); border-radius: var(--r-2xs); }
.cbo .chk .i { width: 12px; height: 12px; }
.cbo[aria-selected="true"] .chk { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.o-main { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
.o-n { font-weight: 600; font-size: var(--fs-lg); }
.o-k { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-sub { grid-column: 1 / -1; font-size: var(--fs-2xs); color: var(--muted); }
.cb-empty { padding: 12px 8px; color: var(--muted); font-size: var(--fs-base); }
.cb-strict { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; padding: 10px 8px 4px; border-top: 1px solid var(--line); font-size: var(--fs-md); cursor: pointer; }
.cb-strict input { accent-color: var(--accent); margin-top: 2px; }
.cb-strict small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.35; font-weight: 400; }
.cb-done { display: none; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* conversion line on cards, and the minimap */
.price .conv { margin-top: 1px; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.notice.conflict { background: var(--bad-soft); color: var(--bad); }
.mm-wrap { position: relative; margin-top: 8px; }
.minimap { height: 220px; margin-top: 0; }
.minimap .leaflet-control-attribution { font-size: 10px; line-height: 1.35; padding: 0 4px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); }
.minimap .leaflet-control-attribution a { color: var(--ink-2); }
.mm-recenter { margin-top: 6px !important; }
.mm-recenter a { display: grid; place-items: center; width: 30px; height: 30px; }
.mm-recenter .i { width: 16px; height: 16px; }
.mm-hint { position: absolute; inset: 0; z-index: 900; display: grid; place-items: center; padding: 0 20px; text-align: center; pointer-events: none;
           border-radius: var(--r-lg); background: color-mix(in srgb, var(--ink) 62%, transparent); color: var(--bg); font-weight: 600; font-size: var(--fs-md); opacity: 0; transition: opacity .2s; }
.mm-hint.show { opacity: 1; }

/* ---------------------------------------------------------------- phones: the sheet */
@media (max-width: 720px) {
  .btn.more-btn { height: 44px; }
  .sheet-scrim { z-index: 54; }
  .sbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 14px;
          max-height: 92vh; overflow-y: auto; padding: 0 16px; background: var(--surface); border-radius: 20px 20px 0 0;
          box-shadow: 0 -12px 40px rgba(0, 0, 0, .22); transform: translateY(106%); visibility: hidden;
          transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .25s; }
  .sbar.open { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; padding: 14px 0 6px; background: var(--surface); font-size: 16px; }
  .sbar .fld { flex: none; width: 100%; max-width: none; }
  .ctl { height: 48px; font-size: var(--fs-xl); }
  .joined .sel { flex-basis: 108px; }
  .fx, .help, .ferr { max-width: none; }
  .fx-fields { grid-template-columns: 108px minmax(0, 1fr); }
  .fx-fields .ctl { height: 44px; }
  .f-save { position: sticky; bottom: 0; z-index: 2; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .save-row { flex-direction: row-reverse; gap: 10px; }
  .btn.save { flex: 1; height: 48px; }
  #sbarDiscard { display: inline-flex !important; align-items: center; justify-content: center; height: 48px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
  #sbarDiscard[hidden] { opacity: .4; pointer-events: none; }
  .bar-err { max-width: none; }
  /* Barrio opens as a full-screen list with the search pinned at the top */
  .cb-pop.full:not([hidden]) { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 70; width: auto; max-width: none; border: 0; border-radius: 0; padding: 12px; box-shadow: none; }
  .cb-pop.full .cb-field { flex: none; }
  .cb-pop.full .cb-list { flex: 1; max-height: none; }
  .cb-pop.full .cb-strict { flex: none; }
  .cb-pop.full .cb-done { display: inline-flex; flex: none; justify-content: center; height: 48px; margin-top: 8px; }
  .cbo { padding: 12px 8px; }
  .opt { padding: 13px 10px; }
}

/* ===================================================== Phase 3 (2/3): "Más requisitos"
   A right-hand sheet on desktop, a bottom sheet on phones. Tokens only. */
.f-more { display: none; }
.more-req { align-self: flex-start; padding: 2px 0; }
.rq-scrim { z-index: 79; }
.rq { position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(560px, 100vw); display: flex; flex-direction: column;
      background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0, 0, 0, .14);
      transform: translateX(102%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.rq[hidden] { display: none; }
.rq.open { transform: none; }
.rq-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rq-head h2 { margin: 0; font: 700 22px/1.2 var(--display); letter-spacing: -.015em; }
.rq-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 24px; }
.rq-intro { margin: 14px 0 6px; font-size: var(--fs-base); line-height: 1.5; color: var(--ink-2); }
.rq-sec { border-bottom: 1px solid var(--line); }
.rq-sec > summary { display: flex; align-items: baseline; gap: 10px; padding: 14px 0; cursor: pointer; list-style: none; }
.rq-sec > summary::-webkit-details-marker { display: none; }
.rq-sec > summary::before { content: ""; flex: none; width: 7px; height: 7px; margin-right: 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
                            transform: translateY(-2px) rotate(-45deg); transition: transform .15s; }
.rq-sec[open] > summary::before { transform: translateY(-3px) rotate(45deg); }
.rq-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.rq-sec > summary b { font-size: var(--fs-xl); }
.rq-sum { margin-left: auto; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: var(--fs-sm); color: var(--muted); }
.rq-sec.has-error > summary b::after { content: "●"; margin-left: 6px; font-size: 9px; color: var(--bad); vertical-align: middle; }
.rq-secbody { display: grid; gap: 14px; padding: 0 0 18px; }
.rq-field { display: grid; gap: 5px; min-width: 0; }
.rq-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.rq-help { margin: 0; font-size: var(--fs-xs); line-height: 1.45; color: var(--muted); }
.rq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rq-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
           background: var(--surface); color: var(--ink-2); font: inherit; font-size: var(--fs-base); cursor: pointer; }
.rq-chip:hover { border-color: var(--ink-2); }
.rq-chip[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.rq-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rq-fx { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
.rq-fx > .rq-field:last-child { grid-column: 1 / -1; }
.rq-date { color-scheme: light dark; font-size: var(--fs-lg); }
.rq-slider { display: flex; align-items: center; gap: 10px; }
.rq-slider input { flex: 1; min-width: 0; accent-color: var(--accent); }
.rq-wval { width: 2.4em; text-align: right; font-weight: 600; font-feature-settings: "tnum" 1; }
.rq-weights { display: grid; gap: 10px; }
.rq-wrow { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 10px; font-size: var(--fs-md); }
.rq-switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-lg); }
.rq-pref { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rq-pref:empty { display: none; }
.rq-pi { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.rq-pi.dragging { background: var(--accent-soft); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.rq-pi .hd { display: grid; place-items: center; padding: 4px; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); cursor: grab; touch-action: none; }
.rq-pi .hd:focus-visible { outline: 2px solid var(--accent); }
.rq-pi .rk { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-2xs); font-weight: 700; }
.rq-pi .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-lg); font-weight: 600; }
.rq-pi .iconbtn { width: 30px; height: 30px; }
.rq-pi .iconbtn:disabled { opacity: .35; cursor: default; }
.rq-pi .up { transform: rotate(180deg); }
.rq-danger { display: grid; gap: 4px; padding: 18px 0 4px; }
.linkbtn.danger { justify-self: start; padding: 0; color: var(--bad); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--accent-ink); }
.conflict-note { font-weight: 500; }
.rq-foot { display: grid; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.rq-actions { display: flex; align-items: center; gap: 8px; }
.rq-state { margin-right: auto; font-size: var(--fs-sm); color: var(--muted); }
.rq-save { min-width: 156px; justify-content: center; }
.rq-save.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rq-save:disabled { opacity: .55; cursor: default; }
.rq-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-base); line-height: 1.45; }
.rq-confirm[hidden] { display: none; }
.rq-confirm span { flex: 1 1 100%; }
.rq-ask-scrim { z-index: 94; }
.rq-ask { position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); padding: 18px;
       background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-hover); }
.rq-ask b { font: 700 17px/1.3 var(--display); }
.rq-ask p { margin: 8px 0 14px; font-size: var(--fs-base); line-height: 1.45; color: var(--ink-2); }
.rq-ask .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rq-ask-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

@media (max-width: 720px) {
  .f-more { display: block; margin-top: -4px; }
  .f-save .more-req { display: none; }
  .rq { top: auto; left: 0; right: 0; width: auto; height: 92vh; max-height: 92vh; border-left: 0; border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, .22); transform: translateY(106%); }
  .rq.open { transform: none; }
  .rq-head { padding: 14px 16px 10px; }
  .rq-body, .rq-foot { padding-left: 16px; padding-right: 16px; }
  .rq-fx { grid-template-columns: 1fr; }
  .rq-sum { max-width: 46%; }
  .rq-chip { height: 44px; }
  .rq-actions .btn { height: 46px; }
  .rq-save { flex: 1; }
}

.rq:focus { outline: none; }

/* ============================================================== Phase 4 (2/3): the map view core */
.mapview { scroll-margin-top: 62px; }          /* land under the header and the sticky tabs */
.mi { cursor: pointer; }
.mi:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ml-head b { font-weight: 600; }
.mapbox .leaflet-control-attribution { font-size: 10px; line-height: 1.35; padding: 0 4px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); }
.mapbox .leaflet-control-attribution a { color: var(--ink-2); }

/* ------------------------------------------------- Phase 4 (3/3): clusters, list notes, "Ver en el mapa" */
.pin-cluster { background: none; border: 0; }
.pin-cluster .cl { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 42px; padding: 5px 9px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); border: 2px solid var(--surface);
  box-shadow: var(--shadow-hover); font-family: var(--sans, inherit); line-height: 1.1; white-space: nowrap; cursor: pointer; }
.pin-cluster .cl b { font-size: var(--fs-lg); font-weight: 700; }
.pin-cluster .cl span { font-size: 10.5px; font-weight: 500; opacity: .92; }
.pin-cluster:hover .cl { background: var(--ink); color: var(--bg); }
.fab[hidden] { display: none !important; }
.see-map { display: inline-block; margin-top: 6px; padding-left: 0; }
@media (max-width: 720px) {
  .maplist { padding-bottom: 72px; }          /* the floating button never covers the last row */
  .ml-head { flex-wrap: wrap; }
}

/* listing photos (hotlinked; an image that fails to load removes itself) */
.d-photos { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scroll-snap-type: x proximity; }
.d-photos a { flex: 0 0 auto; scroll-snap-align: start; }
.d-photos img { height: 190px; width: auto; max-width: 78vw; border-radius: var(--r-lg); display: block; background: var(--line); }
.refresh-btn[hidden] { display: none; }

/* Keyboard triage: current-card marker and the shortcuts panel. */

.shortcuts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 14px 16px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  font-family: var(--sans);
  font-style: normal;
}
.shortcuts[hidden] { display: none; }
.shortcuts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.shortcuts-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.shortcuts-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.shortcuts-close:hover { background: var(--accent-soft); color: var(--ink); }
.shortcuts-close:focus-visible, .shortcuts kbd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shortcuts-close svg { width: 16px; height: 16px; }
.shortcuts-list { margin: 0; display: grid; gap: 2px; }
.shortcuts-list > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.shortcuts-list > div:first-child { border-top: 0; }
.shortcuts-list dt { margin: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.shortcuts-list dd { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.shortcuts kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xs);
}

@media (max-width: 719px) {
  .shortcuts {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 380px) {
  .top .wrap { padding: 0 10px; gap: 4px; }
  .top .seg button { padding: 4px 6px; font-size: var(--fs-2xs); }
  .top .brand .logo { display: none; }
}
.seg button, .status, .brand b { white-space: nowrap; }
@media (max-width: 1100px) and (min-width: 721px) { .brand span { display: none; } .status .txt { display: none; } }

/* chevron next to "Datos" and the small × in pills are drawn icons, not glyphs */
.data-trigger .chev { width: 12px; height: 12px; }
.pill .px svg.i { width: 12px; height: 12px; stroke-width: 2.2; }
.linkbtn svg.i { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.chk-ic svg.i, .checks .ic svg.i { width: 14px; height: 14px; }
/* a lone photo fills the drawer column; two or more scroll as a strip */
.d-photos:has(> a:only-child) img { width: 100%; max-width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
/* the one authored moment: the sun rises into the band once */
@media (prefers-reduced-motion: no-preference) {
  .hero .sunrise { animation: rise 1.2s var(--ease) both; }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: .85; } }
}
@media (max-width: 720px) {
  .crit { display: none !important; }
  .data-trigger { padding: 4px 2px; gap: 4px; font-size: var(--fs-xs); }
  .view button { min-height: 44px; }
  /* 44px touch targets without making the chips taller: the hit area grows past the pill */
  .pill .pbtn, .pill .px, .pill.edit { position: relative; }
  .pill .pbtn::after, .pill .px::after, .pill.edit::after { content: ""; position: absolute; inset: -8px -2px; }
  .iconbtn, .feedback-controls .iconbtn, .contact-choice .iconbtn { min-width: 44px; min-height: 44px; }
}

/* Audit round: phone hit areas for the header and drawer controls grow past the visible control instead of reshaping it */
@media (max-width: 720px) {
  .top .seg button, .data-trigger, .refresh-btn, .themebtn { position: relative; }
  .top .seg button::after, .data-trigger::after, .refresh-btn::after, .themebtn::after { content: ""; position: absolute; inset: -8px -2px; }
  .drawer-feedback .btn, .d-head .btn, .d-head .linkbtn { min-height: 44px; }
}

/* a row with no requirements to check says so quietly instead of showing a green check */
.why.none { color: var(--ink-2); font-weight: 500; }
.price .total .nodata { font: 600 18px var(--display); color: var(--ink-2); }
.price .conv.unk { color: var(--muted); font-weight: 400; }
@media (max-width: 720px) { .listhead .btn.more-btn, .sortlbl select.chip { min-height: 44px; } }

/* the public copy's "Seguir en otro dispositivo" button: its label is long, so it collapses to an icon below 1000px */
@media (max-width: 1000px) { #followBtn .lbl { display: none; } #followBtn { padding: 0 9px; } }
@media (max-width: 720px) { #followBtn { position: relative; } #followBtn::after { content: ""; position: absolute; inset: -8px -2px; } }

/* In-place answer (PR 2) */
.answer-panel { margin-top: 8px; }
.answer-label { display: block; font-size: 13px; }
.answer-row { display: flex; gap: 6px; margin-top: 6px; }
.answer-row input { flex: 1; min-width: 0; }
.answer-done { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; }
.answer-flash { animation: answerFlash 1.6s ease-out; }
@keyframes answerFlash {
  0% { outline: 3px solid var(--accent, #2563eb); outline-offset: 2px; }
  100% { outline: 3px solid transparent; outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .answer-flash { animation: none; outline: 2px solid var(--accent, #2563eb); }
}

/* Hoy places (PR 3) */
.hoy-sec { margin-bottom: 28px; }
.hoy-sec .section-title { font-size: 15px; margin: 18px 0 12px; }
.hoy-fresh { margin: 4px 0 8px; }
