/* PadLaser brand theme — navy + laser cyan on white, mobile-first. */
:root {
  --navy: #0F2B52;
  --navy-2: #14315C;
  --cyan: #19A7DC;
  --cyan-bright: #29C4F0;
  --ink: #10233D;
  --ink-soft: #4A5A70;
  --ink-faint: #8595A8;
  --bg: #F7FAFC;
  --card: #FFFFFF;
  --line: #E1E8F0;
  --good: #1E8E5A;
  --warn: #C28A17;
  --bad: #C0392B;
  --radius: 14px;
  --nav-h: 62px;
  --top-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  overscroll-behavior: none;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 4px; }
a { color: var(--cyan); }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-bottom: 1px solid var(--line); padding: 0 12px;
}
.topbar-logo { height: 42px; cursor: pointer; }
.iconbtn { position: relative; padding: 8px; color: var(--navy); border-radius: 10px; }
.iconbtn:active { background: var(--bg); }
.badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

.screen {
  position: fixed; top: var(--top-h); bottom: var(--nav-h); left: 0; right: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.screen.noscroll { overflow: hidden; }
.pad { padding: 16px; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h); z-index: 30;
  display: flex; align-items: stretch; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.navbtn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--ink-faint);
}
.navbtn.active { color: var(--navy); }
.navbtn.active svg { stroke: var(--cyan); }
.plus-circle {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--cyan) 120%); color: #fff;
  box-shadow: 0 4px 14px rgba(25, 167, 220, .45); margin-top: -14px;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--navy); color: #fff; font-weight: 700; border-radius: 12px;
  padding: 13px 18px; width: 100%; margin-top: 14px;
}
.btn:active { opacity: .85; }
.btn.cyan { background: var(--cyan); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13.5px; margin-top: 0; }

.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line);
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.good { background: #E7F5EE; color: var(--good); border-color: #BFE5D2; }
.chip.warn { background: #F9F1DC; color: var(--warn); border-color: #EBD9A8; }
.chip.bad { background: #FBE9E6; color: var(--bad); border-color: #F2C6BE; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(15, 43, 82, .25); max-height: 80vh; overflow-y: auto;
  animation: sheetup .18s ease-out;
}
@keyframes sheetup { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 6px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 10px; border-radius: 12px; font-weight: 600; font-size: 15px;
}
.sheet-item:active { background: var(--bg); }
.sheet-item .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--cyan); flex: none; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 43, 82, .4); z-index: 39; }

.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px;
  z-index: 60; max-width: 90vw; text-align: center; box-shadow: 0 6px 24px rgba(15,43,82,.35);
}
.hidden { display: none !important; }

.empty { text-align: center; color: var(--ink-faint); padding: 48px 24px; }
.empty img { height: 56px; opacity: .5; margin-bottom: 10px; }

h1 { font-size: 22px; margin: 0 0 12px; color: var(--navy); }
h2 { font-size: 17px; margin: 0 0 10px; color: var(--navy); }
.muted { color: var(--ink-soft); font-size: 13.5px; }
.price { color: var(--navy); font-weight: 800; font-size: 20px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Mini-map: persistent bottom-right, expandable */
.minimap {
  position: fixed; right: 12px; bottom: calc(var(--nav-h) + 12px); z-index: 25;
  width: 118px; height: 88px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--card); box-shadow: 0 4px 16px rgba(15,43,82,.3);
  transition: width .22s ease, height .22s ease;
}
.minimap.expanded { width: calc(100vw - 24px); height: 55vh; }
.minimap .leaflet-container { width: 100%; height: 100%; }
.minimap-close { position: absolute; top: 8px; right: 8px; z-index: 1000; background: var(--card); border-radius: 8px; padding: 4px 10px; font-weight: 700; color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.2); }

@media (min-width: 720px) {
  .screen { max-width: 560px; margin: 0 auto; left: 50%; transform: translateX(-50%); }
  .topbar, .bottomnav { max-width: 560px; left: 50%; transform: translateX(-50%); }
}

/* House ads */
.feed-ad { position: relative; border-color: var(--cyan); cursor: pointer; }
.ad-tag {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: var(--navy); color: #fff; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px;
}
.ad-overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 24px;
  background: rgba(15, 43, 82, .55); backdrop-filter: blur(3px);
}
.ad-overlay-card { width: 100%; max-width: 420px; margin: 0; }
.ad-overlay .btn { width: auto; background: var(--card); }
