:root {
  --bg: #140f0c;
  --surface: #221a14;
  --surface2: #2c231c;
  --text: #f6eee4;
  --muted: #b5a394;
  --accent: #d08a4c;
  --accent-text: #1a120c;
  --line: #3a2e24;
  --ok: #8faf74;
  --bad: #d37a6a;
  --info: #7ea0c4;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
  padding-bottom: calc(88px + var(--safe-b));
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
h1, h2, .serif { font-family: Georgia, "Iowan Old Style", serif; font-weight: 400; }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: .01em; }
h2 { font-size: 20px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.top {
  padding: 18px 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.top button.link {
  background: none; border: 0; color: var(--accent); font: inherit; padding: 0; cursor: pointer;
}
.hero-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.list { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.yurt {
  cursor: pointer;
}
.cover {
  height: 180px;
  background: #2a2018 center/cover no-repeat;
  position: relative;
}
.cover .ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #2a1e16;
  color: #c4a078;
  font-family: Georgia, serif;
  font-size: 22px;
}
.yurt .body, .pad { padding: 14px 16px 16px; }
.price { color: var(--accent); font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px;
}
.gallery { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 8px; scroll-snap-type: x mandatory; }
.gallery img, .gallery .ph {
  width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; scroll-snap-align: start; flex: 0 0 100%;
}
.desc { padding: 4px 18px 18px; line-height: 1.55; color: #e6d9cc; white-space: pre-wrap; }
.cal-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; }
.cal-head button {
  background: var(--surface2); color: var(--text); border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
}
.cal { padding: 0 12px 16px; }
.cal table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { color: var(--muted); font-size: 12px; font-weight: 500; padding: 6px 0; }
.cal td { text-align: center; padding: 3px; }
.cal button {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text); font: inherit; cursor: pointer;
}
.cal button.in { background: var(--accent); color: var(--accent-text); }
.cal button.mid { background: #3d2a1c; }
.cal button.busy, .cal button:disabled { color: #6a5a4e; text-decoration: line-through; cursor: default; }
.field { margin: 12px 18px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px; font: inherit;
}
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface2); color: var(--text); font-size: 20px; cursor: pointer;
}
.summary { margin: 12px 16px; padding: 14px 16px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); }
.summary row, .row { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; }
.pay-box { margin: 12px 16px; padding: 16px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); }
.req {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.req:last-child { border-bottom: 0; }
.copy {
  background: var(--surface2); color: var(--accent); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; cursor: pointer; font: inherit;
}
.btn, .main-btn {
  display: block; width: calc(100% - 32px); margin: 10px 16px;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 14px;
  padding: 14px; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.wa { background: #1f6b46; color: #fff; }
.err { margin: 8px 16px; color: var(--bad); }
.ok { color: var(--ok); }
.pill {
  display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: 999px;
  background: var(--surface2); color: var(--muted);
}
.pill.warn { color: #e0b07a; }
.pill.info { color: var(--info); }
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--bad); }
.book-item { padding: 14px 16px; cursor: pointer; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.loader { padding: 60px 20px; text-align: center; color: var(--muted); }
.file {
  margin: 12px 16px; padding: 16px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--muted);
}
.file input { display: none; }
.tg-banner {
  display: block; margin: 0 16px 10px; padding: 10px 14px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--accent); text-decoration: none; font-size: 14px;
}
.web-bar {
  position: sticky; bottom: 0; z-index: 40;
  padding: 10px 16px calc(12px + var(--safe-b));
  background: var(--bg);
}

body.map-mode { padding-bottom: 0; }
body.map-mode #app { max-width: none; min-height: 100vh; }
.map-page { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.map-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 500;
  padding: 12px 14px 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(20,15,12,.92), rgba(20,15,12,0));
  pointer-events: none;
}
.map-bar > * { pointer-events: auto; }
.map-bar h1 { font-size: 22px; margin: 0; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button {
  background: transparent; color: var(--muted); border: 0; padding: 8px 12px; font: inherit; cursor: pointer;
}
.seg button.on { background: var(--accent); color: var(--accent-text); }
#mapCanvas { position: absolute; inset: 0; background: #1a2214; }
.map-page .zm-zoom { top: 64px; bottom: auto; }
.map-page .zm-hint { top: 64px; bottom: auto; max-width: 56%; }
.map-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 10px 14px calc(16px + var(--safe-b));
  max-height: 58vh; overflow: auto;
  transform: translateY(110%); transition: transform .22s ease;
}
.map-sheet.open { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; background: #5a4a3c; border-radius: 4px; margin: 0 auto 10px; }
.sheet-gal { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; scroll-snap-type: x mandatory; }
.sheet-gal img { width: 160px; height: 110px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; scroll-snap-align: start; }
.avail { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 12px; }
.avail span {
  width: 28px; height: 28px; border-radius: 8px; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text);
}
.avail span.busy { color: #6a5a4e; text-decoration: line-through; background: #1a1410; }
.avail span.okd { background: #2a3820; color: var(--ok); }
.mini-map { height: 180px; margin: 0 16px 16px; border-radius: 14px; overflow: hidden; }
.mini-map .zm-zoom, .mini-map .zm-hint { display: none; }
