/* Beijing field atlas visual system */
:root {
  --ink: #28262a;
  --ink-soft: #667080;
  --paper: #f6f1e9;
  --paper-deep: #e8e2da;
  --card: #fcf9f3;
  --line: rgba(102, 112, 128, 0.18);
  --line-strong: rgba(102, 112, 128, 0.34);
  --red: #9c2529;
  --red-dark: #70171c;
  --jade: #667080;
  --jade-light: #e5e8ec;
  --ochre: #b58b27;
  --gold: #d4af37;
  --blue: #667080;
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(39, 31, 36, 0.14);
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI",
    "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(102, 112, 128, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 112, 128, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 64px 64px;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--red);
  color: var(--white);
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.page-shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

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

/* Header rests on the photograph like a field-note cover. */
.site-header {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - var(--shell)) / 2));
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  background: linear-gradient(180deg, rgba(42, 24, 29, 0.46), transparent);
  color: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 0;
  background: var(--red);
  color: var(--white);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.16),
    5px 5px 0 rgba(212, 175, 55, 0.56);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.brand-copy small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  letter-spacing: 0.19em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.local-only {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  cursor: pointer;
}

.local-only svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.sync-status.is-connecting svg {
  animation: spin 1s linear infinite;
}

.sync-status.is-error,
.sync-status.is-error svg {
  color: #ffc3b8;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 0;
  background: rgba(40, 38, 42, 0.22);
  color: var(--white);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.icon-button:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
  transform: none;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

/* Hero: a full-bleed field view with an atlas axis laid over it. */
.hero {
  position: relative;
  height: clamp(680px, 92svh, 840px);
  min-height: 680px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  isolation: isolate;
  background: #352b31;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center 48%;
  transform: scale(1.015);
  filter: sepia(0.04) saturate(0.9) contrast(1.03);
}

.hero-overlay {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(37, 23, 28, 0.95) 0%, rgba(52, 27, 33, 0.73) 42%, rgba(52, 27, 33, 0.12) 78%),
    linear-gradient(0deg, rgba(53, 24, 30, 0.77) 0%, transparent 48%),
    linear-gradient(180deg, rgba(37, 23, 28, 0.38), transparent 24%);
}

.hero-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(to right, transparent calc(25% - 1px), rgba(255, 255, 255, 0.14) 25%, transparent calc(25% + 1px)),
    linear-gradient(to right, transparent calc(50% - 1px), rgba(255, 255, 255, 0.1) 50%, transparent calc(50% + 1px)),
    linear-gradient(to right, transparent calc(75% - 1px), rgba(255, 255, 255, 0.14) 75%, transparent calc(75% + 1px));
  mask-image: linear-gradient(to top, black, transparent 82%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 64px;
  padding-block: 156px 102px;
}

.hero-copy {
  max-width: 760px;
  color: var(--white);
  animation: hero-reveal 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.eyebrow span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--red);
  box-shadow: 4px 4px 0 rgba(212, 175, 55, 0.6);
}

.eyebrow.dark {
  margin-bottom: 15px;
  color: var(--red);
}

.eyebrow.dark span {
  width: 20px;
  height: 2px;
  background: currentColor;
  box-shadow: none;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 7.2vw, 92px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.035em;
  text-wrap: balance;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.hero h1 em {
  color: var(--gold);
  font-style: normal;
}

.hero-description {
  max-width: 590px;
  margin: 27px 0 34px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  line-height: 1.95;
  text-wrap: pretty;
}

.primary-link {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 26px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: rgba(252, 249, 243, 0.97);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 7px 7px 0 rgba(112, 23, 28, 0.76);
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.primary-link svg {
  width: 17px;
  height: 17px;
  color: var(--red);
  transition: transform 180ms ease;
}

.primary-link:hover {
  background: var(--white);
  box-shadow: 3px 3px 0 rgba(112, 23, 28, 0.88);
}

.primary-link:hover svg {
  transform: translate(2px, 2px);
}

.progress-seal {
  position: relative;
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px 0 6px;
  color: rgba(255, 255, 255, 0.74);
  animation: hero-reveal 760ms 100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.progress-seal::before,
.progress-seal::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.26);
}

.progress-seal::before {
  top: -105px;
  height: 96px;
}

.progress-seal::after {
  bottom: -38px;
  height: 22px;
}

.progress-seal p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.progress-seal p strong {
  color: var(--white);
  font-family: var(--serif);
  font-size: 20px;
}

.seal-ring {
  --progress: 0deg;
  width: 156px;
  height: 156px;
  padding: 7px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--progress), rgba(255, 253, 248, 0.2) 0);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 18px 50px rgba(0, 0, 0, 0.23);
}

.seal-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(40, 38, 42, 0.82);
  backdrop-filter: blur(10px);
}

.seal-inner span {
  color: var(--white);
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
}

.seal-inner small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.photo-credit {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
  letter-spacing: 0.05em;
}

/* Statistics become a dark itinerary strip overlapping the photo. */
.stats-strip {
  position: relative;
  z-index: 4;
  background: transparent;
  border: 0;
}

.stats-grid {
  min-height: 132px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  margin-top: -58px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--gold);
  background: rgba(112, 23, 28, 0.98);
  color: var(--white);
  box-shadow: 0 24px 55px rgba(55, 25, 30, 0.2);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 28px 27px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.stat-item:first-child {
  padding-left: 27px;
}

.stat-item:last-child {
  border-right: 0;
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(212, 175, 55, 0.58);
  border-radius: 0;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.025);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-item > div {
  display: flex;
  flex-direction: column;
}

.stat-item strong {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-item span:not(.stat-icon) {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.stat-quote {
  gap: 13px;
  background: rgba(255, 253, 248, 0.055);
}

.stat-quote > svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--gold);
  fill: rgba(212, 175, 55, 0.16);
}

.stat-quote p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.75;
}

/* The collection reads as a field index rather than a set of cards. */
.collection {
  position: relative;
  isolation: isolate;
  padding-block: 98px 86px;
}

.collection::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  background:
    linear-gradient(to right, rgba(102, 112, 128, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(102, 112, 128, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: translateX(-50%);
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  pointer-events: none;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 38px;
}

.section-heading > div {
  position: relative;
  padding-left: 24px;
  border-left: 3px solid var(--red);
}

.section-heading h2,
.field-notes h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 50px);
  font-weight: 700;
  line-height: 1.22;
  text-wrap: balance;
}

.section-intro {
  max-width: 360px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
  text-align: right;
  text-wrap: pretty;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.filter-tab span {
  font-size: 10px;
  opacity: 0.62;
}

.filter-tab:hover {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.68);
  color: var(--ink);
}

.filter-tab.is-active {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field,
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg,
.select-wrap > svg {
  position: absolute;
  width: 15px;
  height: 15px;
  color: var(--ink-soft);
  pointer-events: none;
}

.search-field svg {
  left: 13px;
}

.select-wrap > svg {
  right: 11px;
}

.search-field input,
.select-wrap select {
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: rgba(252, 249, 243, 0.88);
  color: var(--ink);
  font-size: 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.search-field input {
  width: 236px;
  padding: 0 12px 0 37px;
}

.select-wrap select {
  min-width: 128px;
  padding: 0 34px 0 12px;
  appearance: none;
  cursor: pointer;
}

.search-field input:focus,
.select-wrap select:focus,
.detail-dialog input:focus,
.detail-dialog textarea:focus {
  border-color: var(--red);
  background: var(--white);
  box-shadow: inset 0 -2px 0 var(--red);
}

.search-field input::placeholder {
  color: var(--blue);
}

.results-meta {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.text-button {
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
}

.text-button.danger:hover {
  color: var(--red);
}

.attraction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--card);
}

.attraction-card {
  --category-color: var(--ochre);
  position: relative;
  min-width: 0;
  min-height: 278px;
  display: flex;
  flex-direction: column;
  padding: 25px 24px 21px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(252, 249, 243, 0.98);
  box-shadow: none;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
  animation: none;
}

.attraction-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  width: auto;
  height: 3px;
  background: var(--category-color);
}

.attraction-card::after {
  content: attr(data-index);
  position: absolute;
  right: 20px;
  top: 63px;
  color: rgba(102, 112, 128, 0.08);
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.attraction-card:hover {
  z-index: 2;
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(102, 112, 128, 0.38);
  transform: none;
}

.attraction-card:nth-child(3n) {
  border-right: 0;
}

.attraction-card.is-visited {
  background:
    linear-gradient(145deg, rgba(252, 249, 243, 0.96), rgba(229, 232, 236, 0.94)),
    var(--card);
}

.attraction-card.is-visited:hover {
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(229, 232, 236, 0.98)),
    var(--card);
}

.card-topline {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 21px;
}

.category-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--category-color);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.category-label svg {
  width: 14px;
  height: 14px;
}

.visit-toggle {
  position: relative;
  z-index: 4;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.visit-toggle:hover {
  border-color: var(--red);
  background: rgba(156, 37, 41, 0.08);
  color: var(--red);
}

.visit-toggle svg {
  width: 14px;
  height: 14px;
}

.attraction-card.is-visited .visit-toggle {
  color: var(--white);
  border-color: var(--red);
  background: var(--red);
}

.card-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.35;
}

.card-title button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.card-title button::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.card-title button:hover {
  color: var(--red);
}

.card-location {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 14px;
  color: var(--ink-soft);
  font-size: 11px;
}

.card-location svg {
  width: 12px;
  height: 12px;
}

.card-description {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  max-width: 95%;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 19px;
  border-top: 1px dotted var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-footer svg {
  width: 12px;
  height: 12px;
}

.visited-date {
  color: #8a6b1c;
  font-weight: 700;
}

.detail-link {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom-color: transparent;
  color: var(--ink);
  font-weight: 700;
}

.detail-link svg {
  width: 12px;
  height: 12px;
  transition: transform 160ms ease;
}

.detail-link:hover {
  border-bottom-color: currentColor;
}

.attraction-card:hover .detail-link svg {
  transform: translateX(2px);
}

.empty-state {
  padding: 76px 20px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  text-align: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.empty-icon svg {
  width: 23px;
  height: 23px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 12px;
}

.secondary-button,
.outline-button,
.solid-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 170ms ease,
    border-color 170ms ease,
    color 170ms ease;
}

.secondary-button:hover,
.outline-button:hover {
  color: var(--white);
  background: var(--ink);
}

.solid-button {
  color: var(--white);
  border-color: var(--red);
  background: var(--red);
}

.solid-button:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.secondary-button svg,
.outline-button svg,
.solid-button svg {
  width: 15px;
  height: 15px;
}

/* Footer note returns to the dark cover material with a full-bleed band. */
.field-notes.page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 48px max(24px, calc((100vw - var(--shell)) / 2));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  border: 0;
  background: #6d1a20;
  color: var(--white);
}

.notes-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.68);
  border-radius: 0;
  color: var(--gold);
  transform: rotate(-5deg);
  box-shadow: 5px 5px 0 rgba(112, 23, 28, 0.72);
}

.notes-mark svg {
  width: 28px;
  height: 28px;
}

.field-notes .eyebrow.dark {
  color: var(--gold);
}

.field-notes h2 {
  margin-bottom: 9px;
  font-size: clamp(26px, 3.2vw, 38px);
}

.field-notes p:last-child {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.85;
  text-wrap: pretty;
}

.field-notes .outline-button {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.42);
}

.field-notes .outline-button:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
}

.site-footer {
  padding: 25px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #2b252d;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.site-footer .text-button {
  color: rgba(255, 255, 255, 0.52);
}

.site-footer .text-button.danger:hover {
  color: var(--gold);
}

/* Dialogs use the same square archival language as the index. */
.detail-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: min(800px, calc(100vh - 40px));
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34);
}

.detail-dialog::backdrop {
  background: rgba(32, 30, 36, 0.76);
  backdrop-filter: blur(5px);
}

.auth-dialog {
  width: min(490px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34);
}

.auth-dialog::backdrop {
  background: rgba(32, 30, 36, 0.8);
  backdrop-filter: blur(6px);
}

.auth-panel {
  position: relative;
  padding: 42px;
  background:
    linear-gradient(rgba(102, 112, 128, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 112, 128, 0.05) 1px, transparent 1px),
    var(--card);
  background-size: 32px 32px;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--red);
}

.auth-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(252, 249, 243, 0.86);
  cursor: pointer;
}

.auth-close:hover {
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}

.auth-close svg {
  width: 15px;
  height: 15px;
}

.auth-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0;
  background: var(--red);
  color: var(--white);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.14),
    5px 5px 0 rgba(212, 175, 55, 0.58);
}

.auth-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
}

.auth-description {
  margin: 15px 0 25px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-bottom: 19px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--line-strong);
}

.auth-mode-tab {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.auth-mode-tab.is-active {
  color: var(--white);
  background: var(--red);
}

.auth-form label {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
}

.auth-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-row svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  pointer-events: none;
}

.auth-input-row input {
  width: 100%;
  height: 48px;
  padding: 0 13px 0 40px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
}

.auth-input-row input:focus {
  border-color: var(--red);
  box-shadow: inset 0 -2px 0 var(--red);
}

.auth-password-row input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 7px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

.password-toggle svg {
  position: static;
  width: 15px;
  height: 15px;
}

.auth-submit {
  width: 100%;
  margin-top: 5px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-message {
  min-height: 20px;
  margin: 13px 0 0;
  color: var(--jade);
  font-size: 11px;
  line-height: 1.7;
}

.auth-message.is-error {
  color: var(--red);
}

.auth-note {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.dialog-head {
  --dialog-color: #667080;
  position: relative;
  min-height: 146px;
  display: flex;
  align-items: flex-end;
  padding: 28px 30px;
  overflow: hidden;
  background:
    linear-gradient(125deg, #381b21 0%, color-mix(in srgb, var(--dialog-color) 42%, #381b21) 100%);
  color: var(--white);
}

.dialog-head::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(to right, transparent calc(25% - 1px), rgba(255, 255, 255, 0.2) 25%, transparent calc(25% + 1px)),
    linear-gradient(to right, transparent calc(50% - 1px), rgba(255, 255, 255, 0.16) 50%, transparent calc(50% + 1px)),
    linear-gradient(to right, transparent calc(75% - 1px), rgba(255, 255, 255, 0.2) 75%, transparent calc(75% + 1px));
}

.dialog-head::after {
  content: attr(data-badge);
  position: absolute;
  right: 24px;
  bottom: -20px;
  color: rgba(255, 255, 255, 0.08);
  font-family: var(--serif);
  font-size: 100px;
  font-weight: 700;
  line-height: 1;
}

.dialog-head > div {
  position: relative;
  z-index: 1;
}

.dialog-head small {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 700;
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.14);
  color: var(--white);
  cursor: pointer;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.dialog-close svg {
  width: 16px;
  height: 16px;
}

.dialog-body {
  padding: 29px 30px 32px;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.dialog-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
}

.dialog-meta svg {
  width: 12px;
  height: 12px;
}

.dialog-description {
  margin: 0 0 21px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.95;
}

.dialog-highlights {
  margin-bottom: 25px;
  padding: 16px 18px;
  border-left: 3px solid var(--red);
  background: #f3efe6;
}

.dialog-highlights strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.dialog-highlights p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.visit-form {
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.visit-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.visit-form-heading strong {
  font-family: var(--serif);
  font-size: 18px;
}

.visit-form-grid {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  color: var(--ink-soft);
  font-size: 10px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
}

.field input {
  height: 42px;
  padding: 0 10px;
}

.field textarea {
  min-height: 88px;
  padding: 10px;
  line-height: 1.65;
  resize: vertical;
}

.field input:disabled,
.field textarea:disabled {
  color: var(--ink-soft);
  background: #ecebe9;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  max-width: min(370px, calc(100% - 48px));
  padding: 13px 17px;
  border-left: 3px solid var(--red);
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes hero-reveal {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .hero-content {
    gap: 42px;
  }

  .hero h1 {
    font-size: clamp(50px, 7vw, 78px);
  }

  .stat-item {
    padding-inline: 20px;
  }

  .stat-item:first-child {
    padding-left: 20px;
  }
}

@media (max-width: 980px) {
  .hero {
    height: 790px;
  }

  .hero-content {
    align-items: flex-end;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-quote {
    display: none;
  }

  .stat-item:nth-child(3) {
    border-right: 0;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .toolbar-controls {
    width: 100%;
  }

  .search-field {
    flex: 1;
  }

  .search-field input {
    width: 100%;
  }

  .attraction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attraction-card:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .attraction-card:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 720px) {
  body {
    background-size: 48px 48px;
  }

  .page-shell {
    width: min(calc(100% - 32px), var(--shell));
  }

  .site-header {
    height: 76px;
    padding-inline: 16px;
  }

  .header-actions {
    gap: 10px;
  }

  .local-only {
    display: inline-flex;
    font-size: 10px;
  }

  .brand {
    gap: 11px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 20px;
    box-shadow:
      inset 0 0 0 3px rgba(255, 255, 255, 0.14),
      4px 4px 0 rgba(212, 175, 55, 0.5);
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    font-size: 7px;
  }

  .icon-button {
    width: 39px;
    height: 39px;
  }

  .hero {
    height: 820px;
    min-height: 720px;
  }

  .hero-image {
    object-position: 64% center;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(37, 23, 28, 0.9), rgba(52, 27, 33, 0.32)),
      linear-gradient(0deg, rgba(37, 23, 28, 0.9) 0%, rgba(52, 27, 33, 0.3) 65%, transparent 100%);
  }

  .hero-overlay::after {
    background-image:
      linear-gradient(to right, transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.11) 33.33%, transparent calc(33.33% + 1px)),
      linear-gradient(to right, transparent calc(66.66% - 1px), rgba(255, 255, 255, 0.11) 66.66%, transparent calc(66.66% + 1px));
  }

  .hero-content {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
    gap: 30px;
    padding-block: 132px 78px;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(43px, 12.3vw, 60px);
    line-height: 1.12;
    letter-spacing: 0.02em;
  }

  .hero-description {
    max-width: 540px;
    margin-block: 22px 27px;
    font-size: 13px;
    line-height: 1.85;
  }

  .primary-link {
    min-height: 47px;
    gap: 20px;
  }

  .progress-seal {
    flex: none;
    flex-direction: row;
    align-self: flex-start;
    gap: 15px;
    padding: 0;
  }

  .progress-seal::before,
  .progress-seal::after {
    display: none;
  }

  .seal-ring {
    width: 76px;
    height: 76px;
    padding: 4px;
  }

  .seal-inner span {
    font-size: 20px;
  }

  .seal-inner small {
    font-size: 7px;
    letter-spacing: 0.05em;
  }

  .progress-seal p {
    max-width: 145px;
    line-height: 1.7;
  }

  .progress-seal p strong {
    font-size: 17px;
  }

  .photo-credit {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    min-height: 105px;
    margin-top: -43px;
    border-left-width: 3px;
  }

  .stat-item {
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 15px 8px;
    text-align: center;
  }

  .stat-item:first-child {
    padding-left: 8px;
  }

  .stat-icon {
    width: 31px;
    height: 31px;
  }

  .stat-icon svg {
    width: 15px;
    height: 15px;
  }

  .stat-item strong {
    font-size: 22px;
  }

  .stat-item span:not(.stat-icon) {
    margin-top: 2px;
    font-size: 9px;
  }

  .collection {
    padding-block: 57px 58px;
  }

  .collection::before {
    background-size: 48px 48px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 27px;
  }

  .section-heading > div {
    padding-left: 17px;
  }

  .section-heading h2 {
    font-size: clamp(32px, 9.5vw, 42px);
  }

  .section-intro {
    max-width: none;
    text-align: left;
  }

  .toolbar {
    margin-inline: 0;
    padding-block: 12px;
    border-right: 0;
    border-left: 0;
  }

  .filter-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-tab {
    justify-content: center;
    padding-inline: 8px;
  }

  .toolbar-controls {
    flex-direction: column;
  }

  .search-field,
  .select-wrap,
  .select-wrap select {
    width: 100%;
  }

  .attraction-grid {
    grid-template-columns: 1fr;
  }

  .attraction-card,
  .attraction-card:nth-child(2n),
  .attraction-card:nth-child(3n) {
    border-right: 0;
  }

  .attraction-card {
    min-height: 248px;
    padding: 24px 22px 20px;
  }

  .attraction-card::after {
    right: 18px;
    top: 59px;
    font-size: 58px;
  }

  .card-title {
    font-size: 24px;
  }

  .field-notes.page-shell {
    padding: 38px 16px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
  }

  .notes-mark {
    width: 52px;
    height: 52px;
  }

  .notes-mark svg {
    width: 22px;
    height: 22px;
  }

  .field-notes .outline-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-dialog {
    max-height: calc(100vh - 20px);
  }

  .auth-dialog {
    width: calc(100% - 20px);
    margin-top: auto;
    margin-bottom: 10px;
  }

  .auth-panel {
    padding: 34px 22px 26px;
  }

  .auth-panel h2 {
    font-size: 27px;
  }

  .dialog-head {
    min-height: 134px;
    padding: 24px 20px;
  }

  .dialog-head h2 {
    font-size: 27px;
  }

  .dialog-body {
    padding: 23px 20px 25px;
  }

  .visit-form-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 430px) {
  .brand-copy small {
    display: none;
  }

  .local-only svg {
    width: 14px;
    height: 14px;
  }

  .hero h1 {
    font-size: clamp(39px, 12vw, 49px);
  }

  .hero {
    height: 790px;
  }

  .filter-tab {
    gap: 5px;
    font-size: 12px;
  }

  .card-footer {
    align-items: flex-end;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions .outline-button,
  .dialog-actions .solid-button {
    width: 100%;
  }
}

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

/* Atlas interaction: click to locate, swipe to browse. */
.atlas-toolbar {
  margin-bottom: 10px;
}

.atlas-toolbar .filter-tab {
  min-height: 44px;
}

.atlas-toolbar .search-field input,
.atlas-toolbar .select-wrap select {
  height: 44px;
}

.atlas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
}

.atlas-instruction {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.atlas-instruction svg {
  width: 15px;
  height: 15px;
  color: var(--red);
}

.atlas-head .results-meta {
  min-height: 0;
  justify-content: flex-end;
  gap: 16px;
  text-align: right;
}

.atlas-layout {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--card);
}

.atlas-layout.is-map-only {
  grid-template-columns: 1fr;
}

.atlas-map-panel {
  min-width: 0;
  background:
    linear-gradient(rgba(102, 112, 128, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 112, 128, 0.055) 1px, transparent 1px),
    #e8e4dc;
  background-size: 32px 32px;
}

.atlas-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line-strong);
}

.atlas-map-head > div {
  min-width: 0;
}

.map-caption {
  display: block;
  margin-bottom: 4px;
  color: #505965;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.atlas-map-head h3,
.candidate-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.map-focus-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: rgba(252, 249, 243, 0.9);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.map-focus-button:hover {
  border-color: var(--red);
  color: var(--red);
}

.map-focus-button[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.map-focus-button:disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.48;
}

.map-focus-button svg {
  width: 14px;
  height: 14px;
}

.map-stage {
  position: relative;
  height: min(58vh, 440px);
  min-height: 360px;
  overflow: hidden;
  background: #e9e5dc;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.map-stage.is-dragging {
  cursor: grabbing;
}

.map-stage.is-pinching {
  cursor: zoom-in;
}

.map-world {
  --map-zoom: 1;
  --map-pan-x: 0px;
  --map-pan-y: 0px;
  position: absolute;
  inset: -2%;
  transform: translate(var(--map-pan-x), var(--map-pan-y)) scale(var(--map-zoom));
  transform-origin: center;
  transition: transform 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.map-stage.is-dragging .map-world,
.map-stage.is-pinching .map-world {
  transition: none;
}

.map-base,
.map-route-layer,
.map-pins {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-base {
  overflow: visible;
}

.map-boundary {
  fill: rgba(252, 249, 243, 0.9);
  stroke: rgba(102, 112, 128, 0.52);
  stroke-width: 0.58;
  vector-effect: non-scaling-stroke;
}

.map-district {
  fill: none;
  stroke: rgba(102, 112, 128, 0.22);
  stroke-width: 0.45;
  stroke-dasharray: 2 2;
  vector-effect: non-scaling-stroke;
}

.map-ring {
  fill: none;
  stroke: rgba(102, 112, 128, 0.22);
  stroke-width: 0.7;
  stroke-dasharray: 2.4 1.6;
  vector-effect: non-scaling-stroke;
}

.map-ring--inner {
  stroke: rgba(156, 37, 41, 0.18);
}

.map-axis {
  fill: none;
  stroke: rgba(156, 37, 41, 0.42);
  stroke-width: 0.75;
  stroke-dasharray: 1 1.2;
  vector-effect: non-scaling-stroke;
}

.map-river {
  fill: none;
  stroke: rgba(70, 105, 123, 0.33);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.map-region {
  fill: rgba(72, 79, 87, 0.56);
  font-family: var(--sans);
  font-size: 2.6px;
  letter-spacing: 0.08em;
  text-anchor: middle;
}

.map-route {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2.4 1.4;
  vector-effect: non-scaling-stroke;
}

.map-pins {
  pointer-events: none;
}

.map-pin {
  position: absolute;
  z-index: var(--pin-layer, 2);
  left: var(--pin-x);
  top: var(--pin-y);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transform: translate(-50%, -50%) scale(var(--map-pin-scale, 1));
  transform-origin: center;
}

.map-pin-core {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border: 2px solid var(--pin-color, var(--red));
  border-radius: 50%;
  background: var(--card);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(40, 38, 42, 0.22);
  transition:
    width 160ms ease,
    height 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.map-pin.is-visited .map-pin-core {
  width: 25px;
  height: 25px;
  border-color: var(--white);
  background: var(--red);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 248, 0.58),
    0 3px 10px rgba(40, 38, 42, 0.3);
}

.map-stage[data-zoomed="true"] .map-pin-core,
.map-stage[data-zoomed="true"] .map-pin.is-visited .map-pin-core {
  box-shadow: none;
}

.map-pin.is-active .map-pin-core {
  outline: 3px solid var(--white);
  outline-offset: 2px;
  transform: scale(1.14);
}

.map-pin.is-muted {
  opacity: 0.24;
}

.map-pin:hover .map-pin-core,
.map-pin:focus-visible .map-pin-core {
  transform: scale(1.2);
}

.map-pin-label {
  position: absolute;
  z-index: 20;
  top: calc(100% - 2px);
  left: 50%;
  max-width: 180px;
  padding: 6px 8px;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  font-size: var(--map-pin-label-font, 11px);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.map-pin.is-active .map-pin-label,
.map-pin:hover .map-pin-label,
.map-pin:focus-visible .map-pin-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.map-tools {
  position: absolute;
  z-index: 12;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  background: rgba(252, 249, 243, 0.96);
}

.map-tools button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.map-tools button:last-child {
  border-bottom: 0;
}

.map-tools button:hover {
  background: var(--ink);
  color: var(--white);
}

.map-tools svg {
  width: 16px;
  height: 16px;
}

.map-legend {
  position: absolute;
  z-index: 11;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: rgba(252, 249, 243, 0.93);
  color: #505965;
  font-size: 11px;
  line-height: 1;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: var(--card);
}

.legend-stamp {
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
}

.legend-stamp svg {
  width: 8px;
  height: 8px;
}

.legend-route {
  width: 16px;
  height: 1px;
  border-top: 1px dashed var(--red);
}

.map-compass {
  position: absolute;
  z-index: 10;
  right: 17px;
  bottom: 17px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(252, 249, 243, 0.88);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
}

.map-compass::before {
  content: "";
  position: absolute;
  top: 4px;
  border-right: 3px solid transparent;
  border-bottom: 6px solid var(--red);
  border-left: 3px solid transparent;
}

.map-place-card {
  --place-color: var(--red);
  position: absolute;
  z-index: 20;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 16px 15px 18px;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--place-color);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 16px 42px rgba(40, 38, 42, 0.22);
  cursor: default;
}

.map-place-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-place-copy > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.map-place-copy > span svg {
  width: 11px;
  height: 11px;
}

.map-place-copy strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-place-copy small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-place-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-place-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.map-place-actions button:first-child {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.map-place-actions button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.map-place-actions .map-place-clear {
  width: 44px;
  padding: 0;
  border-color: transparent;
}

.map-place-actions svg {
  width: 14px;
  height: 14px;
}

.atlas-map-foot {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  border-top: 1px solid var(--line-strong);
  background: rgba(252, 249, 243, 0.78);
  color: #505965;
  font-size: 11px;
}

.atlas-map-foot p {
  margin: 0;
}

.atlas-map-foot span {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 700;
}

.candidate-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-strong);
  background:
    linear-gradient(rgba(102, 112, 128, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 112, 128, 0.045) 1px, transparent 1px),
    var(--card);
  background-size: 32px 32px;
}

.candidate-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 19px 18px 14px;
}

.candidate-heading > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.candidate-heading h3 {
  font-size: 20px;
}

.rail-position {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.candidate-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 16px 16px;
  overflow: visible;
  border: 0;
  background: transparent;
}

.candidate-card,
.candidate-card:nth-child(2n),
.candidate-card:nth-child(3n) {
  min-height: 258px;
  padding: 22px 20px 18px;
  border: 1px solid var(--line-strong);
  background: rgba(252, 249, 243, 0.98);
}

.candidate-card.is-selected {
  background:
    linear-gradient(145deg, rgba(252, 249, 243, 0.98), rgba(238, 228, 217, 0.96)),
    var(--card);
  box-shadow: inset 0 0 0 2px var(--red);
}

.candidate-card.is-selected::after {
  color: rgba(156, 37, 41, 0.09);
}

.candidate-card .card-title {
  font-size: 24px;
}

.candidate-card .card-description {
  max-width: 100%;
}

.candidate-card .card-footer {
  font-size: 11px;
}

.visited-stamp {
  position: absolute;
  top: 61px;
  right: 17px;
  padding: 4px 7px;
  border: 1px solid rgba(156, 37, 41, 0.65);
  color: var(--red);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.8;
  transform: rotate(-7deg);
}

.selection-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.selection-note svg {
  width: 12px;
  height: 12px;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.select-link {
  color: var(--red);
}

.candidate-card.is-selected .select-link {
  border-bottom-color: transparent;
  cursor: default;
}

.rail-guidance {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: auto 0 0;
  padding: 14px 18px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.rail-guidance svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--red);
}

@media (min-width: 981px) {
  .atlas-layout {
    grid-template-columns: minmax(0, 1.58fr) minmax(310px, 0.72fr);
  }

  .atlas-layout.is-map-only {
    grid-template-columns: 1fr;
  }

  .atlas-map-panel {
    border-right: 1px solid var(--line-strong);
  }

  .atlas-layout.is-map-only .atlas-map-panel {
    border-right: 0;
  }

  .map-stage {
    height: clamp(500px, 46vw, 660px);
  }

  .candidate-panel {
    border-top: 0;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-color: var(--red) rgba(102, 112, 128, 0.14);
    scrollbar-width: thin;
  }

  .candidate-panel::-webkit-scrollbar {
    width: 5px;
  }

  .candidate-panel::-webkit-scrollbar-track {
    background: rgba(102, 112, 128, 0.12);
  }

  .candidate-panel::-webkit-scrollbar-thumb {
    background: var(--red);
  }

  .candidate-heading {
    position: sticky;
    z-index: 6;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--card);
  }

  .candidate-card,
  .candidate-card:nth-child(2n),
  .candidate-card:nth-child(3n) {
    min-height: 258px;
  }
}

@media (max-width: 720px) {
  .site-header {
    height: 68px;
    padding-top: env(safe-area-inset-top);
  }

  .hero {
    height: 690px;
    min-height: 640px;
  }

  .hero-content {
    gap: 24px;
    padding-block: 108px 55px;
  }

  .hero h1 {
    font-size: clamp(39px, 11.7vw, 55px);
  }

  .hero-description {
    margin-block: 18px 22px;
  }

  .stats-grid {
    margin-top: -34px;
  }

  .collection {
    padding-block: 46px 52px;
  }

  .atlas-toolbar {
    gap: 12px;
    padding-block: 9px 14px;
  }

  .atlas-toolbar .filter-tab {
    min-height: 44px;
  }

  .atlas-toolbar .toolbar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    gap: 8px;
  }

  .atlas-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-block: 12px 9px;
  }

  .atlas-head .results-meta {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .atlas-layout {
    margin-inline: -16px;
    border-right: 0;
    border-left: 0;
  }

  .atlas-map-head {
    padding: 17px 16px 14px;
  }

  .atlas-map-head h3 {
    font-size: 20px;
  }

  .map-focus-button {
    min-height: 44px;
  }

  .map-stage {
    height: min(58vh, 430px);
    min-height: 355px;
  }

  .map-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 9px;
  }

  .map-tools {
    top: auto;
    right: 10px;
    bottom: 10px;
    flex-direction: row;
  }

  .map-tools button {
    width: 44px;
    height: 44px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .map-tools button:last-child {
    border-right: 0;
  }

  .map-compass {
    display: none;
  }

  .map-place-card {
    right: 10px;
    bottom: 64px;
    left: 10px;
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 13px 13px 12px 15px;
  }

  .map-place-copy strong {
    font-size: 19px;
  }

  .map-place-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
  }

  .map-place-actions button {
    min-height: 44px;
  }

  .map-place-actions .map-place-clear {
    width: 44px;
  }

  .atlas-map-foot {
    align-items: flex-start;
    padding-inline: 14px;
  }

  .atlas-map-foot p {
    max-width: 78%;
    line-height: 1.65;
  }

  .candidate-heading {
    padding-inline: 16px;
  }

  .candidate-card,
  .candidate-card:nth-child(2n),
  .candidate-card:nth-child(3n) {
    min-height: 286px;
    padding: 23px 20px 18px;
  }

  .candidate-card .visit-toggle {
    width: 44px;
    height: 44px;
    margin: -7px -7px 0 0;
  }

  .candidate-card .visited-stamp {
    top: 77px;
  }

  .rail-guidance {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .search-field input,
  .select-wrap select {
    font-size: 16px;
  }

  .search-field input {
    height: 46px;
  }

  .detail-dialog {
    margin-top: auto;
    margin-bottom: 0;
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-radius: 0;
  }
}

@media (max-width: 430px) {
  .hero {
    height: 665px;
  }

  .atlas-map-head {
    gap: 10px;
  }

  .map-focus-button {
    padding-inline: 10px;
  }

  .map-focus-button span {
    font-size: 11px;
  }

  .map-stage {
    height: min(56vh, 408px);
    min-height: 345px;
  }

  .map-legend {
    max-width: calc(100% - 72px);
  }

  .map-place-card {
    right: 8px;
    left: 8px;
  }

  .map-place-copy small {
    font-size: 9px;
  }

  .candidate-card,
  .candidate-card:nth-child(2n),
  .candidate-card:nth-child(3n) {
    min-height: 298px;
  }

  .candidate-card .card-footer {
    align-items: flex-end;
  }

  .card-actions {
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .candidate-rail {
    scroll-behavior: auto;
  }

  .map-world,
  .map-pin-core,
  .map-pin-label {
    transition: none;
  }
}
