:root {
  --blue: #1355a4;
  --blue-deep: #0c3e7c;
  --red: #d7263d;
  --red-deep: #a81528;
  --tag: #ffc53d;
  --ink: #17233b;
  --paper: #ffffff;
  --line: #dce3ee;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI",
    "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
}

#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}

.panel {
  pointer-events: auto;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(12, 32, 68, 0.16);
  padding: 10px 14px;
}

.title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--blue-deep);
}

.title h1 small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: #5b6b85;
  letter-spacing: 0.08em;
}

.tag {
  position: relative;
  background: var(--tag);
  border-radius: 4px 10px 10px 4px;
  padding: 6px 12px 6px 16px;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 3px 8px rgba(120, 80, 0, 0.25);
  transform: rotate(-2deg);
  white-space: nowrap;
}

.tag::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px rgba(120, 80, 0, 0.5);
}

.tag .num {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.tag .lbl {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: #6b4e00;
}

.bar {
  height: 5px;
  border-radius: 3px;
  background: #edf1f7;
  margin-top: 7px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #f0596e);
  width: 0%;
  transition: width 0.4s;
}

.filters {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pref-select {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px 7px 14px;
  box-shadow: 0 3px 10px rgba(12, 32, 68, 0.14);
  font-size: 12.5px;
  font-weight: 700;
}

.pref-select span {
  color: #5b6b85;
  letter-spacing: 0.06em;
}

.pref-select select {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  max-width: 9em;
}

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(12, 32, 68, 0.14);
}

.chip.on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.chip.on.warn {
  background: var(--red);
  border-color: var(--red);
}

.chip:focus-visible {
  outline: 3px solid var(--tag);
  outline-offset: 1px;
}

.locate {
  position: fixed;
  right: 12px;
  bottom: calc(108px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(12, 32, 68, 0.2);
}

.locate:focus-visible {
  outline: 3px solid var(--tag);
}

.pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--blue);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 7px rgba(10, 25, 60, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin span {
  transform: rotate(45deg);
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  font-family: "Arial Black", "Hiragino Kaku Gothic ProN", sans-serif;
}

.pin.done {
  background: var(--red);
}

.leaflet-div-icon {
  background: transparent;
  border: none;
}

.leaflet-popup-content {
  margin: 14px 16px;
  min-width: 225px;
}

.pop .brand {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--blue);
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 5px;
}

.pop.done .brand {
  background: var(--red);
}

.pop h2 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 5px;
}

.pop .addr {
  font-size: 12px;
  color: #44536e;
  line-height: 1.5;
}

.pop .date {
  font-size: 11.5px;
  color: var(--red);
  font-weight: 700;
  margin-top: 6px;
}

.pop .links {
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  gap: 12px;
}

.pop .links a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.pop button {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: 9px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: var(--blue);
}

.pop.done button {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
}

.pop .note {
  font-size: 10px;
  color: #8a97ac;
  margin-top: 7px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(70px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  z-index: 2000;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 18px;
  opacity: 0;
  transition: 0.25s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .bar i,
  .toast {
    transition: none;
  }
}

@media (max-width: 430px) {
  .title h1 {
    font-size: 15px;
  }

  .tag .num {
    font-size: 16px;
  }
}
