:root {
  --sand: #EFE7DA;
  --sand-2: #E6DCCB;
  --sand-3: #DCD0BC;
  --paper: #FBF8F3;
  --white: #FFFFFF;
  --ink: #1C1A17;
  --ink-2: #3B3631;
  --muted: #7C7367;
  --faint: #A79D90;
  --line: #E4DACA;
  --hair: rgba(28, 26, 23, 0.08);
  --accent: #9A7647;
  --accent-soft: #F1E6D4;
  --green: #4E8A5E;
  --amber: #C59A3D;
  --red: #B4533F;
  --blue: #4C6A82;
  --r-lg: 22px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(48, 36, 22, 0.06);
  --shadow: 0 1px 2px rgba(48, 36, 22, 0.05), 0 18px 40px -18px rgba(48, 36, 22, 0.22);
  --shadow-lg: 0 2px 6px rgba(48, 36, 22, 0.06), 0 40px 80px -30px rgba(48, 36, 22, 0.35);
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--accent-soft); }

.serif { font-family: var(--serif); font-optical-sizing: auto; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- logo */
.logo { font-family: var(--sans); font-weight: 300; letter-spacing: 0.06em; font-size: 22px; line-height: 1; white-space: nowrap; }
.logo span { color: var(--accent); }
.logo-xl { font-size: clamp(44px, 6vw, 68px); }
.logo-sub { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 13px; letter-spacing: 0.01em; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #33302b; box-shadow: 0 8px 20px -10px rgba(28, 26, 23, 0.6); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #876640; }
.btn-ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { border-color: var(--ink); background: #fff; }
.btn-quiet { padding: 0 10px; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); }
.btn-danger { color: var(--red); border-color: rgba(180, 83, 63, 0.3); background: #fff; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.85); transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--ink); background: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- form controls */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: #fff; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237C7367' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(154, 118, 71, 0.12); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 12px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.18s;
}
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; background: var(--accent-soft); color: #7A5B33; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-available { background: #E3EFE5; color: #356B45; }
.pill-reserved { background: #F6ECD5; color: #8D6A1F; }
.pill-sold { background: #F3E1DC; color: #933F2E; }
.pill-dark { background: var(--ink); color: var(--paper); }
.pill-ghost { background: rgba(255,255,255,0.8); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- dual range */
.range { display: grid; gap: 10px; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.range-val { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.range-track { position: relative; height: 22px; }
.range-track::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 2px; border-radius: 2px; background: var(--sand-3); }
.range-fill { position: absolute; top: 10px; height: 2px; background: var(--ink); border-radius: 2px; }
.range-track input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; appearance: none; -webkit-appearance: none; height: 22px; }
.range-track input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: all; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,0.12); cursor: grab; }
.range-track input::-moz-range-thumb { pointer-events: all; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); cursor: grab; }
.range-track input::-webkit-slider-runnable-track { background: none; }
.range-track input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(154, 118, 71, 0.25); }

/* ---------- overlays */
.scrim { position: fixed; inset: 0; background: rgba(28, 24, 18, 0.38); backdrop-filter: blur(3px); z-index: 900; opacity: 0; transition: opacity 0.25s; }
.scrim.in { opacity: 1; }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 901; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform: translate(-50%, -46%) scale(0.98); opacity: 0; transition: transform 0.3s var(--ease), opacity 0.25s;
}
.modal.in { transform: translate(-50%, -50%); opacity: 1; }
.modal-wide { width: min(980px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h3 { font-family: var(--serif); font-size: 24px; }
.modal-body { padding: 18px 24px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 901; width: min(520px, 100vw); overflow: auto;
  background: var(--paper); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform 0.38s var(--ease);
}
.drawer.in { transform: none; }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 2000; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all 0.3s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast-err { background: var(--red); }

/* ---------- boot */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot-msg { color: var(--muted); font-size: 13px; }
.boot-bar { width: 180px; height: 2px; background: var(--sand-3); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s; }

/* ---------- stage (rotatable view with polygons) */
.stage { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.stage-frame { position: relative; }
.stage-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; transition: opacity 0.35s; }
.stage-frame img.fading { opacity: 0; }
.stage-frame svg.polys { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.polys polygon { vector-effect: non-scaling-stroke; transition: fill 0.2s, stroke 0.2s, opacity 0.2s; }
.stage-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); padding: 40px; }
.stage-empty svg { width: 40px; height: 40px; opacity: 0.55; margin-bottom: 6px; }
.stage-empty b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--ink-2); }
.stage-empty span { font-size: 13px; }

.rotator {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(251, 248, 243, 0.86); backdrop-filter: blur(10px); box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.7);
}
.rotator .icon-btn { width: 38px; height: 38px; border: 0; background: transparent; }
.rotator .icon-btn:hover { background: var(--ink); color: var(--paper); }
.rotator-dots { display: flex; gap: 6px; padding: 0 6px; align-items: center; }
.rotator-dots button { width: 7px; height: 7px; border-radius: 50%; background: var(--sand-3); transition: all 0.25s var(--ease); }
.rotator-dots button.on { width: 22px; border-radius: 4px; background: var(--ink); }
.rotator-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); min-width: 92px; text-align: center; }

.tip {
  position: fixed; z-index: 800; pointer-events: none; min-width: 200px; max-width: 280px;
  background: rgba(28, 26, 23, 0.94); color: var(--paper); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); font-size: 12px; opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s;
}
.tip.in { opacity: 1; transform: none; }
.tip b { font-family: var(--serif); font-weight: 400; font-size: 18px; display: block; margin-bottom: 2px; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; color: rgba(251, 248, 243, 0.7); }
.tip .row strong { color: var(--paper); font-weight: 600; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- map markers */
.zv-marker { transform: translate(-50%, -100%); display: inline-flex; flex-direction: column; align-items: center; }
.zv-marker .mk {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--paper); color: var(--ink);
  box-shadow: 0 6px 18px -6px rgba(40, 30, 20, 0.45); border: 1px solid rgba(255,255,255,0.8);
  font-size: 12px; font-weight: 700; transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}
.zv-marker .mk i { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; }
.zv-marker .mk small { font-weight: 500; color: var(--muted); }
.zv-marker .stem { width: 2px; height: 10px; background: var(--ink); }
.zv-marker .foot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(28,26,23,0.15); }
.zv-marker.active .mk, .zv-marker:hover .mk { background: var(--ink); color: var(--paper); transform: translateY(-3px); }
.zv-marker.active .mk i, .zv-marker:hover .mk i { background: var(--accent); }
.zv-marker.active .mk small, .zv-marker:hover .mk small { color: rgba(251,248,243,0.65); }
.zv-marker.dim { opacity: 0.35; }
.compact .zv-marker .mk { padding: 4px; gap: 0; font-size: 0; }
.compact .zv-marker .mk small { display: none; }
.compact .zv-marker:hover .mk, .compact .zv-marker.active .mk { padding: 6px 12px 6px 6px; gap: 8px; font-size: 12px; }
.compact .zv-marker:hover .mk small, .compact .zv-marker.active .mk small { display: inline; }
.leaflet-container { font-family: var(--sans); background: #ECE6DC; }
.leaflet-tile-pane { filter: grayscale(0.92) sepia(0.28) brightness(1.06) contrast(0.88); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(251, 248, 243, 0.8) !important; font-size: 10px; border-radius: 8px 0 0 0; }
.map-pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: var(--ink); transform: rotate(-45deg) translate(4px, -4px); border: 3px solid var(--paper); box-shadow: var(--shadow); }
