body {
  margin: 0;
  padding: 0 0 3.5rem;
  background:
    radial-gradient(circle at top, rgba(255, 250, 236, 0.95), rgba(238, 226, 199, 0.92) 48%, rgba(223, 209, 181, 0.94) 100%);
  color: #35261a;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

body[data-view-mode="landscape"] {
  --mobile-card-flow: row;
}

body[data-view-mode="portrait"] {
  --mobile-card-flow: column;
}

a {
  color: #6a3f1e;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

a:hover,
a:focus {
  color: #45250f;
}

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

h1,
h2 {
  margin-top: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  text-align: center;
}

p {
  margin: 0.55rem 0;
}

select,
input[type="text"],
input[type="submit"],
button {
  font: inherit;
}

.page-intro {
  max-width: 1020px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.25rem;
}

.homepage .page-intro {
  max-width: 1480px;
}

.page-intro-panel {
  padding: 1.5rem 1.5rem 1.2rem;
  border: 1px solid #9d8464;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.96), rgba(247, 237, 214, 0.97));
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 230, 0.8),
    0 16px 30px rgba(92, 66, 36, 0.12);
}

.page-kicker {
  margin: 0 0 0.6rem;
  text-align: center;
  color: #805226;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.page-title {
  margin-bottom: 0.4rem;
  color: #7c2716;
  font-size: clamp(2rem, 3vw, 3rem);
}

.page-subtitle {
  text-align: center;
  color: #3f5f35;
  font-size: 1.16rem;
}


.top-tabs {
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.top-tabs-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.6rem;
}

.top-tab {
  display: inline-block;
  padding: 0.7rem 1.1rem 0.6rem;
  border: 1px solid #9b805d;
  border-bottom-width: 2px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #f6ead3, #ead7b7);
  color: #5f3618;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 12px rgba(92, 66, 36, 0.08);
}

.top-tab:hover,
.top-tab:focus {
  background: linear-gradient(180deg, #f9eedb, #efdfc0);
  color: #43230f;
}

.top-tab.active {
  background: linear-gradient(180deg, #fff8ea, #f4e7cf);
  color: #7b2417;
}

.county-index {
  max-width: 1480px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.county-index-panel {
  padding: 0.9rem 1rem;
  border: 1px solid #b39674;
  border-radius: 14px;
  background: rgba(255, 248, 232, 0.92);
  box-shadow: 0 10px 18px rgba(92, 66, 36, 0.08);
}

.county-index-title {
  margin: 0 0 0.65rem;
  text-align: center;
  color: #6e4321;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.county-index-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.county-index-links a {
  display: inline-block;
  padding: 0.42rem 0.68rem;
  border: 1px solid #b89d7c;
  border-radius: 999px;
  background: #f8eedc;
  color: #5c3416;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

@media (min-width: 1180px) {
  .county-index-panel {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .county-index-links {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .county-index-links a {
    padding-left: 0.58rem;
    padding-right: 0.58rem;
    font-size: 0.94rem;
    white-space: nowrap;
  }
}

.county-index-links a:hover,
.county-index-links a:focus {
  background: #f1e0bf;
}

.research-link-cta {
  max-width: 1100px;
  margin: -0.2rem auto 1.3rem;
  padding: 0 1rem;
  text-align: center;
}

.research-link-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.research-link-button {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border: 1px solid #9b805d;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6ead3, #ead7b7);
  color: #5f3618;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 12px rgba(92, 66, 36, 0.08);
}

.research-link-button:hover,
.research-link-button:focus {
  background: linear-gradient(180deg, #f9eedb, #efdfc0);
  color: #43230f;
}

.county-group {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
}

.county-card {
  display: flex;
  align-items: flex-start;
  gap: 1.8rem;
  margin: 1.5rem 0;
  padding: 1.55rem;
  border: 1px solid #9d8464;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(246, 235, 209, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 230, 0.85),
    0 18px 28px rgba(92, 66, 36, 0.12);
}

.county-image {
  flex: 0 0 520px;
  text-align: center;
}

.county-image a {
  text-decoration: none;
}

.county-image img {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #9f8768;
  border-radius: 14px;
  background: #fffaf0;
  box-shadow:
    inset 0 0 0 1px rgba(168, 138, 101, 0.45),
    0 10px 18px rgba(92, 66, 36, 0.08);
}

.map-links {
  margin-top: 0.9rem;
  color: #5b3b1c;
  font-size: 0.98rem;
}

.map-links strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7d522a;
}

.map-links a {
  display: inline-block;
  margin: 0.18rem 0.28rem;
  padding: 0.24rem 0.62rem;
  border: 1px solid #b69b77;
  border-radius: 999px;
  background: #f6ead1;
  text-decoration: none;
}

.county-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.06rem;
  text-align: left;
}

.county-text h2 {
  text-align: left;
  margin-bottom: 0.9rem;
  color: #5c2d1c;
  font-size: 1.55rem;
}

.county-text div,
.county-text p {
  text-align: left;
}

.county-text input[type="text"],
.county-text select {
  min-width: 240px;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  margin: 0.24rem 0;
  border: 1px solid #a58a69;
  border-radius: 7px;
  background: #fffaf1;
  color: #35261a;
}

.county-text input[type="submit"],
.county-text button {
  margin: 0.2rem 0.2rem 0.2rem 0;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(72, 46, 23, 0.24);
  border-radius: 7px;
  color: #2f2015;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dropdown-controls,
.inline-select-controls {
  width: 100%;
}

.inline-select-group {
  min-width: 0;
}

.county-divider {
  border: 0;
  border-top: 1px solid rgba(132, 105, 75, 0.45);
  margin: 0.35rem 0;
}

.notice-banner {
  max-width: 1120px;
  margin: 2rem auto 1.5rem;
  padding: 1.15rem 1.35rem;
  border: 1px solid #b18e5f;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 247, 228, 0.98), rgba(245, 226, 182, 0.98));
  color: #6a4212;
  text-align: center;
  box-shadow:
    inset 0 0 0 2px rgba(255, 245, 220, 0.85),
    0 12px 20px rgba(122, 77, 0, 0.08);
}

.notice-banner h2 {
  margin-bottom: 0.3rem;
  color: #7e4910;
  font-size: 1.2rem;
}

.notice-banner p {
  margin: 0.2rem 0;
}

.research-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.research-card {
  padding: 1.3rem 1.35rem;
  border: 1px solid #9d8464;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(246, 235, 209, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 230, 0.85),
    0 14px 24px rgba(92, 66, 36, 0.1);
}

.research-card h2 {
  color: #5c2d1c;
}

.research-card ul {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
}

.research-card li + li {
  margin-top: 0.55rem;
}

.research-link-cards {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.7rem;
}

.research-link-card {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(121, 94, 60, 0.28);
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 230, 0.75);
}

.research-link-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.research-link {
  min-width: 0;
  font-weight: 700;
  color: #1f5b2c;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.research-link:hover,
.research-link:focus {
  color: #174421;
}

.research-link-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.research-link-badge-free {
  color: #174421;
  background: rgba(31, 91, 44, 0.12);
}

.research-link-badge-paid {
  color: #8b0000;
  background: rgba(255, 0, 0, 0.12);
}

.research-link-description {
  margin: 0.45rem 0 0;
  color: #4d3928;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .research-link-cards {
    gap: 0.5rem;
  }

  .research-link-card {
    padding: 0.7rem 0.8rem;
  }

  .research-link-card-header {
    align-items: center;
    gap: 0.5rem;
  }

  .research-link {
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .research-link-badge {
    padding: 0.15rem 0.45rem;
    font-size: 0.68rem;
  }

  .research-link-description {
    margin-top: 0.28rem;
    font-size: 0.88rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.maps-page {
  padding-bottom: 2.5rem;
}

.cemeteries-page {
  padding-bottom: 2.5rem;
}

.cemeteries-page-body .page-intro,
.cemeteries-page-body .research-link-cta,
.cemeteries-page {
  max-width: 1520px;
}

.cemeteries-page-body .page-intro-panel {
  background:
    linear-gradient(180deg, rgba(249, 247, 235, 0.98), rgba(231, 237, 224, 0.98));
  border-color: #8ea17d;
}

.cemeteries-page-body .page-title {
  color: #5d3320;
}

.cemeteries-page-body .page-subtitle {
  color: #3e5945;
}

.cemeteries-overview,
.cemetery-table-shell {
  border: 1px solid #9d8464;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(250, 247, 239, 0.98), rgba(234, 238, 228, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 230, 0.85),
    0 14px 24px rgba(92, 66, 36, 0.1);
}

.cemeteries-overview {
  margin-bottom: 1rem;
  padding: 1.05rem 1.2rem;
  color: #4a4132;
  text-align: center;
}

.cemeteries-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.cemeteries-legend-item {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(103, 85, 62, 0.2);
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cemeteries-legend-item-location {
  background: rgba(112, 82, 46, 0.12);
  color: #5b3b1c;
}

.cemeteries-legend-item-street {
  background: rgba(84, 108, 132, 0.14);
  color: #3c5669;
}

.cemeteries-legend-item-drive {
  background: rgba(173, 113, 59, 0.14);
  color: #8a5225;
}

.cemeteries-legend-item-wpa {
  background: rgba(82, 118, 74, 0.14);
  color: #42623d;
}

.cemeteries-legend-item-grave {
  background: rgba(113, 87, 132, 0.12);
  color: #5c476c;
}

.cemetery-table-shell {
  overflow-x: auto;
  padding: 0.7rem;
}

.cemetery-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  color: #3b2a1b;
  background: rgba(255, 252, 244, 0.86);
  font-size: 0.9rem;
  line-height: 1.3;
}

.cemetery-table th,
.cemetery-table td {
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(130, 103, 72, 0.35);
  vertical-align: top;
}

.cemetery-table th {
  background: linear-gradient(180deg, rgba(230, 219, 194, 0.98), rgba(220, 230, 213, 0.98));
  color: #4c3425;
  text-align: left;
}

.cemetery-header-mask {
  color: transparent;
}
.cemetery-table tbody tr:nth-child(even) {
  background: rgba(244, 246, 240, 0.78);
}

.cemetery-table tbody tr:hover {
  background: rgba(236, 230, 211, 0.88);
}

.cemetery-table th.min,
.cemetery-table td.min {
  white-space: normal;
  width: auto;
}

.cemetery-table td.size {
  text-align: right;
  color: #5f4631;
  font-variant-numeric: tabular-nums;
}

.cemetery-table th:first-child,
.cemetery-table td:first-child,
.cemetery-table th:nth-child(3),
.cemetery-table td:nth-child(3) {
  white-space: nowrap;
  width: 1%;
}

.cemetery-table th:nth-child(4),
.cemetery-table td:nth-child(4),
.cemetery-table th:nth-child(5),
.cemetery-table td:nth-child(5),
.cemetery-table th:nth-child(6),
.cemetery-table td:nth-child(6),
.cemetery-table th:nth-child(7),
.cemetery-table td:nth-child(7) {
  text-align: center;
}

.cemetery-table td:first-child {
  color: #3f5742;
  font-weight: 700;
}

.cemetery-table td:first-child:not(:empty) {
  background:
    linear-gradient(90deg, rgba(104, 129, 97, 0.12), rgba(104, 129, 97, 0.04));
}

.cemetery-table td:nth-child(2) a {
  color: #5b3b1c;
  font-weight: 700;
}

.cemetery-table td:nth-child(2) a:hover,
.cemetery-table td:nth-child(2) a:focus {
  color: #3f2812;
}

.cemetery-table td:nth-child(4) a {
  color: #47657c;
}

.cemetery-table td:nth-child(5) a {
  color: #9a5d2a;
}

.cemetery-table td:nth-child(6) a {
  color: #486d43;
}

.cemetery-table td:nth-child(7) a {
  color: #66507a;
}

.cemetery-table td:nth-child(4) a,
.cemetery-table td:nth-child(5) a,
.cemetery-table td:nth-child(6) a,
.cemetery-table td:nth-child(7) a {
  font-weight: 700;
}

.cemetery-wpa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.cemetery-findagrave-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.cemetery-thumbnail {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(72, 109, 67, 0.28);
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 252, 244, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 2px 6px rgba(65, 93, 60, 0.12);
}

.cemetery-zoom-overlay {
  position: fixed;
  z-index: 40;
  overflow: hidden;
  border: 1px solid rgba(73, 61, 45, 0.45);
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 24px 50px rgba(43, 32, 21, 0.28);
  cursor: grab;
}

.cemetery-zoom-overlay.is-dragging {
  cursor: grabbing;
}

.cemetery-zoom-image {
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.cemetery-table td.comments {
  white-space: normal;
  min-width: 12rem;
  color: #4c4032;
}

.cemetery-table td.comments a {
  color: #7a4632;
}

@media (max-width: 1200px) {
  .cemetery-table {
    min-width: 980px;
  }
}

@media (max-width: 520px) {
  .cemetery-table td:nth-child(6),
  .cemetery-table td:nth-child(7) {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }

  .cemetery-table td:nth-child(6) a,
  .cemetery-table td:nth-child(7) a {
    font-size: 0.84rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  .cemetery-wpa-link,
  .cemetery-findagrave-link {
    gap: 0.2rem;
  }

  .cemetery-thumbnail {
    width: 28px;
    height: 28px;
  }
}
.maps-overview,
.county-map-highlight,
.township-map-card {
  border: 1px solid #9d8464;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(246, 235, 209, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 230, 0.85),
    0 14px 24px rgba(92, 66, 36, 0.1);
}

.maps-overview {
  margin-bottom: 1rem;
  padding: 1.05rem 1.2rem;
  color: #5b3b1c;
  text-align: center;
}

.county-map-highlight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.2rem 1.35rem;
}

.county-map-highlight-header h2 {
  margin-bottom: 0;
  color: #5c2d1c;
  text-align: left;
}

.county-map-highlight-kicker {
  margin: 0 0 0.35rem;
  color: #805226;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.maps-section-heading {
  margin-bottom: 0.9rem;
  text-align: center;
}

.maps-section-heading h2 {
  margin-bottom: 0;
  color: #5c2d1c;
}

.township-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.township-map-card {
  padding: 1.15rem 1.2rem;
}

.township-map-card h3 {
  margin: 0 0 0.7rem;
  color: #5c2d1c;
  font-size: 1.2rem;
}

.map-year-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.map-year-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 4.25rem;
  min-height: 2.65rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid #b69b77;
  border-radius: 999px;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 7px 14px rgba(92, 66, 36, 0.08);
}

.map-year-link-historic {
  background: linear-gradient(180deg, #f8ecd7, #efdfbf);
  color: #6a3f1e;
}

.map-year-link-modern {
  background: linear-gradient(180deg, #edf4e0, #d8e6bc);
  color: #2d5320;
  border-color: #9db37b;
}

.map-year-link:hover,
.map-year-link:focus {
  transform: translateY(-1px);
}

.map-year-link-selected {
  border-color: #2e6127;
  background: linear-gradient(180deg, #3f7d33, #28551f);
  color: #f5f8ef;
  box-shadow:
    inset 0 0 0 2px rgba(228, 242, 220, 0.32),
    0 10px 18px rgba(38, 74, 26, 0.22);
}

.map-year-link-toggle-target {
  border-color: #5f9548;
  background: linear-gradient(180deg, #cfe5b7, #a9cf86);
  color: #224d18;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.75),
    0 8px 14px rgba(56, 100, 38, 0.16);
}

.township-ownership-page {
  max-width: 1180px;
}

.township-ownership-overview {
  grid-column: 1 / -1;
  text-align: left;
}

.township-ownership-overview p {
  margin: 0.45rem 0;
}

.township-ownership-tip,
.township-ownership-example,
.township-ownership-status {
  font-size: 0.98rem;
}

.township-ownership-status {
  color: #73481f;
}

.township-ownership-controls {
  grid-column: 2;
  grid-row: 2;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: fit-content;
}

.township-ownership-control-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  width: 100%;
}

.township-ownership-button-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  width: 100%;
}

.township-ownership-year-links {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.township-ownership-extra-links {
  justify-content: flex-start;
  align-items: stretch;
}

.township-ownership-year-links .map-year-link {
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.township-ownership-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.township-toggle-link {
  background: linear-gradient(180deg, #7f97a5, #586e79);
  color: #f5f8fa;
  border-color: #4e6470;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 14px rgba(46, 67, 77, 0.18);
}

.township-toggle-link[disabled] {
  opacity: 0.65;
  cursor: default;
}

.township-crossfade-link {
  background: linear-gradient(180deg, #bf8654, #8d5a31);
  color: #fff7f0;
  border-color: #7b4d29;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 14px rgba(97, 58, 28, 0.2);
}

.township-crossfade-link[disabled] {
  opacity: 0.65;
  cursor: default;
}

.township-ownership-stage {
  grid-column: 1;
  grid-row: 2;
  padding: 1.25rem 1.35rem 1.4rem;
  border: 1px solid #9d8464;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(246, 235, 209, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 230, 0.85),
    0 14px 24px rgba(92, 66, 36, 0.1);
}

.township-ownership-frame {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.township-ownership-image-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid #9f8768;
  border-radius: 14px;
  background: #fffaf0;
  box-shadow:
    inset 0 0 0 1px rgba(168, 138, 101, 0.45),
    0 10px 18px rgba(92, 66, 36, 0.08);
  cursor: grab;
  touch-action: none;
}

.township-ownership-image-viewport.is-dragging {
  cursor: grabbing;
}

.township-ownership-image {
  display: block;
  width: 100%;
  max-width: 100%;
  user-select: none;
  transform-origin: 0 0;
  will-change: transform;
}

.township-ownership-image-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
}

.township-ownership-image-overlay.is-resetting {
  transition: none;
}

.township-ownership-image-overlay.is-preview-visible {
  opacity: 0.5;
  transition: none;
}

.township-ownership-image-overlay.is-visible {
  opacity: 1;
}

.township-ownership-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  color: #5b3b1c;
  font-size: 0.97rem;
}

.township-ownership-caption p {
  margin: 0;
}

@media (min-width: 981px) {
  .township-ownership-page {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.75fr);
    gap: 1rem;
    align-items: start;
  }

  .township-ownership-stage .maps-section-heading {
    text-align: left;
  }
}

@media (max-width: 980px) {
  .county-card {
    flex-direction: column;
    gap: 1.15rem;
  }

  .county-image {
    flex-basis: auto;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

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

  .township-map-grid {
    grid-template-columns: 1fr;
  }

  .township-ownership-page {
    display: block;
  }
}

@media (max-width: 800px) {
  body {
    padding-bottom: 2rem;
  }

  .page-intro {
    padding: 1rem 0.8rem 0.9rem;
  }

  .page-intro-panel,
  .county-card,
  .notice-banner,
  .county-index-panel {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }

  .page-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  .page-title {
    font-size: 1.9rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .county-index {
    padding: 0 0.8rem;
  }

  .county-index-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .county-index-links a {
    padding: 0.55rem 0.45rem;
    text-align: center;
  }

  .research-link-cta {
    padding: 0 0.8rem;
  }

  .research-link-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cemeteries-legend {
    gap: 0.35rem;
  }

  .cemeteries-legend-item {
    font-size: 0.78rem;
  }

  .research-link-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .county-group,
  .research-page {
    padding: 0 0.8rem 1.2rem;
  }

  .county-card {
    margin: 1rem 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-direction: var(--mobile-card-flow, column);
  }

  .county-image {
    max-width: 100%;
  }

  .county-image img {
    padding: 0.35rem;
  }

  .county-text {
    font-size: 1rem;
  }

  .county-text h2,
  .county-text div,
  .county-text p,
  .map-links {
    text-align: center;
  }

  .county-text input[type="text"],
  .county-text select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .county-text input[type="submit"],
  .county-text button,
  .research-link-button,
  .county-index-links a {
    min-height: 44px;
  }

  .dropdown-controls {
    margin: 0.8rem 0;
  }

  .inline-select-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .inline-select-group {
    width: 100%;
  }

  .inline-select-group select {
    width: 100%;
    box-sizing: border-box;
  }

  .research-card {
    padding: 1rem;
  }

  .county-map-highlight {
    flex-direction: column;
    align-items: flex-start;
  }

  .county-map-highlight-header,
  .county-map-highlight-header h2 {
    width: 100%;
    text-align: center;
  }

  .county-map-highlight-kicker {
    text-align: center;
  }

  .county-map-highlight .map-year-links,
  .township-map-card .map-year-links {
    justify-content: center;
  }

  .township-ownership-control-panel {
    width: 100%;
    align-items: center;
  }

  .township-ownership-button-columns {
    width: 100%;
  }

  body[data-view-mode="landscape"] .page-intro {
    padding-top: 0.8rem;
  }

  body[data-view-mode="landscape"] .county-index-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view-mode="landscape"] .county-card {
    align-items: flex-start;
    gap: 0.9rem;
  }

  body[data-view-mode="landscape"] .county-image {
    flex: 0 0 43%;
    width: 43%;
    max-width: 260px;
    margin: 0;
  }

  body[data-view-mode="landscape"] .county-text {
    font-size: 0.97rem;
  }

  body[data-view-mode="landscape"] .county-text h2,
  body[data-view-mode="landscape"] .county-text div,
  body[data-view-mode="landscape"] .county-text p,
  body[data-view-mode="landscape"] .map-links {
    text-align: left;
  }

  body[data-view-mode="landscape"] .dropdown-controls,
  body[data-view-mode="landscape"] .inline-select-controls {
    margin: 0.55rem 0;
  }

  body[data-view-mode="landscape"] .inline-select-controls {
    flex-direction: row;
    align-items: center;
  }

  body[data-view-mode="landscape"] .research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view-mode="landscape"] .township-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .county-index-links {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.7rem;
  }

  .map-links a {
    margin: 0.15rem;
    padding: 0.28rem 0.5rem;
  }

  body[data-view-mode="landscape"] .county-index-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view-mode="landscape"] .county-card {
    gap: 0.75rem;
  }

  body[data-view-mode="landscape"] .county-image {
    flex-basis: 40%;
    width: 40%;
    max-width: 180px;
  }

  body[data-view-mode="landscape"] .research-grid {
    grid-template-columns: 1fr;
  }

  .maps-overview,
  .county-map-highlight,
  .township-map-card {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }

  .township-ownership-stage {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }

  .map-year-link {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
  }

  body[data-view-mode="landscape"] .township-map-grid {
    grid-template-columns: 1fr;
  }
}
