:root {
  --navy: #154a78; --navy-deep: #0d3354; --spark: #f5b700;
  --gas: #d64545; --ev: #e8892a; --other: #7a6ad8; --station: #4a8f5a;
  --bg: #ffffff; --text: #1b1f24; --muted: #5d6670; --border: #e3e1da; --soft: #f4f3ee;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b2128; --text: #e9ecef; --muted: #9aa4ae; --border: #2c343d; --soft: #232a32; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); overflow: hidden; }

.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 3; display: flex; gap: 8px; align-items: center;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; color: inherit; text-decoration: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 6px; background: #fff; }
.search { flex: 1; display: flex; gap: 6px; min-width: 0; }
.search input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--soft); color: var(--text); font: inherit; }
.search button, .locate { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--soft); color: var(--text); font: inherit; cursor: pointer; }

#map { position: fixed; top: 54px; bottom: 0; left: 0; right: 0; }

.legend { position: fixed; z-index: 2; top: 64px; left: 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: calc(100% - 20px);
  padding: 4px 10px; font-size: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-radius: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; border: 1.5px solid #fff; }
.dot.gas { background: var(--gas); } .dot.ev { background: var(--ev); } .dot.other { background: var(--other); }
.dot.station { background: var(--station); width: 8px; height: 8px; }

.report-btn { position: fixed; z-index: 2; left: 50%; transform: translateX(-50%); bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
  padding: 14px 22px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: 600 17px system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; white-space: nowrap; }
.report-btn:hover { background: var(--navy-deep); }

.attrib { position: fixed; z-index: 1; left: 0; bottom: 0; padding: 2px 6px; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--bg) 80%, transparent); }
.attrib a { color: inherit; }

.panel { position: fixed; z-index: 4; right: 0; bottom: 0; width: min(420px, 100%); max-height: calc(100% - 54px); overflow: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
@media (min-width: 760px) { .panel { top: 64px; bottom: auto; right: 12px; border-radius: 16px; max-height: calc(100% - 76px); } }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel h2 { margin: 0; font-size: 19px; }
.close { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; }

.notice { padding: 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--border); font-size: 14px; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--soft); color: var(--text); font: 600 15px system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.google { width: 100%; background: #fff; color: #1b1f24; border-color: #c9c9c9; }
.btn.link { border: 0; background: none; color: var(--muted); margin-top: 6px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 8px; }
.row { display: flex; gap: 6px; }
.row input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--soft); color: var(--text); font: inherit; }
.msg { font-size: 14px; color: var(--muted); margin: 8px 0 0; min-height: 1em; }
.msg.err { color: var(--gas); }

.photo { display: block; border: 2px dashed var(--border); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; margin-bottom: 12px; }
.photo input { display: none; }
.photo img { display: block; max-width: 100%; max-height: 220px; margin: 0 auto; border-radius: 8px; }
.field { margin-bottom: 12px; }
.label { font-weight: 600; font-size: 14px; margin-bottom: 4px; display: block; }
.hint { font-weight: 400; color: var(--muted); }
.choice { display: block; padding: 6px 0; font-size: 15px; }
select, textarea, #unlisted-name { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--soft); color: var(--text); font: inherit; }
.rules { font-size: 13px; color: var(--muted); }
#submit { width: 100%; }

#move-pin { margin: 6px 0; }
#unlisted { margin-top: 8px; }
.field > .hint { font-size: 12px; margin: 6px 0 0; }
.adjust-bar { position: fixed; z-index: 4; left: 10px; right: 10px; bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 14px; }
@media (min-width: 760px) { .adjust-bar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; } }

.ok { font-weight: 600; color: var(--station); }
.recipient { padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; font-size: 14px; }
.recipient label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.recipient small { color: var(--muted); display: block; }
.send-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.preview pre { white-space: pre-wrap; font: 13px/1.45 system-ui, sans-serif; background: var(--soft); padding: 10px; border-radius: 8px; }

.maplibregl-popup-content { color: #1b1f24; font: 14px/1.4 system-ui, sans-serif; }
.pop-report { margin-top: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--navy); color: #fff;
  font: 600 14px system-ui, sans-serif; cursor: pointer; }
