:root {
  --navy: #16335C;
  --blue: #1F57A4;
  --sky: #E6EEF8;
  --clay: #B8420F;
  --clay-soft: #FCEDE4;
  --green: #1F6B45;
  --green-soft: #E4F0E9;
  --gold: #8A5A10;
  --gold-soft: #FBF1DC;
  --gold-line: #E6C27A;
  --ink: #1C1B18;
  --muted: #5E5A52;
  --bg: #F4F1EA;
  --card: #FFFFFF;
  --line: #E3DDD0;
  --shadow: 0 1px 2px rgba(22, 51, 92, .05), 0 4px 14px rgba(22, 51, 92, .06);
  --shadow-lg: 0 8px 28px rgba(22, 51, 92, .16);
  --display: 'Unbounded', 'Segoe UI', sans-serif;
  --body: 'Onest', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #6FA0E0; outline-offset: 2px; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Апп-ын бүтэц ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

.demo-strip {
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
}

.hero {
  position: relative;
  background: var(--navy);
  color: #fff;
  border-radius: 0 0 30px 30px;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 18px 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero.tall { padding-bottom: 84px; }
.hero .hee {
  position: absolute; left: 0; right: 0; bottom: 10px; height: 18px; opacity: .2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='18'%3E%3Cpath d='M0 15H5V3H19V11H11V7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}
.hero-row { display: flex; align-items: center; gap: 12px; }
.hero-sub { font-size: 13px; color: #C9D8EE; font-weight: 500; }
.hero h1 {
  margin: 0; flex: 1;
  font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.01em;
}
.hero.tall h1 { font-size: 25px; }
.hero-note { font-size: 14px; color: #C9D8EE; margin: 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 0;
  background: rgba(255, 255, 255, .14); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.search {
  display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 16px;
  background: #fff; border-radius: 16px; color: var(--muted);
  box-shadow: 0 6px 18px rgba(10, 25, 50, .18);
}
.search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--ink); min-width: 0; }

.page { display: flex; flex-direction: column; gap: 22px; }
.wrap { margin: 0 18px; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.section-head a { font-size: 14px; font-weight: 600; }

/* Яаралтай */
.sos {
  margin: -54px 18px 0; position: relative;
  background: #fff; border-radius: 22px; padding: 16px;
  box-shadow: 0 2px 4px rgba(22, 51, 92, .05), 0 10px 28px rgba(22, 51, 92, .10);
  display: flex; flex-direction: column; gap: 12px;
}
.sos-head { display: flex; justify-content: space-between; align-items: center; }
.sos-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.sos-head span { font-size: 12px; color: var(--muted); }
.sos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sos-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: 16px; text-align: center;
}
.sos-btn .dot { width: 40px; height: 40px; border-radius: 20px; color: #fff; display: flex; align-items: center; justify-content: center; }
.sos-btn .num { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.sos-btn .lbl { font-size: 12px; font-weight: 600; }
.tone-fire { background: var(--clay-soft); color: #9A360B; } .tone-fire .dot { background: var(--clay); } .tone-fire .lbl { color: #5E3A26; }
.tone-police { background: var(--sky); color: var(--navy); } .tone-police .dot { background: var(--blue); } .tone-police .lbl { color: #2A3F5E; }
.tone-ambulance { background: var(--green-soft); color: #185637; } .tone-ambulance .dot { background: var(--green); } .tone-ambulance .lbl { color: #2B4A39; }

/* Баннер */
.banners { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 18px; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 100%; scroll-snap-align: center;
  position: relative; overflow: hidden;
  background: var(--clay); color: #fff; border-radius: 22px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.banners.multi .banner { flex-basis: 88%; }
.banner::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px;
  border-radius: 50%; border: 10px solid rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 20px rgba(255, 255, 255, .0), inset 0 0 0 20px rgba(255, 255, 255, .0);
  pointer-events: none;
}
.banner .tag { align-self: flex-start; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .18); padding: 4px 8px; border-radius: 6px; }
.banner .org { font-size: 13px; color: #FFE7D6; font-weight: 600; }
.banner h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.35; max-width: 300px; }
.banner p { margin: 0; font-size: 13px; color: #FFE7D6; }
.banner img { border-radius: 14px; max-height: 160px; width: 100%; object-fit: cover; }
.banner .call { align-self: flex-start; margin-top: 4px; color: #fff; font-weight: 700; font-size: 14px; background: rgba(0, 0, 0, .18); padding: 8px 14px; border-radius: 12px; }

/* Ангилал */
.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 14px 6px; background: #fff; border-radius: 18px; color: var(--ink); box-shadow: var(--shadow);
}
.cat .ico { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.cat span:last-child { font-size: 12px; font-weight: 600; line-height: 1.25; }

/* Чипс */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 40px; padding: 0 16px; border-radius: 20px; border: 0;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(22, 51, 92, .08);
}
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(22, 51, 92, .25); }

/* Табс */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: rgba(255, 255, 255, .12); border-radius: 14px; }
.tab { height: 42px; border: 0; border-radius: 11px; background: transparent; color: #DCE6F4; font-size: 14px; font-weight: 700; }
.tab[aria-selected="true"] { background: #fff; color: var(--navy); }

/* Лавлахын мөр */
.list { display: flex; flex-direction: column; gap: 10px; }
.person {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
}
.person.featured { background: #FFFDF7; outline: 1.5px solid var(--gold-line); }
.person .ava {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 17px; font-weight: 700;
}
.person .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.person .name { font-size: 15px; font-weight: 700; }
.person .role { font-size: 13px; color: var(--muted); }
.person .phone { font-size: 14px; font-weight: 600; color: var(--navy); }
.badge-gold {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--gold); background: var(--gold-soft);
  padding: 3px 7px; border-radius: 6px;
}
.call-btn {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 24px;
  background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(31, 107, 69, .3);
}

/* Такси */
.taxi { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.taxi.featured { background: #FFFDF7; outline: 1.5px solid var(--gold-line); }
.taxi-top { display: flex; gap: 14px; align-items: center; }
.taxi-photo { width: 72px; height: 72px; flex-shrink: 0; border-radius: 18px; object-fit: cover; background: var(--clay-soft); }
.taxi-photo.ph { display: flex; align-items: center; justify-content: center; color: var(--clay); font-family: var(--display); font-size: 26px; font-weight: 700; }
.taxi .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.taxi .name { font-size: 16px; font-weight: 700; }
.taxi .role { font-size: 13px; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.fact { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #3A3832; background: #F4F1EA; padding: 6px 10px; border-radius: 10px; }
.fact svg { color: var(--muted); }
.fact.plate { background: #fff; border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; letter-spacing: .04em; padding: 5px 10px; }
.taxi-call { min-height: 48px; font-size: 15px; }
.taxi-fields { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin: 0; }
.taxi-fields legend { font-size: 14px; font-weight: 700; padding: 0 6px; }
.taxi-fields[hidden] { display: none; }

/* Зар */
.ads-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ad {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 12px;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow); color: var(--ink);
}
.ad.boosted { background: #FFFBF7; outline: 1.5px solid #E7B08C; }
.ad .thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; background: #ECE6DA; color: #8A8478;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ad .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad .flag { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 700; color: #fff; background: var(--clay); padding: 4px 8px; border-radius: 8px; }
.ad .t { font-size: 14px; font-weight: 600; line-height: 1.3; padding: 0 4px; overflow-wrap: anywhere; }
.ad .p { font-size: 15px; font-weight: 700; color: var(--blue); padding: 0 4px; }
.ad .m { font-size: 11px; color: var(--muted); padding: 0 4px; }

.ad-row {
  display: flex; gap: 12px; padding: 10px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); color: var(--ink);
}
.ad-row .thumb { width: 76px; height: 76px; flex-shrink: 0; border-radius: 14px; background: #ECE6DA; color: #8A8478; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-row .body { display: flex; flex-direction: column; gap: 4px; justify-content: center; min-width: 0; }
.ad-row .t { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ad-row .p { font-size: 16px; font-weight: 700; color: var(--blue); }
.ad-row .m { font-size: 12px; color: var(--muted); }
.ad-row .org { font-size: 12px; color: var(--muted); font-weight: 600; }
.ad-row .ini { width: 56px; height: 56px; border-radius: 16px; background: var(--sky); color: var(--blue); font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Дэлгэрэнгүй */
.detail { display: flex; flex-direction: column; gap: 14px; background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--shadow); }
.detail img { border-radius: 16px; width: 100%; max-height: 360px; object-fit: cover; }
.detail h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.detail .price { font-size: 20px; font-weight: 700; color: var(--blue); }
.detail .meta { font-size: 13px; color: var(--muted); }
.detail .desc { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* Маягт */
.form-card { display: flex; flex-direction: column; gap: 16px; background: #fff; border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #3A3832; }
.field input, .field select, .field textarea {
  min-height: 50px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; font-size: 16px; font-weight: 400; color: var(--ink); width: 100%;
}
.field textarea { padding: 12px 14px; resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: none; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-pick {
  position: relative; min-height: 120px; border: 1.5px dashed #B9C8DD; border-radius: 16px; background: #F3F7FC; color: var(--blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; overflow: hidden;
}
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick img { width: 100%; max-height: 220px; object-fit: cover; }
.boost-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #FFFBF3; border-radius: 22px; outline: 1.5px solid var(--gold-line); }
.boost-box .row { display: flex; align-items: center; gap: 12px; }
.boost-box .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.boost-box b { display: block; font-size: 15px; }
.boost-box small { font-size: 13px; color: var(--muted); }
.btn {
  min-height: 52px; padding: 0 20px; border: 0; border-radius: 16px;
  background: var(--navy); color: #fff; font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { box-shadow: 0 8px 22px rgba(22, 51, 92, .28); }
.btn.green { background: var(--green); }
.btn.clay { background: var(--clay); }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.small { min-height: 40px; font-size: 13px; padding: 0 14px; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: default; }
.error { color: #A3260B; font-size: 14px; font-weight: 600; margin: 0; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }
.center { text-align: center; }

.empty { text-align: center; padding: 32px 18px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; background: #fff; border-radius: 22px; padding: 28px 20px; box-shadow: var(--shadow); }
.success .ok { width: 64px; height: 64px; border-radius: 32px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.success h2 { margin: 0; font-size: 19px; }
.success p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.skeleton { background: linear-gradient(90deg, #ECE6DA 0%, #F4EFE6 50%, #ECE6DA 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 18px; height: 76px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.fab {
  position: fixed; right: max(18px, calc(50% - 262px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  height: 54px; padding: 0 22px; border-radius: 27px; background: var(--clay); color: #fff;
  display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(184, 66, 15, .35); z-index: 5;
}

/* Доод цэс */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: min(532px, calc(100% - 28px)); height: 68px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); z-index: 10;
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.nav a[aria-current="page"] { background: var(--sky); color: var(--navy); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  z-index: 50; max-width: calc(100% - 36px);
}

.install {
  display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--sky); border-radius: 18px;
}
.install p { margin: 0; flex: 1; font-size: 13px; color: var(--navy); font-weight: 600; }

/* ---------- Админ ---------- */
.admin { display: flex; min-height: 100vh; }
.side {
  width: 250px; flex-shrink: 0; background: var(--navy); color: #DCE6F4;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand b { display: block; font-family: var(--display); color: #fff; font-size: 17px; }
.side .brand span { font-size: 12px; color: #A9BEDD; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav button {
  height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #DCE6F4;
  text-align: left; font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: space-between;
}
.side nav button[aria-current="true"] { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }
.side nav .count { font-size: 12px; font-weight: 700; background: var(--clay); color: #fff; padding: 2px 8px; border-radius: 10px; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #A9BEDD; }
.side .foot button { height: 40px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #fff; border-radius: 10px; font-weight: 600; }
.main { flex: 1; min-width: 0; padding: 28px 32px 60px; display: flex; flex-direction: column; gap: 22px; }
.main h1 { margin: 0; font-family: var(--display); font-size: 24px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat b { font-family: var(--display); font-size: 26px; }
.panel { background: #fff; border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-size: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid #EFEAE0; vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.pill.ok { color: var(--green); background: var(--green-soft); }
.pill.wait { color: #7A3A0C; background: var(--clay-soft); }
.pill.off { color: var(--muted); background: #EFEAE0; }
.pill.gold { color: var(--gold); background: var(--gold-soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pending { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #EFEAE0; }
.pending .thumb { width: 88px; height: 66px; border-radius: 10px; background: #ECE6DA; flex-shrink: 0; overflow: hidden; }
.pending .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pending .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pending .info b { color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.pending .info p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-form .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; min-height: 44px; }
.check input { width: 20px; height: 20px; }
.login { max-width: 400px; margin: 10vh auto; padding: 0 18px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-family: var(--display); margin: 0; font-size: 24px; color: var(--navy); }
.sos-edit { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; align-items: end; }

@media (max-width: 860px) {
  .admin { flex-direction: column; }
  .side { width: auto; height: auto; position: static; padding: 16px; gap: 12px; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .side nav button { white-space: nowrap; flex-shrink: 0; }
  .side .foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .main { padding: 20px 16px 60px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form { grid-template-columns: 1fr; }
  .sos-edit { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 561px) {
  .hero { border-radius: 0 0 30px 30px; }
}

/* ---------- Эхлэх дэлгэц ---------- */
body.welcome-mode .nav, body.welcome-mode .fab { display: none; }
body.welcome-mode .app { padding-bottom: 0; max-width: none; }
.welcome {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  background: var(--navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 22px calc(72px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.welcome .w-hee {
  position: absolute; left: 0; right: 0; height: 18px; opacity: .2;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='18'%3E%3Cpath d='M0 15H5V3H19V11H11V7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}
.w-top { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.w-emblem {
  width: 168px; height: 168px; border-radius: 36px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 6px solid rgba(255, 255, 255, .14); background-clip: padding-box; box-sizing: content-box; margin-bottom: 10px;
  animation: wpop .5s ease-out both;
}
.w-emblem img { width: 150px; height: 150px; object-fit: contain; }
.w-place { font-size: 13px; color: #C9D8EE; font-weight: 600; letter-spacing: .02em; }
.welcome h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.01em; }
.w-greet { margin: 0; font-size: 17px; color: #E3EAF5; }
.w-ad {
  position: relative; width: 100%; max-width: 440px; text-align: left;
  background: #fff; color: var(--ink); border-radius: 22px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(5, 15, 35, .3);
}
.w-ad img { width: 100%; max-height: 180px; object-fit: cover; }
.w-ad-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.w-ad-body b { font-size: 16px; }
.w-ad-body p { margin: 0; font-size: 13px; color: var(--muted); }
.w-ad-org { font-size: 12px; font-weight: 700; color: var(--clay); }
.w-ad-tag {
  position: absolute; right: 10px; top: 10px; z-index: 1;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  background: rgba(28, 27, 24, .7); color: #fff; padding: 3px 8px; border-radius: 6px;
}
.w-ad-call { align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--green); }
.w-ad-empty {
  background: rgba(255, 255, 255, .08); color: #fff; border: 1.5px dashed rgba(255, 255, 255, .35);
  box-shadow: none; padding: 20px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.w-ad-empty .w-ad-tag { background: rgba(255, 255, 255, .15); }
.w-ad-empty b { font-size: 15px; }
.w-ad-empty p { margin: 0; font-size: 13px; color: #C9D8EE; }
.w-ad-empty a { color: #fff; font-weight: 700; text-decoration: underline; }
.w-actions { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px; }
.w-btn {
  min-height: 56px; border-radius: 18px; font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0;
}
.w-install { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); }
.w-install:hover { background: rgba(255, 255, 255, .08); }
.w-go { background: #fff; color: var(--navy); box-shadow: 0 10px 26px rgba(5, 15, 35, .35); }
.w-go:hover { background: #F1F5FB; }
@keyframes wpop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .w-emblem { animation: none; } }
@media (min-width: 720px) {
  .w-actions, .w-ad { max-width: 560px; }
  .w-actions { flex-direction: row; }
  .w-actions .w-btn { flex: 1; }
}

.sheet-bg { position: fixed; inset: 0; background: rgba(10, 20, 40, .5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: #fff; width: 100%; max-width: 480px; border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px;
}
.sheet h2 { margin: 0; font-size: 19px; }
.sheet ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; }
@media (min-width: 600px) { .sheet-bg { align-items: center; } .sheet { border-radius: 24px; } }

.w-admin {
  position: absolute; z-index: 2;
  top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 20px;
  background: rgba(255, 255, 255, .1); color: #DCE6F4;
  font-size: 13px; font-weight: 600;
}
.w-admin:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.w-credit {
  position: absolute; z-index: 2;
  left: 16px; bottom: calc(42px + env(safe-area-inset-bottom, 0px));
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: #E6C27A; opacity: .95;
  display: inline-flex; align-items: center; gap: 8px;
}
.w-credit img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(230, 194, 122, .35); }

/* ---------- Үйлчилгээний байгууллага ---------- */
.chip.small { height: 36px; padding: 0 13px; font-size: 13px; }
.sub-chips[hidden] { display: none; }
.svc { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.svc.featured { background: #FFFDF7; outline: 1.5px solid var(--gold-line); }
.svc-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; color: var(--ink); }
.svc-cover { width: 84px; height: 84px; flex-shrink: 0; border-radius: 16px; overflow: hidden; background: var(--gold-soft); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.svc-cover img { width: 100%; height: 100%; object-fit: cover; }
.svc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.svc-type { font-size: 12px; font-weight: 600; color: var(--muted); }
.svc .name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.svc-more { font-size: 12px; font-weight: 700; color: var(--blue); }
.open-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.open-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.open-dot.is-open { color: var(--green); }
.open-dot.is-closed { color: #A3260B; }

.gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 18px; position: relative; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.g-item { flex: 0 0 86%; scroll-snap-align: center; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: #ECE6DA; aspect-ratio: 4 / 3; cursor: zoom-in; }
.gallery .g-item:only-of-type { flex-basis: 100%; }
.g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-empty { flex: 1; aspect-ratio: 16 / 7; border-radius: 20px; background: var(--gold-soft); display: flex; align-items: center; justify-content: center; font-size: 56px; }
.g-count { position: sticky; right: 0; align-self: flex-end; margin-left: -80px; margin-bottom: 10px; background: rgba(28, 27, 24, .72); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 10px; white-space: nowrap; height: fit-content; }
.org-head { display: flex; flex-direction: column; gap: 6px; }
.org-head h2 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.org-role { margin: 0; color: var(--muted); font-size: 14px; }
.org-calls { display: flex; flex-direction: column; gap: 8px; }
.card { background: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 15px; }
.card .desc { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; font-weight: 600; background: var(--green-soft); color: #185637; padding: 6px 10px; border-radius: 10px; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours td { padding: 8px 4px; border-bottom: 1px solid #EFEAE0; }
.hours td:last-child { text-align: right; font-weight: 600; }
.hours tr.today td { color: var(--navy); font-weight: 700; background: var(--sky); }
.hours tr.today td:first-child { border-radius: 8px 0 0 8px; padding-left: 8px; }
.hours tr.today td:last-child { border-radius: 0 8px 8px 0; padding-right: 8px; }
.hours small { font-weight: 500; color: var(--muted); }
.prices { list-style: none; margin: 0; padding: 0; }
.prices li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #E3DDD0; font-size: 15px; }
.prices li:last-child { border-bottom: 0; }
.prices b { white-space: nowrap; color: var(--blue); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8, 12, 20, .95); }
.lb-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 46px; height: 46px; border-radius: 23px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; }

/* Админ: үйлчилгээний маягт */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.chk-small { font-size: 13px; font-weight: 500; min-height: 36px; }
.chk-small input { width: 18px; height: 18px; }
.hours-edit { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.h-row { display: grid; grid-template-columns: 80px 1fr 1fr auto; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; }
.h-row input[type=time] { min-height: 42px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; }
.price-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-bottom: 6px; }
.price-row input { min-height: 42px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 400; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.aph { position: relative; width: 110px; height: 82px; border-radius: 10px; overflow: hidden; background: #ECE6DA; }
.aph img { width: 100%; height: 100%; object-fit: cover; }
.aph button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 14px; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; }
.aph.new span { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; background: var(--green); color: #fff; padding: 2px 6px; border-radius: 6px; }
.aph.is-cover::after { content: 'Нүүр'; position: absolute; left: 4px; top: 4px; font-size: 10px; font-weight: 700; background: var(--navy); color: #fff; padding: 2px 6px; border-radius: 6px; }
@media (max-width: 560px) {
  .h-row { grid-template-columns: 1fr 1fr; }
  .h-row > span { grid-column: 1 / -1; }
  .price-row { grid-template-columns: 1fr 100px auto; }
}

.note.wrap { margin: 0 18px; }

/* ---------- Зэрэглэл ---------- */
.tier-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.tier-badge.tier-verified { background: var(--sky); color: var(--blue); }
.tier-badge.tier-partner { background: var(--gold-soft); color: var(--gold); }
.tier-badge.tier-vip { background: #1C1B18; color: #F2C94C; letter-spacing: .02em; }
.person.tier-vip, .taxi.tier-vip, .svc.tier-vip {
  background: linear-gradient(180deg, #FFF9E8, #FFFFFF 70%);
  outline: 2px solid #D4A72C; box-shadow: 0 6px 20px rgba(212, 167, 44, .22);
}
.pill.tier-pill.tier-verified { color: var(--blue); background: var(--sky); }
.pill.tier-pill.tier-partner { color: var(--gold); background: var(--gold-soft); }
.pill.tier-pill.tier-vip { color: #F2C94C; background: #1C1B18; }
.vip-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 18px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.vip-row::-webkit-scrollbar { display: none; }
.vip-card {
  position: relative; flex: 0 0 150px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 12px;
  background: #1C1B18; color: #fff; border-radius: 20px; box-shadow: 0 6px 18px rgba(28, 27, 24, .25);
  outline: 1.5px solid rgba(242, 201, 76, .55);
}
.vip-cover { height: 100px; border-radius: 14px; overflow: hidden; background: #2E2B25; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.vip-cover img { width: 100%; height: 100%; object-fit: cover; }
.vip-crown { position: absolute; top: 14px; left: 14px; font-size: 10px; font-weight: 800; background: #F2C94C; color: #1C1B18; padding: 3px 7px; border-radius: 6px; }
.vip-name { font-size: 14px; font-weight: 700; line-height: 1.25; padding: 0 4px; overflow-wrap: anywhere; }
.vip-type { font-size: 11px; color: #D9D2C3; padding: 0 4px; }
.vip-strip { background: #1C1B18; color: #F2C94C; font-weight: 700; font-size: 14px; text-align: center; padding: 10px; border-radius: 14px; letter-spacing: .02em; }

/* Админ тохируулдаг зургийн хэмжээ */
.g-item { aspect-ratio: auto; height: auto; }
.g-item img { display: block; }
.gallery.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: visible; }
.gallery.grid .g-item { flex: none; }
.gallery.grid .g-item:first-child { grid-column: 1 / -1; }
.gallery.grid .g-count { display: none; }
.banner img, .w-ad img, .detail img { background: rgba(0, 0, 0, .06); }
.media-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; padding: 12px; background: #F7F4EE; border-radius: 14px; }
.media-ctl .mp { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.mp-frame { width: 300px; max-width: 100%; background: #fff; border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.mp-frame img { border-radius: 10px; background: #ECE6DA; display: block; }
.mp-frame .mp-empty { font-size: 12px; color: var(--muted); padding: 20px; text-align: center; }
.banners { align-items: flex-start; }

/* Ажилтнуудын жагсаалт */
.staff { list-style: none; margin: 0; padding: 0; }
.staff li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EFEAE0; }
.staff li:last-child { border-bottom: 0; }
.staff li div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.staff li b { font-size: 13px; color: var(--muted); font-weight: 600; }
.staff li span { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.staff-call { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 12px; background: var(--green-soft); color: #185637; font-weight: 700; font-size: 14px; }
.staff-row { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: 8px; margin-bottom: 6px; }
.staff-row input { min-height: 42px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 400; }
[data-rich][hidden], [data-staff][hidden] { display: none; }
@media (max-width: 560px) { .staff-row { grid-template-columns: 1fr 1fr; } }

.renew { align-items: center; margin-bottom: 6px; }
.renew select { min-height: 40px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 13px; background: #fff; }

/* ---------- VIP алтан, Silver мөнгөлөг хүрээ ---------- */
.frame { padding: 3px !important; box-sizing: border-box; }
.frame-gold { background: linear-gradient(135deg, #FFF1B8 0%, #E9C14F 28%, #A87B12 55%, #F4D676 78%, #C9971E 100%) !important; box-shadow: 0 4px 14px rgba(201, 151, 30, .35); }
.frame-silver { background: linear-gradient(135deg, #FFFFFF 0%, #D5DAE0 28%, #8E99A4 55%, #EEF1F4 78%, #AEB7C0 100%) !important; box-shadow: 0 4px 12px rgba(110, 122, 134, .3); }
.frame > img, .frame > .svc-emoji, .frame > .ava, .frame > .taxi-photo { border-radius: inherit; }
.svc-cover.frame img { border-radius: 13px; }
.svc-emoji { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); border-radius: 13px; }
.vip-cover.frame .svc-emoji { background: #2E2B25; }
.vip-cover.frame img { border-radius: 11px; }
.taxi-frame { display: inline-flex; flex-shrink: 0; border-radius: 18px; }
.taxi-frame.frame .taxi-photo { width: 66px; height: 66px; border-radius: 15px; }
.ava-wrap { display: inline-flex; flex-shrink: 0; border-radius: 14px; }
.ava-wrap.frame .ava { width: 38px; height: 38px; border-radius: 11px; }
.g-item.frame { padding: 4px !important; }
.g-item.frame img { border-radius: 16px; }

/* Silver тэмдэг, карт */
.tier-badge.tier-partner { background: linear-gradient(135deg, #F4F6F8, #CBD2D9); color: #3E4A56; box-shadow: inset 0 0 0 1px #AEB7C0; }
.pill.tier-pill.tier-partner { background: linear-gradient(135deg, #F4F6F8, #CBD2D9); color: #3E4A56; }
.person.tier-partner, .taxi.tier-partner, .svc.tier-partner { background: linear-gradient(180deg, #F6F8FA, #FFFFFF 70%); outline: 1.5px solid #AEB7C0; }
.silver-strip { background: linear-gradient(135deg, #EEF1F4, #C7CED6); color: #2F3A45; font-weight: 700; font-size: 14px; text-align: center; padding: 10px; border-radius: 14px; }

.fact.route { background: var(--clay-soft); color: #7A3A0C; }

/* ---------- Хүрэл хамтрагч ---------- */
.frame-bronze { background: linear-gradient(135deg, #FBE3CC 0%, #D9955A 28%, #8A5226 55%, #E8B587 78%, #A9652F 100%) !important; box-shadow: 0 4px 12px rgba(138, 82, 38, .3); }
.tier-badge.tier-bronze { background: linear-gradient(135deg, #FBE9D8, #E2B08A); color: #5A3416; box-shadow: inset 0 0 0 1px #C8875A; }
.pill.tier-pill.tier-bronze { background: linear-gradient(135deg, #FBE9D8, #E2B08A); color: #5A3416; }
.person.tier-bronze, .taxi.tier-bronze, .svc.tier-bronze { background: linear-gradient(180deg, #FDF6F0, #FFFFFF 70%); outline: 1.5px solid #C8875A; }
.bronze-strip { background: linear-gradient(135deg, #FBE9D8, #DFAA80); color: #4A2A10; font-weight: 700; font-size: 14px; text-align: center; padding: 10px; border-radius: 14px; }
/* Хамтрагч байгууллагуудын карт: зэрэглэл бүр өөрийн өнгөтэй */
.vip-card.tier-partner { outline-color: rgba(200, 208, 216, .7); }
.vip-card.tier-partner .vip-crown { background: linear-gradient(135deg, #F4F6F8, #BFC7CF); color: #2F3A45; }
.vip-card.tier-bronze { outline-color: rgba(214, 150, 98, .7); }
.vip-card.tier-bronze .vip-crown { background: linear-gradient(135deg, #F6D7BC, #C98A57); color: #3E2208; }

.tile-emoji { font-size: 24px; line-height: 1; }
.cat { padding: 14px 4px; }
.cat span:last-child { font-size: 11.5px; }

/* Хандалтын график */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 8px 0 22px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar span { display: block; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar:last-child span { background: var(--green); }
.bar em { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; }
#statsBox { display: flex; flex-direction: column; gap: 22px; }

/* ---------- Popup зар ---------- */
.pop-bg { position: fixed; inset: 0; z-index: 90; background: rgba(10, 20, 40, .62); display: flex; align-items: center; justify-content: center; padding: 20px; animation: popfade .2s ease-out; }
.pop { position: relative; width: 100%; max-width: 380px; max-height: 90vh; overflow: auto; background: #fff; border-radius: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); animation: popin .25s ease-out; }
.pop img { border-radius: 24px 24px 0 0; display: block; }
.pop-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.pop-body b { font-size: 18px; }
.pop-body p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.pop-org { font-size: 12px; font-weight: 700; color: var(--clay); }
.pop-tag { position: absolute; left: 12px; top: 12px; z-index: 1; font-size: 10px; font-weight: 700; letter-spacing: .06em; background: rgba(28, 27, 24, .72); color: #fff; padding: 3px 8px; border-radius: 6px; }
.pop-close { position: absolute; right: 10px; top: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(28, 27, 24, .72); color: #fff; font-size: 16px; font-weight: 700; }
.pop-close[disabled] { opacity: .85; cursor: default; }
@keyframes popfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop-bg, .pop { animation: none; } }

/* Зургийн хэрэгсэл: ★ нүүр болгох, ↻ эргүүлэх, ✕ устгах */
.aph { width: 132px; height: 96px; }
.aph .ph-tools { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.aph .ph-tools button { position: static; width: 28px; height: 28px; border-radius: 14px; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; line-height: 1; }
.aph .ph-tools button:hover { background: rgba(0, 0, 0, .85); }
.aph .ph-tools [data-ptool=cover] { color: #F2C94C; }
.aph.is-cover { outline: 3px solid var(--navy); outline-offset: 1px; }
.aph.is-cover::after { top: auto; bottom: 4px; left: 4px; }
.aph.new span { left: auto; right: 4px; bottom: 4px; }

/* Форматтай текст засварлагч */
.rte { border: 1.5px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; font-weight: 400; }
.rte:focus-within { border-color: var(--blue); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: #F7F4EE; border-bottom: 1px solid var(--line); }
.rte-bar button { min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.rte-bar button:hover { background: var(--sky); }
.rte-bar select { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; padding: 0 6px; }
.rte-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.rte-colors { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rte-bar .rte-sw { min-width: 24px; width: 24px; height: 24px; padding: 0; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 0 0 1px rgba(0, 0, 0, .15); }
.rte-area { min-height: 110px; padding: 12px 14px; font-size: 15px; line-height: 1.55; outline: none; color: var(--ink); overflow-wrap: anywhere; }
.rte-area:empty::before { content: attr(data-ph); color: #9A958A; }
.rte-area ul { padding-left: 22px; margin: 6px 0; }

/* Иргэдэд харагдах форматтай текст */
.rich { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.rich p, .rich div { margin: 0; }
.rich ul, .rich ol { margin: 6px 0; padding-left: 22px; }
.rich h3 { margin: 6px 0; font-size: 17px; }
.banner .rich, .w-ad .rich, .pop .rich { font-size: 13px; }
.field .rte-bar select { width: auto; min-height: 34px; height: 34px; padding: 0 6px; border-radius: 8px; font-size: 13px; border: 1px solid var(--line); }
.field .rte-bar button { font-weight: 600; }

/* Иргэний зар: олон зураг, засвар */
.post-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 8px; }
.post-photos:empty { display: none; }
.pp { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #ECE6DA; }
.pp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp.is-cover { outline: 3px solid var(--navy); outline-offset: 1px; }
.pp-cover { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; background: var(--navy); color: #fff; padding: 2px 6px; border-radius: 6px; }
.pp-tools { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.pp-tools button { width: 30px; height: 30px; border-radius: 15px; border: 0; background: rgba(0, 0, 0, .62); color: #fff; font-size: 14px; }
.pp-tools [data-pp=cover] { color: #F2C94C; }
.photo-pick.small { min-height: 72px; flex-direction: row; }
.photo-pick[hidden] { display: none; }
.form-card .rte-bar { gap: 3px; }
.form-card .rte-bar button { min-width: 32px; height: 32px; }
.pend-imgs { display: flex; gap: 6px; margin-top: 6px; }
.pend-imgs img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }

/* ---------- Мэдээ, цаг уур ---------- */
.nav { grid-template-columns: repeat(5, 1fr); }
.nav a { font-size: 10.5px; }
.wx-alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #A3260B; color: #fff; font-size: 14px; font-weight: 600; }
.wx-alert a { color: #fff; flex: 1; text-decoration: underline; text-underline-offset: 3px; }
.wx-alert button { border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 32px; height: 32px; border-radius: 16px; }
.wx-mini { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: #E6F1FB; color: #0C447C; box-shadow: var(--shadow); }
.wx-mini-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wx-mini-body b { font-size: 13px; }
.wx-mini-body span { font-size: 15px; font-weight: 600; color: #16335C; overflow-wrap: anywhere; }
.wx-mini-go { font-size: 12px; font-weight: 700; white-space: nowrap; }
.wx-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); outline: 2px solid #B5D4F4; }
.wx-card h2 { margin: 0; font-size: 19px; }
.wx-head { display: flex; align-items: center; gap: 12px; color: #0C447C; }
.wx-head > div { display: flex; flex-direction: column; }
.wx-head b { font-size: 15px; }
.wx-head span { font-size: 12px; color: var(--muted); }
.wx-warn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #FCEBEB; color: #791F1F; font-weight: 700; font-size: 14px; }
.wx-empty { flex-direction: row; align-items: center; color: var(--muted); font-size: 14px; outline: none; }
.g-one { border: 0; padding: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in; background: #ECE6DA; }
.g-one img { width: 100%; height: auto; display: block; }
.news-gal { padding: 0; }
.news-gal .g-item { aspect-ratio: auto; }
.news-gal .g-item img { height: auto; }
.news-item { display: flex; gap: 12px; padding: 10px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); color: var(--ink); }
.news-thumb { width: 92px; height: 72px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: #ECE6DA; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-body b { font-size: 15px; overflow-wrap: anywhere; }
.news-ex { font-size: 13px; color: var(--muted); line-height: 1.4; }
.news-date { font-size: 12px; color: var(--muted); }
.news-detail .g-one, .news-detail .gallery { margin: 0 -2px; }

.wx-portal { max-width: 640px; margin: 0 auto; padding-bottom: 40px; }
.wx-portal .form-card { gap: 16px; }

.wx-logo { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .15); }
.wx-logo.big { width: 88px; height: 88px; align-self: center; }

.news-gal.grid { padding: 0; }
.g-one img { background: #F4F1EA; }

/* Буудлын төрөл */
.lodge-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lodge-tags span { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: #E1F1F2; color: #1C6A70; white-space: nowrap; }
.lodge-tags.big span { font-size: 13px; padding: 5px 10px; border-radius: 9px; }
[data-lodging][hidden] { display: none; }

/* ---------- Сэтгэгдэл ---------- */
.comments { margin-top: 14px; background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.comments h3 { margin: 0; font-family: var(--display); font-size: 16px; color: var(--navy); }
.comments h3 span { color: var(--muted); font-family: var(--body); font-weight: 500; font-size: 14px; }
.cmt-list { display: flex; flex-direction: column; gap: 8px; }
.cmt { border-radius: 14px; padding: 10px 12px; background: var(--sky); border-left: 4px solid var(--blue); }
.cmt.u1 { background: #EEF5EF; border-color: #2F8A57; } .cmt.u2 { background: #F7EEF7; border-color: #8B4A8F; }
.cmt.u3 { background: #FDF2E8; border-color: #C26A1E; } .cmt.u4 { background: #EEF3F7; border-color: #3F6C8C; }
.cmt.u5 { background: #F3F1EA; border-color: #76705F; } .cmt.u0 { background: #F0EEF8; border-color: #5B54A3; }
.cmt.cmt-admin { background: var(--clay-soft); border-color: var(--clay); }
.cmt.cmt-owner { background: var(--gold-soft); border-color: var(--gold-line); }
.cmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cmt-head b { color: var(--ink); }
.cmt.cmt-admin .cmt-head b { color: var(--clay); }
.cmt-me { font-size: 11px; background: var(--navy); color: #fff; border-radius: 99px; padding: 1px 7px; }
.cmt-head .meta { font-size: 12px; }
.cmt-del { margin-left: auto; border: 0; background: none; color: var(--clay); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.cmt-text { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.45; }
.cmt-form, .chat-form { display: flex; gap: 8px; align-items: flex-end; }
.cmt-form textarea, .chat-form textarea { flex: 1; min-width: 0; resize: vertical; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fff; }
.cmt-form textarea:focus, .chat-form textarea:focus { outline: none; border-color: var(--blue); }
.cmt-note { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- Чат ---------- */
.chat-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); }
.chat-card .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--sky); display: grid; place-items: center; font-size: 22px; }
.chat-card small { display: block; color: var(--muted); font-size: 13px; }
.chat-badge { min-width: 22px; height: 22px; border-radius: 99px; background: var(--clay); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.chat-badge[hidden] { display: none; }
.chat { background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.chat-intro { margin: 0; font-size: 14px; color: var(--muted); }
.chat-msgs { display: flex; flex-direction: column; gap: 8px; min-height: 200px; max-height: 58vh; overflow-y: auto; padding: 8px; background: var(--bg); border-radius: 16px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble b { display: block; font-size: 12px; color: var(--clay); }
.bubble .t { display: block; font-size: 11px; opacity: .7; margin-top: 3px; text-align: right; }
.side nav .count[hidden] { display: none; }
.achat { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px; min-height: 420px; }
.achat-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.achat-item { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; font: inherit; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.achat-item[aria-current="true"] { border-color: var(--blue); background: var(--sky); }
.achat-item small { grid-column: 1 / -1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achat-item .count { font-size: 12px; font-weight: 700; background: var(--clay); color: #fff; padding: 1px 8px; border-radius: 10px; }
.achat-thread { display: flex; flex-direction: column; gap: 10px; }
.achat-head { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 720px) { .achat { grid-template-columns: 1fr; } }
.chat-fab {
  position: fixed; left: max(18px, calc(50% - 262px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(22, 51, 92, .35); z-index: 6;
}
.chat-fab[hidden] { display: none; }
.chat-fab .chat-badge { position: absolute; top: -4px; right: -4px; box-shadow: 0 0 0 2px #fff; }
.dir-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dir-filter input { flex: 1 1 260px; min-width: 0; }
.dir-filter select { flex: 0 1 auto; width: auto; max-width: 100%; }
.dir-filter input, .dir-filter select { height: 42px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 14px; background: #fff; }
.dir-filter input:focus, .dir-filter select:focus { outline: none; border-color: var(--blue); }
tr[hidden] { display: none; }
.wx-compact { color: var(--ink); gap: 10px; }
.wx-row { display: flex; gap: 12px; align-items: flex-start; }
.wx-thumb { border: 1px solid var(--line); position: relative; flex: 0 0 96px; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--sky); }
.wx-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.wx-thumb em { position: absolute; right: 5px; bottom: 5px; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .6); padding: 1px 7px; border-radius: 99px; }
.wx-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wx-sum b { font-size: 18px; line-height: 1.25; }
.wx-sum > span:not(.wx-go) { font-size: 14px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wx-go { font-size: 14px; font-weight: 700; color: var(--blue); margin-top: 2px; }
.wx-tip { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- Унаа ---------- */
.tabs.tabs-3 { grid-template-columns: 1fr 1fr 1fr; }
.chip-sep { flex: 0 0 1px; align-self: stretch; background: var(--line); margin: 4px 2px; }
.ride-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.rides { display: flex; flex-direction: column; gap: 10px; }
.ride { display: flex; align-items: stretch; background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; border-left: 5px solid var(--blue); }
.ride.ride-passenger { border-left-color: var(--green); }
.ride-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; color: var(--ink); }
.ride-role { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--sky); color: var(--blue); }
.ride-passenger .ride-role { background: var(--green-soft); color: var(--green); }
.ride-route { font-size: 17px; font-weight: 700; line-height: 1.25; }
.ride-when { font-size: 14px; font-weight: 600; color: var(--clay); }
.ride-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.ride-note { flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ride-call { flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }
.ride-ico { display: grid; place-items: center; font-size: 26px; background: var(--sky); }
.ride-detail { display: flex; flex-direction: column; gap: 8px; }
.ride-detail h2 { margin: 0; }
.ride-detail dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ride-detail dl > div { background: var(--bg); border-radius: 12px; padding: 8px 12px; }
.ride-detail dl > div.full { grid-column: 1 / -1; }
.ride-detail dt { font-size: 12px; color: var(--muted); }
.ride-detail dd { margin: 2px 0 0; font-weight: 700; font-size: 15px; white-space: pre-wrap; }
.ride-link { display: flex; align-items: center; gap: 12px; background: var(--sky); border-radius: 18px; padding: 12px 14px; color: var(--ink); margin-bottom: 12px; font-size: 20px; }
.ride-link b { display: block; font-size: 15px; }
.ride-link small { display: block; font-size: 13px; color: var(--muted); }
.ride-link .ico { font-size: 26px; }
.seg { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 6px; }
.seg.seg-3 { grid-template-columns: 1fr 1fr 1fr; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; flex-direction: column; justify-content: center; min-height: 52px; height: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 14px; font-size: 14px; font-weight: 700; line-height: 1.25; background: #fff; cursor: pointer; }
.seg small { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.seg input:checked + span { border-color: var(--blue); background: var(--sky); color: var(--navy); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.grid-2[hidden] { display: none; }

/* ---------- Стикер ---------- */
.sticker { font-size: 44px; line-height: 1.1; display: inline-block; }
.bubble .sticker { font-size: 48px; }
.st-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.st-btn[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); background: var(--sky); }
.st-tray { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 8px; background: var(--bg); border-radius: 16px; }
.st-tray[hidden] { display: none; }
.st-tray button { border: 0; background: transparent; font-size: 28px; height: 44px; border-radius: 12px; cursor: pointer; }
.st-tray button:hover, .st-tray button:focus-visible { background: #fff; }

/* ---------- Зүрх ---------- */
.like-bar { display: flex; align-items: center; gap: 12px; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.like-btn svg path { fill: none; }
.like-btn[aria-pressed="true"] { border-color: #E5484D; color: #D93036; background: #FFF0F0; }
.like-btn[aria-pressed="true"] svg path { fill: currentColor; }
.like-btn.pop svg { animation: likepop .35s ease; }
@keyframes likepop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .like-btn.pop svg { animation: none; } }
.like-hint { font-size: 13px; color: var(--muted); }
.more-btn { width: 100%; margin: 14px 0 84px; }
.bubble.st { background: transparent !important; border: 0 !important; color: var(--muted) !important; padding: 0 4px; }
