:root {
  --white: #ffffff; --ink: #111214; --brown: #37312c; --bronze: #b4925a; --card: #f6f6f5;
  --line: #e4e1dc; --muted: #6f6b66; --shadow: 0 10px 30px rgba(17, 18, 20, .12);
  --sans: "Helvetica Neue", Inter, Helvetica, Arial, sans-serif; --serif: "Cormorant Garamond", Georgia, serif;
  --panel-w: 380px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--white); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* top bar */
#topbar { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 8px; background: var(--white); padding: 9px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.wordmark { letter-spacing: .28em; font-weight: 400; font-size: 13px; }
.sub { font-size: 13px; color: var(--muted); } .sub i { font-family: var(--serif); font-size: 17px; color: var(--bronze); }
.badge { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.badge.demo { background: #fff4e0; color: #8a6420; border-color: #f0dcb4; }
.badge.feat { margin-left: 8px; background: #b4925a1f; color: #7d5f2c; border-color: #b4925a55; vertical-align: 2px; }
.powered { font-size: 10px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.item .hit { display: block; font-size: 12px; color: #7d5f2c; margin-top: 2px; }
.brokerbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: #b4925a14; border: 1px solid #b4925a33; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 12px; }
.brokerbar .chip { box-shadow: none; padding: 5px 10px; margin-left: auto; }
.unitbar { display: flex; gap: 10px; align-items: center; margin: 6px 0; } .unitbar select { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); }
label.c { display: flex; gap: 6px; align-items: center; font-size: 13px; }
table.units { width: 100%; border-collapse: collapse; font-size: 12px; } table.units th { text-align: left; font-weight: 500; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 4px; }
table.units td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; } table.units tr.off td { color: var(--muted); }
.status.Reserved { color: #8a6420; } .status.Sold { color: var(--muted); text-decoration: line-through; }
.drawer { position: fixed; z-index: 8; top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100% - 24px)); background: var(--white); border-radius: 14px; box-shadow: var(--shadow); overflow: auto; padding: 14px 18px 24px; }
.drawer .dhead { display: flex; justify-content: space-between; align-items: center; }
.drawer input:not([type=checkbox]):not([type=file]), .drawer textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 4px 0; }
.drawer label.f { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.drawer .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
a.btn { text-decoration: none; }
.search { flex: 1 1 220px; max-width: 420px; }
.search input { width: 100%; border: 0; border-radius: 10px; padding: 11px 14px; font: inherit; box-shadow: var(--shadow); background: var(--white); outline: none; }
.tools { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--white); padding: 8px 12px; border-radius: 99px; box-shadow: var(--shadow); white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.chip b { color: var(--bronze); font-weight: 600; }
.filters { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; background: var(--white); padding: 10px; border-radius: 12px; box-shadow: var(--shadow); max-width: 760px; }
.filters label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; gap: 3px; }
.filters select { font: inherit; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); min-width: 140px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.filters .reset { align-self: end; }

/* side panel / bottom sheet */
#panel { position: fixed; z-index: 4; left: 12px; top: 74px; bottom: 12px; width: var(--panel-w); background: var(--white); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.handle { display: none; }
#crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 14px 16px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
#crumbs a { color: var(--muted); text-decoration: none; cursor: pointer; } #crumbs a:hover { color: var(--ink); }
#crumbs .sep { opacity: .5; } #crumbs .cur { color: var(--ink); }
#crumbs .back { margin-left: auto; }
#panelBody { overflow: auto; padding: 6px 16px 20px; flex: 1; -webkit-overflow-scrolling: touch; }
h2 { font-weight: 300; text-transform: uppercase; letter-spacing: .08em; font-size: 19px; margin: 12px 0 4px; }
h2 i { font-family: var(--serif); text-transform: none; letter-spacing: 0; color: var(--bronze); font-size: 23px; }
h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; margin: 16px 0 6px; }
.meta { color: var(--muted); font-size: 12px; }
.list { list-style: none; padding: 0; margin: 0; }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.item:hover, .item.hl { background: var(--card); }
.item .dot { width: 10px; height: 10px; border-radius: 50%; background: #9b9893; flex: none; }
.item .dot.pr { background: var(--bronze); box-shadow: 0 0 0 3px #b4925a33; }
.item .t { flex: 1; min-width: 0; } .item .t b { display: block; font-weight: 500; }
.item .go { color: var(--muted); }
.tabs { display: flex; gap: 2px; margin: 12px 0 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-color: var(--bronze); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.facts div { background: var(--card); border-radius: 10px; padding: 9px 10px; } .facts span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.gallery { display: flex; gap: 8px; overflow-x: auto; margin: 10px -16px; padding: 0 16px; scroll-snap-type: x mandatory; }
.gallery img { height: 150px; border-radius: 10px; scroll-snap-align: start; cursor: zoom-in; background: var(--card); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--ink); color: var(--white); padding: 11px 16px; border-radius: 10px; margin: 8px 8px 0 0; }
.btn.ghost { background: var(--card); color: var(--ink); }
.status { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--card); }
.status.Available { background: #b4925a22; color: #7d5f2c; } .status.Booked { color: var(--muted); }
.note { font-size: 12px; color: var(--muted); background: var(--card); border-radius: 10px; padding: 10px; margin-top: 12px; }
.empty { color: var(--muted); padding: 20px 0; }

/* 3D viewer overlay */
#viewer { position: fixed; z-index: 3; inset: 0; background: #f3f1ee; }
#viewerCanvas { position: absolute; inset: 0; } #viewerCanvas canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.viewer-bar { position: absolute; top: 74px; right: 12px; left: calc(var(--panel-w) + 24px); display: flex; gap: 10px; align-items: center; pointer-events: none; }
.viewer-bar > * { pointer-events: auto; }
#vTitle { font-weight: 300; text-transform: uppercase; letter-spacing: .1em; }
.legend { position: absolute; right: 12px; bottom: 14px; display: flex; gap: 12px; background: var(--white); border-radius: 99px; padding: 8px 14px; box-shadow: var(--shadow); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.walkpad { position: absolute; right: 16px; bottom: 60px; display: grid; grid-template-columns: repeat(3, 52px); gap: 6px; }
.walkpad button { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #ffffffe6; font-size: 18px; box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; }

/* table pairing */
.pair { position: fixed; z-index: 6; right: 14px; bottom: 34px; background: var(--white); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; width: 190px; text-align: center; font-size: 12px; }
.pair svg { width: 150px; height: 150px; display: block; margin: 0 auto 6px; }
.pair .code { font-size: 18px; letter-spacing: .2em; font-weight: 500; }
.pair.connected { width: auto; }
.pair.connected { top: 70px; bottom: auto; padding: 8px 12px; }

#lightbox { position: fixed; inset: 0; z-index: 20; background: #111214e6; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; }
#toasts { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: var(--ink); color: var(--white); padding: 9px 14px; border-radius: 99px; font-size: 13px; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* table mode: bigger touch targets */
body.table { font-size: 16px; --panel-w: 430px; }
body.table .item { padding: 14px 8px; }
body.table .chip { padding: 11px 16px; }

/* phone: panel becomes a bottom sheet over the map */
@media (max-width: 767px) {
  #topbar { top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; gap: 6px; }
  .brand { padding: 7px 10px; } .brand .sub { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand .badge { display: none; } .wordmark { letter-spacing: .2em; font-size: 12px; }
  .tools { margin-left: auto; gap: 4px; } .chip { padding: 7px 9px; font-size: 12px; }
  .filters { max-height: 50vh; overflow: auto; }
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 16px 16px 0 0; transition: height .25s ease; padding-bottom: env(safe-area-inset-bottom); }
  #panel.sheet-peek { height: 112px; } #panel.sheet-half { height: 52vh; } #panel.sheet-full { height: calc(100% - 120px); }
  .handle { display: block; padding: 8px 0 2px; cursor: grab; touch-action: none; } .handle span { display: block; width: 40px; height: 4px; border-radius: 3px; background: #d6d2cc; margin: 0 auto; }
  #crumbs { padding-top: 4px; }
  .viewer-bar { left: 8px; right: 8px; top: 112px; }
  .legend { left: 8px; right: auto; bottom: auto; top: 156px; }
  .walkpad { bottom: calc(52vh + 12px); right: 10px; grid-template-columns: repeat(3, 46px); } .walkpad button { height: 46px; }
  .gallery img { height: 120px; }
}
