/* Localized repairs to the existing header/menu. Keep the original motion and content. */
.header #inner-header { position: relative; }
.header .header-search { right: 54px; top: 0; width: 44px; z-index: 102; }
.header .header-search__open { display: block; width: 44px; text-align: center; }
.header #logo .outer-menu { position: absolute !important; top: 0 !important; right: 0 !important; z-index: 103; }
.header #logo .outer-menu .checkbox-toggle,
.header #logo .outer-menu .hamburger-pc { width: 48px; }
.header #logo .outer-menu .hamburger-pc { padding: 12px; }
/* Preserve the existing fixed desktop menu, aligned with the 897px header. */
@media (min-width: 1024px) {
  .header #logo .outer-menu { position: fixed !important; right: max(24px, calc((100vw - 897px) / 2 + 5px)) !important; }
}
.header #logo .header-logo__link { max-width: calc(100% - 132px); }
.header #drawer__open { width: 48px; right: 0; text-align: center; }
@media (min-width: 766px) {
  .header #drawer { display: none; }
  .header #logo .header-logo__link { left: 0; right: 0; margin-inline: auto; }
}
@media (max-width: 765px) {
  .header #inner-header { position: static; }
  .header .header-search { right: 52px; width: 40px; }
  .header .header-search__open { width: 40px; }
  .header #drawer #drawer__open { right: 12px; width: 40px; }
  .header #drawer { display: block; }
  .header #logo .header-logo__link { position: relative !important; left: auto; right: auto; display: inline-flex; align-items: center; justify-content: flex-start; vertical-align: middle; }
  .header #logo .header-logo__link > .img-inner { min-width: 0; margin: 0; }
  .header #logo .header-logo__link img { max-width: 100%; object-fit: contain; }
}
/* A mobile browser at tablet width must not squeeze the map beside its widgets. */
.header #drawer__content {
  box-sizing: border-box; flex-direction: column; align-items: center; justify-content: safe center;
  gap: 24px; padding: 64px 30px; width: 100%; height: 100vh; height: 100dvh;
  overflow-y: auto; overflow-x: hidden;
}
.header #drawer__content .menu-sp { width: min(708px, 100%); flex: none; }
.header #drawer__content > .widget { width: min(400px, 100%); flex: none; margin: 0; }
.header #drawer__content .ham_search { width: 100%; padding-top: 0; }
.header #drawer__content .searchform { width: 100%; max-width: 100%; margin: 0; }
.header #drawer__content .searchform__input { width: 100%; box-sizing: border-box; font-size: 16px; }
.header #logo .menu-pc > div > div {
  display: block; width: min(708px, calc(100vw - 48px)); max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px); padding: 8px; box-sizing: border-box; overflow-y: auto;
}
/* Scope map dimensions to the open navigation, leaving the top-page maps unchanged. */
.header .ham-map {
  position: relative; container-type: inline-size; width: 100% !important; max-width: 708px;
  height: auto !important; aspect-ratio: 708 / 656; margin: 0 auto; padding: 0;
}
.header .ham-map > .img-inner,
.header .ham-map > .img_inner { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; }
.header #logo .ham-map img,
.header #drawer__content .ham-map img {
  display: block; position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  max-width: none; max-height: none; padding: 0 !important; margin: 0; object-fit: contain; transform: none;
}
.header .ham-map .search_hosoku {
  position: absolute; left: 0; top: 1%; width: 60% !important; margin: 0;
  transform: none !important; z-index: 1;
}
.header .ham-map .search_hosoku dt { color: #fff; font-size: clamp(10px, 3cqw, 18px); line-height: 1.4; white-space: nowrap; }
.header .ham-map .search_hosoku dd {
  box-sizing: border-box; width: 100%; margin: 5px 0 0; padding: clamp(7px, 2cqw, 14px);
  border: solid clamp(2px, .5cqw, 3px) #111; background: #fff; color: #111;
}
.header .ham-map .search_hosoku dd p {
  display: flex; justify-content: space-between; width: 100%; margin: 0 !important;
  padding: 0; gap: 4px; font-size: clamp(9px, 2.8cqw, 18px) !important; line-height: 1.8; white-space: nowrap;
}
.header .ham-map .area_btn,
.header .ham-map .area_btn-normal {
  position: absolute !important; inset: auto !important; transform: translate(-50%, -50%);
  box-sizing: border-box; width: auto; margin: 0; padding: .35em .7em !important;
  border: solid clamp(2px, .5cqw, 3px) #111 !important; border-radius: 3px;
  font-size: clamp(11px, 3.2cqw, 22px) !important; line-height: 1.5 !important;
  white-space: nowrap; color: #111; background: #fff; z-index: 2;
}
.header .ham-map .area_btn-normal > a { position: static !important; display: block; margin: 0; padding: 0; color: #111; }
.header .ham-map .area1 { left: 76% !important; top: 10% !important; }
.header .ham-map .area10 { left: 86% !important; top: 35% !important; }
.header .ham-map .area2 { left: 80% !important; top: 64% !important; }
.header .ham-map .area3 { left: 64% !important; top: 49% !important; }
.header .ham-map .area4 { left: 50% !important; top: 65% !important; }
.header .ham-map .area5 { left: 34% !important; top: 54% !important; }
.header .ham-map .area6 { left: 17% !important; top: 72% !important; }
.header .ham-map .area11 { left: 10% !important; top: 91% !important; }
.header .ham-map .area26 { left: 42% !important; top: 85% !important; }
.header .ham-map .area8 { left: 69% !important; top: 84% !important; }
.japan_map_overlay-header { position: fixed; inset: 0; z-index: 10000; }
.japan_map_overlay-header .pref_small_div { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }

/* Preserve footer links, with the requested 3 / 2 / 1 rows on small screens. */
@media (max-width: 600px) {
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_menu, .footer_menu) { width: 100%; }
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_ul, .footer_ul) {
    display: grid; grid-template-columns: max-content max-content max-content;
    column-gap: 12px; row-gap: 4px; padding: 0; margin: 0;
  }
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_ul, .footer_ul) > li {
    width: auto; padding: 0; margin: 0;
    font-size: clamp(11px, 3.2vw, 13px); line-height: 1.6;
  }
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_ul, .footer_ul) > li > a { white-space: nowrap; }
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_ul, .footer_ul) > li:nth-child(4) { grid-column: 1; }
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_ul, .footer_ul) > li:nth-child(5) { grid-column: 2 / 4; }
  :is(.pc-result_footer, .top_footer) :is(.pc-result-footer_ul, .footer_ul) > li:nth-child(n+6) { grid-column: 1 / -1; }
}
