
    :root {
      --page-bg: #f4efe4;
      --panel-bg: #fffaf0;
      --panel-bg-soft: #fbf4e8;
      --ink: #2f2a22;
      --muted: #6f6252;
      --border: #d8c8ad;
      --accent: #7b4f2a;
      --accent-dark: #4d321d;
      --marker: #8b3f2f;
      --shadow: rgba(0, 0, 0, 0.14);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      background: var(--page-bg);
      color: var(--ink);
      font-family: Georgia, "Times New Roman", serif;
    }

    .map-page {
      max-width: 1280px;
      margin: 0 auto;
      padding: 24px;
    }

    .map-header {
      margin-bottom: 16px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 12px;
    }

    .map-header h1 {
      margin: 0 0 8px;
      font-size: 2rem;
      font-weight: normal;
      color: var(--accent-dark);
    }

    .map-header p {
      margin: 0;
      color: var(--muted);
      line-height: 1.5;
    }

    .map-layout {
      display: grid;
      grid-template-columns: 320px 1fr;
      gap: 18px;
      align-items: stretch;
    }

    .location-sidebar {
      background: var(--panel-bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 8px 24px var(--shadow);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      min-height: 720px;
    }

    .sidebar-header {
      padding: 16px 16px 12px;
      border-bottom: 1px solid var(--border);
      background: var(--panel-bg-soft);
    }

    .sidebar-header h2 {
      margin: 0 0 6px;
      font-size: 1.25rem;
      font-weight: normal;
      color: var(--accent-dark);
    }

    .sidebar-header p {
      margin: 0;
      font-size: 0.92rem;
      line-height: 1.4;
      color: var(--muted);
    }

    .location-list {
      list-style: none;
      margin: 0;
      padding: 8px;
      overflow-y: auto;
    }

    .location-button {
      width: 100%;
      border: 0;
      border-bottom: 1px solid #eadcc5;
      background: transparent;
      color: var(--ink);
      text-align: left;
      padding: 12px 10px;
      border-radius: 8px;
      font-family: Georgia, "Times New Roman", serif;
      cursor: pointer;
    }

    .location-button:hover,
    .location-button:focus {
      background: #f3e5cf;
      outline: none;
    }

    .location-button.active {
      background: #ead7ba;
    }

    .location-name {
      display: block;
      font-size: 1rem;
      color: var(--accent-dark);
    }

    .location-meta {
      display: block;
      margin-top: 4px;
      font-size: 0.86rem;
      color: var(--muted);
    }

    .location-ancestors {
      display: block;
      margin-top: 4px;
      font-size: 0.86rem;
      color: var(--muted);
      line-height: 1.35;
    }

    #ancestor-map {
      height: 720px;
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 8px 24px var(--shadow);
      background: #ddd;
    }

    .ancestor-popup {
      min-width: 240px;
      max-width: 340px;
      font-family: Georgia, "Times New Roman", serif;
    }

    .ancestor-popup h2 {
      margin: 0 0 6px;
      font-size: 1.15rem;
      color: var(--accent-dark);
      border-bottom: 1px solid #e4d7c0;
      padding-bottom: 4px;
    }

    .ancestor-popup .place-note {
      margin: 0 0 10px;
      font-size: 0.9rem;
      color: var(--muted);
    }

    .ancestor-popup ul {
      margin: 0;
      padding-left: 18px;
    }

    .ancestor-popup li {
      margin: 0 0 8px;
      line-height: 1.3;
    }

    .ancestor-popup a {
      color: var(--accent);
      font-weight: bold;
      text-decoration: none;
    }

    .ancestor-popup a:hover {
      text-decoration: underline;
    }

    .ancestor-years {
      color: var(--muted);
      white-space: nowrap;
    }

    .ancestor-marker {
      width: 18px;
      height: 18px;
      background: var(--marker);
      border: 3px solid #fff8e8;
      border-radius: 50%;
      box-shadow: 0 1px 6px rgba(0,0,0,0.35);
    }

    .leaflet-tooltip {
      font-family: Georgia, "Times New Roman", serif;
      background: var(--panel-bg);
      color: var(--ink);
      border: 1px solid var(--border);
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    @media (max-width: 900px) {
      .map-layout {
        grid-template-columns: 1fr;
      }

      .location-sidebar {
        min-height: auto;
        max-height: 320px;
      }

      #ancestor-map {
        height: 620px;
      }
    }

    @media (max-width: 700px) {
      .map-page {
        padding: 12px;
      }

      .map-header h1 {
        font-size: 1.6rem;
      }

      #ancestor-map {
        height: 540px;
      }
    }
  