@font-face {
  font-family: 'Zen Maru Gothic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/zen-maru-gothic-400-subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Zen Maru Gothic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/zen-maru-gothic-500-subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Zen Maru Gothic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/zen-maru-gothic-700-subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/space-mono-400-subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/space-mono-700-subset.woff2') format('woff2');
}

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

html {
  font-size: 16px;
  color-scheme: light dark;
}

body {
  font-family: 'Zen Maru Gothic', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --bg: #fbfaf6;
  --bg2: #f1ede4;
  --surface: #ffffff;
  --ink: #23201d;
  --ink2: #5f5a52;
  --dim: #9a9388;
  --accent: #0f766e;
  --line: rgba(35, 32, 29, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15140f;
    --bg2: #1f1d18;
    --surface: #1c1a15;
    --ink: #f3efe6;
    --ink2: #bdb3a2;
    --dim: #7d7466;
    --accent: #5eead4;
    --line: rgba(243, 239, 230, 0.12);
  }
}

:root[data-theme="dark"] {
  --bg: #15140f;
  --bg2: #1f1d18;
  --surface: #1c1a15;
  --ink: #f3efe6;
  --ink2: #bdb3a2;
  --dim: #7d7466;
  --accent: #5eead4;
  --line: rgba(243, 239, 230, 0.12);
}

.r-root {
  container-type: inline-size;
  container-name: r;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 1rem;
}

.theme-toggle {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle-icon-dark {
  display: none;
}
:root[data-theme="dark"] .theme-toggle-icon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle-icon-dark {
  display: inline;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-icon {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle-icon-dark {
    display: inline;
  }
}

.r-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 48px 72px;
  flex: 1;
}

.r-hero {
  margin-bottom: 40px;
  max-width: 42rem;
}
.r-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.r-lede {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.6;
}

.r-toc {
  margin-bottom: 48px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.r-toc-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.r-toc-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.r-toc-country {
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
  padding-left: 2px;
}
.r-toc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.r-toc-tab {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink2);
  background: transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  line-height: 1.4;
  cursor: pointer;
  font-family: inherit;
}
.r-toc-tab:hover {
  background: var(--bg2);
  color: var(--ink);
}
.r-toc-tab-on,
.r-toc-tab-on:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.r-toc-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.r-toc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px dotted var(--line);
}
.r-toc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  align-items: baseline;
  min-height: 1.6em;
  flex: 1;
}
.r-toc-chip {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1.5;
}
.r-toc-chip:hover {
  background: var(--bg2);
  color: var(--accent);
}
.r-toc-filter {
  flex-shrink: 0;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--ink2);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.r-toc-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.r-toc-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.r-toc-filter-on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.r-toc-filter-on:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.r-area {
  margin-bottom: 42px;
  scroll-margin-top: 24px;
}
.r-area-name {
  font-size: 26px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 24px;
  letter-spacing: -0.005em;
}
.r-cat {
  margin-bottom: 24px;
  scroll-margin-top: 24px;
}
.r-cat-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.r-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 16px;
}

.r-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.r-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(35, 32, 29, 0.08);
}
.r-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg2);
  position: relative;
  display: grid;
  place-items: center;
}
.r-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.r-card:hover .r-card-img img {
  transform: scale(1.04);
}
.r-card-placeholder {
  font-size: 42px;
  font-weight: 700;
  color: var(--dim);
  opacity: 0.5;
  font-family: 'Shippori Mincho', 'Hiragino Mincho ProN', serif;
}
.r-card--todo {
  border-style: dashed;
  background: transparent;
}
.r-card--todo .r-card-img img {
  filter: saturate(0.7) brightness(0.97);
}

.r-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px 13px;
}
.r-card-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.r-card--todo .r-card-name {
  color: var(--ink2);
}
.r-card-foot {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.r-visit-status {
  display: grid;
  place-items: center;
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.r-visit-status::before {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.r-visit-status--visited::before {
  content: "✓";
  color: var(--ink2);
  border: 1.5px solid currentColor;
  background: transparent;
}
.r-visit-status--todo::before {
  content: "";
  border: 1.5px dashed var(--dim);
  background: transparent;
}
.r-visit-status::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 2;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink2);
  box-shadow: 0 6px 18px rgba(35, 32, 29, 0.1);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 2px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}
.r-visit-status:hover::after,
.r-visit-status:focus::after,
.r-visit-status:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.r-visit-status:focus-visible {
  outline: 2px solid var(--ink2);
  outline-offset: 2px;
  border-radius: 5px;
}
.r-link {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  color: var(--ink2);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.r-link:hover {
  background: var(--bg2);
  color: var(--accent);
}
.r-link svg {
  display: block;
}
.r-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 48px 72px;
  flex: 1;
}
.page-header {
  margin-bottom: 32px;
}
.page-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 16px;
}
.page-description {
  max-width: 42rem;
  color: var(--ink2);
  font-size: 15px;
  line-height: 1.6;
}
.toc-filter-btn {
  flex-shrink: 0;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--ink2);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.toc-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.map-page {
  overflow: hidden;
}
.map-container {
  max-width: none;
  min-height: 100vh;
  padding-bottom: 24px;
}
.map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: min(72vh, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(35, 32, 29, 0.08);
}
.map-canvas {
  min-height: 58vh;
  background: var(--bg2);
}
.map-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.map-sidebar-header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.map-search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.map-search {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
.map-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.map-status {
  padding: 11px 14px;
  color: var(--dim);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.map-place-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  list-style: none;
}
.map-place-item + .map-place-item {
  border-top: 1px solid var(--line);
}
.map-place-button {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 11px 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.map-place-button:hover,
.map-place-button:focus-visible {
  background: var(--bg2);
}
.map-place-button span {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}
.map-place-button small {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.35;
}
.map-info-window {
  max-width: 15rem;
  color: #23201d;
  font-family: 'Zen Maru Gothic', system-ui, sans-serif;
}
.map-info-window h2 {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.35;
}
.map-info-window p {
  margin-bottom: 8px;
  color: #5f5a52;
  font-size: 12px;
}
.map-info-links {
  display: flex;
  gap: 8px;
}
.map-info-links a {
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

@container r (max-width: 940px) {
  .r-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@container r (max-width: 640px) {
  .r-inner {
    padding: 28px 12px 48px;
  }
  .r-title {
    font-size: 34px;
  }
  .r-area-name {
    font-size: 22px;
  }
  .r-toc-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .r-toc-tabs::-webkit-scrollbar {
    display: none;
  }
  .r-toc-tab {
    flex-shrink: 0;
    padding: 5px 11px;
    font-size: 13px;
  }
  .r-toc-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .r-toc-actions {
    justify-content: flex-end;
  }
  .r-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .r-card-img {
    aspect-ratio: 16 / 10;
  }
  .r-card-name {
    font-size: 14px;
  }
  .container {
    padding: 28px 12px 48px;
  }
  .page-title {
    font-size: 34px;
  }
  .map-header {
    flex-direction: column;
  }
}

@media (min-width: 900px) {
  .map-layout {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
    height: min(72vh, 760px);
    min-height: 32rem;
  }
  .map-canvas {
    height: 100%;
    min-height: 0;
  }
  .map-sidebar {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
