:root {
  --ink: #14181d; --ink-soft: #5d6671; --paper: #fff; --surface: #f3f5f7;
  --line: #e3e7ea; --brand: #0f766e; --brand-dark: #0b574f; --accent: #e8a33d;
  --ok: #16a34a; --warn: #b45309; --danger: #c0392b;
  --radius: 14px; --shadow: 0 8px 30px rgba(20,24,28,.14); --shadow-sm: 0 1px 6px rgba(20,24,28,.08);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--brand); }
.hidden { display: none !important; }

.appbar { position: fixed; inset: 0 0 auto 0; height: 58px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.brand small { color: var(--ink-soft); font-size: 12px; }
.spacer { flex: 1; }
.pts { font-size: 13px; background: #fff8ee; color: var(--brand-dark); border: 1px solid var(--accent); padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 14px; font-size: 14px; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn-cta { background: var(--brand); color: #fff; border-color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.btn-cta:hover { background: var(--brand-dark); }

main { padding: 70px 16px 40px; max-width: 1100px; margin: 0 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 13px; color: var(--ink-soft); }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }

.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
#map { height: 60vh; min-height: 380px; }
.filters { position: absolute; top: 12px; left: 12px; right: 64px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--paper); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.fchip .dot { width: 10px; height: 10px; border-radius: 50%; }
.fchip.off { opacity: .4; }
.fab { position: absolute; right: 14px; bottom: 16px; z-index: 5; background: var(--brand); color: #fff; border-radius: 999px; padding: 13px 18px; font-size: 15px; font-weight: 600; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 7px; }
.fab:hover { background: var(--brand-dark); }

.recent { margin-top: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; }
.recent h3 { font-size: 14px; color: var(--ink-soft); font-weight: 600; margin: 12px 0 6px; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rrow:last-child { border-bottom: 0; }
.rrow .rdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.rrow .rname { flex: 1; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.pill.ok { background: #e6f4ec; color: #15803d; }

.sheet { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: 0; width: min(480px, 100%); background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--shadow); padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; }
.sheet::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 999px; background: var(--line); }
.sheet h2 { margin: 6px 0 4px; font-size: 20px; }
.sheet .close { position: absolute; top: 12px; right: 14px; font-size: 24px; color: var(--ink-soft); }
.verified-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--brand-dark); background: rgba(15,118,110,.1); padding: 4px 10px; border-radius: 999px; }
.desc { font-size: 15px; line-height: 1.6; margin: 10px 0; }

label.field { display: block; margin: 14px 0 5px; font-size: 13px; color: var(--ink-soft); }
input, select, textarea { width: 100%; padding: 12px; font-size: 16px; font-family: inherit; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.btn-primary { width: 100%; margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 600; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { width: 100%; margin-top: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.hint { font-size: 13px; color: var(--ink-soft); margin: 6px 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.tabs button { flex: 1; padding: 11px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }
.menu-links { display: flex; gap: 14px; }
.menu-links a { font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.menu-links a:hover { color: var(--brand); }
.maplibregl-ctrl-bottom-left { display: none; }

@media (max-width: 680px) {
  .brand small, .menu-links { display: none; }
  main { padding: 66px 10px 30px; }
  #map { height: 56vh; }
}
