/* Silverleaf — frosted glass UI */
:root {
  --navy: #1f1b4e;
  --navy-2: #342e82;
  --navy-soft: rgba(31, 27, 78, .07);
  --text: #16142e;
  --muted: #6b6e8a;
  --amber: #e9a23b;
  --green: #2f9e6d;
  --red: #d64545;
  --taylor: #e8806f;
  --drees: #5fbf6a;
  --saratoga: #6a6ae0;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .75);
  --hair: rgba(31, 27, 78, .09);
  --shadow: 0 1px 1px rgba(31, 27, 78, .04), 0 10px 34px rgba(31, 27, 78, .10);
  --shadow-lg: 0 2px 4px rgba(31, 27, 78, .06), 0 24px 70px rgba(31, 27, 78, .22);
  --ease: cubic-bezier(.32, .72, 0, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; max-width: 100vw; }
body {
  font-size: 16px; line-height: 1.4; letter-spacing: -.005em;
  background:
    radial-gradient(900px 600px at 8% -5%, rgba(120, 110, 230, .30), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(110, 200, 220, .26), transparent 60%),
    radial-gradient(900px 700px at 70% 105%, rgba(232, 128, 111, .20), transparent 60%),
    #eef0f8;
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; transition: transform .18s var(--ease), background .2s, box-shadow .2s, opacity .2s; }
button:active:not(:disabled) { transform: scale(.97); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
.hidden { display: none !important; }
a { color: var(--navy-2); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow);
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.login::before { width: 420px; height: 420px; background: #8b82f0; left: -120px; top: -100px; }
.login::after { width: 380px; height: 380px; background: #f0a08f; right: -100px; bottom: -90px; }
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 390px; text-align: center; padding: 30px 26px 24px; border-radius: 34px;
  background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(40px) saturate(200%); backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, .8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--shadow-lg);
  animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.login-card img.logo { width: 220px; max-width: 78%; margin: 2px auto 4px; display: block; }
.login-card h1 { font-size: 20px; font-weight: 650; margin: 14px 0 4px; }
.login-card p { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.who { display: grid; gap: 10px; }
.who button {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 18px; text-align: left; font-weight: 600;
  background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 1px 2px rgba(31, 27, 78, .06);
}
.who button:hover { background: #fff; box-shadow: 0 6px 18px rgba(31, 27, 78, .12); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .7); }
.linkbtn { background: none; border: 0; color: var(--navy-2); font-size: 14px; padding: 10px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 4px 0 20px; min-height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--navy); transition: .15s var(--ease); }
.pin-dots i.on { background: var(--navy); transform: scale(1.1); }
.pin-dots.shake { animation: shake .38s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 78px); gap: 14px; justify-content: center; }
.keypad button {
  width: 78px; height: 78px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .85); font-size: 28px; font-weight: 500; color: var(--navy);
  background: rgba(255, 255, 255, .62); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(31, 27, 78, .08);
}
.keypad button:active { background: rgba(255, 255, 255, .95); }
.keypad button.ghost { background: transparent; border-color: transparent; box-shadow: none; font-size: 15px; font-weight: 500; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 0 0 10px !important; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 10px; z-index: 30; margin: 10px 12px 0; padding: 8px 10px 8px 18px; border-radius: 26px;
  display: flex; align-items: center; gap: 16px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--shadow);
}
.topbar img.brand { height: 26px; flex: none; }
.tabs {
  display: flex; gap: 2px; padding: 4px; border-radius: 99px; background: rgba(31, 27, 78, .06); margin: 0 auto;
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.tabs button:hover { color: var(--navy); }
.tabs button.active { color: var(--navy); background: #fff; box-shadow: 0 1px 2px rgba(31, 27, 78, .12), 0 4px 12px rgba(31, 27, 78, .08); }
.who-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 6px 6px 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .9); flex: none; }
.nm-s { display: none; }
.who-chip button { background: var(--navy-soft); border: 0; color: var(--navy); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; }
main { padding: 18px 16px 40px; max-width: 1200px; margin: 0 auto; animation: fade .35s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main.map-main { max-width: none; padding: 12px; }

/* ---------- common ---------- */
.card { border-radius: 26px; padding: 18px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.btn { border: 0; border-radius: 99px; padding: 12px 22px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #3a3390 0%, var(--navy) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px rgba(31, 27, 78, .28); }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: rgba(255, 255, 255, .7); color: var(--navy); border: 1px solid rgba(255, 255, 255, .9); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(31, 27, 78, .08); }
.btn.danger { background: rgba(214, 69, 69, .10); color: var(--red); box-shadow: none; border: 1px solid rgba(214, 69, 69, .18); }
.btn.green { background: linear-gradient(180deg, #3bb07e 0%, var(--green) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px rgba(47, 158, 109, .32); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; background: rgba(31, 27, 78, .07); color: var(--navy); }
.pill.available { background: rgba(31, 27, 78, .07); color: #54567a; }
.pill.contract { background: rgba(233, 162, 59, .2); color: #8a5608; }
.pill.closed { background: rgba(47, 158, 109, .18); color: #17683f; }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 5px 4px; }
.f-wrap { margin-bottom: 12px; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=tel], input[type=password], select, textarea {
  width: 100%; padding: 12px 14px; min-height: 46px; border-radius: 15px; border: 1px solid rgba(31, 27, 78, .10); background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 2px rgba(31, 27, 78, .06);
}
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: rgba(52, 46, 130, .5); box-shadow: 0 0 0 4px rgba(52, 46, 130, .14); }
input[readonly] { background: rgba(31, 27, 78, .05); color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { font-size: 34px; font-weight: 700; letter-spacing: -.03em; color: var(--navy); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.bar { height: 9px; border-radius: 99px; background: rgba(31, 27, 78, .08); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; font-weight: 600; }
table.t td { padding: 12px; border-bottom: 1px solid rgba(31, 27, 78, .05); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; transition: background .15s; }
table.t tr.click:hover td { background: rgba(255, 255, 255, .7); }
.tablewrap { overflow-x: auto; }
.section-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 26px 4px 10px; display: flex; align-items: center; gap: 10px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.warn { background: rgba(233, 162, 59, .16); border: 1px solid rgba(233, 162, 59, .35); color: #7b5206; border-radius: 16px; padding: 10px 14px; font-size: 14px; }
.ok { background: rgba(47, 158, 109, .14); border: 1px solid rgba(47, 158, 109, .3); color: #1b6a45; border-radius: 16px; padding: 10px 14px; font-size: 14px; }

/* ---------- map ---------- */
.mapshell {
  position: relative; height: calc(100vh - 96px); min-height: 420px; overflow: hidden; touch-action: none; border-radius: 30px;
  background: #fff; border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow-lg);
}
.mapshell svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
.mapshell svg.panning { cursor: grabbing; }
.lot { stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill .2s, fill-opacity .2s; cursor: pointer; }
.lot.dim { cursor: default; }
.lot:hover { stroke-width: 3; fill-opacity: .95 !important; }
.lot.sel { stroke: #111 !important; stroke-width: 3; }
.lot-label { pointer-events: none; fill: #16142e; text-anchor: middle; dominant-baseline: central; font-weight: 700; paint-order: stroke; stroke: rgba(255, 255, 255, .9); stroke-width: 3px; }
.map-ctl { position: absolute; left: 14px; top: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 5; max-width: calc(100% - 28px); align-items: flex-start; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border: 1px solid rgba(255, 255, 255, .85); box-shadow: inset 0 1px 0 #fff, var(--shadow); }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: 14.5px; color: var(--muted); }
.seg button.active { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(31, 27, 78, .3); }
.legend, .mapstats {
  background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .85); box-shadow: inset 0 1px 0 #fff, var(--shadow); border-radius: 20px; padding: 9px 14px; font-size: 13px;
}
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.legend i { width: 13px; height: 13px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .15); display: inline-block; }
.mapstats { position: absolute; right: 14px; top: 14px; z-index: 5; }
.map-ctl select { min-height: 40px; border-radius: 99px; padding: 8px 16px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--shadow); width: auto; }
.zoom-ctl { position: absolute; right: 14px; bottom: 16px; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; z-index: 5; background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border: 1px solid rgba(255, 255, 255, .85); box-shadow: inset 0 1px 0 #fff, var(--shadow); }
.zoom-ctl button { width: 46px; height: 46px; border: 0; background: none; font-size: 22px; font-weight: 500; color: var(--navy); }
.zoom-ctl button + button { border-top: 1px solid var(--hair); }
.tip { position: absolute; pointer-events: none; background: rgba(22, 20, 46, .86); color: #fff; font-size: 13px; padding: 7px 12px; border-radius: 12px; z-index: 6; white-space: nowrap; transform: translate(-50%, -150%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- lot sheet ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(22, 20, 56, .22); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 40; display: flex; justify-content: flex-end; align-items: stretch; padding: 12px; animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  width: 440px; max-width: 100%; height: 100%; overflow-y: auto; padding: 22px 22px calc(26px + env(safe-area-inset-bottom)); border-radius: 32px;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(40px) saturate(200%); backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: inset 0 1px 0 #fff, var(--shadow-lg); animation: slideIn .5s var(--ease) both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(40px) scale(.98); } }
.sheet header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sheet h2 { font-size: 24px; font-weight: 700; }
.sheet .x { border: 0; background: rgba(31, 27, 78, .08); border-radius: 50%; width: 34px; height: 34px; font-size: 15px; color: var(--navy); flex: none; }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 9px 10px; font-size: 15px; margin: 14px 0 18px; padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .85); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.history { font-size: 13px; color: var(--muted); border-top: 1px solid var(--hair); margin-top: 20px; padding-top: 12px; }
.history div { padding: 3px 0; }

.tabbar { display: none; }

/* ---------- mobile first ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar { position: sticky; top: 0; margin: 0; border-radius: 0 0 26px 26px; padding: calc(9px + env(safe-area-inset-top)) 14px 9px; gap: 10px; }
  .topbar .tabs { display: none; }
  .topbar img.brand { height: 21px; flex: 0 1 auto; min-width: 0; max-width: 52%; object-fit: contain; object-position: left; }
  .who-chip { margin-left: auto; padding: 4px 4px 4px 10px; min-width: 0; gap: 6px; font-size: 13px; }
  .who-chip span.nm { display: none; }
  .who-chip span.nm-s { display: inline; }
  .who-chip button { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
  .tabbar {
    display: flex; position: fixed; z-index: 35; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); padding: 6px; gap: 2px;
    border-radius: 30px; overflow-x: auto; scrollbar-width: none; justify-content: space-around;
    background: rgba(255, 255, 255, .66); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: inset 0 1px 0 #fff, 0 10px 40px rgba(31, 27, 78, .22);
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar button { flex: 1 0 auto; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 8px 10px 7px; border-radius: 24px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
  .tabbar button svg { width: 24px; height: 24px; }
  .tabbar button.active { color: var(--navy); background: rgba(255, 255, 255, .95); box-shadow: 0 2px 10px rgba(31, 27, 78, .14); }
  main { padding: 14px 14px calc(110px + env(safe-area-inset-bottom)); }
  main.map-main { padding: 0; }
  .mapshell { height: calc(100dvh - 58px - env(safe-area-inset-top)); min-height: 360px; border-radius: 0; border: 0; box-shadow: none; }
  .map-ctl { left: 10px; right: 10px; top: 10px; gap: 8px; flex-direction: row; flex-wrap: wrap; max-width: none; }
  .seg button { padding: 7px 13px; font-size: 13.5px; }
  .map-ctl select { min-height: 36px; font-size: 14px; }
  .legend { padding: 6px 11px; font-size: 11.5px; gap: 9px; }
  .legend i { width: 11px; height: 11px; }
  .zoom-ctl { bottom: calc(104px + env(safe-area-inset-bottom)); right: 12px; }
  .mapstats { display: block; top: auto; right: auto; left: 10px; bottom: calc(104px + env(safe-area-inset-bottom)); font-size: 12.5px; }
  .sheet-back { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; height: auto; max-height: 90dvh; border-radius: 32px 32px 0 0; padding-bottom: calc(28px + env(safe-area-inset-bottom)); animation: slideUp .5s var(--ease) both; }
  .sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(31, 27, 78, .18); margin: -10px auto 14px; }
  @keyframes slideUp { from { opacity: 0; transform: translateY(70px); } }
  .two { grid-template-columns: 1fr 1fr; }
  .two > .f-wrap:only-child { grid-column: 1 / -1; }
  .keypad { grid-template-columns: repeat(3, 76px); gap: 13px; }
  .keypad button { width: 76px; height: 76px; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  table.t { font-size: 13.5px; }
  #toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .actions .btn { flex: 1 1 auto; }
}
@media (max-width: 380px) { .two { grid-template-columns: 1fr; } }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px) scale(.96); background: rgba(22, 20, 46, .86); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #fff; padding: 13px 22px; border-radius: 99px; box-shadow: var(--shadow-lg); opacity: 0; transition: .35s var(--ease); z-index: 100; pointer-events: none; max-width: 90vw; text-align: center; font-weight: 500; }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#toast.bad { background: rgba(190, 40, 40, .92); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- softer map + banners ---------- */
.lot { stroke-width: 1.4; }
.lot:hover { stroke-width: 2.4; fill-opacity: .95 !important; }
.map-banner { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 99px; width: max-content; max-width: calc(100% - 28px); background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%); border: 1px solid rgba(255, 255, 255, .9); box-shadow: inset 0 1px 0 #fff, 0 10px 34px rgba(31, 27, 78, .2); }
.map-banner .txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.map-banner .txt strong { font-size: 14.5px; }
.map-banner .txt span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet.small { height: auto; width: min(420px, calc(100% - 24px)); align-self: center; margin: auto; padding: 24px; border-radius: 28px; }
.sheet-back.confirm { justify-content: center; align-items: center; z-index: 60; }
.sheet.small h2 { font-size: 19px; }
@media (max-width: 760px) {
  .map-banner { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .sheet.small { width: calc(100% - 20px); margin: 0 10px calc(14px + env(safe-area-inset-bottom)); align-self: flex-end; }
  .sheet-back.confirm { align-items: flex-end; }
  .sheet.small::before { display: none; }
}

/* ---------- sales cards (phones) ---------- */
.salecards { display: grid; gap: 10px; }
.salecard { border-radius: 24px; padding: 14px 16px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow); }
.salecard.click { cursor: pointer; }
.sc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sc-name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.sc-price { font-weight: 700; color: var(--navy); }
.sc-lines { margin-top: 4px; font-size: 14px; color: var(--muted); display: grid; gap: 1px; }
.sc-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.only-narrow { display: none; }
@media (max-width: 760px) { .only-wide { display: none; } .only-narrow { display: grid; } }

/* realistic land base */
.mapshell { background: linear-gradient(160deg, #e9f2e3 0%, #e3eedd 100%); }

/* Google-Maps-like base, modern */
.mapshell { background: #eef0ec; }
.lot-label { fill: #3c4043; }

/* ---------- team / leaderboard ---------- */
.rank-list { display: grid; gap: 10px; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow); }
.rank-row.click { cursor: pointer; }
.rank-row.click:hover { background: rgba(255, 255, 255, .85); }
.rank-n { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--navy); background: rgba(31, 27, 78, .07); }
.rank-n.r1 { background: linear-gradient(160deg, #ffe08a, #f2b632); color: #5a3d00; }
.rank-n.r2 { background: linear-gradient(160deg, #eef0f5, #c3c8d6); color: #3d4256; }
.rank-n.r3 { background: linear-gradient(160deg, #f6c9a5, #d79660); color: #5a2f0b; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 6px; border-radius: 99px; background: rgba(31, 27, 78, .08); margin: 7px 0 5px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4cc38f, #2aa771); }
.rank-sub { font-size: 12.5px; color: var(--muted); }
.rank-val { font-weight: 800; font-size: 22px; color: var(--navy); letter-spacing: -.02em; }
.stat-card { padding: 14px 16px; }

.seller-box { padding: 12px 14px 2px; margin-bottom: 14px; border-radius: 20px; background: rgba(31, 27, 78, .045); border: 1px solid rgba(31, 27, 78, .07); }

.rank-team { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; margin-top: 1px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-team .dot { width: 9px; height: 9px; box-shadow: none; }

/* ---------- traffic clock-in ---------- */
.clock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.clock-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 14px 14px; min-height: 150px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 28px; text-align: left; color: var(--navy); background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: inset 0 1px 0 #fff, var(--shadow); }
.clock-btn:active:not(:disabled) { transform: scale(.96); }
.clock-btn .clock-plus { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(31, 27, 78, .08); }
.clock-btn .clock-label { margin-top: 12px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.clock-btn .clock-sub { font-size: 12px; color: var(--muted); }
.clock-btn .clock-count { margin-top: auto; font-size: 38px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.clock-btn.k-visit { background: linear-gradient(160deg, rgba(76, 195, 143, .30), rgba(255, 255, 255, .85)); }
.clock-btn.k-return { background: linear-gradient(160deg, rgba(124, 92, 240, .22), rgba(255, 255, 255, .85)); }
.clock-btn.k-realtor { background: linear-gradient(160deg, rgba(240, 165, 58, .28), rgba(255, 255, 255, .85)); }
@media (max-width: 420px) { .clock-btn { min-height: 130px; padding: 14px 11px 12px; } .clock-btn .clock-label { font-size: 15px; } .clock-btn .clock-count { font-size: 32px; } }

/* ---------- saving indicator ---------- */
#saving { position: fixed; z-index: 120; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -16px) scale(.96); display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 99px; font-weight: 600; font-size: 14.5px; color: var(--navy); background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%); border: 1px solid rgba(255, 255, 255, .95); box-shadow: inset 0 1px 0 #fff, 0 10px 34px rgba(31, 27, 78, .22); opacity: 0; pointer-events: none; transition: .3s var(--ease); }
#saving.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#saving .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(31, 27, 78, .16); border-top-color: var(--navy); animation: spin .7s linear infinite; }
#saving.ok { color: #17683f; }
#saving.ok svg { color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- feels like an app when installed ---------- */
html, body { overscroll-behavior: none; }
body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
input, textarea, select, .kv dd, .sc-lines, table.t td { -webkit-user-select: text; user-select: text; }
@media all and (display-mode: standalone) { .install-tip { display: none !important; } }
.install-tip { margin: 16px 0 0; padding: 12px 14px; border-radius: 18px; text-align: left; font-size: 13.5px; line-height: 1.4; color: var(--navy); background: rgba(31, 27, 78, .06); border: 1px solid rgba(31, 27, 78, .08); }
.install-tip b { font-weight: 700; }

/* illustrated site-plan style */
.mapshell:has(.lot-label.site) { background: #dbeac3; }
.lot-label.site { fill: #fff; stroke: rgba(20, 30, 10, .55); stroke-width: 2.6px; font-weight: 800; }

#setup { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(238, 240, 248, .82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
#setup .box { display: grid; gap: 10px; justify-items: center; text-align: center; max-width: 340px; padding: 26px 24px; border-radius: 28px; background: rgba(255, 255, 255, .85); border: 1px solid #fff; box-shadow: 0 20px 60px rgba(31, 27, 78, .2); color: var(--navy); }
#setup .box span { color: var(--muted); font-size: 14px; }
#setup .spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(31, 27, 78, .15); border-top-color: var(--navy); animation: spin .8s linear infinite; }
