:root {
  --ink: #0f2233; --panel: rgba(13, 30, 45, .93); --line: rgba(255, 255, 255, .13); --text: #fff7e6; --muted: #a9bdcc;
  --gold: #f6bb22; --gold-ink: #2b1d00; --turq: #2ba6a0; --sky: #d3e6f0; --r: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color: var(--text); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#map { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
#tags { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }

/* ---------- xaritadagi yorliqlar ---------- */
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; font-weight: 650; font-size: 12px; line-height: 1; padding: 5px 9px 5px 8px; border-radius: 10px; color: #14283a; background: rgba(255, 250, 238, .96); box-shadow: 0 2px 8px rgba(10, 25, 40, .28); }
.tag::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--turq); vertical-align: 1px; }
.tag.wait::before { background: #c9b98f; }
.tag.me { font-size: 15px; font-weight: 800; padding: 7px 12px 7px 10px; background: var(--gold); color: var(--gold-ink); z-index: 3; box-shadow: 0 4px 16px rgba(60, 40, 0, .4); }
.tag.me::before { background: #fff; }
.tag.place { font-weight: 750; font-size: 12.5px; padding: 6px 10px; color: #fff; background: rgba(13, 30, 45, .9); border: 1px solid rgba(255, 255, 255, .22); z-index: 2; }
.tag.place::before { background: var(--gold); border-radius: 2px; transform: rotate(45deg); }
.tag.car { font-size: 11px; font-weight: 750; padding: 4px 8px 4px 7px; border-radius: 9px; color: #fff; background: rgba(43, 166, 160, .95); z-index: 1; }
.tag.car::before { width: 9px; height: 5px; border-radius: 3px 3px 1px 1px; background: #fff; vertical-align: 0; }
.tag.tuman { background: none; box-shadow: none; padding: 0; font-size: 13px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; color: rgba(74, 44, 24, .82); text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.tag.tuman::before { display: none; }
.night .tag.tuman { color: rgba(255, 240, 214, .86); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* ---------- yuqori qism ---------- */
.top { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; z-index: 5; }
.brand, .pop, .tools, .sheet, .toast { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 34px rgba(8, 20, 34, .34); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 16px; text-align: left; }
.brand img { border-radius: 11px; display: block; }
.brand b { display: block; font-size: 17px; font-weight: 850; letter-spacing: -.3px; line-height: 1.1; }
.brand small { display: block; margin-top: 2px; font-size: 11px; font-weight: 650; color: var(--gold); letter-spacing: .04em; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop { padding: 7px 14px 8px; border-radius: 16px; text-align: right; }
.pop small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pop b { display: block; font-size: 21px; font-weight: 850; letter-spacing: -.4px; line-height: 1.1; font-variant-numeric: tabular-nums; }

.tools { position: fixed; right: 12px; top: 50%; transform: translateY(-58%); display: grid; padding: 4px; border-radius: 16px; z-index: 4; }
.tools button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
.tools button:hover { background: rgba(255, 255, 255, .1); }
.tools button:active { background: rgba(255, 255, 255, .18); }

/* ---------- pastki oyna ---------- */
.sheet { position: fixed; left: 16px; bottom: 16px; width: 404px; max-height: calc(100dvh - 110px); overflow: auto; padding: 22px 22px 20px; border-radius: var(--r); z-index: 6; animation: rise .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.badge { display: inline-block; padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--gold-ink); background: var(--gold); }
.badge.ok { background: var(--turq); color: #fff; }
.badge.soft { background: rgba(255, 255, 255, .14); color: var(--text); }
.sheet h1, .sheet h2 { margin: 12px 0 8px; font-weight: 850; letter-spacing: -.6px; line-height: 1.12; text-wrap: balance; overflow-wrap: anywhere; }
.sheet h1 { font-size: 27px; }
.sheet h2 { font-size: 24px; padding-right: 40px; }
.lead { margin: 0 0 14px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.addr { margin: 0 0 10px; font-size: 16px; font-weight: 650; line-height: 1.35; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin: 0 0 10px; }
.price b { font-size: 24px; font-weight: 850; letter-spacing: -.4px; color: var(--gold); font-variant-numeric: tabular-nums; }
.price span { font-size: 13px; color: var(--muted); }
.msg { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: #ffd98a; }
.msg:empty { display: none; }
#find { position: relative; display: flex; gap: 8px; margin-top: 14px; }
#find .primary { flex: none; width: auto; padding: 0 16px; }
/* qidiruv takliflari: maydon ustida ochiladi */
.hits { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 2; max-height: 296px; overflow: auto; margin: 0; padding: 6px; list-style: none; border-radius: 14px; background: #152b3e; border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 -12px 30px rgba(4, 12, 22, .55); }
.hits li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.hits li:hover, .hits li[aria-selected="true"] { background: rgba(255, 255, 255, .13); }
.hits b { flex: 0 1 auto; min-width: 0; max-width: 66%; font-size: 15.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hits b::before { content: "@"; margin-right: 1px; color: var(--gold); }
.hits span { flex: 1 1 0; min-width: 0; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hits li.none { font-size: 13.5px; color: var(--muted); cursor: default; background: none; }
.field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; padding: 0 12px; height: 50px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .2); }
.field:focus-within { border-color: var(--gold); }
.field span { font-size: 18px; font-weight: 800; color: var(--gold); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 600; }
.field input::placeholder { color: #8fa5b6; font-weight: 500; }
.primary { height: 50px; padding: 0 18px; border-radius: 14px; font-size: 16px; font-weight: 800; color: var(--gold-ink); background: var(--gold); white-space: nowrap; transition: transform .12s, filter .12s; }
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: scale(.97); }
.primary[disabled] { opacity: .6; pointer-events: none; }
.wide { width: 100%; margin-top: 4px; }
.ghost { height: 46px; padding: 0 14px; border-radius: 13px; font-size: 14.5px; font-weight: 700; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); white-space: nowrap; }
.ghost:hover { background: rgba(255, 255, 255, .16); }
.ghost[disabled] { opacity: .6; pointer-events: none; }
.link { margin-top: 12px; padding: 6px 2px; font-size: 14px; font-weight: 700; color: var(--text); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .4); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.foot a.link { color: var(--gold); text-decoration-color: rgba(246, 187, 34, .5); }
.cta { display: flex; align-items: center; justify-content: center; min-height: 50px; margin: 0 0 12px; padding: 6px 16px; border-radius: 14px; font-size: 16px; font-weight: 800; text-align: center; text-decoration: none; color: #fff; background: var(--turq); }
.cta:hover { filter: brightness(1.07); }
.cta.second { margin: 10px 0 0; }
#signup { margin-top: 10px; }
#authForm { display: grid; gap: 8px; }
.alt { display: grid; gap: 8px; margin-top: 12px; justify-items: stretch; }
.alt .or { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#gBtn { display: flex; justify-content: center; min-height: 44px; }
.decor #buildBtn { margin: 0 0 12px; }
.builds { display: grid; gap: 8px; }
.builds button { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; padding: 12px 14px; border-radius: 14px; text-align: left; background: rgba(255, 255, 255, .08); border: 1.5px solid var(--line); }
.builds button:hover { background: rgba(255, 255, 255, .14); }
.builds button[aria-checked="true"] { border-color: var(--gold); background: rgba(246, 187, 34, .14); }
.builds b { font-size: 16px; font-weight: 800; }
.builds span { padding: 3px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 800; color: var(--gold-ink); background: var(--gold); white-space: nowrap; }
.builds small { grid-column: 1 / -1; font-size: 13px; line-height: 1.35; color: var(--muted); }
.tower { margin-top: 8px; padding: 14px; border-radius: 14px; background: rgba(246, 187, 34, .1); border: 1.5px solid rgba(246, 187, 34, .45); }
.tower .label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tower-top, .tower-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tower-top b { font-size: 22px; font-weight: 850; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.tower-pick { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.tower-pick button { flex: none; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; font-weight: 800; line-height: 1; background: rgba(255, 255, 255, .12); border: 1px solid var(--line); }
.tower-pick button:hover { background: rgba(255, 255, 255, .2); }
.tower-pick button:disabled { opacity: .4; }
.tower-pick input { flex: 1; min-width: 0; height: 44px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.tower-sum span { font-size: 13px; font-weight: 700; color: var(--muted); }
.tower-sum b { font-size: 24px; font-weight: 850; letter-spacing: -.4px; color: var(--gold); font-variant-numeric: tabular-nums; }
.tiers { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.tiers li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.tiers li[aria-current="true"] { color: var(--text); background: rgba(255, 255, 255, .12); }
/* bino hammaga ko'rinadimi: to'lovdan oldin — yo'l, keyin — tasdiq */
.pub { margin-top: 10px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.pub p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.pub[data-state="ok"] { border-color: rgba(43, 166, 160, .7); background: rgba(43, 166, 160, .16); }
.pub[data-state="ok"] p, .pub p:last-child { margin: 0; }
.pub[data-state="ok"] p { font-weight: 750; }
.pub a.primary, .pub a.ghost { display: flex; align-items: center; justify-content: center; margin-top: 0; text-decoration: none; text-align: center; }
.pub a.ghost { margin-top: 8px; color: var(--text); }
.fine { display: block; margin-top: 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chips button { min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 13.5px; font-weight: 700; background: rgba(255, 255, 255, .09); border: 1px solid var(--line); }
.chips button:hover { background: rgba(255, 255, 255, .16); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row > * { flex: 1; }
.x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.decor { margin: 4px 0 2px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.decor .label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.decor small { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18); }
.swatches button[aria-checked="true"] { border-color: #fff; }
.swatches.small { gap: 7px; flex-wrap: wrap; }
.swatches.small button { width: 32px; height: 32px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5), inset 0 0 0 2px rgba(0, 0, 0, .14); }
.decor .label + .seg, .decor .row + .label, .decor .seg + .label { margin-top: 14px; }
.decor .label + .seg { margin-top: 0; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; height: 42px; border-radius: 12px; font-size: 14.5px; font-weight: 750; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); white-space: nowrap; }
.seg button:hover { background: rgba(255, 255, 255, .16); }
.seg button[aria-checked="true"] { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.carrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.carrow .ghost { flex: none; }

.toast { position: fixed; left: 50%; top: calc(74px + env(safe-area-inset-top)); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 700; z-index: 9; animation: rise .2s ease-out; }
.osm { position: fixed; right: 8px; bottom: 6px; z-index: 3; font-size: 10.5px; color: rgba(20, 35, 50, .7); text-decoration: none; background: rgba(255, 255, 255, .55); padding: 2px 6px; border-radius: 6px; }
.demo { position: fixed; top: calc(72px + env(safe-area-inset-top)); right: 12px; z-index: 5; padding: 4px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold); }
.load, .fail { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px; background: #12283a; transition: opacity .5s; }
.load img { border-radius: 18px; animation: bob 1.4s ease-in-out infinite; }
.load p, .fail p { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.load.done { opacity: 0; pointer-events: none; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .load img { animation: none; } }

/* ---------- telefon ---------- */
@media (max-width: 819px) {
  .sheet { left: 0; right: 0; bottom: 0; width: auto; max-height: 62dvh; border-radius: 22px 22px 0 0; border-width: 1px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  #welcome { max-height: 72dvh; }                    /* bosh oyna: pastki «Mening hovlim» qatori ko'rinib tursin */
  .sheet h1 { font-size: 23px; }
  .sheet h2 { font-size: 21px; }
  .lead { font-size: 14px; }
  .tools { top: calc(104px + env(safe-area-inset-top)); transform: none; right: 10px; }
  .tools button { width: 42px; height: 42px; }
  .osm { bottom: auto; right: auto; left: 12px; top: calc(68px + env(safe-area-inset-top)); }
  .brand b { font-size: 15.5px; }
  .pop b { font-size: 19px; }
  .tag { font-size: 11.5px; }
}
@media (max-width: 380px) { .primary { width: 100%; } }
