@font-face { font-family: 'Dia'; src: url('/assets/fonts/Dia-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Dia'; src: url('/assets/fonts/Dia-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root { --green: #0c3518; --green2: #164a24; --accent: #9be15d; --ink: #10251a; --muted: #4d6656; --bg: #f3f5ef; --tab: 64px; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Dia', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)); }
a { color: var(--green); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { background: var(--green); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 18px; }
.top-row, .hero, main, .tabbar-inner { max-width: 640px; margin: 0 auto; }
.top-row { display: flex; align-items: center; justify-content: space-between; }
.logo { height: 30px; width: auto; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #3c6b49; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.big { font-size: 52px; font-weight: 700; line-height: 1; color: var(--accent); }
.sub { font-size: 15px; color: #cfe3d3; margin-top: 4px; }
.stand { font-size: 13px; color: #cfe3d3; display: flex; align-items: center; gap: 6px; text-align: right; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.offline { max-width: 640px; margin: 12px auto 0; background: #fbefdc; color: #7a470a; border-radius: 10px; padding: 8px 12px; font-size: 14px; }

main { padding: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.seg { display: flex; background: #fff; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; min-height: 40px; padding: 0 14px; border-radius: 9px; cursor: pointer; font-size: 15px; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }
.near { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--green); background: #fff; color: var(--green); min-height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; }
.near[aria-pressed="true"] { background: var(--green); color: #fff; }
.msg { margin: 0 0 8px; font-size: 14px; color: var(--muted); min-height: 0; }
.msg:empty { display: none; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lot { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 16px; background: #fff; text-align: left; cursor: pointer; }
.count { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; background: var(--c); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.count b { font-size: 21px; }
.count small { font-size: 10px; margin-top: 3px; opacity: .9; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.name { font-size: 16px; font-weight: 700; }
.addr { font-size: 13px; color: var(--muted); }
.dist { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.legend { font-size: 12px; color: var(--muted); margin: 12px 4px 0; }
.s-many { --c: #1f8a3f; --bg2: #e3f3e6; --fg2: #1d5a2e; }
.s-few  { --c: #c97a10; --bg2: #fbefdc; --fg2: #7a470a; }
.s-full { --c: #b3261e; --bg2: #fbe4e2; --fg2: #8f1e18; }
.s-none { --c: #7d8a80; --bg2: #eef1ec; --fg2: #4d5a51; }

#view-map { margin: -16px; }
#map { height: calc(100vh - var(--tab) - 170px - env(safe-area-inset-bottom)); min-height: 360px; background: #e7ede2; }
.pin-wrap { background: none; border: 0; }
.pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; background: var(--c); box-shadow: 0 6px 14px rgba(12,53,24,.35); display: flex; align-items: center; justify-content: center; }
.pin span { transform: rotate(45deg); color: #fff; font: 700 12px 'Dia', system-ui, sans-serif; }
.me { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25); }

#view-info h2 { font-size: 22px; margin: 4px 0 12px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { background: #fff; border-radius: 16px; padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 88px; }
.card span { font-size: 13px; color: #1d6b33; font-weight: 700; }
.install { background: #fff; border-radius: 16px; padding: 16px; margin-top: 20px; }
.install h2 { margin-top: 0 !important; }
.install p { margin: 0; font-size: 15px; line-height: 1.5; }
.btn { border: 0; background: var(--green); color: #fff; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.links { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; }
.links a { display: inline-block; padding: 6px 0; }
.fine { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: #fff; border-top: 1px solid #dfe7dc; padding-bottom: env(safe-area-inset-bottom); }
.tabbar-inner { display: flex; }
.tabbar button { flex: 1; height: var(--tab); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tabbar button[aria-current="page"] { color: var(--green); font-weight: 700; }

.sheet { position: fixed; inset: 0; z-index: 2000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: 86vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-close { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border: 0; background: #eef4ec; border-radius: 50%; font-size: 24px; cursor: pointer; }
.badge { display: inline-block; font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--bg2); color: var(--fg2); }
.sheet h2 { margin: 10px 48px 4px 0; font-size: 26px; line-height: 1.15; }
.sheet .addr2 { color: var(--muted); font-size: 15px; }
.free { display: flex; align-items: baseline; gap: 8px; margin: 12px 0; }
.free b { font-size: 52px; line-height: 1; color: var(--c); }
.hint { background: #fbefdc; color: #7a470a; border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.nav { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 999px; background: var(--green); color: #fff !important; text-decoration: none; font-weight: 700; margin: 14px 0 18px; }
.h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: #1d6b33; margin: 16px 0 8px; }
.tarife { list-style: none; margin: 0; padding: 0; }
.tarife li { padding: 9px 0; border-bottom: 1px solid #e6ece3; font-size: 15px; }
.conn { display: flex; flex-wrap: wrap; gap: 8px; }
.conn a, .conn span { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: #eef4ec; color: var(--ink); text-decoration: none; }

@media (min-width: 700px) { #map { height: 560px; } #view-map { margin: 0; border-radius: 18px; overflow: hidden; } }
