/* Les Terrasses du Lac — 3D viewer. Light, phone first.
   FONTS: no variable fonts. System stack for now; to use static OFL fonts, drop the files in fonts/
   and uncomment the @font-face blocks below, then they take over through the variables. */
/*
@font-face { font-family: "TDL Display"; src: url("../fonts/Display-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TDL UI"; src: url("../fonts/UI-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TDL UI"; src: url("../fonts/UI-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
*/
:root {
  --font-display: "TDL Display", Georgia, "Times New Roman", serif;
  --font-ui: "TDL UI", "Segoe UI", Arial, sans-serif;

  --green-deep: #2c4a2e;
  --green: #4a8550;
  --green-soft: #90cd98;
  --cream: #f8f5ef;
  --paper: #fffdf8;
  --line: #e0dbd0;
  --ink: #1a2a1a;
  --muted: #587058;
  --st-disponible: #3a6e40;  --st-disponible-bg: #e3efe4; --st-disponible-dot: #4a8550;
  --st-reserve: #a85410;     --st-reserve-bg: #fbebd9;     --st-reserve-dot: #e07820;
  --st-vendu: #a82828;       --st-vendu-bg: #f6dcdc;       --st-vendu-dot: #c03030;

  --hover: #ece7da; --hover2: #f3efe4; --sel: #e9f1ea; --hair: #efeadf; --scroll: #c9c3b4; --sep: #b3ab99; --grab: #cfc9ba;
  --disabled-bg: #f4f1e8; --disabled-fg: #7b8a7b; --tip-sub: #d6e6d6; --stage-bg: #e9f0f0; --glass: rgba(255,253,248,.93);
  color-scheme: light dark;
  --header-h: 56px;
  --panel-w: 410px;
  --list-w: 372px;
  --r: 14px;
  --shadow: 0 1px 2px rgba(26,42,26,.10), 0 12px 32px -8px rgba(26,42,26,.22);
  --ease: cubic-bezier(.16,1,.3,1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 400 15px/1.45 var(--font-ui); color: var(--ink); background: var(--cream); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
::selection { background: var(--green-soft); color: var(--green-deep); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 8px; }
.num, dd, .price-v, td { font-variant-numeric: tabular-nums; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ───────── header ───────── */
#top { flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; min-height: var(--header-h);
  padding: 8px 16px; background: var(--cream); border-bottom: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-title { font-family: var(--font-display); font-size: 19px; color: var(--green-deep); white-space: nowrap; letter-spacing: .005em; }
.brand-place { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
#crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
#crumbs::-webkit-scrollbar { display: none; }
#crumbs .sep { color: var(--sep); flex: none; width: 16px; height: 16px; }
#crumbs button { background: none; border: 0; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 14px; }
#crumbs button:hover { background: var(--hover); color: var(--green-deep); }
#crumbs button[aria-current="page"] { color: var(--green-deep); font-weight: 600; cursor: default; }
#crumbs button[aria-current="page"]:hover { background: none; }
#crumbs .back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px 6px 6px; margin-right: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--green-deep); }
#crumbs .back svg { width: 16px; height: 16px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--green-deep); background: transparent; color: var(--green-deep); font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
.pill-btn svg { width: 18px; height: 18px; }
.pill-btn:hover, .pill-btn[aria-expanded="true"] { background: var(--green-deep); color: var(--cream); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--paper); }
.lang button { border: 0; background: none; padding: 0 11px; height: 32px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.lang button[aria-pressed="true"] { background: var(--green-deep); color: var(--cream); }

/* ───────── stage ───────── */
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--stage-bg); }
#canvasHost { position: absolute; inset: 0; touch-action: none; }
#canvasHost canvas { display: block; width: 100%; height: 100%; outline: none; }
#app[data-hover="1"] #canvasHost canvas { cursor: pointer !important; }

.float { position: absolute; z-index: 5; }
#hint { position: absolute; z-index: 5; top: 14px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 140px);
  padding: 8px 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 14px; color: var(--green-deep); text-align: center; pointer-events: none; transition: opacity .3s, transform .5s var(--ease); }
#hint:empty, #app[data-apt="open"] #hint { opacity: 0; transform: translate(-50%, -8px); }

#tooltip { position: absolute; z-index: 8; pointer-events: none; padding: 9px 13px; border-radius: 10px; background: var(--green-deep); color: var(--cream); box-shadow: var(--shadow); max-width: 240px; transform: translate(14px, 14px); }
#tooltip[hidden] { display: none; }
#tooltip b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 17px; line-height: 1.2; }
#tooltip span { font-size: 12.5px; color: var(--tip-sub); }
#tooltip .st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

#pins { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; width: 38px; height: 38px; margin: -52px 0 0 -19px; border-radius: 50%; border: 0; pointer-events: auto;
  background: var(--green-deep); color: var(--cream); font-family: var(--font-display); font-size: 18px; box-shadow: 0 2px 4px rgba(26,42,26,.25), 0 8px 18px -4px rgba(26,42,26,.4);
  transition: opacity .3s, scale .2s; will-change: transform; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 2px; height: 10px; margin-left: -1px; background: var(--green-deep); opacity: .6; }
.pin:hover { scale: 1.08; background: var(--green); }
.pin[hidden] { display: none; }
.pin.dim { opacity: .55; }

#compass { position: absolute; z-index: 5; top: 14px; right: 14px; width: 46px; text-align: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
#compass svg { display: block; width: 40px; height: 40px; margin: 0 auto 1px; transition: transform .05s linear; stroke-width: 1; }
#compass circle { fill: var(--glass); stroke: var(--line); }
#compass .n { fill: var(--green-deep); stroke: none; } #compass .s { fill: var(--scroll); stroke: none; }

#legend { position: absolute; z-index: 5; left: 14px; bottom: 14px; display: flex; gap: 14px; align-items: center; padding: 9px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; }
#legend .it { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#legend .dot { width: 10px; height: 10px; border-radius: 50%; }
#legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
#indicative { position: absolute; z-index: 4; right: 14px; bottom: 14px; font-size: 12px; letter-spacing: .06em; color: var(--ink); background: var(--glass); padding: 4px 10px; border-radius: 999px; pointer-events: none; }

#levelNav { position: absolute; z-index: 6; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); transition: right .5s var(--ease); }
#levelNav[hidden] { display: none; }
#levelNav button { width: 58px; height: 42px; border: 0; border-radius: 10px; background: none; font-size: 13px; color: var(--muted); font-weight: 600; }
#levelNav button:hover { background: var(--hover); color: var(--green-deep); }
#levelNav button[aria-pressed="true"] { background: var(--green-deep); color: var(--cream); }

/* ───────── panels ───────── */
.icon-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--green-deep); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--hover); }

#listPanel, #aptPanel { position: absolute; z-index: 10; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; visibility: hidden; transition: transform .5s var(--ease), opacity .3s, visibility 0s .5s; }
#listPanel { left: 12px; top: 12px; bottom: 12px; width: var(--list-w); transform: translateX(-20px); opacity: 0; }
#app[data-list="open"] #listPanel { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
#aptPanel { right: 12px; top: 12px; bottom: 12px; width: var(--panel-w); transform: translateX(24px); opacity: 0; overflow-y: auto; }
#app[data-apt="open"] #aptPanel { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
#app[data-apt="open"] #levelNav { right: calc(var(--panel-w) + 28px); }
.sheet-grab { display: none; }
#aptPanel .close { position: absolute; top: 12px; right: 12px; z-index: 6; }

.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; }
.panel-head h2 { margin: 0; font: 400 22px/1.1 var(--font-display); color: var(--green-deep); }
.panel-head .muted { margin-left: auto; font-size: 13px; }

#filters { padding: 2px 18px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.fgroup { display: grid; grid-template-columns: 74px 1fr; align-items: start; gap: 8px; }
.fgroup > label { font-size: 12.5px; color: var(--muted); padding-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green-deep); border-color: var(--green-deep); color: var(--cream); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .c { font-size: 11.5px; opacity: .75; }
.chip[disabled] { opacity: .4; cursor: default; }

.rows { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 10px 10px; border: 0; background: none; border-radius: 10px; border-bottom: 1px solid var(--hair); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.row:hover { background: var(--hover2); border-radius: 10px; }
.row[aria-current="true"] { background: var(--sel); border-radius: 10px; }
.row .a { font-weight: 600; color: var(--green-deep); }
.row .b { font-size: 13px; color: var(--muted); grid-column: 1; }
.row .p { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.row .s { grid-column: 2; grid-row: 2; justify-self: end; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.row .s i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty button { margin-top: 10px; }

/* apartment card */
#aptBody { padding: 22px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.apt-head { padding-right: 44px; }
.apt-head h2 { margin: 0; font: 400 30px/1.05 var(--font-display); color: var(--green-deep); letter-spacing: -.005em; }
.apt-sub { margin: 6px 0 0; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status i { width: 9px; height: 9px; border-radius: 50%; }
.status.disponible { background: var(--st-disponible-bg); color: var(--st-disponible); } .status.disponible i { background: var(--st-disponible-dot); }
.status.reserve { background: var(--st-reserve-bg); color: var(--st-reserve); } .status.reserve i { background: var(--st-reserve-dot); }
.status.vendu { background: var(--st-vendu-bg); color: var(--st-vendu); } .status.vendu i { background: var(--st-vendu-dot); }
.specs { margin: 0; display: grid; }
.specs > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
.price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.price-l { color: var(--muted); }
.price-v { font: 400 26px/1.1 var(--font-display); color: var(--green-deep); }
.price-v.req { font-size: 20px; }
.plan-btn { position: relative; display: block; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.plan-btn img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.plan-btn .zoom { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: var(--green-deep); color: var(--cream); font-size: 12px; }
.plan-btn .zoom svg { width: 14px; height: 14px; }
.plan-btn:hover { border-color: var(--green); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--green-deep); background: transparent; color: var(--green-deep); font-weight: 600; font-size: 14px; text-decoration: none; text-align: center; line-height: 1.15; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--green-deep); color: var(--cream); }
.btn.primary:hover { background: var(--green); border-color: var(--green); }
.btn[aria-disabled="true"] { border-color: var(--line); color: var(--disabled-fg); background: var(--disabled-bg); cursor: default; pointer-events: none; flex-direction: column; gap: 0; }
.btn small { font-weight: 400; font-size: 11.5px; }
button.btn { font-family: inherit; cursor: pointer; }
.btn .tag { flex: none; padding: 2px 6px; border-radius: 6px; border: 1px solid currentColor; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; line-height: 1; opacity: .85; }
.btn.wide { grid-column: 1 / -1; }

/* round 21b: panorama viewer ("Vue" of a flat) */
#pano { position: fixed; inset: 0; z-index: 150; background: #101611; overflow: hidden; touch-action: none; overscroll-behavior: contain; }
#pano[hidden] { display: none; }
.pano-stage { position: absolute; inset: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.pano-stage.grab { cursor: grabbing; }
.pano-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; -webkit-user-drag: none; }
.pano-load { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 12px; color: #c9d6c6; font-size: 14px; pointer-events: none; }
#pano.loading .pano-load { display: grid; }
.pano-load i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #a5dcad; animation: panospin .9s linear infinite; }
@keyframes panospin { to { transform: rotate(360deg); } }
.pano-err { position: absolute; left: 50%; top: 45%; transform: translateX(-50%); padding: 12px 16px; border-radius: 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.pano-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: var(--glass); box-shadow: var(--shadow); }
.pano-nav { position: absolute; z-index: 3; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.pano-nav .icon-btn { background: var(--glass); box-shadow: var(--shadow); width: 40px; height: 40px; }
.pano-sep { height: 6px; }
.pano-cap { position: absolute; z-index: 3; left: 14px; bottom: 14px; max-width: min(640px, calc(100% - 28px)); box-sizing: border-box; padding: 10px 16px; border-radius: 14px; background: var(--glass); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 2px; pointer-events: none; }
.pano-cap b { font: 600 14px/1.3 var(--font-ui); }
.pano-cap span { font-size: 13px; color: var(--muted); }
.pano-cap em { font-style: normal; font-size: 12px; color: var(--muted); }
@media (max-width: 760px), (max-height: 500px) {
  .pano-nav { top: auto; bottom: 14px; right: 14px; transform: none; flex-direction: row; }
  .pano-nav .icon-btn { width: 44px; height: 44px; }
  .pano-sep { width: 6px; height: auto; }
}
@media (max-width: 760px) {
  .pano-cap { left: 10px; right: 10px; max-width: none; bottom: 70px; padding: 8px 12px; }
  .pano-cap em { display: none; }
}
@media (max-height: 500px) { .pano-cap { max-width: calc(100% - 330px); padding: 6px 12px; } .pano-cap em { display: none; } .pano-cap b { font-size: 13px; } }

/* loading / notice / lightbox */
#loading { position: absolute; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--cream); color: var(--muted); transition: opacity .6s, visibility 0s .6s; }
#loading.done { opacity: 0; visibility: hidden; pointer-events: none; }
#loading img { animation: breathe 2s ease-in-out infinite; }
#loading::after { content: ""; display: block; width: 160px; height: 3px; border-radius: 2px; background: linear-gradient(var(--green), var(--green)) left / calc(var(--p, 0.05) * 100%) 100% no-repeat, var(--line); }
@keyframes breathe { 50% { opacity: .45; } }
#notice { position: absolute; z-index: 25; left: 50%; top: 40%; transform: translateX(-50%); width: min(420px, calc(100% - 32px)); padding: 16px 18px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
#lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20,32,20,.92); display: flex; }
#lightbox[hidden] { display: none; }
#lightbox .icon-btn { position: absolute; top: 14px; right: 14px; z-index: 2; }
.lb-scroll { flex: 1; overflow: auto; display: grid; place-items: center; padding: 56px 12px 12px; }
.lb-scroll img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; cursor: zoom-in; }
.lb-scroll.zoomed { place-items: start; }
.lb-scroll.zoomed img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }

/* ───────── phone ───────── */
@media (max-width: 760px) {
  :root { --header-h: 52px; }
  #top { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 6px 12px 4px; }
  .brand-title { font-size: 17px; }
  #crumbs { grid-column: 1 / -1; grid-row: 2; margin: 0 -6px; }
  #crumbs button { padding: 5px 6px; font-size: 13.5px; }
  .pill-btn { height: 36px; padding: 0 12px 0 10px; }
  .lang button { height: 30px; padding: 0 9px; }
  #hint { top: 10px; font-size: 13px; padding: 7px 13px; max-width: calc(100% - 96px); }
  #compass { top: 10px; right: 10px; width: 40px; } #compass svg { width: 34px; height: 34px; }
  #legend { left: 10px; bottom: 10px; gap: 10px; padding: 7px 11px; font-size: 12px; }
  #indicative { right: auto; left: 50%; transform: translateX(-50%); bottom: 54px; font-size: 11px; white-space: nowrap; }
  #levelNav { right: 8px; top: 46%; }
  #levelNav button { width: 52px; height: 38px; font-size: 12px; }
  #app[data-apt="open"] #levelNav, #app[data-apt="open"] #legend, #app[data-apt="open"] #indicative { display: none; }

  #listPanel { inset: 0; width: auto; border-radius: 0; border: 0; transform: translateY(24px); }
  #aptPanel { --sheet-h: 56%; left: 0; right: 0; top: auto; bottom: 0; width: auto; height: var(--sheet-h); border-radius: 18px 18px 0 0; border-bottom: 0; transform: translateY(100%); transition: transform .5s var(--ease), height .35s var(--ease), visibility 0s .5s; }
  #aptPanel[data-snap="peek"] { --sheet-h: 150px; } #aptPanel[data-snap="full"] { --sheet-h: 92%; }
  #aptPanel.dragging { transition: none; }
  .sheet-grab { display: block; position: sticky; top: 0; z-index: 3; flex: none; height: 24px; background: var(--paper); cursor: grab; touch-action: none; }
  .sheet-grab span { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--grab); margin: 10px auto 0; }
  #aptPanel .close { top: 14px; right: 12px; }
  #aptBody { padding: 4px 18px 28px; gap: 14px; }
  .apt-head h2 { font-size: 26px; }
  .plan-btn img { max-height: 240px; }
  #filters { padding-bottom: 10px; }
}
/* ───────── context toggle (Maquette / Photo réelle) ───────── */
#ctxToggle { position: absolute; z-index: 6; right: 14px; bottom: 50px; display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow); font-size: 13px; overflow: hidden; }
#ctxToggle[hidden] { display: none; }
#ctxToggle .ctx-label { color: var(--muted); margin-right: 6px; }
#ctxToggle button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-weight: 600; font-size: 13px; }
#ctxToggle button:hover { background: var(--hover); color: var(--green-deep); }
#ctxToggle button[aria-pressed="true"] { background: var(--green-deep); color: var(--cream); }
#ctxToggle .ctx-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--green); transition: width .3s; opacity: 0; }
#ctxToggle[data-loading="1"] .ctx-bar { opacity: 1; }
#ctxToggle[data-loading="1"] button[data-ctx="photo"]::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: currentColor; animation: breathe 1s ease-in-out infinite; }
@media (max-width: 760px) { #ctxToggle { right: 10px; bottom: 92px; padding-left: 10px; } #ctxToggle .ctx-label { display: none; } }
@media (prefers-color-scheme: dark) { #ctxToggle button[aria-pressed="true"] { color: #0f1812; } }

/* ───────── labels on apartments, filter badge ───────── */
#aptLabels { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.aptlabel { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px; border: 1px solid var(--green-deep);
  background: var(--glass); color: var(--green-deep); font-size: 12.5px; font-weight: 600; pointer-events: auto; box-shadow: 0 4px 10px -4px rgba(26,42,26,.35); white-space: nowrap; will-change: transform; font-variant-numeric: tabular-nums; }
.aptlabel .dot { width: 9px; height: 9px; border-radius: 50%; }
.aptlabel:hover, .aptlabel.hot { background: var(--green-deep); color: var(--cream); }
.aptlabel[hidden] { display: none; }
/* round 7: tags on the apartments of the open (exploded) building: number · rooms · m², status dot. Phone: the number only. */
.xtag { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; border: 1px solid var(--green-deep);
  background: var(--glass); color: var(--green-deep); font: 600 12px/1 var(--font-ui); pointer-events: none; box-shadow: 0 4px 10px -4px rgba(26,42,26,.35); white-space: nowrap; will-change: transform;
  font-variant-numeric: tabular-nums; opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s .18s, background-color .15s, color .15s; cursor: pointer; }
.xtag.on { opacity: 1; visibility: visible; transition: opacity .25s .1s, background-color .15s, color .15s; }
.xtag::after { content: ""; position: absolute; left: calc(50% + var(--lead, 0px)); bottom: calc(-8px - var(--lift, 0px)); width: 1px; height: calc(8px + var(--lift, 0px)); background: var(--green-deep); opacity: .55; }
.xtag .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--glass); }
.xtag b { font-weight: 700; }
.xtag .more { display: none; font-weight: 500; opacity: .82; padding-left: 6px; border-left: 1px solid var(--line); }
.xtag.hot .more, .xtags-full .xtag .more { display: inline; }   /* round 9: rooms and m2 only on the hovered / chosen flat (?tags=full: always) */
.xtag:focus-visible, .xtag.hot { background: var(--green-deep); color: var(--cream); z-index: 2; }
.xtag.on.mute { opacity: .45; }
.xtag.on.mute.hot { opacity: 1; }
@media (max-width: 760px) { .xtag { height: 22px; padding: 0 7px 0 6px; gap: 5px; font-size: 11.5px; } .xtags-full .xtag:not(.hot) .more { display: none; } }
#filterBadge { position: absolute; z-index: 6; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 14px; border-radius: 999px; border: 1px solid var(--green-deep); background: var(--glass); color: var(--green-deep); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
#filterBadge[hidden] { display: none; }
#filterBadge svg { width: 16px; height: 16px; }
#app[data-list="open"] #filterBadge { display: none; }
.brand img { border-radius: 50%; }

/* ───────── dark theme (follows the system; light stays the default look) ───────── */
@media (prefers-color-scheme: dark) {
  :root {
    --green-deep: #a5dcad; --green: #6fb879; --green-soft: #2f5a36;
    --cream: #0f1812; --paper: #172119; --line: #2b392d; --ink: #e8efe5; --muted: #9db39d;
    --st-disponible: #94d69f; --st-disponible-bg: #1e3524; --st-disponible-dot: #5fb36b;
    --st-reserve: #f0a763;    --st-reserve-bg: #3b2a17;    --st-reserve-dot: #e8873a;
    --st-vendu: #f08a8a;      --st-vendu-bg: #3d1e1e;      --st-vendu-dot: #d95454;
    --hover: #223024; --hover2: #1d2a1f; --sel: #21392a; --hair: #243126; --scroll: #3a4a3c; --sep: #5b6e5d; --grab: #44564a;
    --disabled-bg: #1b251d; --disabled-fg: #6f836f; --tip-sub: #2a4a2e; --stage-bg: #16222a; --glass: rgba(23,33,25,.92);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -8px rgba(0,0,0,.6);
  }
  .brand img { background: #f8f5ef; padding: 2px; }
  .lang button[aria-pressed="true"], .chip[aria-pressed="true"], .pill-btn:hover, .pill-btn[aria-expanded="true"], #levelNav button[aria-pressed="true"] { color: #0f1812; }
  .btn.primary, .btn.primary:hover { color: #0f1812; }
  .plan-btn .zoom { color: #0f1812; }
  .plan-btn { background: #f4f1ea; }
  #tooltip span { color: #1f3a24; }
  #compass circle { fill: var(--glass); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* round 5, revision 1: narrow phones. The title never runs under the "Liste" button (layout only, same fonts). */
.brand-text { overflow: hidden; }
.brand-title { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 430px) {
  #top { gap: 4px 8px; padding-left: 10px; padding-right: 10px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand-title { font-size: 15.5px; }
  .top-actions { gap: 6px; }
  .pill-btn { padding: 0 10px 0 8px; gap: 5px; font-size: 13px; }
  .lang button { padding: 0 7px; font-size: 12px; }
}

/* round 10: short veil in the studio ground colour while the studio view of a furnished flat comes or goes */
.xveil { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .45s ease; }
.xveil.on { opacity: 1; transition: opacity .17s ease; }
@media (prefers-reduced-motion: reduce) { .xveil { transition: none; } }

/* round 11: switcher between the versions of a furnished flat (studio view); same pill language as the level bar */
.xsnap { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0; }
.xsnap.fade { animation: xsnap .42s ease-out both; }
@keyframes xsnap { from { opacity: 1; } to { opacity: 0; } }
.xstyle { position: absolute; z-index: 6; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 28px); box-sizing: border-box; padding: 5px 5px 5px 15px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); }
.xstyle[hidden] { display: none; }
.xstyle-t { flex: none; font: 600 10.5px/1 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.xstyle-row { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px; margin: -2px; }
.xstyle-row::-webkit-scrollbar { display: none; }
.xstyle button { flex: none; position: relative; height: 38px; padding: 0 15px; border: 0; border-radius: 10px; background: none; font: 600 13px/1 var(--font-ui); color: var(--muted); white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s; }
.xstyle button:hover { background: var(--hover); color: var(--green-deep); }
.xstyle button[aria-checked="true"] { background: var(--green-deep); color: var(--cream); }
.xstyle button:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.xstyle-sep { flex: none; width: 1px; height: 20px; margin: 0 6px; background: var(--line); }
.xstyle button.busy { padding-left: 32px; }
.xstyle button.busy::before { content: ""; position: absolute; left: 12px; top: 50%; width: 11px; height: 11px; margin-top: -7.5px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: xspin .7s linear infinite; }
@keyframes xspin { to { transform: rotate(360deg); } }
.xstyle.more-r .xstyle-row { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
.xstyle.more-l .xstyle-row { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 34px), transparent); }
.xstyle.more-l.more-r .xstyle-row { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); }
.xstyle.narrow { flex-direction: column; align-items: stretch; gap: 6px; max-width: none; padding: 8px 5px 5px; }
.xstyle.narrow .xstyle-t { padding-left: 10px; }
.xstyle.narrow button { height: 36px; padding: 0 13px; }
.xstyle.narrow button.busy { padding-left: 30px; }
@media (prefers-color-scheme: dark) { .xstyle button[aria-checked="true"] { color: #0f1812; } }
@media (prefers-reduced-motion: reduce) { .xsnap.fade { animation: none; } .xstyle button.busy::before { animation: none; border-right-color: currentColor; opacity: .5; } }

/* round 12: wall height slider and walk button (studio view of a furnished flat), walk mode */
.xtools { position: absolute; z-index: 6; left: 14px; bottom: 72px; display: flex; align-items: center; gap: 8px; }
.xtools[hidden], .xwall[hidden], .xwalk-btn[hidden], .xwalk-hint[hidden] { display: none; }
.xwall { display: flex; align-items: center; gap: 12px; height: 44px; box-sizing: border-box; padding: 0 14px 0 15px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); }
.xwall-t { flex: none; font: 600 10.5px/1 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.xwall input { flex: 1; min-width: 70px; width: 170px; height: 22px; margin: 0; accent-color: var(--green-deep); cursor: pointer; }
.xwall input:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 3px; border-radius: 6px; }
.xwall-v { flex: none; min-width: 98px; text-align: right; font: 600 13px/1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--green-deep); white-space: nowrap; }
.xwalk-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 15px; border-radius: 14px; border: 1px solid var(--green-deep); background: var(--green-deep); color: var(--cream); font: 600 13px/1 var(--font-ui); white-space: nowrap; box-shadow: var(--shadow); cursor: pointer; transition: filter .15s; }
.xwalk-btn:hover { filter: brightness(1.14); }
.xwalk-btn:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 3px; }
.xwalk-btn svg { width: 16px; height: 16px; flex: none; }
.xwalk-hint { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); padding: 9px 15px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); font: 500 13px/1.2 var(--font-ui); color: var(--green-deep); white-space: nowrap; pointer-events: none; }
.xtools.narrow { left: 8px; right: 8px; }
.xtools.narrow .xwall { flex: 1; min-width: 0; height: 42px; gap: 8px; padding: 0 10px 0 12px; }
.xtools.narrow .xwall-t { display: none; }
.xtools.narrow .xwall input { width: auto; min-width: 50px; }
.xtools.narrow .xwall-v { min-width: 0; }
.xtools.narrow .xwalk-btn { height: 42px; padding: 0 14px 0 12px; }
.xtools.narrow.walking { justify-content: center; }
#app[data-walk="1"] #aptPanel, #app[data-walk="1"] #levelNav, #app[data-walk="1"] #legend, #app[data-walk="1"] #compass, #app[data-walk="1"] #hint, #app[data-walk="1"] #indicative,
#app[data-walk="1"] #filterBadge, #app[data-walk="1"] #ctxToggle, #app[data-walk="1"] #pins, #app[data-walk="1"] #aptLabels { visibility: hidden !important; pointer-events: none !important; }
#app[data-walk="1"] #canvasHost canvas { cursor: grab; }
@media (prefers-color-scheme: dark) { .xwalk-btn { color: #0f1812; } }

/* round 18: "Espaces communs" view - marker, list entry, layer bar */
.xcm-pin { position: absolute; left: 0; top: 0; z-index: 4; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px 0 12px; margin: -52px 0 0 0; border-radius: 999px; border: 0; pointer-events: auto; cursor: pointer;
  background: var(--green-deep); color: var(--cream); font: 600 13px/1 var(--font-ui); white-space: nowrap; box-shadow: 0 8px 18px -8px rgba(26,42,26,.55); translate: -50% 0; transition: background-color .15s, scale .15s; }
.xcm-pin::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 2px; height: 10px; margin-left: -1px; background: var(--green-deep); opacity: .6; }
.xcm-pin:hover { scale: 1.05; background: var(--green); }
.xcm-pin[hidden], .xcm-layers[hidden], .xcm-row[hidden] { display: none; }
.xcm-pin svg, .xcm-row svg { width: 16px; height: 16px; flex: none; }
.xcm-row { display: flex; align-items: center; gap: 9px; width: calc(100% - 24px); margin: 4px 12px 8px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--green-deep); font: 600 13.5px/1 var(--font-ui); cursor: pointer; text-align: left; }
.xcm-row:hover { background: var(--hover); }
.xcm-layers { position: absolute; z-index: 6; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); }
.xcm-layers .xcm-t { padding: 6px 10px 4px; font: 600 10.5px/1.25 var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); max-width: 120px; }
.xcm-layers .xcm-n { padding: 0 10px 4px; font: 500 11px/1.25 var(--font-ui); color: var(--muted); max-width: 120px; }
.xcm-layers button { min-width: 104px; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: 600 13px/1 var(--font-ui); color: var(--muted); cursor: pointer; text-align: left; white-space: nowrap; }
.xcm-layers button:hover { background: var(--hover); color: var(--green-deep); }
.xcm-layers button[aria-pressed="true"] { background: var(--green-deep); color: var(--cream); }
.xcm-layers button:focus-visible, .xcm-pin:focus-visible, .xcm-row:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.xcm-layers button.xcm-x { color: var(--green-deep); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 2px; }
.xcm-tag { pointer-events: none; }
#app[data-commons="1"] #levelNav, #app[data-commons="1"] #hint, #app[data-commons="1"] #pins, #app[data-commons="1"] #aptLabels, #app[data-commons="1"] #ctxToggle { visibility: hidden !important; pointer-events: none !important; }
@media (max-width: 760px) { .xcm-pin { height: 34px; font-size: 12px; padding: 0 12px 0 10px; margin-top: -48px; }
  .xcm-layers { right: 8px; left: 8px; top: auto; bottom: 8px; transform: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; } .xcm-layers .xcm-t, .xcm-layers .xcm-n { display: none; } .xcm-layers button { min-width: 0; height: 38px; padding: 0 10px; }
  .xcm-layers button.xcm-x { border-top: 0; border-left: 1px solid var(--line); border-radius: 0 10px 10px 0; margin: 0 0 0 2px; } }
@media (max-width: 760px) { #app[data-commons="1"] #legend { visibility: hidden !important; } }   /* phone: the layer bar takes the place of the legend */

/* round 19: a calm note while the flats of a building arrive (slow connections only) */
.xload { position: absolute; z-index: 5; left: 50%; top: 62px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  font: 500 12.5px/1.2 var(--font-ui); color: var(--muted); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .35s; }
.xload.on { opacity: 1; }
#app[data-walk="1"] .xload, #app[data-commons="1"] .xload { display: none; }
@media (max-width: 760px) { .xload { top: 52px; font-size: 12px; } }

/* round 20: the shared areas open from the parking area itself (no button): pointer cursor, small label beside the pointer */
#app[data-cmhover="1"] #canvasHost canvas { cursor: pointer !important; }
.xcm-hover { position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; padding: 7px 12px; border-radius: 999px; background: var(--green-deep); color: var(--cream); font: 600 12.5px/1 var(--font-ui); white-space: nowrap; box-shadow: 0 8px 18px -8px rgba(26,42,26,.55); opacity: 0; transition: opacity .12s; }
.xcm-hover.on { opacity: 1; }
#app[data-commons="1"] .xcm-hover, #app[data-walk="1"] .xcm-hover { display: none; }

/* ═══════════ round 21 (Pixel UI): price gate, docked filter panel, phone sheets and touch sizes ═══════════ */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* filters: the group label is a plain caption now (the chips carry the group name for screen readers) */
.fgroup > .flabel { font-size: 12.5px; color: var(--muted); padding-top: 7px; }

/* "Afficher le prix" button (flat sheet, phone list) and the price once shown */
.price { align-items: center; min-height: 44px; }
.price-gate { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 17px 0 14px; border-radius: 999px; border: 1px solid var(--green-deep);
  background: var(--paper); color: var(--green-deep); font: 600 14px/1 var(--font-ui); white-space: nowrap; transition: background-color .15s, color .15s; }
.price-gate svg { width: 16px; height: 16px; flex: none; }
.price-gate:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
@media (hover: hover) { .price-gate:hover { background: var(--green-deep); color: var(--cream); } }
.price-v { animation: tdlPriceIn .45s var(--ease) both; }
.price-v:focus { outline: none; }
@keyframes tdlPriceIn { from { opacity: 0; transform: translateY(4px); } }

/* the form */
html.gate-open, html.gate-open body { overflow: hidden; }
.gate { position: fixed; left: 0; right: 0; top: 0; height: 100%; z-index: 200; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: rgba(20,32,20,.46); opacity: 0; transition: opacity .25s ease; }
.gate[hidden] { display: none; }
.gate.on { opacity: 1; }
.gate-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.gate-dlg { position: relative; width: min(440px, 100%); box-sizing: border-box; padding: 26px 28px 22px; border-radius: 18px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(26,42,26,.12), 0 30px 70px -20px rgba(26,42,26,.45); transform: translateY(10px); transition: transform .35s var(--ease); }
.gate.on .gate-dlg { transform: none; }
.gate-dlg:focus { outline: none; }
.gate-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; }
.gate-ico { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 14px; border-radius: 50%; background: var(--sel); color: var(--green-deep); }
.gate-ico svg { width: 20px; height: 20px; }
.gate-dlg h2 { margin: 0 50px 6px 0; font: 400 26px/1.1 var(--font-display); color: var(--green-deep); }
.gate-lead { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.gate-form { display: grid; gap: 12px; }
.gate-names { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gate-f { display: grid; gap: 5px; align-content: start; min-width: 0; }
.gate-f label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gate-f label b { margin-left: 3px; font-weight: 400; color: var(--muted); }
.gate-f input { width: 100%; min-width: 0; height: 46px; box-sizing: border-box; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--cream);
  color: var(--ink); font: 400 16px/1.2 var(--font-ui); transition: border-color .15s, box-shadow .15s; }   /* 16 px: iOS does not zoom into the field */
.gate-f input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.gate-f input[aria-invalid="true"] { border-color: var(--st-vendu); }
.gate-f input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--st-vendu-bg); }
.gate-err { margin: 0; font-size: 13px; line-height: 1.3; color: var(--st-vendu); }
.gate-err:empty { display: none; }
.gate-req { margin: -2px 0 0; font-size: 12.5px; color: var(--muted); }
.gate-check { display: flex; align-items: center; gap: 11px; min-height: 44px; font-size: 14.5px; cursor: pointer; }
.gate-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--green-deep); cursor: pointer; }
.gate-go { width: 100%; min-height: 48px; font-size: 15px; }
.gate-privacy { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); text-align: center; }
@media (max-width: 480px) {
  .gate-wrap { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .gate-dlg { padding: 20px 18px 18px; border-radius: 16px; }
  .gate-dlg h2 { font-size: 23px; }
  .gate-ico { width: 38px; height: 38px; margin-bottom: 10px; }
  .gate-lead { margin-bottom: 14px; }
  .gate-names { grid-template-columns: 1fr; }
}
@media (max-height: 520px) { .gate-wrap { align-items: flex-start; } .gate-ico { display: none; } .gate-lead { margin-bottom: 12px; } .gate-form { gap: 10px; } }
@media (prefers-color-scheme: dark) {
  .gate { background: rgba(0,0,0,.6); }
  .gate-dlg { box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 30px 70px -20px rgba(0,0,0,.8); }
  .price-gate:hover { color: #0f1812; }
}
@media (prefers-reduced-motion: reduce) { .price-v { animation: none; } }

/* list rows: no price column on desktop / tablet */
.row.np .s { grid-row: 1; }
.row.np .b { grid-column: 1 / -1; }
.row .p.req { font-size: 12.5px; color: var(--muted); }
.list-gate { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 14px 10px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--sel); color: var(--green-deep); font-size: 13.5px; font-weight: 600; }
.list-gate[hidden] { display: none; }
.list-gate .price-gate { min-height: 40px; font-size: 13.5px; }
#listPanel .ico-dock { display: none; }
#listPanel .dock .ico-x { display: none; }
#listPanel .dock .ico-dock { display: block; }
#app[data-walk="1"] #listPanel { visibility: hidden !important; pointer-events: none !important; }

/* desktop / tablet: the filter panel is docked on the left from the start, narrow, collapsible; the overlays move beside it */
@media (min-width: 761px) {
  :root { --list-w: 296px; }
  #listPanel .panel-head { padding: 12px 10px 8px 16px; }
  #listPanel .panel-head h2 { font-size: 20px; }
  #filters { padding: 0 16px 12px; gap: 9px; }
  .fgroup { grid-template-columns: 1fr; gap: 5px; }
  .fgroup > .flabel { padding-top: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
  .chip { height: 32px; }
  #legend { transition: left .5s var(--ease); }
  #app[data-list="open"] #legend { left: calc(var(--list-w) + 26px); }
  #hint { transition: opacity .3s, transform .5s var(--ease), left .5s var(--ease); }
  #app[data-list="open"] #hint { left: calc(50% + (var(--list-w) + 12px) / 2); max-width: calc(100% - var(--list-w) - 150px); }
}

/* touch screens: no sticky hover colours after a tap */
@media (hover: none) {
  .row:hover { background: none; } .row[aria-current="true"]:hover { background: var(--sel); }
  .chip:hover { border-color: var(--line); } .chip[aria-pressed="true"]:hover { border-color: var(--green-deep); }
  .btn:hover { background: transparent; } .btn.primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
  .pill-btn:hover { background: transparent; color: var(--green-deep); } .pill-btn[aria-expanded="true"]:hover { background: var(--green-deep); color: var(--cream); }
  #levelNav button:hover { background: none; color: var(--muted); } #levelNav button[aria-pressed="true"]:hover { background: var(--green-deep); color: var(--cream); }
  #crumbs button:hover { background: none; color: var(--muted); } #crumbs button[aria-current="page"]:hover { color: var(--green-deep); }
  .icon-btn:hover { background: var(--paper); }
  .pin:hover { scale: 1; background: var(--green-deep); }
}

/* phone, portrait: list + filters in a bottom sheet with a handle, 44 px targets, safe areas */
@media (max-width: 760px) {
  #top { padding-top: max(6px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .pill-btn { height: 40px; }
  .lang button { height: 36px; min-width: 40px; }
  #crumbs button { min-height: 36px; }
  #crumbs .back { min-height: 36px; position: sticky; left: 0; z-index: 1; box-shadow: 8px 0 8px -4px var(--cream); }
  .icon-btn { width: 44px; height: 44px; }
  #levelNav button { height: 44px; }
  .sheet-grab { height: 36px; }
  .sheet-grab span { margin-top: 12px; width: 48px; }
  #aptPanel .close { top: 12px; }
  #aptBody { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .price-v { font-size: 24px; }

  #listPanel { --sheet-h: 64%; inset: auto 0 0 0; height: var(--sheet-h); width: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
    opacity: 1; transform: translateY(100%); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -10px 40px -12px rgba(26,42,26,.35);
    transition: transform .5s var(--ease), height .35s var(--ease), visibility 0s .5s; }
  #app[data-list="open"] #listPanel { transform: none; }
  #listPanel[data-snap="full"] { --sheet-h: calc(100% - 6px); }
  #listPanel.dragging { transition: none; }
  #listPanel .panel-head { position: sticky; top: 36px; z-index: 3; background: var(--paper); padding: 0 12px 10px 18px; }
  #listPanel .rows { flex: none; overflow: visible; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  #filters { padding: 2px 0 10px 18px; gap: 8px; }
  .fgroup { grid-template-columns: 64px 1fr; align-items: center; gap: 6px; }
  .fgroup > .flabel { padding-top: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 18px 2px 2px; margin: -2px 0; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 40px; padding: 0 14px; font-size: 14px; }
  .row { min-height: 58px; padding: 11px 10px; }
  .xcm-row { min-height: 44px; }
  .list-gate { margin: 0 12px 10px 18px; }
}
@media (prefers-color-scheme: dark) and (max-width: 760px) { #listPanel { box-shadow: 0 -10px 40px -12px rgba(0,0,0,.7); } }

/* phone held sideways (low and not wide): compact bar, narrower side panels */
@media (max-height: 500px) and (max-width: 1000px) and (min-width: 761px) {
  :root { --header-h: 46px; --panel-w: 330px; --list-w: 288px; }
  #top { min-height: 46px; gap: 12px; padding: 3px max(12px, env(safe-area-inset-right)) 3px max(12px, env(safe-area-inset-left)); }
  .brand img { width: 28px; height: 28px; }
  .brand-place { display: none; }
  .brand-title { font-size: 16px; }
  #crumbs button { padding: 4px 6px; font-size: 13.5px; }
  .pill-btn { height: 38px; }
  .lang button { height: 34px; }
  #listPanel, #aptPanel { top: 6px; bottom: 6px; }
  #listPanel { left: max(6px, env(safe-area-inset-left)); }
  #aptPanel { right: max(6px, env(safe-area-inset-right)); }
  #app[data-apt="open"] #levelNav, #app[data-apt="open"] #legend, #app[data-apt="open"] #indicative { display: none; }   /* as on the portrait phone: the flat, its bars and the sheet need the room */
  #aptBody { padding: 14px 16px 18px; gap: 12px; }
  .apt-head h2 { font-size: 22px; }
  .status { margin-top: 8px; }
  .specs > div { padding: 6px 0; }
  .plan-btn img { max-height: 150px; }
  .price-v { font-size: 22px; }
  #listPanel { overflow-y: auto; overscroll-behavior: contain; }
  #listPanel .panel-head { position: sticky; top: 0; z-index: 3; background: var(--paper); padding: 8px 8px 6px 14px; }
  #listPanel .rows { flex: none; overflow: visible; }
  #filters { padding: 0 0 10px 14px; gap: 6px; }
  .fgroup { grid-template-columns: 62px 1fr; align-items: center; gap: 6px; }
  .fgroup > .flabel { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 400; }
  .chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 14px 2px 2px; margin: -2px 0; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 38px; }
  .list-gate { margin: 0 10px 8px 14px; font-size: 12.5px; }
  #hint { top: 8px; font-size: 12.5px; padding: 6px 12px; }
  #compass { top: 8px; right: 8px; } #compass svg { width: 32px; height: 32px; }
  #legend { left: 8px; bottom: 8px; padding: 6px 10px; font-size: 12px; gap: 10px; }
  #indicative { bottom: 8px; right: 8px; font-size: 11px; }
  #levelNav { right: 8px; }
  #levelNav button { height: 40px; width: 54px; }
  .icon-btn { width: 40px; height: 40px; }
  .xwall-t { display: none; }   /* the wall-height bar and Visiter fit beside the sheet */
  .xwall { height: 42px; gap: 8px; padding: 0 12px; }
  .xwall input { width: 110px; min-width: 60px; }
  .xwall-v { min-width: 0; }
  .xwalk-btn { height: 42px; padding: 0 14px 0 12px; }
}
