:root {
  --blue: #1f6feb;
  --ink: #16202c;
  --muted: #5b6776;
  --bg: #ffffff;
  --line: #e3e7ec;
  --good: #1a7f37;
  --warn: #b35900;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
body { display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg); border-bottom: 1px solid var(--line); z-index: 2;
}
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand span { color: var(--blue); }
.search { flex: 1; min-width: 0; }
.search gmp-place-autocomplete { width: 100%; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; }

#map { flex: 1; }

.hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); margin: 0;
  background: rgba(22,32,44,.85); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .85rem;
  max-width: calc(100% - 32px); text-align: center;
}

.pin {
  background: var(--blue); color: #fff; font-size: 16px; border-radius: 50%;
  width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.panel {
  position: fixed; z-index: 3; background: var(--bg); overflow-y: auto; padding: 16px 18px 24px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  left: 0; right: 0; bottom: 0; max-height: 75vh; border-radius: 16px 16px 0 0;
}
@media (min-width: 760px) {
  .panel { left: auto; top: 57px; right: 0; bottom: 0; width: 380px; max-height: none; border-radius: 0; }
}
.panel h2 { margin: 0 32px 4px 0; font-size: 1.2rem; }
.close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.muted { color: var(--muted); margin: 0 0 12px; font-size: .9rem; }

.code-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.code-group h4 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.code-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.6rem; font-weight: 700; }
.code-meta { font-size: .8rem; color: var(--muted); margin: 2px 0 8px; }
.code-note { font-size: .9rem; margin: 4px 0; }
.stale { color: var(--warn); font-weight: 600; }
.vote-row { display: flex; gap: 8px; }
.vote-row button { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .9rem; }
.vote-row button.voted { border-color: var(--blue); background: #eef4ff; }
details.history { margin-top: 8px; font-size: .85rem; color: var(--muted); }
details.history li { margin: 2px 0; }

.add-form { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.add-form h3 { font-size: 1rem; }
.restroom-pick { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.restroom-pick legend { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.restroom-pick label { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.restroom-pick label:has(input:checked) { border-color: var(--blue); background: #eef4ff; }
.restroom-pick input { margin: 0 4px 0 0; }
.field { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.field input { display: block; width: 100%; margin-top: 4px; padding: 10px; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; }
.primary { width: 100%; padding: 12px; font-size: 1rem; font-weight: 600; border: 0; border-radius: 10px; background: var(--blue); color: #fff; cursor: pointer; }
.primary:disabled { opacity: .6; }
.msg { font-size: .9rem; min-height: 1.2em; }
.msg.ok { color: var(--good); }
.msg.err { color: #c62828; }
