*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.4;
}

a { color: var(--yellow); }
a:hover { color: var(--yellow-soft); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.cream :focus-visible, .stat :focus-visible, .dialog :focus-visible, .toast :focus-visible, .map-note :focus-visible { outline-color: var(--red); }

.visually-hidden, .offscreen {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--on-navy-3); margin: 0; }
.small { font-size: 13px; line-height: 1.5; }
.mono-label { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }

.display {
  margin: 0;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.9;
  font-weight: 900;
  font-stretch: 70%;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  font-stretch: 70%;
  text-transform: uppercase;
}

.subtitle {
  margin: 16px 0 6px;
  font-size: 18px;
  font-weight: 900;
  font-stretch: 70%;
  text-transform: uppercase;
}

.label-chip {
  background: var(--yellow);
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  letter-spacing: 0.06em;
}
.label-chip.outline { background: transparent; color: var(--cream); border: 2px solid var(--cream); padding: 2px 8px; }

.logo {
  flex: none;
  width: 76px; height: 76px;
  background: var(--red);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900;
  transform: rotate(-6deg);
  box-shadow: 4px 4px 0 var(--yellow);
}

.icon { flex: none; width: 20px; height: 20px; }

.btn {
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px;
  border: 3px solid var(--cream);
  background: transparent;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 16px; font-weight: 900; font-stretch: 75%;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-ghost[aria-pressed="true"], .btn[aria-pressed="true"] { background: var(--yellow); color: var(--navy); }
.cream .btn-ghost, .dialog .btn-ghost, .toast .btn-ghost, .map-note .btn-ghost { border-color: var(--navy); color: var(--navy); }
.btn-primary { background: var(--red); color: var(--white); border-color: var(--navy); box-shadow: 3px 3px 0 var(--navy); font-size: 18px; padding: 0 20px; }
.btn-primary:hover { background: var(--red-dark); color: var(--white); }
.btn-accent { background: var(--yellow); color: var(--navy); border-color: var(--navy); box-shadow: 3px 3px 0 var(--red); }
.btn-accent:hover { background: var(--yellow-soft); color: var(--navy); }
.btn-square { width: 44px; padding: 0; background: var(--cream); color: var(--navy); border-color: var(--navy); box-shadow: 3px 3px 0 var(--navy); }
.btn-square:hover { background: var(--yellow); }
.btn.wide { flex: 1 1 200px; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0;
  background: transparent; color: inherit;
  cursor: pointer;
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 3px solid var(--navy);
  border-radius: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 15px;
}
.field::placeholder { color: var(--border-on-navy); }
textarea.field { resize: vertical; line-height: 1.45; }
.field.mono { font-family: var(--font-mono); font-size: 14px; }

.field-label { font-size: 14px; font-weight: 700; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }

.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px;
  border: 2px solid var(--border-on-navy);
  background: transparent;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.chip:hover { border-color: var(--cream); }
.chip[aria-pressed="true"] { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.chip .icon { width: 16px; height: 16px; }

.swatch { flex: none; width: 12px; height: 12px; background: var(--tint); border: 1px solid var(--navy); }
.num {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--navy);
  background: var(--tint);
  color: var(--navy);
  font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.num.big { width: 40px; height: 40px; border-width: 3px; font-size: 16px; box-shadow: 0 0 0 2px var(--cream); }

.cat-food { --tint: var(--cat-food); }
.cat-temple { --tint: var(--cat-temple); }
.cat-nature { --tint: var(--cat-nature); }
.cat-shop { --tint: var(--cat-shop); }
.cat-stay { --tint: var(--cat-stay); }
.cat-transport { --tint: var(--cat-transport); }
.cat-residence { --tint: var(--cat-residence); }
.cat-other { --tint: var(--cat-other); }
.region-hokkaido { --tint: var(--region-hokkaido); }
.region-tohoku { --tint: var(--region-tohoku); }
.region-kanto { --tint: var(--region-kanto); }
.region-chubu { --tint: var(--region-chubu); }
.region-kansai { --tint: var(--region-kansai); }
.region-chugoku { --tint: var(--region-chugoku); }
.region-shikoku { --tint: var(--region-shikoku); }
.region-kyushu { --tint: var(--region-kyushu); }
.region-pending { --tint: var(--region-pending); }
.region-link-only { --tint: var(--region-link-only); }

.stars { display: flex; }
.star {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: transparent;
  color: var(--border-on-navy);
  cursor: pointer;
}
.star .icon { width: 26px; height: 26px; }
.star.lit { color: var(--yellow); }
.star.lit .icon { fill: currentColor; }

.tags { display: flex; flex-direction: column; gap: 8px; }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list:empty { display: none; }
.tag {
  display: inline-flex; align-items: center;
  padding-left: 10px;
  background: var(--navy);
  border: 2px solid var(--border-on-navy);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.tag-remove { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.tag-remove .icon { width: 16px; height: 16px; }
.tag-add { display: flex; gap: 8px; }

.toasts {
  position: fixed;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px;
  z-index: 3000;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 4px 14px;
  background: var(--cream);
  color: var(--navy);
  border: 3px solid var(--navy);
  box-shadow: 4px 4px 0 var(--red);
  font-weight: 700;
}
.toast-text { flex: 1 1 auto; }

.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  background: var(--cream);
  color: var(--navy);
  border: 3px solid var(--navy);
  box-shadow: 8px 8px 0 var(--red);
}
.dialog::backdrop { background: var(--backdrop); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 6px 6px 18px; background: var(--navy); color: var(--yellow); }
.dialog-body { padding: 4px 18px 18px; }
.dialog-body p { margin: 0; line-height: 1.5; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.keys dd { margin: 0; }
kbd {
  display: inline-block; min-width: 28px;
  padding: 2px 6px;
  border: 2px solid var(--navy);
  background: var(--white);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  text-align: center;
}

.empty { padding: 14px; margin: 0; color: var(--on-navy-3); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.empty p { margin: 0; }

.splash { min-height: 100vh; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; margin: 0; font-weight: 700; }
.day-0 { --day: var(--day-0); }
.day-1 { --day: var(--day-1); }
.day-2 { --day: var(--day-2); }
.day-3 { --day: var(--day-3); }
.day-4 { --day: var(--day-4); }
.day-5 { --day: var(--day-5); }
.day-6 { --day: var(--day-6); }
.day-7 { --day: var(--day-7); }

.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: var(--navy); color: var(--cream); }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: var(--backdrop); }
.lightbox-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-bottom: 3px solid var(--cream); }
.lightbox-count { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.lightbox-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; }
.lightbox-img { display: block; width: auto; height: auto; max-width: calc(100% - 128px); max-height: calc(100vh - 90px); object-fit: contain; touch-action: pan-y pinch-zoom; }
@media (max-width: 720px) {
  .lightbox-stage { padding: 0; }
  .lightbox-img { max-width: 100%; }
  .lightbox-stage .btn-square { position: absolute; bottom: 16px; }
  .lightbox-prev { left: 16px; }
  .lightbox-next { right: 16px; }
}
